:root {
  --ink: #0b0b0b;
  --grey: #6d6d6d;
  --hair: rgba(11, 11, 11, 0.85);
  --faint: rgba(11, 11, 11, 0.12);
  --paper: #ffffff;
  --serif: "Old Standard TT", "Times New Roman", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- Glass menu ---------- */
.glass {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--hair);
}
nav.glass {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center;
  padding: 24px clamp(16px, 4vw, 48px);
}
nav .tabs { justify-content: center; align-items: center; }
nav .mark { font-size: 12px; letter-spacing: 0.35em; text-decoration: none; }
nav .tabs { display: flex; gap: clamp(14px, 3.5vw, 48px); }
nav .tabs a, nav .social {
  font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase;
  text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
nav .tabs a[aria-current="page"], nav .tabs a:hover, nav .social:hover { border-bottom-color: var(--ink); }
nav .social { justify-self: end; }

/* ---------- Masthead ---------- */
.masthead { padding: 124px clamp(16px, 6vw, 96px) 0; max-width: 1100px; margin: 0 auto; text-align: center; }
.rule.thin { border-top: 1px solid var(--hair); }
.rule.double { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); height: 4px; }
.dateline {
  display: flex; justify-content: space-between; gap: 12px; margin: 6px 0;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--grey);
}
.masthead h1 {
  font-weight: 400; font-size: clamp(56px, 11vw, 132px); line-height: 1;
  letter-spacing: 0.04em; margin: 28px 0 6px;
}
.masthead .of { font-style: italic; font-size: clamp(16px, 2.2vw, 22px); letter-spacing: 0.08em; margin: 0 0 10px; }
.flourish { display: block; width: min(560px, 86%); height: auto; margin: 0 auto 22px; color: var(--ink); overflow: visible; }
.flourish .fl { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: draw-eat 7.5s cubic-bezier(.65, 0, .35, 1) infinite; }
.flourish .fl:nth-child(n+4) { animation-delay: .35s; }
.flourish .dot { animation-delay: .15s; }
@keyframes draw-eat {
  0% { stroke-dashoffset: 1; opacity: 1; }
  42% { stroke-dashoffset: 0; opacity: 1; }
  58% { stroke-dashoffset: 0; opacity: 1; }
  92% { stroke-dashoffset: -1; opacity: .35; }
  100% { stroke-dashoffset: -1; opacity: 0; }
}
.live { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #1fbf5b; box-shadow: 0 0 6px 1px rgba(31, 191, 91, .75); }
.pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid rgba(31, 191, 91, .7); animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.pulse { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 12px 3px rgba(31, 191, 91, .9); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shared ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 0 clamp(16px, 6vw, 96px); }
.kicker { font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; margin: 0 0 14px; }
.center { text-align: center; }
.fine { font-size: 14px; color: var(--grey); font-style: italic; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
button {
  font: inherit; font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase;
  background: transparent; color: var(--ink); border: 1px solid var(--ink);
  padding: 14px 34px; cursor: pointer; transition: background 0.3s, color 0.3s;
}
button:hover { background: var(--ink); color: var(--paper); }
.status { min-height: 1.6em; font-style: italic; font-size: 14px; text-align: center; margin: 14px 0 0; }

/* ---------- I. Wealth of Agents ---------- */
.feature {
  display: grid; grid-template-columns: minmax(220px, 1fr) 1.3fr; gap: clamp(32px, 7vw, 110px);
  align-items: center; padding: clamp(80px, 12vh, 140px) 0;
}
.pitch h2 { font-weight: 400; font-size: clamp(40px, 6vw, 72px); line-height: 1.05; margin: 0 0 18px; }
.pitch .tagline { font-style: italic; font-size: 20px; margin: 0 0 22px; }
.pitch .desc { color: #262626; max-width: 52ch; }

.book3d { perspective: 1400px; display: grid; place-items: center; min-height: 420px; cursor: pointer; text-decoration: none; color: inherit; }
/* The book's aura: pen-and-ink hatching, as an illustrator would shade light around an object */
.book3d { position: relative; isolation: isolate; }
.book3d::before, .book3d::after {
  content: ""; position: absolute; left: 50%; top: 50%; z-index: -1; pointer-events: none;
  width: 440px; height: 520px; transform: translate(-50%, -50%);
  -webkit-mask: radial-gradient(closest-side, transparent 52%, #000 64%, rgba(0,0,0,.55) 80%, transparent 100%);
          mask: radial-gradient(closest-side, transparent 52%, #000 64%, rgba(0,0,0,.55) 80%, transparent 100%);
  animation: ink 3.2s ease-in-out infinite;
}
.book3d::before { /* fine single hatching */
  background: repeating-linear-gradient(135deg, var(--ink) 0 0.7px, transparent 0.7px 5px);
}
.book3d::after { /* cross-hatching, denser close to the book */
  background: repeating-linear-gradient(45deg, var(--ink) 0 0.6px, transparent 0.6px 6px);
  -webkit-mask: radial-gradient(closest-side, transparent 54%, #000 62%, transparent 76%);
          mask: radial-gradient(closest-side, transparent 54%, #000 62%, transparent 76%);
  animation-delay: -1.6s;
}
@keyframes ink {
  0%, 100% { opacity: 0.12; transform: translate(-50%, -50%) scale(0.94); }
  50% { opacity: 0.55; transform: translate(-50%, -50%) scale(1.03); }
}
@media (max-width: 700px) { .book3d::before, .book3d::after { width: 360px; height: 430px; } }
@media (prefers-reduced-motion: reduce) { .book3d::before, .book3d::after { animation: none; opacity: 0.3; } }
.book3d:focus-visible { outline: 1px solid var(--ink); outline-offset: 8px; }
.credit a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.book3d .book {
  --w: 250px; --h: 370px; --d: 46px;
  width: var(--w); height: var(--h); position: relative; transform-style: preserve-3d;
  animation: turn 9s linear infinite;
}
@keyframes turn { from { transform: rotateX(-6deg) rotateY(0deg); } to { transform: rotateX(-6deg) rotateY(360deg); } }
.face { position: absolute; background: var(--paper); border: 1px solid var(--ink); }
.front {
  inset: 0; transform: translateZ(calc(var(--d) / 2));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  text-align: center; padding: 28px; outline: 1px solid var(--ink); outline-offset: -12px;
}
.front .k { font-size: 10px; letter-spacing: 0.4em; text-transform: uppercase; }
.front .t { font-size: 34px; line-height: 1.08; }
.front .r { width: 46px; border-top: 1px solid var(--ink); }
.front .a { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; }
.spine {
  width: var(--d); height: var(--h); left: calc(50% - var(--d) / 2);
  transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
  display: grid; place-items: center; background: var(--ink); color: var(--paper);
}
.spine span { writing-mode: vertical-rl; font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; }
.back {
  inset: 0; transform: rotateY(180deg) translateZ(calc(var(--d) / 2));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 34px;
  outline: 1px solid var(--ink); outline-offset: -12px;
}
.back .k { font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase; }
.back .blurb { font-style: italic; font-size: 17px; line-height: 1.45; }
.back .r { width: 40px; border-top: 1px solid var(--ink); }
.back .a { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; }
.edge {
  width: var(--d); height: calc(var(--h) - 6px); top: 3px; left: calc(50% - var(--d) / 2);
  transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 2px));
  background: repeating-linear-gradient(90deg, #fff 0 2px, #e9e9e9 2px 3px); border-color: #bdbdbd;
}

.menu-card {
  max-width: 640px; margin: 0 auto; padding: 56px clamp(20px, 6vw, 64px);
  border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 6px;
}
.menu { list-style: none; padding: 0; margin: 18px 0 0; }
.menu li { display: flex; align-items: baseline; gap: 12px; padding: 16px 0; }
.menu li + li { border-top: 1px solid var(--faint); }
.menu .name { font-size: 21px; }
.menu .dots { flex: 1; border-bottom: 1px dotted var(--grey); transform: translateY(-5px); }
.menu .state { font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; }
.menu .state button { padding: 8px 16px; font-size: 11px; }

.reserve { max-width: 560px; margin: clamp(100px, 16vh, 180px) auto clamp(120px, 18vh, 200px); text-align: center; }
.fields { display: grid; gap: 22px; margin: 36px 0 34px; text-align: left; }
.fields label span, .line span { display: block; font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 4px; }
input, textarea {
  width: 100%; font: inherit; font-size: 18px; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--ink); padding: 8px 0; border-radius: 0; outline: none;
}
input:focus, textarea:focus { border-bottom-width: 2px; padding-bottom: 7px; }
textarea { resize: vertical; }

/* ---------- II & III. Galleries ---------- */
.intro { min-height: 62vh; display: grid; place-content: center; text-align: center; padding: 60px 0; }
.lede { font-size: clamp(20px, 2.6vw, 28px); font-style: italic; max-width: 30ch; margin: 0 auto; line-height: 1.4; }
.hint { margin-top: 56px; font-size: 10px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--grey); }
.hint::after { content: ""; display: block; width: 1px; height: 54px; background: var(--ink); margin: 14px auto 0; }

.gallery { perspective: 1200px; padding-bottom: 30vh; }
.stage { min-height: 96vh; display: grid; place-items: center; align-content: center; gap: 34px; }
.plate {
  --w: min(330px, 72vw);
  width: var(--w); aspect-ratio: 3 / 4; background: var(--paper);
  border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -14px;
  position: relative; cursor: pointer;
  transform-style: preserve-3d; will-change: transform;
  border: 0; outline: 0; background: none;
}
.plate .pf, .plate .pb {
  position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  text-align: center; padding: 42px 32px; overflow: hidden;
  background: linear-gradient(155deg, rgba(255,255,255,.92), rgba(255,255,255,.62));
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -14px;
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255,255,255,.9);
}
.plate .pb { transform: rotateY(180deg); justify-content: center; gap: 18px; }
.plate .pb .mono { font-size: 15px; letter-spacing: .5em; }
/* a sheet of glass: a soft glare that slides across as the plate turns */
.plate .pf::after, .plate .pb::after {
  content: ""; position: absolute; inset: -40%; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.75) 48%, rgba(255,255,255,0) 58%);
  transform: translateX(calc(var(--g, -1) * 62%)); mix-blend-mode: screen; opacity: .6;
}
.plate .pf::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0) 22%);
}
.plate:focus-visible .pf { outline: 2px solid var(--ink); }
.plate .k { font-size: 10px; letter-spacing: 0.36em; text-transform: uppercase; }
.plate .t { font-size: clamp(28px, 3.6vw, 36px); line-height: 1.1; }
.plate .s { font-style: italic; font-size: 14px; color: #333; }
.plate .r { display: block; width: 44px; border-top: 1px solid var(--ink); margin: 0 auto; }
.plate .a { display: block; margin-top: 12px; font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; }
.plate.book .t { font-size: clamp(26px, 3.2vw, 32px); }

.caption { text-align: center; max-width: 440px; opacity: 0; transform: translateY(12px); transition: opacity 0.5s, transform 0.5s; }
.stage.centered .caption { opacity: 1; transform: none; }
.caption h3 { font-weight: 400; font-size: 26px; margin: 0 0 6px; }
.caption p { margin: 0 0 14px; color: #333; font-size: 15px; }
.caption .meta { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--grey); }
.caption button, .caption .buy { margin-top: 10px; }
.buy {
  display: inline-block; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); border: 1px solid var(--ink); padding: 13px 30px; transition: background .3s, color .3s;
  background: rgba(255,255,255,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.buy:hover { background: var(--ink); color: var(--paper); }

/* ---------- Reader (the reading room) ---------- */
body.reading { overflow: hidden; }
.reader {
  position: fixed; inset: 0; z-index: 50; background: var(--paper);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.reader-bar {
  position: absolute; inset: 0 0 auto 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 12px clamp(16px, 4vw, 48px);
}
.reader-bar .kicker { margin: 0; }
.reader-title { font-style: italic; font-size: 15px; text-align: center; }
.reader-bar .close { justify-self: end; padding: 8px 18px; font-size: 11px; }
.reader-scroll { position: absolute; inset: 0; overflow-y: auto; padding: 96px 20px 120px; }
.sheet { max-width: 680px; margin: 0 auto; position: relative; z-index: 1; }
.sheet h1 { font-weight: 400; font-size: clamp(40px, 6vw, 60px); line-height: 1.05; text-align: center; margin: 40px 0 10px; }
.sheet .dek { text-align: center; font-size: 19px; margin: 0; }
.sheet .byline { text-align: center; font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--grey); margin: 18px 0 56px; padding-bottom: 28px; border-bottom: 1px solid var(--hair); }
.sheet h2 { font-weight: 400; font-size: 26px; margin: 56px 0 14px; padding-top: 20px; border-top: 1px solid var(--faint); }
.sheet .byline + h2 { border-top: 0; padding-top: 0; margin-top: 0; }
.sheet h3 { font-weight: 400; font-style: italic; font-size: 20px; margin: 32px 0 8px; }
.sheet p, .sheet li { font-size: 18px; line-height: 1.75; }
.sheet ol, .sheet ul { padding-left: 1.2em; }
.sheet li { margin-bottom: 10px; }
.sheet table { width: 100%; border-collapse: collapse; margin: 28px 0; font-size: 14px; }
.sheet th, .sheet td { text-align: left; vertical-align: top; padding: 10px 8px; border-top: 1px solid var(--faint); }
.sheet th { font-weight: 400; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.sheet .signature { text-align: right; margin-top: 40px; }
.sheet .sources li { font-size: 14px; line-height: 1.5; }

.chart { margin: 36px 0; padding: 24px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.chart figcaption { font-size: 15px; margin-bottom: 18px; }
.chart figcaption span { color: var(--grey); font-size: 13px; font-style: italic; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 120px 1fr 56px; align-items: center; gap: 12px; font-size: 13px; }
.bar span { text-align: right; }
.bar i { display: block; height: 14px; width: calc(var(--v) * 1%); background: #bdbdbd; }
.bar.accent i { background: var(--ink); }
.chart .src { font-size: 12px !important; color: var(--grey); margin: 16px 0 0; }

.watermark {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260'%3E%3Ctext x='0' y='150' transform='rotate(-24 210 130)' font-family='Georgia,serif' font-size='18' letter-spacing='4' fill='%23000'%3ELIONEL K MUNYUKI %C2%B7 READ ONLY%3C/text%3E%3C/svg%3E");
}

/* Ratings */
.review { margin-top: 90px; }
.score { font-size: 15px; letter-spacing: 0.08em; color: var(--grey); margin: 0 0 26px; }
.stars { border: 0; padding: 0; margin: 0 auto 34px; display: flex; flex-direction: row-reverse; justify-content: center; gap: 10px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 30px; color: transparent; -webkit-text-stroke: 1px var(--ink); cursor: pointer; transition: color 0.2s; line-height: 1; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--ink); }
.stars input:focus-visible + label { outline: 1px dotted var(--ink); outline-offset: 4px; }
#rate { display: grid; gap: 24px; max-width: 460px; margin: 0 auto; text-align: center; }
#rate .line { text-align: left; }
#rate button { justify-self: center; }
.reviews { list-style: none; padding: 0; margin: 70px 0 0; }
.reviews li { padding: 22px 0; border-top: 1px solid var(--faint); }
.reviews .who { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--grey); }
.reviews .st { letter-spacing: 3px; margin-right: 10px; }
.reviews p { margin: 6px 0 0; font-style: italic; font-size: 16px !important; }

/* Footer */
footer { max-width: 1100px; margin: 0 auto; padding: 0 clamp(16px, 6vw, 96px) 48px; text-align: center; font-size: 12px; letter-spacing: 0.14em; color: var(--grey); }
footer p { margin-top: 18px; }
footer .credit { font-style: italic; font-size: 14px; letter-spacing: .06em; color: var(--ink); margin-top: 26px; }
footer .disclosure { font-size: 11px; letter-spacing: .04em; }

/* Nothing prints. */
@media print {
  body * { display: none !important; }
  body::after { content: "This library is read online only."; display: block; font: 18px Georgia, serif; padding: 40px; }
}

@media (max-width: 760px) {
  nav.glass { grid-template-columns: 1fr; padding: 16px 12px; }
  nav .mark, nav .social, nav .full { display: none; }
  nav .tabs { justify-content: center; gap: 22px; }
  nav .tabs a { font-size: 10px; letter-spacing: 0.2em; white-space: nowrap; }
  .dateline { flex-wrap: wrap; justify-content: center; }
  .dateline > span:nth-child(2) { display: none; }
  .feature { grid-template-columns: 1fr; text-align: center; }
  .pitch .desc { margin: 0 auto; }
  .book3d .book { --w: 210px; --h: 310px; --d: 40px; }
  .book3d { min-height: 360px; }
  .bar { grid-template-columns: 88px 1fr 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .book3d .book { animation: none; transform: rotateY(-18deg); }
  .plate { transform: none !important; }
}

.state .buylink { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Plates: a gentle zoom, no turning */
.plate { transition: transform .18s ease-out, opacity .18s ease-out; }
a.plate { display: block; color: inherit; text-decoration: none; }
/* Ornaments between the plates: drawn slowly from the centre outwards, held, then slowly withdrawn */
.divider { display: grid; place-items: center; padding: 3vh 0; color: #1c1c1c; }
.ornament { display: block; width: min(560px, 84%); height: auto; overflow: visible; }
.ornament .ln { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: ornament 22s cubic-bezier(.45, 0, .25, 1) infinite; }
.ornament .o-centre .ln { animation-delay: 0s; }
.ornament .o-half .ln:nth-child(1) { animation-delay: 1.2s; }
.ornament .o-half .ln:nth-child(2) { animation-delay: 2s; }
.ornament .o-half .ln:nth-child(3) { animation-delay: 2.6s; }
.ornament .o-half .ln:nth-child(4) { animation-delay: 3.4s; }
.ornament .o-half .ln:nth-child(n+5) { animation-delay: 4s; }
@keyframes ornament {
  0%   { stroke-dashoffset: 1;  opacity: 0; }
  6%   { opacity: .9; }
  34%  { stroke-dashoffset: 0;  opacity: 1; }
  66%  { stroke-dashoffset: 0;  opacity: 1; }
  94%  { stroke-dashoffset: -1; opacity: .5; }
  100% { stroke-dashoffset: -1; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .ornament .ln { animation: none; stroke-dashoffset: 0; } }
