/* MAHABHARATA site: night indigo, temple gold, saffron fire, paper */

/* ---------- fonts: self-hosted (latin, plus latin-ext for accented letters as in Sanskrit transliteration, fetched only when a page uses one; variable weight), so the first paint never waits on another server.
   The "Fallback" faces are Georgia resized to each font's measurements, so text barely moves when the real font
   arrives (numbers from fontTools, 2026-11-16). */
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/cinzel-v2.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/cinzel-ext-v2.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/cormorant-v2.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(../fonts/cormorant-ext-v2.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400 500; font-display: swap; src: url(../fonts/cormorant-italic-v2.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400 500; font-display: swap; src: url(../fonts/cormorant-italic-ext-v2.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(../fonts/alegreya-v2.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(../fonts/alegreya-ext-v2.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Alegreya"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/alegreya-italic-v2.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alegreya"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/alegreya-italic-ext-v2.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cinzel Fallback"; src: local("Georgia"); size-adjust: 100.5%; ascent-override: 97.1%; descent-override: 37%; line-gap-override: 0%; }
@font-face { font-family: "Cormorant Fallback"; font-style: normal; src: local("Georgia"); size-adjust: 88.6%; ascent-override: 104.3%; descent-override: 32.4%; line-gap-override: 0%; }
@font-face { font-family: "Cormorant Fallback"; font-style: italic; src: local("Georgia Italic"), local("Georgia-Italic"); size-adjust: 78.3%; ascent-override: 118%; descent-override: 36.7%; line-gap-override: 0%; }
@font-face { font-family: "Alegreya Fallback"; font-style: normal; src: local("Georgia"); size-adjust: 91.9%; ascent-override: 110.6%; descent-override: 37.6%; line-gap-override: 0%; }
@font-face { font-family: "Alegreya Fallback"; font-style: italic; src: local("Georgia Italic"), local("Georgia-Italic"); size-adjust: 79.7%; ascent-override: 127.5%; descent-override: 43.3%; line-gap-override: 0%; }
:root {
  --night: #0b0918;
  --night-2: #120f26;
  --indigo: #1d1a44;
  --ink: #241d3a;
  --gold: #d9a441;
  --gold-hi: #f6e2a4;
  --gold-lo: #9a6a22;
  --saffron: #e8762b;
  --vermilion: #b8321f;
  --paper: #f5ecd9;
  --paper-2: #ebdfc4;
  --text: #ece4d2;
  --muted: #b5a98f;
  --line: rgba(217, 164, 65, .28);
  --head: #f5ecd9;                       /* headings and large text */
  --glass: rgba(11, 9, 24, .35);         /* ghost buttons, arrows */
  --glass-strong: rgba(11, 9, 24, .82);  /* menu bar, phone buy bar */
  --page-edge: #08060f;                  /* footer */
  --display: "Cormorant Garamond", "Cormorant Fallback", Georgia, serif;
  --caps: "Cinzel", "Cinzel Fallback", Georgia, serif;
  --body: "Alegreya", "Alegreya Fallback", Georgia, serif;
  --gold-grad: linear-gradient(180deg, #fff3cc 0%, #f0cf7f 38%, #d9a441 58%, #a8742a 100%);
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  /* the page colour is painted as an image layer, not a background colour: Safari takes its status bar colour at the
     very top from the page's background colour (html's with body's laid over it), and that must be html's own --edge */
  margin: 0; background: linear-gradient(var(--night), var(--night)); color: var(--text);
  font: 400 clamp(17px, 1.05vw + 12px, 19px)/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }   /* height: auto keeps the width/height attributes (which reserve the space) from fixing the height */
a { color: var(--gold-hi); }
em { font-style: italic; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--night); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }

/* paper grain over everything dark */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 60; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- type ---------- */
.kicker {
  font: 500 clamp(11px, .8vw + 6px, 13px)/1.4 var(--caps); letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 14px;
}
h2 {
  font: 500 clamp(34px, 4.4vw, 64px)/1.05 var(--display); margin: 0; color: var(--head); letter-spacing: -.005em;
  text-wrap: balance;
}
h2 em { color: var(--gold-hi); }
h3 { font: 600 24px/1.2 var(--display); margin: 0 0 8px; color: var(--head); }
.lede { font-size: 1.12em; color: var(--text); }
.sec-head { text-align: center; max-width: 820px; margin: 0 auto clamp(40px, 6vw, 72px); }
.sec-lede { color: var(--muted); font-size: 1.08em; margin: 18px auto 0; max-width: 640px; text-wrap: pretty; }
.ornament { color: var(--gold); width: 220px; margin: 22px auto 0; opacity: .85; }
.ornament svg { width: 100%; height: 20px; }

/* ---------- buttons ---------- */
.btn { white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 0 28px; border-radius: 2px; text-decoration: none; cursor: pointer;
  font: 600 14px/1 var(--caps); letter-spacing: .16em; text-transform: uppercase; border: 1px solid transparent;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s;
}
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 12px; }
.btn-gold { background: var(--gold-grad); color: #2a1a06; box-shadow: 0 0 0 1px rgba(255, 236, 180, .5) inset, 0 10px 30px -10px rgba(232, 118, 43, .6); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 236, 180, .7) inset, 0 16px 40px -10px rgba(232, 150, 43, .85); }
.btn-ghost { color: var(--gold-hi); border-color: var(--line); background: var(--glass); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--gold); background: rgba(217, 164, 65, .1); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; gap: 28px;
  padding: calc(14px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 14px max(var(--gutter), env(safe-area-inset-left));
  transition: background .4s, padding .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.solid { background: var(--glass-strong); backdrop-filter: blur(14px); border-color: var(--line); padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: 10px; }
/* the bar reaches up through the phone's status bar (viewport-fit=cover) and an opaque strip above it hides whatever
   scrolls past there, in the colour of the page under the bar (--edge, set by site.js); the same colour fills the
   page's overscroll, so the browser's top bar has one colour to take on */
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; pointer-events: none; background: var(--edge, var(--night)); }
html { background-color: var(--edge, var(--night)); }
:root:has(.hero) { background-color: var(--edge, #0b0918); }   /* the film is dark in both themes: right from the first paint */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold-hi); font: 600 16px/1 var(--caps); letter-spacing: .22em; }
.brand-mark { width: 26px; height: 26px; color: var(--gold); animation: spin 30s linear infinite; will-change: transform; }   /* one slow turn every 30 s; the wordmark stays still (reduced motion: stops) */
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { white-space: nowrap; color: var(--text); text-decoration: none; font: 500 12px/1 var(--caps); letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.nav-links a:hover { color: var(--gold-hi); opacity: 1; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; margin-left: auto; }
.nav-toggle span { display: block; width: 24px; height: 1.5px; background: var(--gold-hi); margin: 6px auto; transition: transform .3s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- hero ---------- */
/* a painted film behind a quiet, film-credit title at the lower left */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; background: var(--night); }
.hero-still, .hero-still img, .hero-film { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
/* the film's first painting shows at once (it is the page's largest picture); the film loads after the page and
   fades in over it once it is past its own fade from night */
.hero-film { opacity: 0; transition: opacity 1s ease; }
.hero-film.playing { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11, 9, 24, .6) 0%, rgba(11, 9, 24, 0) 16%),
    linear-gradient(0deg, var(--night) 0%, rgba(11, 9, 24, .86) 16%, rgba(11, 9, 24, .35) 42%, rgba(11, 9, 24, 0) 62%),
    linear-gradient(90deg, rgba(11, 9, 24, .55) 0%, rgba(11, 9, 24, 0) 55%);
}
.hero-inner { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter) clamp(64px, 9vh, 110px); }
.scene-cap { display: flex; align-items: center; gap: 14px; margin: 0 0 clamp(18px, 3vh, 30px); min-height: 1.6em; transition: opacity .6s ease; }
.scene-cap.swap { opacity: 0; }
.cap-name { font: italic 500 clamp(17px, 1.4vw, 21px)/1.2 var(--display); color: #f3e9d2; text-shadow: 0 1px 10px rgba(0, 0, 0, .8); }
.hero-title { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.title-kick { font: italic 500 clamp(20px, 2vw, 28px)/1 var(--display); color: var(--gold-hi); letter-spacing: .02em; text-shadow: 0 2px 14px rgba(0, 0, 0, .7); }
.title-word {
  font: 500 clamp(40px, 7.2vw, 112px)/1 var(--caps); letter-spacing: .14em; text-transform: uppercase;
  color: #f8f0dc; margin-left: -.06em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .45), 0 0 50px rgba(0, 0, 0, .55), 0 0 2px rgba(255, 220, 150, .3);
}
.title-word::after { content: ""; display: block; width: min(320px, 42%); height: 1px; margin-top: clamp(16px, 2.4vh, 24px);
  background: linear-gradient(90deg, var(--gold), rgba(217, 164, 65, 0)); }
.hero-tag { max-width: 34em; font: 400 clamp(17px, 1.3vw, 20px)/1.55 var(--body); color: #ece2cb; margin: clamp(14px, 2.2vh, 22px) 0 clamp(24px, 3.6vh, 34px); text-shadow: 0 1px 10px rgba(0, 0, 0, .85); text-wrap: pretty; }
.hero-tag em { color: #fff7e2; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.film-bar { position: absolute; left: 50%; translate: -50% 0; bottom: 26px; width: min(var(--wrap), 100%); padding: 0 var(--gutter); display: flex; gap: 6px; }
.film-bar i { flex: 1; height: 2px; background: rgba(246, 226, 164, .2); position: relative; overflow: hidden; }
.film-bar i::after { content: ""; position: absolute; inset: 0; background: var(--gold-hi); transform-origin: left; transform: scaleX(var(--p, 0)); }
.film-toggle { position: absolute; right: var(--gutter); bottom: 44px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(246, 226, 164, .4);
  background: rgba(11, 9, 24, .45); color: var(--gold-hi); cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(6px); }
.film-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.film-toggle .i-play, .film-toggle[aria-pressed="true"] .i-pause { display: none; }
.film-toggle[aria-pressed="true"] .i-play { display: block; }

/* ---------- invocation ---------- */
.invocation { padding: clamp(80px, 8vw, 112px) 0; background: radial-gradient(ellipse 60% 70% at 25% 50%, rgba(232, 118, 43, .14), transparent 70%), var(--night); }
.invocation-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.invocation-art { margin: 0; position: relative; }
.invocation-art img { border-radius: 2px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px var(--line); }
.invocation-art::before { content: ""; position: absolute; inset: -14px; border: 1px solid var(--line); pointer-events: none; }
.big-quote { margin: 0 0 24px; font: italic 500 clamp(28px, 3.2vw, 44px)/1.18 var(--display); color: var(--head); text-wrap: balance; }

/* ---------- books ---------- */
.books { padding: clamp(80px, 8vw, 112px) 0; background: linear-gradient(180deg, var(--night), var(--night-2) 40%, var(--night)); }
.book-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 44px); align-items: stretch; }
/* each card a column, its buttons at the bottom, so the three cards' buttons line up */
.book { text-align: center; display: flex; flex-direction: column; }
.book > .book-status { align-self: center; }
.book > .book-actions { margin-top: auto; }
.book-cover { display: block;
  position: relative; aspect-ratio: 2 / 3; margin: 0 auto 26px; max-width: 340px; perspective: 1200px;
}
.book-cover-inner {
  position: absolute; inset: 0; transition: transform .7s cubic-bezier(.2, .7, .2, 1), box-shadow .7s;
  transform: none; transform-origin: left center;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .95);
}
.book-cover-inner img, .book-cover-inner video { display: block; width: 100%; height: 100%; object-fit: cover; }
.book-cover-inner::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; background: linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(255, 255, 255, .12) 45%, rgba(0, 0, 0, .1)); z-index: 1; }
.book-cover.featured::after { content: ""; position: absolute; inset: -30px; z-index: -1; background: radial-gradient(closest-side, rgba(232, 118, 43, .35), transparent); filter: blur(10px); }
.book-blank { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px;
  background: radial-gradient(ellipse at 50% 30%, #3a1414, #120a10 70%); border: 1px solid var(--line); }
.book-blank svg { width: 46%; color: var(--gold); opacity: .55; animation: spin 90s linear infinite; }
.book-blank p { font: 600 13px/1.6 var(--caps); letter-spacing: .3em; color: var(--gold); margin: 18px 0 0; }
.book-blank strong { display: block; font: italic 500 40px/1 var(--display); color: var(--head); letter-spacing: 0; text-transform: none; margin-top: 6px; }
.book-num { font: 500 12px/1 var(--caps); letter-spacing: .3em; color: var(--gold); text-transform: uppercase; margin: 0 0 8px; }
.book h3 { font: italic 500 clamp(30px, 3vw, 40px)/1 var(--display); margin: 0 0 10px; }
.book-hook { color: var(--head); font: 500 1.08em/1.4 var(--display); font-style: italic; margin: 0 0 10px; }
.book-status { display: inline-block; font: 600 11px/1 var(--caps); letter-spacing: .2em; text-transform: uppercase; padding: 7px 12px; border: 1px solid var(--line); color: var(--gold-hi); margin-bottom: 16px; }
/* is-now / is-soon / is-later: a bare "soon" class would pick up the cover overlay's .soon styles and vanish */
.book-status.is-now { background: rgba(217, 164, 65, .14); border-color: var(--gold); }
.book-copy { color: var(--muted); font-size: .95em; max-width: 34ch; margin: 0 auto 20px; text-wrap: pretty; }
.book-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- interlude ---------- */
.interlude { position: relative; min-height: clamp(460px, 80vh, 820px); display: grid; place-items: center; overflow: hidden; isolation: isolate; }
.interlude-art { position: absolute; inset: -12% 0; z-index: -1; background-position: center 35%; background-size: cover; background-repeat: no-repeat; will-change: transform; }
.interlude::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--night) 0%, rgba(11, 9, 24, .2) 25%, rgba(11, 9, 24, .35) 60%, var(--night) 100%); }
.interlude-text { text-align: center; padding: 0 var(--gutter); }
.interlude .kicker { color: var(--gold-hi); }
.interlude-line { font: 500 clamp(40px, 6.4vw, 96px)/1.02 var(--display); color: #fff7e2; margin: 0; text-shadow: 0 4px 40px rgba(0, 0, 0, .8); }
.interlude-line em { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 16px rgba(0, 0, 0, .6)); }

/* ---------- look inside ---------- */
.inside { padding: clamp(80px, 10vw, 140px) 0; background: radial-gradient(ellipse 80% 60% at 50% 45%, #241c3c, var(--night) 70%); }
.flip-stage { position: relative; display: flex; justify-content: center; padding: 10px 0 0; }
.flip-shift { width: 100%; max-width: min(1240px, calc(72vh * 4 / 3)); transition: transform .9s cubic-bezier(.2, .7, .2, 1); filter: drop-shadow(0 40px 50px rgba(0, 0, 0, .7)); }
.flipbook { margin: 0 auto; }
.flipbook .page { background: #f6efdf; overflow: hidden; }
.flipbook .page img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.flipbook .page.cover, .flipbook .page.back { background: #120f26; }
/* the soft shadow of the binding on resting pages */
.flipbook .page.--left::after, .flipbook .page.--right::after { content: ""; position: absolute; top: 0; bottom: 0; width: 24%; pointer-events: none; }
/* 3D spine: the paper darkens as it curves down into the binding, with a soft sheen where it rises off it */
.flipbook .page.--left::after { right: 0; background: linear-gradient(to left, rgba(30, 18, 4, .5) 0%, rgba(30, 18, 4, .26) 3%, rgba(30, 18, 4, .1) 9%, rgba(255, 248, 228, .12) 14%, rgba(30, 18, 4, .03) 19%, rgba(30, 18, 4, 0) 100%); }
.flipbook .page.--right::after { left: 0; background: linear-gradient(to right, rgba(30, 18, 4, .46) 0%, rgba(30, 18, 4, .22) 3%, rgba(30, 18, 4, .07) 8%, rgba(255, 248, 228, .16) 12%, rgba(30, 18, 4, .03) 18%, rgba(30, 18, 4, 0) 100%); }
.flipbook .page.cover::after, .flipbook .page.back::after { display: none; }
/* the stack of page edges along the outer sides */
.flipbook .page.--left:not(.cover):not(.back) { box-shadow: -1px 0 0 #d6c9ac, -2px 1px 0 #f1e8d4, -3px 1px 0 #cdbf9f, -4px 2px 0 #ece2cc, -5px 2px 0 #c7b896, -6px 3px 0 #e6dbc2; }
.flipbook .page.--right:not(.cover):not(.back) { box-shadow: 1px 0 0 #d6c9ac, 2px 1px 0 #f1e8d4, 3px 1px 0 #cdbf9f, 4px 2px 0 #ece2cc, 5px 2px 0 #c7b896, 6px 3px 0 #e6dbc2; }
/* phones: one page at a time, with the facing page curving away into the spine on the left */
.flip-peek { display: none; }
/* until the page-turn library has laid the book out, its pages stay hidden (they would show as a list of names),
   and a page picture that has not loaded yet never shows its broken-image label */
.flipbook:not(.ready) > .page { display: none; }
.flipbook:not(.ready) { aspect-ratio: 4 / 3; max-height: 930px; }          /* the space of the open book meanwhile */
.flip-stage.portrait .flipbook:not(.ready) { aspect-ratio: 2 / 3; }
.flipbook img:not([src]) { visibility: hidden; }
.flip-stage.portrait { align-items: flex-start; }
.flip-stage.portrait.peeking { justify-content: flex-end; }   /* the open page moves right; the facing page fills the left */
.flip-stage.portrait .flip-shift { width: calc(100% - 12vw); margin-left: 0; }
.flip-stage.portrait .flipbook .page:not(.cover):not(.back)::after { left: 0; right: auto; width: 26%;
  background: linear-gradient(to right, rgba(30, 18, 4, .5) 0%, rgba(30, 18, 4, .22) 4%, rgba(30, 18, 4, .07) 10%, rgba(255, 248, 228, .14) 14%, rgba(30, 18, 4, 0) 100%); }
.flip-stage.portrait .flipbook .page:not(.cover):not(.back) { box-shadow: 1px 0 0 #d6c9ac, 2px 1px 0 #f1e8d4, 3px 1px 0 #cdbf9f, 4px 2px 0 #ece2cc, 5px 2px 0 #c7b896; }
/* phones: the facing page at full size, from the spine out past the left edge of the screen (site.js placePeek
   sets its place and size); the screen's edge is the cut, as if the book were bigger than the phone */
.flip-stage.portrait .flip-peek.on { display: block; position: absolute; z-index: 0; background: #f6efdf right top no-repeat;
  cursor: pointer; touch-action: pan-y;   /* a tap goes back; a sideways swipe reaches site.js, not the scroller */
  /* the left page bows like the book's own left pages (the same curve, mirrored from the right page's), so the two
     top edges meet at the spine; sized to the whole page and set at its spine end (site.js placePeek) */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0C55 0 84 .35 100 1.7V98.3C84 99.65 55 100 0 100Z'/%3E%3C/svg%3E") right top no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0C55 0 84 .35 100 1.7V98.3C84 99.65 55 100 0 100Z'/%3E%3C/svg%3E") right top no-repeat; }
/* the fold into the spine (the book's own left-page shading, in pixels of a phone page) and, at the screen's edge,
   a soft shadow: the page carries on behind it */
.flip-stage.portrait .flip-peek.on::after { content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(30, 18, 4, .3) 0, rgba(30, 18, 4, .14) 8px, rgba(30, 18, 4, .05) 18px, rgba(30, 18, 4, 0) 30px),
    linear-gradient(to left, rgba(45, 28, 8, .3) 0, rgba(45, 28, 8, .2) 6px, rgba(45, 28, 8, .11) 18px, rgba(45, 28, 8, .05) 36px, rgba(45, 28, 8, .015) 60px, rgba(45, 28, 8, 0) 90px); }
.flip-controls { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 26px; }
.flip-count { min-width: 9.5em; text-align: center; font: 600 12px/1 var(--caps); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-hi); }
.arrow { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); color: var(--gold-hi); font: 400 30px/1 var(--display); cursor: pointer; transition: background .2s, border-color .2s, opacity .2s; }
.arrow:hover:not(:disabled) { background: rgba(217, 164, 65, .15); border-color: var(--gold); }
.arrow:disabled { opacity: .3; cursor: default; }
.flip-caption { text-align: center; font: italic 500 22px/1.3 var(--display); color: var(--head); margin: 14px 0 26px; min-height: 1.3em; }

/* ---------- Krishna asks ---------- */
.asks { position: relative; padding: clamp(80px, 8vw, 112px) 0; background: linear-gradient(180deg, var(--night), #15123a 50%, var(--night)); overflow: hidden; }
.asks-glow { position: absolute; width: 900px; height: 900px; left: 50%; top: 55%; translate: -50% -50%; background: radial-gradient(closest-side, rgba(120, 110, 220, .25), transparent); pointer-events: none; }
.ask-card { position: relative; display: grid; grid-template-columns: 5fr 6fr; background: var(--paper); color: #2a2238; border-radius: 3px; overflow: hidden;
  box-shadow: 0 60px 100px -40px rgba(0, 0, 0, 1), 0 0 0 1px rgba(217, 164, 65, .5), 0 0 0 7px var(--paper), 0 0 0 8px rgba(184, 135, 50, .6); max-width: 1040px; margin: 0 auto; }
/* the scene sits straight on the card's paper: its own paper is transparent, the clip is masked by the still, and
   the whole painting shows (contain), so no box or straight cropped edge appears */
.ask-art { margin: 0; min-height: 100%; background: transparent; padding: clamp(10px, 1.6vw, 20px); }
.ask-art img, .ask-art video { display: block; width: 100%; height: 100%; object-fit: contain; transition: opacity .4s; }
.ask-art video { -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.ask-body { padding: clamp(26px, 4vw, 52px); display: flex; flex-direction: column; }
.ask-chapter { font: 600 11px/1.4 var(--caps); letter-spacing: .24em; text-transform: uppercase; color: #8a5a1c; margin: 0 0 14px; }
.ask-scene { font: italic 400 1.08em/1.55 var(--body); margin: 0 0 22px; color: #3b3248; }
.ask-q { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; padding: 20px; background: #f7eecf; border: 3px double #c9a052; margin-bottom: 22px; }
.ask-scale { width: 64px; mix-blend-mode: multiply; }
.ask-q p { margin: 0; font: 600 clamp(20px, 1.8vw, 26px)/1.25 var(--display); color: #2a2238; }
.ask-label { display: block; font: 600 11px/1 var(--caps); letter-spacing: .24em; text-transform: uppercase; color: #8a5a1c; margin-bottom: 8px; }
.ask-answers { display: grid; gap: 10px; }
.ask-answers button {
  text-align: left; font: 500 1em/1.35 var(--body); color: #2a2238; background: #fffaf0; border: 1px solid #d8c59d; padding: 14px 16px 14px 46px;
  border-radius: 2px; cursor: pointer; position: relative; transition: border-color .2s, background .2s, transform .2s;
}
.ask-answers button::before { content: ""; position: absolute; left: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 1.5px solid #b48a3a; border-radius: 50%; transition: background .2s, box-shadow .2s; }
.ask-answers button:hover:not(:disabled) { border-color: #b48a3a; transform: translateX(3px); }
.ask-answers button.chosen { background: #f6e6bb; border-color: #b48a3a; }
.ask-answers button.chosen::before { background: #b48a3a; box-shadow: 0 0 0 3px #fffaf0 inset; }
.ask-answers button:disabled:not(.chosen) { opacity: .55; cursor: default; }
.ask-after { margin-top: 22px; animation: rise .5s ease both; }
.ask-reflection { font: italic 500 1.25em/1.4 var(--display); color: #2a2238; border-left: 3px solid #c9a052; padding-left: 16px; margin: 0 0 10px; }
.ask-note { font-size: .92em; color: #5d5266; margin: 0 0 18px; }
.ask-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ask-actions .btn-ghost { color: #6b4413; background: transparent; border-color: #c9a052; backdrop-filter: none; }
.ask-dots { display: flex; gap: 8px; margin-top: auto; padding-top: 22px; }
.ask-dots i { width: 8px; height: 8px; border-radius: 50%; background: #d8c59d; }
.ask-dots i.on { background: #8a5a1c; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- characters ---------- */
/* the cast and teaser glows fade to plain night at top and bottom, so no line shows where a section meets the next */
.cast { padding: clamp(80px, 8vw, 112px) 0; background: linear-gradient(180deg, var(--night), transparent 22%, transparent 78%, var(--night)), radial-gradient(ellipse 70% 50% at 50% 18%, rgba(184, 50, 31, .18), transparent 70%), var(--night); }
.cast-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(18px, 2.4vw, 34px) clamp(14px, 2vw, 26px); }
.person { text-align: center; }
a.person { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.person .more { margin: auto 0 0; padding-top: 10px; font: 600 .9em/1.3 var(--body); color: var(--gold); }
.person .more span { display: inline-block; transition: transform .2s; }
a.person:hover .more, a.person:focus-visible .more { text-decoration: underline; text-underline-offset: 3px; }
a.person:hover .more span { transform: translateX(3px); }
/* portraits blend into the page: no ring or disc. Their sides dissolve (export_assets.py faded); on the light page
   they are multiplied onto it so their own paper disappears, on the dark page each sits on a soft cloud of paper */
.person-img { position: relative; aspect-ratio: 1; margin: 0 auto 14px; width: 100%; max-width: 160px; }
.person-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: opacity .35s ease; }
/* while the clip plays the still fades out, so only one layer is blended onto the page (two multiplied layers
   darkened the face and showed the wash's pale spots) */
.person-img:has(> .person-motion.on) > img { opacity: 0; }
:root[data-theme="light"] .person-img img, :root[data-theme="light"] .person-motion { mix-blend-mode: multiply; }
.person h3 { font: 600 15px/1.2 var(--caps); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 4px; color: var(--gold-hi); }
.person .say { font: italic 400 15px/1.2 var(--display); color: var(--muted); margin: 0 0 8px; }
.person .line { font-size: .9em; line-height: 1.45; color: var(--text); margin: 0; text-wrap: pretty; }

/* ---------- teaser ---------- */
.teaser { padding: clamp(80px, 8vw, 112px) 0; background: linear-gradient(180deg, var(--night), transparent 22%, transparent 78%, var(--night)), radial-gradient(ellipse 80% 60% at 70% 30%, rgba(184, 50, 31, .32), transparent 70%), linear-gradient(180deg, var(--night), #1d0b10 50%, var(--night)); }
.teaser-spread { position: relative; border-radius: 3px; overflow: hidden; box-shadow: 0 60px 100px -40px #000, 0 0 0 1px rgba(232, 118, 43, .35), 0 0 120px -30px rgba(184, 50, 31, .6); }
.teaser-spread img { width: 100%; }
.hotspot { position: absolute; width: 34px; height: 34px; translate: -50% -50%; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle, #fff6d6 0 22%, rgba(246, 210, 120, .9) 30%, rgba(232, 160, 60, .25) 60%, transparent 70%); }
.hotspot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid rgba(255, 230, 160, .8); animation: pulse 2.4s ease-out infinite; }
.hotspot[aria-expanded="true"]::after { animation: none; border-color: #fff; }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.hot-pop { position: absolute; z-index: 3; width: min(280px, 70vw); padding: 14px 16px; background: rgba(15, 8, 14, .92); border: 1px solid rgba(232, 160, 60, .6); color: #fff2d8;
  font: italic 500 19px/1.3 var(--display); border-radius: 2px; box-shadow: 0 20px 40px -10px #000; animation: rise .3s ease both; pointer-events: none; }
.teaser-foot { display: grid; grid-template-columns: 180px 1fr; gap: 36px; align-items: center; max-width: 760px; margin: 56px auto 0; }
.teaser-cover { box-shadow: 0 30px 60px -20px #000, 0 0 60px -10px rgba(184, 50, 31, .5); }
.teaser-quote { margin: 0 0 6px; font: italic 500 clamp(24px, 2.4vw, 32px)/1.25 var(--display); color: var(--head); }
.teaser-quote cite { display: block; font: 500 12px/1.6 var(--caps); letter-spacing: .24em; color: var(--gold); font-style: normal; margin-top: 12px; text-transform: uppercase; }
.teaser-window { color: var(--muted); margin: 14px 0 0; }
:root[data-theme="light"] .teaser-cover { box-shadow: 0 18px 32px -16px rgba(60, 40, 10, .45); }

/* ---------- parents ---------- */
/* home sections: 20% less space between them on computers (author, 2026-11-25); phones keep 80px */
.hero ~ .parents { padding-block: clamp(80px, 8vw, 112px); }
.parents { padding: clamp(80px, 10vw, 140px) 0; background: var(--paper); color: #2a2238; position: relative; }
.parents::before, .parents::after { content: ""; position: absolute; left: 0; right: 0; height: 60px; background: var(--night);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 0h1200v22c-60 14-120-10-190 6s-120 20-200 4-150 18-230 10-110-22-200-8-140 18-210 6S60 18 0 30z'/%3E%3C/svg%3E") center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 0h1200v22c-60 14-120-10-190 6s-120 20-200 4-150 18-230 10-110-22-200-8-140 18-210 6S60 18 0 30z'/%3E%3C/svg%3E") center / 100% 100%; }
.parents::before { top: -1px; }
.parents::after { bottom: -1px; transform: scaleY(-1); }
.parents .kicker { color: #8a5a1c; }
.parents h2 { color: #221b33; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.trust { padding: 28px 24px; background: #fbf5e7; border: 1px solid #e0cfa8; border-radius: 2px; }
.trust svg { width: 42px; height: 42px; color: #a8742a; margin-bottom: 14px; }
.trust h3 { color: #221b33; }
.trust p { margin: 0; color: #4a4157; font-size: .95em; }
.details { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; margin-top: 40px; padding: 28px 32px; border: 3px double #c9a052; background: #f7eecf; }
.details dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 30px; margin: 0; }
.details dt { font: 600 11px/1 var(--caps); letter-spacing: .22em; text-transform: uppercase; color: #8a5a1c; margin-bottom: 6px; }
.details dd { margin: 0; font: 600 1.05em/1.3 var(--display); color: #221b33; }
.details-cta { display: flex; flex-direction: column; gap: 10px; }
.details-cta .btn-ghost { color: #6b4413; background: transparent; border-color: #c9a052; backdrop-filter: none; }

/* ---------- author ---------- */
.author { padding: clamp(80px, 10vw, 130px) 0 clamp(60px, 8vw, 100px); }
.author-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.author-line { filter: invert(1) sepia(.6) saturate(2) hue-rotate(5deg) brightness(.9); opacity: .55; mix-blend-mode: screen; }

/* ---------- signup ---------- */
.signup { position: relative; padding: clamp(100px, 12vw, 170px) 0; text-align: center; overflow: hidden; isolation: isolate; }
.signup-art { position: absolute; inset: 0; z-index: -1; background-position: center 30%; background-size: cover; background-repeat: no-repeat; opacity: .55; }
.signup::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--night), rgba(11, 9, 24, .55) 30%, rgba(11, 9, 24, .7) 70%, var(--night)); }
.signup-inner { max-width: 720px; }
.signup-inner .kicker { color: var(--gold-hi); }
.signup h2 { text-shadow: 0 4px 30px rgba(0, 0, 0, .8); }
.signup-form { display: flex; gap: 10px; max-width: 520px; margin: 34px auto 14px; }
.signup-form input { flex: 1; min-width: 0; min-height: 50px; padding: 0 18px; font: 400 17px var(--body); color: var(--paper); background: rgba(11, 9, 24, .7); border: 1px solid var(--line); border-radius: 2px; }
.signup-form input::placeholder { color: #9d927e; }
.signup-form input:focus { border-color: var(--gold); outline: none; }
.fine { font-size: .9em; color: #d6ccb6; text-shadow: 0 1px 8px #000; }
.signup-thanks { font: italic 500 24px/1.3 var(--display); color: var(--gold-hi); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 46px 0 30px; background: var(--page-edge); }
.foot-grid { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot-brand { font: 600 20px/1 var(--caps); letter-spacing: .24em; margin: 0 0 6px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.foot-by { margin: 0; font: 500 13px/1 var(--caps); letter-spacing: .2em; color: var(--muted); }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot nav a { color: var(--text); text-decoration: none; font-size: .95em; }
.foot nav a:hover { color: var(--gold-hi); }
.copy { color: #877d6e; font-size: .85em; margin-top: 30px; }   /* 4.5:1 on the footer (WCAG AA) */
/* grouped footer links (website/tools/site_links.py writes them on every page) */
.foot-grid:has(.foot-cols) { align-items: flex-start; }
.foot nav.foot-cols { display: grid; grid-template-columns: repeat(5, auto); gap: 22px 44px; }
.foot-cols > div { display: flex; flex-direction: column; gap: 9px; }
.foot-h { font: 500 11px/1.4 var(--caps); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin: 0 0 4px; }
@media (max-width: 1100px) { .foot nav.foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; } }
@media (max-width: 560px) { .foot nav.foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 20px; } .foot-cols a { padding: 5px 0; } }
.nav-links a[aria-current="page"], .nav-links .nav-item > a[aria-current="true"] { color: var(--gold-hi); opacity: 1; }
/* six menu links: a little tighter on mid-size screens, and below 1260px the menu folds into the button (as the 1100px rules do) */
@media (max-width: 1400px) { .nav { gap: 20px; } .nav-links { gap: 18px; } }
@media (max-width: 1260px) {
  .nav-links { position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0; background: var(--glass-strong); border-bottom: 1px solid var(--line); padding: 8px 0; display: none; }
  .nav-links a { padding: 16px var(--gutter); font-size: 13px; }
  .nav.open .nav-links { display: flex; }
  .nav.open { background: var(--glass-strong); }
  .nav-toggle { display: block; margin-left: 0; }
  .theme-toggle { margin-left: auto; }
  .nav-buy { margin-left: 0; }
}
.sec-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 34px 0 0; }
.chapters a { color: inherit; text-decoration: none; }
.chapters a:hover { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5, 4, 10, .96); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lb-scroll { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; padding: 20px; }
.lb-scroll img { max-width: min(1700px, 96vw); max-height: 92vh; object-fit: contain; background: var(--paper); border-radius: 3px; }  /* paintings with transparent paper: shown on their sheet */
.lb-close { position: absolute; top: 12px; right: 16px; z-index: 2; width: 48px; height: 48px; font: 300 36px/1 var(--display); color: var(--gold-hi); background: rgba(0, 0, 0, .5); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }

/* ---------- reveal ---------- */
/* hidden only when JavaScript runs (the head script adds .js), so the page still reads without it */
.js .nojs { display: none !important; }   /* plain copies for readers and crawlers without JavaScript */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
/* the first screen rises in by CSS alone, from the first paint, without waiting for the scripts */
/* the first screen rises from 1% opacity, not 0: it looks the same, but Chrome only counts a picture or heading as the
   page's main content (LCP) if it was visible when first painted */
.js .hero .reveal, .js .bp-hero .reveal { opacity: 1; transform: none; transition: none; animation: hero-rise 1.4s cubic-bezier(.2, .7, .2, 1) both; }
.js .bp-hero .reveal { animation-duration: 1s; }
.hero .reveal:nth-child(2), .bp-hero .reveal:nth-child(2) { animation-delay: .15s; }
.hero .reveal:nth-child(3) { animation-delay: .45s; }
.hero .reveal:nth-child(4) { animation-delay: .6s; }
.hero .reveal:nth-child(5) { animation-delay: .75s; }
.hero .reveal:nth-child(6) { animation-delay: .9s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes hero-rise { from { opacity: .01; transform: translateY(26px); } }

/* ---------- book page ---------- */
.bp-hero { position: relative; padding: 140px 0 90px; overflow: hidden; isolation: isolate; }
.bp-hero-art { position: absolute; inset: 0; z-index: -1; background-position: center 30%; background-size: cover; background-repeat: no-repeat; opacity: .35; filter: blur(2px); transition: opacity 1.2s ease; }
/* the painting behind a book page's hero loads after the page (data-bg), so the cover comes first; it fades in */
.bp-hero-art[data-bg]:not([data-shown]) { opacity: 0 !important; }
.bp-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--night) 10%, rgba(11, 9, 24, .6) 60%, rgba(11, 9, 24, .85)), linear-gradient(0deg, var(--night), transparent 30%); }
.bp-grid { display: grid; grid-template-columns: 380px 1fr; gap: clamp(30px, 6vw, 80px); align-items: center; }
.bp-cover { display: block; width: 100%; aspect-ratio: 640 / 966; object-fit: cover; background: #120f26; box-shadow: 30px 40px 80px -20px #000, 0 0 90px -20px rgba(232, 118, 43, .5); }
/* a book page's cover: the still (sized by srcset, so phones get a small file) with its clip laid on top, faded in
   once it plays */
.bp-cover-wrap { position: relative; }
.bp-cover-motion { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.bp-cover-motion.playing { opacity: 1; }
.bp-cta { justify-content: flex-start; margin-top: 22px; }
.bp-next { padding: clamp(60px, 8vw, 100px) 0; border-top: 1px solid var(--line); background: radial-gradient(ellipse 60% 80% at 20% 50%, rgba(184, 50, 31, .2), transparent 70%), var(--night); }
.bp-next-grid { display: grid; grid-template-columns: 170px 1fr; gap: 36px; align-items: center; max-width: 760px; }
.bp-next-cover { width: 100%; aspect-ratio: 640 / 966; object-fit: cover; box-shadow: 0 30px 60px -20px #000, 0 0 60px -10px rgba(184, 50, 31, .5); }
.bp-next h2 { font-size: clamp(32px, 3.6vw, 48px); margin-bottom: 6px; }
.bp-next h2 a { color: inherit; text-decoration: none; }
.bp-next h2 a:hover { color: var(--gold-hi); }
.bp-next .lede { color: var(--muted); margin: 0 0 18px; }
.buybar { display: none; }
.bp-blurb h1 { font: italic 500 clamp(50px, 6vw, 88px)/1 var(--display); margin: 0 0 10px; color: var(--head); }
.bp-blurb .lead-q { font: 600 clamp(24px, 2.4vw, 32px)/1.25 var(--display); color: var(--gold-hi); margin: 24px 0 14px; }
.bp-blurb p { max-width: 62ch; }
.bp-section { padding: clamp(60px, 8vw, 110px) 0; }
.chapters { columns: 2; column-gap: 50px; list-style: none; padding: 0; margin: 0 auto; max-width: 820px; counter-reset: ch -1; }
.chapters li { break-inside: avoid; display: flex; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); font: 500 1.2em/1.3 var(--display); }
.chapters li span { flex: none; width: 2.2em; font: 600 13px/1 var(--caps); color: var(--gold); letter-spacing: .1em; }
.chapters li .ch-t { flex: 1; width: auto; font: inherit; color: inherit; letter-spacing: 0; display: flex; flex-direction: column; gap: 5px; }
.chapters li .ch-t small { font: 400 .74em/1.45 var(--body); color: var(--muted); text-wrap: pretty; }
/* book pages: the first page (book-pages-text.md, tools/book_page_text.py) */
.first-page { max-width: 680px; margin: 0 auto; }
.first-page blockquote { margin: 0; padding: clamp(28px, 5vw, 56px); background: var(--paper); color: #2a2238; border: 3px double #c9a052;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8); font: 400 clamp(17px, 1.2vw + 10px, 20px)/1.65 var(--body); }
.first-page blockquote p { margin: 0 0 1em; }
.first-page blockquote p:last-child { margin: 0; }
.first-page figcaption { margin-top: 18px; text-align: center; font: italic 400 1em/1.5 var(--display); color: var(--muted); }
/* book pages: who it's for, parents' questions, the characters (inside .parents, above the details box) */
.bp-parents { max-width: 820px; margin: 0 auto 56px; }
.bp-parents .sec-head { margin-bottom: 28px; }
.bp-parents h3 { font: 500 clamp(24px, 2.4vw, 30px)/1.2 var(--display); color: #221b33; text-align: center; margin: 48px 0 16px; }
.bp-who { font-size: 1.08em; line-height: 1.65; color: #2a2238; margin: 0; }
.bp-parents a { color: #8a5a1c; text-underline-offset: 3px; }
.bp-faq details { border-bottom: 1px solid rgba(138, 90, 28, .3); }
.bp-faq summary { cursor: pointer; list-style: none; padding: 16px 36px 16px 0; position: relative; font: 600 1.05em/1.4 var(--body); color: #221b33; }
.bp-faq summary::-webkit-details-marker { display: none; }
.bp-faq summary::after { content: "+"; position: absolute; right: 6px; top: 13px; color: #8a5a1c; font-size: 1.35em; }
.bp-faq details[open] summary::after { content: "–"; }
.bp-faq details p { margin: 0 0 16px; line-height: 1.65; color: #2a2238; }
.bp-cast { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 22px; }
.bp-cast a { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: #221b33; font: 500 1.05em/1.2 var(--display); }
.bp-cast img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #c9a052; }
.bp-cast a:hover span { color: #8a5a1c; text-decoration: underline; }
.spread-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.spread-pair img { box-shadow: 0 30px 60px -25px #000; border-radius: 2px; cursor: zoom-in; }
.prose { max-width: 720px; margin: 0 auto; padding: 150px var(--gutter) 90px; }
.prose h1 { font: 500 clamp(40px, 5vw, 64px)/1.05 var(--display); color: var(--head); margin: 0 0 30px; }
.prose h2 { font-size: 30px; margin: 36px 0 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .nav-links { position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0; background: var(--glass-strong); border-bottom: 1px solid var(--line); padding: 8px 0; display: none; }
  .nav-links a { padding: 16px var(--gutter); font-size: 13px; }
  .nav.open .nav-links { display: flex; }
  .nav.open { background: var(--glass-strong); }
  .nav-toggle { display: block; margin-left: 0; }
  .nav-buy { margin-left: auto; }
  .cast-grid { grid-template-columns: repeat(4, 1fr); }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .invocation-grid, .ask-card, .author-grid, .bp-grid { grid-template-columns: 1fr; }
  .invocation-art { max-width: 420px; margin: 0 auto; }
  .book-row { grid-template-columns: 1fr; gap: 64px; }
  .book-cover { max-width: 260px; }
  /* minmax(0, 1fr) and min-width: 0 keep Safari from widening the card to the painting's min-content width
     (aspect-ratio + max-height made it lay the card out wider than the screen, so the text ran off the right) */
  .ask-card { grid-template-columns: minmax(0, 1fr); }
  .ask-card > * { min-width: 0; }
  .ask-art { aspect-ratio: var(--ar, 1); max-height: 62svh; width: 100%; min-height: 0; }   /* the painting's own shape (site.js), whole */
  .cast-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-grid { grid-template-columns: 1fr; }
  .details { grid-template-columns: 1fr; padding: 22px; }
  .details dl { grid-template-columns: repeat(2, 1fr); }
  .teaser-foot { grid-template-columns: 120px 1fr; gap: 24px; }
  .signup-form { flex-direction: column; }
  .author-line { order: 2; }
  .bp-cover, .bp-cover-wrap { max-width: 260px; margin: 0 auto; }
  .chapters { columns: 1; }
  .spread-pair { grid-template-columns: 1fr; }
  .hotspot { width: 26px; height: 26px; }
}
@media (max-width: 600px) { .nav-buy { display: none; } .nav-toggle { margin-left: auto; } }   /* (it pushed the menu button off the edge; the hero has the buy button) */
/* the smallest phones: a tighter name, so the menu button stays on screen */
@media (max-width: 360px) { .brand { gap: 8px; font-size: 14px; letter-spacing: .15em; } .nav-toggle { flex: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
@media (max-width: 560px) {
  .teaser-foot { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 22px; margin-top: 40px; }
  .teaser-cover { width: 130px; }
  .teaser-quote { font-size: 22px; }
  .title-word { font-size: 10.4vw; letter-spacing: .1em; }
  .hero-tag { font-size: 16px; }
  .hero::after { background:
    linear-gradient(180deg, rgba(11, 9, 24, .6) 0%, rgba(11, 9, 24, 0) 14%),
    linear-gradient(0deg, var(--night) 0%, rgba(11, 9, 24, .9) 30%, rgba(11, 9, 24, .3) 55%, rgba(11, 9, 24, 0) 70%); }
  .film-toggle { bottom: auto; top: 76px; }
  /* phones: everything centred over a portrait film */
  .hero-inner { text-align: center; }
  .scene-cap { justify-content: center; }
  .hero-title { align-items: center; }
  .title-word { margin-left: 0; margin-right: -.1em; }
  .title-word::after { margin-left: auto; margin-right: auto; width: 46%; background: linear-gradient(90deg, rgba(217, 164, 65, 0), var(--gold), rgba(217, 164, 65, 0)); }
  .hero-tag { margin-left: auto; margin-right: auto; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-cta .btn { width: min(300px, 100%); }
}
.book-title-link { color: inherit; text-decoration: none; }
.book-title-link:hover { color: var(--gold-hi); }
/* book page on phones: the two actions stay at hand in a bar at the bottom once the hero's buttons scroll away */
@media (max-width: 760px) {
  .bp-cover-wrap { max-width: 240px; margin: 0 auto; }
  .bp-blurb { text-align: center; }
  .bp-cta { justify-content: center; flex-direction: column; align-items: center; }
  .bp-cta .btn { width: min(300px, 100%); }
  .bp-next-grid { grid-template-columns: 110px 1fr; gap: 20px; }
  .buybar { display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--glass-strong); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    transform: translateY(110%); transition: transform .35s ease; }
  .buybar.show { transform: none; }
  .buybar .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; letter-spacing: .06em; }   /* two equal halves, even at 320 px */
  body:has(.buybar) .foot { padding-bottom: 90px; }
  /* steps aside for the family tree's person sheet (which takes the same place) and while typing (search, sign-up) */
  body:has(.ft:not(.ft-away) .ft-card:not([hidden])) .buybar,
  body:has(input:focus, textarea:focus) .buybar { transform: translateY(110%); }
}
/* the book: a hand cursor, and the "Tap to open" marker on the closed cover */
.flipbook { position: relative; cursor: pointer; }
.flipbook .page { cursor: pointer; }
.flip-hint { position: absolute; z-index: 60; translate: -50% -50%; display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 12px; border-radius: 999px; border: 1px solid rgba(246, 226, 164, .55); cursor: pointer;
  background: rgba(11, 9, 24, .62); backdrop-filter: blur(6px); color: #fff3d4; white-space: nowrap;
  font: 600 11px/1 var(--caps); letter-spacing: .2em; text-transform: uppercase;
  opacity: 0; pointer-events: none; transition: opacity .5s ease; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .7); }
.flip-hint.on { opacity: 1; pointer-events: auto; }
.flip-hint:hover { background: rgba(11, 9, 24, .8); border-color: var(--gold-hi); }
.flip-hint-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #ffe9a8; box-shadow: 0 0 10px 2px rgba(255, 210, 120, .8); }
.flip-hint-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid rgba(255, 230, 160, .8); animation: pulse 2s ease-out infinite; }
/* keep the dark cover from melting into the dark page: a warm spotlight behind the book, a faint gold rim, and the
   block of page edges along the open side of the closed book */
.flip-stage::before { content: ""; position: absolute; left: 50%; top: 46%; width: min(1100px, 120%); height: 115%; translate: -50% -50%;
  background: radial-gradient(ellipse 42% 48% at 50% 50%, rgba(240, 190, 110, .2), rgba(150, 120, 220, .1) 45%, rgba(11, 9, 24, 0) 72%);
  pointer-events: none; z-index: 0; }
.flip-shift, .flip-peek { position: relative; z-index: 1; }
/* the books that turn: up and down is the page's scroll, sideways is the book's (site.js and the library) */
.flipbook, .flipbook .stf__block { touch-action: pan-y; }
.flipbook .page.cover { box-shadow: 0 0 0 1px rgba(246, 226, 164, .28), 2px 0 0 #efe6d2, 3px 1px 0 #cdbf9f, 5px 1px 0 #ece2cc, 6px 2px 0 #c7b896,
  8px 2px 0 #e6dbc2, 9px 3px 0 #bfae8b, 0 0 60px -10px rgba(246, 210, 140, .35); }
.flipbook .page.back { box-shadow: 0 0 0 1px rgba(246, 226, 164, .28), -2px 0 0 #efe6d2, -3px 1px 0 #cdbf9f, -5px 1px 0 #ece2cc, -6px 2px 0 #c7b896,
  -8px 2px 0 #e6dbc2, -9px 3px 0 #bfae8b, 0 0 60px -10px rgba(246, 210, 140, .35); }
.inside { overflow-x: clip; }

/* ---------- Books section: open a book in place ---------- */
.books { overflow-x: clip; }
.book-row[hidden], .book-reader[hidden] { display: none; }
.book-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit;
  touch-action: pan-y; -webkit-user-select: none; user-select: none; }   /* a sideways swipe opens it (site.js) */
.book-open img, .book-open video { -webkit-user-drag: none; }
.book-open:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 8px; }
/* the first page waiting under the cover */
.book-pages { position: absolute; inset: 0; z-index: 0; opacity: 0; transition: opacity .15s; background: #f6efdf center / cover no-repeat;
  box-shadow: 1px 0 0 #d6c9ac, 3px 1px 0 #efe6d2, 4px 1px 0 #cdbf9f, 6px 2px 0 #ece2cc, 7px 2px 0 #c7b896, 0 30px 50px -20px #000; }
.book-open .book-cover-inner { z-index: 1; }
.book-open .book-hint { left: 50%; top: 62%; z-index: 3; }
/* hover: the cover starts to swing open */
/* the invitation: lift the cover open and let it fall back */
.book-open.peek .book-cover-inner { animation: coverPeek 1.9s cubic-bezier(.45, .05, .3, 1); }
@keyframes coverPeek { 0% { transform: none; } 38%, 58% { transform: rotateY(-58deg); } 100% { transform: none; } }
/* opening: the other books slide away and fade */
.books .book { transition: opacity .45s ease, transform .45s ease; }
.books.reading .book { opacity: 0; transform: translateX(var(--away, 0)); pointer-events: none; }
.cover-ghost { position: fixed; z-index: 45; object-fit: cover; pointer-events: none; transform-origin: 0 0; will-change: transform; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .95), 0 0 70px -10px rgba(217, 164, 65, .45); }
.book-reader { position: relative; transition: opacity .3s ease; }
.book-reader.measuring, .book-reader.closing { opacity: 0; }
.no-anim .flip-shift { transition: none !important; }
.reader-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.reader-close { display: block; margin: 22px auto 0; padding: 10px 16px; border: 0; background: none; cursor: pointer;
  font: 600 12px/1 var(--caps); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.reader-close:hover { color: var(--gold-hi); }
@media (max-width: 760px) { .reader-actions .btn { width: min(300px, 100%); } }

/* the first page shows only while the cover lifts */
.book-open.peek .book-pages { opacity: 1; }
/* books not out yet: "Coming soon" over the cover on hover or tap */
.soonable { cursor: pointer; }
.soon { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, rgba(11, 9, 24, .35), rgba(11, 9, 24, .78) 60%); opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.soon-title { font: italic 500 clamp(26px, 2.4vw, 34px)/1 var(--display); color: #fff6e0; text-shadow: 0 2px 14px rgba(0, 0, 0, .8); }
.soon-sub { font: 600 11px/1 var(--caps); letter-spacing: .24em; text-transform: uppercase; color: var(--gold-hi); margin-bottom: 8px; }
.soonable.show-soon .soon { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .soonable:hover .soon, .soonable:focus-visible .soon { opacity: 1; pointer-events: auto; } }
/* the other books, lying flat on top of each other under the open book; click to go back to all books */
.spine-stack { display: flex; flex-direction: column; align-items: center; margin: 6px auto 30px; }
.spine { --c1: #5b4a2a; --c2: #2a2010; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  width: min(440px, 86%); height: 38px; padding: 0 30px; border: 0; border-radius: 3px 3px 2px 2px; cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 70%, white) 0%, var(--c1) 16%, var(--c2) 78%, color-mix(in srgb, var(--c2) 75%, black) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 -2px 0 rgba(0, 0, 0, .35) inset, 0 12px 18px -10px rgba(0, 0, 0, .9);
  color: #f3d58c; transition: transform .25s ease, box-shadow .25s ease; }
.spine + .spine { margin-top: 1px; translate: 14px 0; }
.spine:first-child { translate: -10px 0; z-index: 1; }
/* gold bands near the ends, as on a bound spine */
.spine::before, .spine::after { content: ""; position: absolute; top: 4px; bottom: 4px; width: 2px; border-left: 1px solid rgba(243, 213, 140, .7); border-right: 1px solid rgba(243, 213, 140, .7); }
.spine::before { left: 14px; } .spine::after { right: 14px; }
.spine-series { font: 600 10px/1 var(--caps); letter-spacing: .22em; text-transform: uppercase; opacity: .85; }
.spine-title { font: italic 600 18px/1 var(--display); color: #fff1cf; }
.spine-num { font: 600 10px/1 var(--caps); letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.spine:hover, .spine:focus-visible { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 -2px 0 rgba(0, 0, 0, .35) inset, 0 16px 22px -10px rgba(0, 0, 0, .9), 0 0 24px -6px rgba(243, 213, 140, .45); }
@media (max-width: 560px) { .spine { padding: 0 22px; height: 34px; } .spine-series { display: none; } .spine-title { font-size: 16px; } }
/* the other books as real 3D books (desktop): they tip over and settle into a pile under the open book */
.fly-stage { position: fixed; inset: 0; z-index: 45; pointer-events: none; perspective: 1800px; perspective-origin: 50% 45%; }
.book3d { position: absolute; left: 0; top: 0; transform-style: preserve-3d; transform-origin: 50% 50%; }
.f3 { position: absolute; background-size: 100% 100%; backface-visibility: hidden; }
.f3.front { inset: 0; transform: translateZ(calc(var(--d) / 2)); box-shadow: inset 6px 0 10px -6px rgba(0, 0, 0, .55); }
.f3.back { inset: 0; transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); background: #191433; }
.f3.spine3 { top: 0; height: 100%; width: var(--d); left: calc(50% - var(--d) / 2); transform: rotateY(-90deg) translateZ(calc(var(--w) / 2)); }
.f3.edge-r { top: 0; height: 100%; width: var(--d); left: calc(50% - var(--d) / 2); transform: rotateY(90deg) translateZ(calc(var(--w) / 2));
  background: repeating-linear-gradient(90deg, #f4ecd8 0 1px, #ddd0b3 1px 2px); }
.f3.edge-t, .f3.edge-b { left: 0; width: 100%; height: var(--d); top: calc(50% - var(--d) / 2);
  background: repeating-linear-gradient(0deg, #f4ecd8 0 1px, #ddd0b3 1px 2px); }
.f3.edge-t { transform: rotateX(90deg) translateZ(calc(var(--h) / 2)); }
.f3.edge-b { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2)); }
/* the pile itself: the real spine images */
.spine { display: block; width: min(440px, 86%); height: auto; padding: 0; border: 0; border-radius: 2px; background: none; overflow: hidden; line-height: 0;
  box-shadow: 0 10px 16px -8px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .15) inset; }
.spine::before, .spine::after { display: none; }
.spine img { display: block; width: 100%; height: auto; pointer-events: none; }
@media (max-width: 760px) { .spine-stack { display: none; } }
/* phones: the book opens in place, the same size as the cover it replaces */
.book-reader { min-width: 0; }
.book-reader.inplace { margin: 0 auto 26px; }
.book-reader.inplace .flip-stage { width: calc(260px + 10vw); max-width: 100%; margin: 0 auto; padding-top: 0; }
.book-reader.inplace .flip-stage::before { display: none; }
.book-reader.inplace .flip-controls { margin-top: 16px; }
.book-reader.inplace .flip-caption { font-size: 18px; margin: 8px 0 4px; }
.book-reader.inplace .reader-actions, .book-reader.inplace .spine-stack { display: none; }
.book-reader.inplace .reader-close { margin-top: 6px; }
.book-open[hidden] { display: none; }
.book-reader.inplace .flip-stage { width: 260px; max-width: 100%; position: relative; justify-content: center; }
.book-reader.inplace .flip-stage .flip-shift { width: 100%; }
.book-reader.inplace .flip-stage.peeking { margin-left: auto; margin-right: 0; }   /* the open page to the right */
/* the pile of 3D books under the open book (desktop) */
.spine-stack { position: relative; width: 100%; height: 0; perspective: 1800px; margin: 8px auto 26px; }
.spine-stack .book3d { pointer-events: none; outline: none; }
.pile-hit { position: absolute; z-index: 5; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 3px; }
.pile-hit:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
/* hover: light falls on the spine (a filter here would flatten the 3D book and make it flicker) */
.f3.spine3::after { content: ""; position: absolute; inset: 0; background: rgba(255, 236, 190, .16); opacity: 0; transition: opacity .2s; }
.spine-stack .book3d.lit .spine3::after { opacity: 1; }
.book-reader.measuring { opacity: 1; }
.book-reader.measuring > :not(.spine-stack) { opacity: 0; }
.f3.spine3 { background-size: 100% 100%, 100% 100%; }
.spine-stack { transform-style: preserve-3d; }
/* the pile at rest, as a real stack on a table: */
/* the page ends: cream paper between the two thin edges of the cover, in the shade of the end */
.f3.edge-t, .f3.edge-b { box-shadow: inset 0 1.5px 0 rgba(48, 30, 30, .9), inset 0 -1.5px 0 rgba(48, 30, 30, .9); }
.f3.edge-t::after, .f3.edge-b::after { content: ""; position: absolute; inset: 0; background: rgba(70, 45, 15, .08); }
/* a soft shadow on the table under each book (on the book below, for the upper ones); it rides under the back cover */
.f3.ground { inset: -5% -9%; transform: translateZ(calc(var(--d) / -2 - 1px)); opacity: 0; transition: opacity .5s;
  background: radial-gradient(closest-side, rgba(25, 15, 5, .42), rgba(25, 15, 5, .18) 70%, rgba(25, 15, 5, 0)); }
.book3d.settled .f3.ground { opacity: 1; }
/* where a book lies on the one below, a dark line of shadow along the top of the lower spine */
.f3.spine3::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .5s;
  background: linear-gradient(270deg, rgba(15, 8, 2, .6), rgba(15, 8, 2, .22) 12%, rgba(15, 8, 2, 0) 30%); }
.book3d.under .f3.spine3::before { opacity: 1; }
/* Book One on hover (mouse only): the cover swings partly open, showing the first page, and stays open while hovered */
@media (hover: hover) {
  .book.has-preview .book-open:hover .book-cover-inner { transform: rotateY(-40deg); }
  .book.has-preview .book-open:hover .book-pages { opacity: 1; transition-delay: 0s; }
  .book.has-preview .book-open .book-pages { transition: opacity .15s ease .6s; }   /* hide the page only once the cover has closed */
}
/* every cover in the Books row looks like a real, thick book: cream page edges along the right and bottom, a faint rim */
.book-cover:not(.book-open) .book-cover-inner {
  box-shadow: 0 0 0 1px rgba(246, 226, 164, .22), 2px 0 0 #efe6d2, 3px 1px 0 #cdbf9f, 5px 1px 0 #ece2cc, 6px 2px 0 #c7b896,
    8px 2px 0 #e6dbc2, 9px 3px 0 #bfae8b, 0 30px 60px -20px rgba(0, 0, 0, .95); }
/* Book One: its first page always lies under the cover, so the page edges stay put when the cover swings open */
.book-open .book-pages, .book.has-preview .book-open .book-pages { opacity: 1; transition: none;
  box-shadow: 2px 0 0 #efe6d2, 3px 1px 0 #cdbf9f, 5px 1px 0 #ece2cc, 6px 2px 0 #c7b896, 8px 2px 0 #e6dbc2, 9px 3px 0 #bfae8b, 0 30px 60px -20px rgba(0, 0, 0, .95); }
.book-open .book-cover-inner { box-shadow: 0 0 0 1px rgba(246, 226, 164, .22); }


/* ================= Light theme ================= */
/* A warm parchment page with indigo ink, like the book's own pages. The hero film stays a dark "screen" in both
   themes, and so does the menu while it floats over the film. */
:root[data-theme="light"] {
  color-scheme: light;
  --night: #f6efe1;
  --night-2: #efe5cf;
  --text: #3a3145;
  --muted: #655a6b;                     /* text colours here keep 4.5:1 on every parchment tone (WCAG AA) */
  --head: #221b33;
  --gold: #875b1c;
  --gold-hi: #84561a;
  --line: rgba(132, 86, 26, .28);
  --glass: rgba(255, 250, 240, .6);
  --glass-strong: rgba(250, 245, 233, .92);
  --page-edge: #ece2cc;
}
:root[data-theme="dark"] { color-scheme: dark; }
/* the hero and anything over it keep the dark palette */
.hero, .shelf-strip, :root[data-theme="light"] .nav:not(.solid):not(.open), :root[data-theme="light"] .nav.on-dark:not(.open) {
  --night: #0b0918; --text: #ece4d2; --muted: #b5a98f; --head: #f5ecd9; --gold: #d9a441; --gold-hi: #f6e2a4;
  --line: rgba(217, 164, 65, .28); --glass: rgba(11, 9, 24, .35); --glass-strong: rgba(11, 9, 24, .82);
}
/* blocks that are parchment in both themes take the light theme's ink and deep gold, so links and icons keep 4.5:1
   (WCAG AA) there in the dark theme too; and so does the phone's menu bar while it floats over one of them */
.parents, .talk, .ask-mini, .ask-card, .details, :root:root .nav.on-light:not(.open) {
  --text: #3a3145; --muted: #655a6b; --head: #221b33; --gold: #875b1c; --gold-hi: #84561a;
  --line: rgba(132, 86, 26, .28); --glass: rgba(255, 250, 240, .6); --glass-strong: rgba(250, 245, 233, .92);
}
:root[data-theme="light"] .copy { color: #655c51; }
:root[data-theme="light"] body::before { opacity: .05; mix-blend-mode: multiply; }
:root[data-theme="light"] .nav.solid { box-shadow: 0 6px 24px -14px rgba(60, 40, 10, .35); }
/* gold-gradient lettering reads poorly on parchment: solid deep gold instead */
:root[data-theme="light"] .foot-brand {
  background: none; -webkit-text-fill-color: currentColor; color: var(--gold-hi); }
/* sections with their own dark backgrounds */
:root[data-theme="light"] .asks { background: linear-gradient(180deg, var(--night), #ece3f0 50%, var(--night)); }
:root[data-theme="light"] .asks-glow { background: radial-gradient(closest-side, rgba(150, 130, 230, .18), transparent); }
:root[data-theme="light"] .teaser { background: linear-gradient(180deg, var(--night), transparent 22%, transparent 78%, var(--night)), radial-gradient(ellipse 80% 60% at 70% 30%, rgba(184, 50, 31, .14), transparent 70%), linear-gradient(180deg, var(--night), #f3e3d8 50%, var(--night)); }
:root[data-theme="light"] .cast { background: linear-gradient(180deg, var(--night), transparent 22%, transparent 78%, var(--night)), radial-gradient(ellipse 70% 50% at 50% 18%, rgba(184, 50, 31, .08), transparent 70%), var(--night); }
:root[data-theme="light"] .invocation { background: radial-gradient(ellipse 60% 70% at 25% 50%, rgba(232, 118, 43, .1), transparent 70%), var(--night); }
:root[data-theme="light"] .parents { background: #fffaf0; }
:root[data-theme="light"] .ask-card { box-shadow: 0 40px 80px -40px rgba(60, 40, 10, .45), 0 0 0 1px rgba(217, 164, 65, .5), 0 0 0 7px var(--paper), 0 0 0 8px rgba(184, 135, 50, .6); }
:root[data-theme="light"] .invocation-art img, :root[data-theme="light"] .teaser-spread { box-shadow: 0 30px 60px -30px rgba(60, 40, 10, .5), 0 0 0 1px var(--line); }
:root[data-theme="light"] .author-line { filter: none; mix-blend-mode: multiply; opacity: .55; }
:root[data-theme="light"] .bp-hero-art { opacity: .22; }
:root[data-theme="light"] .flip-shift { filter: drop-shadow(0 30px 40px rgba(60, 40, 10, .35)); }
:root[data-theme="light"] .flip-stage::before { background: radial-gradient(ellipse 42% 48% at 50% 50%, rgba(240, 190, 110, .28), rgba(150, 120, 220, .08) 45%, rgba(246, 239, 225, 0) 72%); }
:root[data-theme="light"] .book-cover.featured::after { background: radial-gradient(closest-side, rgba(232, 118, 43, .22), transparent); }
:root[data-theme="light"] .spine, :root[data-theme="light"] .book3d { --shadow: rgba(60, 40, 10, .5); }
:root[data-theme="light"] .details { background: #f7eecf; }

/* the theme switch in the menu bar */
.theme-toggle { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass);
  color: var(--gold-hi); cursor: pointer; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.theme-toggle:hover { border-color: var(--gold); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme-toggle .i-sun, :root[data-theme="light"] .theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
.nav-links { margin-left: auto; }
@media (max-width: 1100px) { .theme-toggle { margin-left: auto; } .nav-buy { margin-left: 0; } }
:root[data-theme="light"] .bp-hero::after { background: linear-gradient(90deg, rgba(246, 239, 225, .2) 0%, rgba(246, 239, 225, .82) 45%, rgba(246, 239, 225, .95)), linear-gradient(0deg, var(--night), transparent 30%); }
/* the fold of the open book: one smooth curve into the binding on each page (no sheen band, no hard dark seam),
   a touch lighter on the right page as if lit from the left */
.flipbook .page.--left::after, .flipbook .page.--right::after { width: 20%; }
.flipbook .page.--left::after { background: linear-gradient(to left, rgba(45, 28, 8, .3) 0%, rgba(45, 28, 8, .2) 2%, rgba(45, 28, 8, .11) 6%, rgba(45, 28, 8, .05) 12%, rgba(45, 28, 8, .015) 20%, rgba(45, 28, 8, 0) 100%); }
.flipbook .page.--right::after { background: linear-gradient(to right, rgba(45, 28, 8, .26) 0%, rgba(45, 28, 8, .16) 2%, rgba(45, 28, 8, .08) 6%, rgba(45, 28, 8, .03) 12%, rgba(45, 28, 8, 0) 100%); }
.flip-stage.portrait .flipbook .page:not(.cover):not(.back)::after { width: 20%;
  background: linear-gradient(to right, rgba(45, 28, 8, .3) 0%, rgba(45, 28, 8, .18) 2%, rgba(45, 28, 8, .09) 6%, rgba(45, 28, 8, .03) 12%, rgba(45, 28, 8, 0) 100%); }
/* the page-edge stacks of the open book go sideways only, so the top and bottom match and no notch opens at the fold */
.flipbook .page.--left:not(.cover):not(.back) { box-shadow: -1px 0 0 #d6c9ac, -2px 0 0 #f1e8d4, -3px 0 0 #cdbf9f, -4px 0 0 #ece2cc, -5px 0 0 #c7b896, -6px 0 0 #e6dbc2; }
.flipbook .page.--right:not(.cover):not(.back) { box-shadow: 1px 0 0 #d6c9ac, 2px 0 0 #f1e8d4, 3px 0 0 #cdbf9f, 4px 0 0 #ece2cc, 5px 0 0 #c7b896, 6px 0 0 #e6dbc2; }
.flip-stage.portrait .flipbook .page:not(.cover):not(.back) { box-shadow: 1px 0 0 #d6c9ac, 2px 0 0 #f1e8d4, 3px 0 0 #cdbf9f, 4px 0 0 #ece2cc, 5px 0 0 #c7b896; }
/* the page-edge stack is the page's own shape shifted sideways; when the book sits at a fraction of a pixel its top
   could show as a thin straight line above the page's curved top edge. Each page's drawing stops at its own top and
   bottom; only the outer side (where the edges stack) reaches past it. */
.flipbook .page.--right:not(.cover):not(.back), .flip-stage.portrait .flipbook .page:not(.cover):not(.back) { clip-path: inset(0 -8px 0 0); }
.flip-stage:not(.portrait) .flipbook .page.--left:not(.cover):not(.back) { clip-path: inset(0 0 0 -8px); }
/* an open book's pages bow: the top edge dips toward the spine and the bottom edge rises, outer corners square.
   The page picture and its fold shading are shaped by a mask; the page itself stays transparent so the page-edge
   stack (a box-shadow outside the page) is untouched. */
.flipbook .page:not(.cover):not(.back) { background: transparent; }
.flipbook .page.--left:not(.cover):not(.back) img, .flipbook .page.--left:not(.cover):not(.back)::after {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0C55 0 84 .35 100 1.7V98.3C84 99.65 55 100 0 100Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0C55 0 84 .35 100 1.7V98.3C84 99.65 55 100 0 100Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; }
.flipbook .page.--right:not(.cover):not(.back) img, .flipbook .page.--right:not(.cover):not(.back)::after,
.flip-stage.portrait .flipbook .page:not(.cover):not(.back) img, .flip-stage.portrait .flipbook .page:not(.cover):not(.back)::after {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100 0C45 0 16 .35 0 1.7V98.3C16 99.65 45 100 100 100Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100 0C45 0 16 .35 0 1.7V98.3C16 99.65 45 100 100 100Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat; }
/* the fold shading now has to cover the full page height so the mask can shape it */
.flipbook .page.--left::after, .flipbook .page.--right::after { top: 0; bottom: 0; }
/* the author section's line drawing: its paper edges fade into the page, so no box shows (both themes) */
.author-line {
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
          mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
/* the Ganesha painting sits straight on the page (its paper is transparent): no frame, no box, no shadow */
.invocation-art::before { display: none; }
.invocation-art img, :root[data-theme="light"] .invocation-art img { box-shadow: none; border-radius: 0; }
/* buttons: flat and quiet. A solid fill, no bevel or glow, and on hover only the colour shifts (nothing moves) */
.btn { border-radius: 4px; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.btn[hidden] { display: none; }   /* e.g. Buy while a book that is not out yet is open */
.btn-gold { background: #d9a441; color: #1f1405; box-shadow: none; border-color: transparent; }
.btn-gold:hover { background: #e8bb5f; transform: none; box-shadow: none; }
.btn-gold:active { background: #c99336; }
:root[data-theme="light"] .btn-gold { background: #c58d36; color: #1c1205; }
:root[data-theme="light"] .btn-gold:hover { background: #d29c46; }
.btn-ghost:hover { background: rgba(217, 164, 65, .1); border-color: var(--gold); }
/* Buy on Amazon before a book is out (site.js buyBtns): greyed out; hover, focus or a tap shows when it comes */
.btn.btn-soon, .btn.btn-soon:hover, .btn.btn-soon:active { position: relative; background: rgba(160, 150, 135, .28); color: rgba(236, 228, 210, .6);
  border-color: rgba(236, 228, 210, .16); box-shadow: none; transform: none; backdrop-filter: none; cursor: not-allowed; }
:root[data-theme="light"] .btn.btn-soon, :root[data-theme="light"] .btn.btn-soon:hover { background: #ddd5c6; color: #7d7366; border-color: #cdc2ae; }
.btn-soon::after { content: attr(data-soon); position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 30;
  transform: translate(-50%, 4px); padding: 8px 14px; border-radius: 4px; background: #1d1a44; color: #f6e2a4;
  font: italic 500 16px/1.2 var(--display); letter-spacing: 0; text-transform: none; white-space: nowrap;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.btn-soon:hover::after, .btn-soon:focus-visible::after, .btn-soon.show-tip::after { opacity: 1; transform: translate(-50%, 0); }
/* the hero stays a dark screen in both themes */
:root[data-theme="light"] .hero .btn.btn-soon, :root[data-theme="light"] .hero .btn.btn-soon:hover,
:root[data-theme="light"] .shelf-strip .btn.btn-soon, :root[data-theme="light"] .shelf-strip .btn.btn-soon:hover {
  background: rgba(160, 150, 135, .28); color: rgba(236, 228, 210, .6); border-color: rgba(236, 228, 210, .16); }
/* the phone buy bar sits at the screen's left edge: its note opens to the right */
.buybar .btn-soon::after { left: 0; transform: translate(0, 4px); }
.buybar .btn-soon:hover::after, .buybar .btn-soon:focus-visible::after, .buybar .btn-soon.show-tip::after { transform: translate(0, 0); }
.ask-answers button:hover:not(:disabled) { transform: none; background: #fbf3df; }
/* living pictures: clips laid exactly over their stills, faded in once playing */
.art-motion { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.art-motion.on { opacity: 1; }
/* the mask (his painting) loads with the clip, once the clip has a source (when it comes near), not with the page */
.ganesha-motion[src] { -webkit-mask: url(../img/ganesha-mask.webp?v=43777f9714) 0 0 / 100% 100% no-repeat; mask: url(../img/ganesha-mask.webp?v=43777f9714) 0 0 / 100% 100% no-repeat; }
.teaser-motion { z-index: 1; }
.teaser-spread .hotspot, .teaser-spread .hot-pop { z-index: 3; }
.person-motion { object-position: 50% 20%; transition: opacity .35s ease;   /* masked by its still (site.js) */
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
/* character portraits: the circle stays put on hover (no lift, no glow); only the face comes alive */
.person:hover .person-img { transform: none; box-shadow: none; }

/* ---------- Book One in the hero ---------- */
/* computers: the title on the left, Book One standing in the film on the right with its two buttons under it */
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(28px, 5vw, 90px); align-items: end; }
.hero-book { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding-bottom: 4px; }
/* a soft darkness behind the book so the cover reads over any scene; the film stays full width around it */
.hero-book::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 42%; width: 190%; height: 140%; translate: -50% -50%;
  background: radial-gradient(closest-side, rgba(11, 9, 24, .62), rgba(11, 9, 24, .3) 55%, rgba(11, 9, 24, 0)); pointer-events: none; }
.hb-card { display: flex; flex-direction: column; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.hb-cover { position: relative; display: block; width: clamp(170px, 15vw, 240px); aspect-ratio: 2 / 3; perspective: 1400px; }
.hb-cover img, .hb-pages { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 1px 3px 3px 1px; }
/* the page block under the cover, seen when the cover lifts */
.hb-pages { background: linear-gradient(90deg, #d9ccae, #f6efdf 8%, #efe5cf); box-shadow: 0 30px 50px -20px #000, 0 0 40px -10px rgba(217, 164, 65, .35); }
.hb-cover img { transform-origin: left center; box-shadow: inset 3px 0 6px rgba(0, 0, 0, .25), 0 0 0 1px rgba(246, 226, 164, .18);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.hb-cover.lift img { animation: hb-lift 2.2s cubic-bezier(.3, .6, .2, 1); }
.hb-label { display: flex; align-items: baseline; gap: 10px; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
.hb-num { font: 500 11px/1 var(--caps); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.hb-title { font: italic 500 20px/1 var(--display); color: #f3e9d2; }
.hb-hint { display: none; }
.hero-book .hero-cta { flex-wrap: nowrap; }

/* opening the book in the hero: the words step aside, the film dims, the book opens in the middle */
.hero-inner, .hero::after { transition: opacity .45s ease; }
.hero.reading .hero-inner { opacity: 0; pointer-events: none; }
.hero.reading .scene-cap, .hero.reading .film-bar { opacity: 0; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(11, 9, 24, .7); opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.hero.reading::before { opacity: 1; }
.hero-reader { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center;
  padding: 76px var(--gutter) 22px; opacity: 0; transition: opacity .45s ease; }
.hero-reader.on { opacity: 1; }
.hero-reader[hidden] { display: none; }
/* the open spread is 4:3; keep it inside the screen's height under the menu */
.hero-reader .flip-stage { width: min(1060px, 100%, (100svh - 260px) * 4 / 3); margin: 0 auto; padding: 0; }
.hero-reader .flip-stage::before { display: none; }
.hero-reader .flip-shift { width: 100%; }
.hero-reader .flip-controls { margin-top: 14px; }
.hero-reader .flip-caption { font-size: 19px; margin: 8px 0 12px; color: #f3e9d2; }
.hr-actions { display: flex; gap: 12px; justify-content: center; }
/* the × beside the open book's top right corner (closes it, as "Close the book" does); on a narrow window it tucks
   in so it never leaves the screen */
.hr-x { position: absolute; z-index: 5; top: 0; right: calc(-1 * min(64px, (100vw - 100%) / 2 - 12px));
  width: 48px; height: 48px; display: grid; place-items: center; padding: 0 0 4px; border-radius: 50%; cursor: pointer;
  font: 300 34px/1 var(--display); color: var(--gold-hi); background: rgba(11, 9, 24, .55); border: 1px solid var(--line);
  backdrop-filter: blur(6px); transition: border-color .2s, background-color .2s, color .2s; }
.hr-x:hover, .hr-x:focus-visible { border-color: var(--gold); background: rgba(11, 9, 24, .8); color: #fff6e0; }

/* phones: everything centred and stacked; the book is a card that leads down to the books */
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; gap: 22px; padding-top: 124px; }   /* below the menu bar and the pause button */
  .hero-book { gap: 12px; }
  .hero-book::before { display: none; }
  .hb-card { flex-direction: row; gap: 14px; width: min(300px, 100%); padding: 10px 14px 10px 10px; border-radius: 6px;
    background: rgba(11, 9, 24, .55); border: 1px solid rgba(246, 226, 164, .22); backdrop-filter: blur(8px); text-align: left; }
  .hb-cover { width: 54px; perspective: none; }
  .hb-cover img { animation: none; }   /* (the shelf's one half open in site.js may still swing it) */
  .hb-pages { box-shadow: 0 6px 14px -6px #000; }
  .hb-label { flex-direction: column; align-items: flex-start; gap: 6px; }
  .hb-title { font-size: 19px; }
  .hb-hint { display: block; font: 500 11px/1 var(--caps); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-hi); }
  .hero-book .hero-cta { flex-direction: row; width: min(300px, 100%); gap: 10px; }
  /* both buttons share the card's width exactly: equal halves, tighter lettering so the words fit */
  .hero-book .hero-cta .btn { flex: 1 1 0; min-width: 0; width: auto; padding: 0 8px; font-size: 13px; letter-spacing: .08em; }
  .hero-reader { display: none !important; }
}
@media (min-width: 561px) and (max-width: 760px) { .hero-book { align-items: flex-start; } }
/* the title fits the column beside the book (its width is 9.5x its size with this spacing) */
.hero-text { container-type: inline-size; }
@media (min-width: 561px) { .title-word { font-size: clamp(40px, 10cqi, 112px); } }
/* computers: the buttons stack under the cover at its width, so the book column is narrow and stands at the right edge */
@media (min-width: 761px) { .hero-book .hero-cta { flex-direction: column; width: clamp(170px, 15vw, 240px); gap: 10px; } .hero-book .hero-cta .btn { width: 100%; padding: 0 10px; } }

/* ---------- the three books on a shelf in the hero (computers) ---------- */
/* Each book is a 3D box: cover in front, spine on its left, page edge on its right, back behind. A book on the shelf
   stands turned almost side-on (spine to the viewer, a sliver of cover showing); the chosen one turns to face out. */
.hero-cta[hidden] { display: none; }
.hb-caption { display: none; }
/* half open: the cover swings out from its spine, on hover and by itself now and then */
@keyframes hb-lift { 0% { transform: none; } 35%, 60% { transform: rotateY(-38deg); } 100% { transform: none; } }
/* every width (author, 2026-11-26: phones show the same 3D books and the same turn as computers); each width only
   sets the sizes: --hbw the cover's width, --hbh its height, --d the book's thickness */
@media (min-width: 761px) {
  .hb-shelf { --hbw: clamp(170px, 15vw, 240px); --hbh: calc(var(--hbw) * 1.5); --d: max(30px, calc(var(--hbh) * .09)); }
}
@media all {
  .hb-shelf { display: flex; align-items: flex-end; gap: 4px; perspective: 2400px; perspective-origin: 50% 30%; }
  /* the space each book takes on the shelf: its cover when face out, its spine plus a sliver of cover when not */
  .hb-item { position: relative; display: block; height: var(--hbh); width: calc(var(--d) + var(--hbw) * .06);
    transition: width .8s cubic-bezier(.3, .6, .2, 1); cursor: pointer; transform-style: preserve-3d; }
  .hb-item.open { width: calc(var(--hbw) + var(--d) * .3); }
  /* picked up and dragged (site.js): it rides above the others, follows the pointer at once, and when let go
     springs back to its place with a little overshoot */
  .hb-shelf { user-select: none; -webkit-user-select: none; }
  .hb-item { touch-action: pan-y; -webkit-user-drag: none; }   /* a finger moving up or down scrolls the page */
  .hb-item.hb-dragging { z-index: 20; cursor: grabbing; transition: width .8s cubic-bezier(.3, .6, .2, 1); }
  .hb-item.hb-return { z-index: 20; transition: width .8s cubic-bezier(.3, .6, .2, 1), translate .6s cubic-bezier(.34, 1.45, .5, 1),
    rotate .6s cubic-bezier(.34, 1.45, .5, 1), scale .45s ease; }
  .hb-box { position: absolute; left: 50%; top: 0; width: var(--hbw); height: var(--hbh); margin-left: calc(var(--hbw) / -2);
    transform-style: preserve-3d; transform: rotateY(85deg); transition: transform .8s cubic-bezier(.3, .6, .2, 1); }
  .hb-item.open .hb-box { transform: rotateY(-7deg); }
  .hb-item:not(.open):hover .hb-box, .hb-item:not(.open):focus-visible .hb-box { transform: rotateY(78deg) translateY(-8px); }
  .hb-cover, .hb-spine, .hb-edge, .hb-back { position: absolute; top: 0; height: 100%; backface-visibility: hidden; }
  .hb-cover { left: 0; width: 100%; transform: translateZ(calc(var(--d) / 2)); transform-style: preserve-3d; }
  .hb-spine { left: 50%; width: var(--d); margin-left: calc(var(--d) / -2); transform: rotateY(-90deg) translateZ(calc(var(--hbw) / 2));
    background-size: 100% 100%; border-radius: 2px 0 0 2px;
    box-shadow: inset 2px 0 3px rgba(255, 255, 255, .14), inset -2px 0 3px rgba(0, 0, 0, .4); }
  .hb-spine::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(255, 255, 255, .1) 40%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .25)); }
  .hb-edge { left: 50%; width: var(--d); margin-left: calc(var(--d) / -2); transform: rotateY(90deg) translateZ(calc(var(--hbw) / 2 - 2px));
    background: repeating-linear-gradient(90deg, #efe5cf 0 1px, #d9ccae 1px 2px); top: 2px; height: calc(100% - 4px); }
  .hb-back { left: 0; width: 100%; transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); background: #2a1f3a; }
  .hb-item:not(.open) .hb-cover img { transform: none; animation: none; }
  .hb-item.open:hover .hb-cover img, .hb-item.open:focus-visible .hb-cover img { transform: rotateY(-38deg); }
  .hb-pages { box-shadow: none; }
}
@media (min-width: 761px) {
  /* the shelf's shadow on the ground */
  .hb-shelf::after { content: ""; position: absolute; left: -6%; right: -6%; bottom: -18px; height: 30px; z-index: -1;
    background: radial-gradient(closest-side, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); pointer-events: none; }
  .hb-shelf { position: relative; }
  .hb-shelf .hb-label { display: none; }
  .hb-caption { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px; margin: 0; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
  .hb-status { flex-basis: 100%; text-align: center; font: italic 400 15px/1.3 var(--body); color: #d8cdb4; }
}
/* phones and tablets (author's design, 2026-11-21): the chosen book's cover stands large with the other two beside it
   on a thin shelf; its name and date under it, then the two buttons. Tapping a spine, or swiping the shelf, turns
   that book face out (site.js); tapping the cover opens it. The books are the computer's 3D books (author,
   2026-11-26), sized to the shelf's width. */
@media (max-width: 760px) {
  .hero-book { --hbw: min(320px, 100%); }
  /* the shelf's width (the caption's too) is the .hero-book --hbw above; inside it the cover's width is set so the
     face-out book (cover + .3 thickness) and two books standing side-on (thickness + .06 cover) and the two gaps
     fill it exactly, with the thickness 0.09 of the height as on computers: 1.4305 covers + 8px */
  .hb-shelf { position: relative; justify-content: center; width: var(--hbw); padding-bottom: 14px;
    container-type: inline-size; touch-action: pan-y; }
  .hb-shelf > .hb-item { --hbw: calc((100cqi - 8px) / 1.4305); --hbh: calc(var(--hbw) * 1.5); --d: calc(var(--hbh) * .09);
    flex: none; padding: 0; background: none; border: 0; border-radius: 0; backdrop-filter: none;
    -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
  .hb-shelf .hb-label { display: none; }
  .hb-shelf.hb-instant .hb-item, .hb-shelf.hb-instant .hb-item * { transition: none !important; }   /* the first setting */
  /* the cover half opens over its first page at the end of the shelf's first turn (site.js), as on computers */
  .hb-shelf .hb-cover { perspective: 1400px; }
  .hb-shelf .hb-cover.lift img { animation: hb-lift 2.2s cubic-bezier(.3, .6, .2, 1) !important; }
  /* the quick half open after a tap or a swipe turns a book out (site.js) */
  .hb-shelf .hb-cover.lift.quick img { animation-duration: 1.4s !important; }
}
/* touch screens: a tapped book keeps :hover, so the computer's hover turns stay off; a finger pressing a book
   standing side-on lifts it as the mouse does on a computer */
@media (max-width: 760px) and (hover: none) {
  .hb-item:not(.open):hover .hb-box { transform: rotateY(85deg); }
  .hb-item.open:hover .hb-cover img { transform: none; }
  .hb-item:not(.open):active .hb-box { transform: rotateY(78deg) translateY(-8px); }
}
@media (max-width: 760px) {
  /* the shelf: a thin gold edge under the books and its shadow */
  .hb-shelf::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: 0; height: 1px;
    background: linear-gradient(90deg, rgba(217, 164, 65, 0), rgba(217, 164, 65, .45) 20%, rgba(217, 164, 65, .45) 80%, rgba(217, 164, 65, 0));
    box-shadow: 0 6px 14px 2px rgba(0, 0, 0, .55); pointer-events: none; }
  /* under it: "Book One · The Vow" on one line, then when (author, 2026-11-21: no line from the book) */
  .hero-book .hb-caption { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 8px 12px;
    margin: 6px 0 2px; text-align: center; width: var(--hbw); text-shadow: 0 1px 8px rgba(0, 0, 0, .8); }
  .hb-caption .hb-num { font: 500 12px/1 var(--caps); letter-spacing: .24em; }
  .hb-caption .hb-num::after { content: "·"; margin-left: 12px; letter-spacing: 0; color: var(--gold); }
  .hb-caption .hb-title { font-size: 28px; line-height: 1.05; white-space: nowrap; }
  .hb-caption .hb-status { flex-basis: 100%; justify-content: center; }
  .hb-caption .hb-status { display: inline-flex; align-items: center; gap: 10px; font: 600 12px/1 var(--caps); letter-spacing: .2em;
    text-transform: uppercase; color: #f3e9d2; }
  .hb-caption .hb-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
  .hb-caption .hb-yr { display: none; }
  /* the two buttons side by side at the shelf's width, equal halves */
  .hero-book .hero-cta { flex-direction: row; width: min(300px, 100%); gap: 8px; }
  .hero-book .hero-cta .btn { flex: 1 1 0; min-width: 0; width: auto; min-height: 48px; padding: 4px 8px; font-size: 12px;
    letter-spacing: .05em; line-height: 1.2; white-space: normal; text-align: center; font-size: 11.5px; }
}
/* phones and tablets: the words now sit high in the film, over its brightest skies (the cosmic form): a soft dark
   wash behind them and a firmer shadow on the letters keep them readable over any scene */
@media (max-width: 760px) {
  .hero-text { position: relative; }
  .hero-text::before { content: ""; position: absolute; z-index: -1; inset: -48px -40px -36px; pointer-events: none;
    background: radial-gradient(closest-side, rgba(11, 9, 24, .62), rgba(11, 9, 24, .38) 60%, rgba(11, 9, 24, 0)); }
  .hero-text .scene-cap, .hero-text .title-kick, .hero-text .hero-tag { text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 16px rgba(11, 9, 24, .95); }
  .hero-text .title-word { text-shadow: 0 2px 4px rgba(0, 0, 0, .7), 0 0 24px rgba(11, 9, 24, .9); }
}
/* phones (author, 2026-11-21): the film fills the first screen with only the words and Book One's two buttons over
   it; the shelf stands in its own dark strip just under it (site.js moves it there) */
.hero-top-cta, .shelf-strip { display: none; }
@media (max-width: 560px) {
  .hero-top-cta { display: flex; flex-direction: row; justify-content: center; gap: 8px; width: min(300px, 100%); margin: 24px auto 0; }
  .hero-top-cta .btn { flex: 1 1 0; min-width: 0; width: auto; min-height: 48px; padding: 4px 8px; font-size: 11.5px;
    letter-spacing: .05em; line-height: 1.2; text-align: center; }
  .shelf-strip:not([hidden]) { display: block; position: relative; background: var(--night); padding: 36px var(--gutter) 52px; }
  .shelf-strip .hero-book { align-items: center; }
  /* Buy and Look inside are already in the film just above (author, 2026-11-21: not twice); the cover still opens */
  .shelf-strip .hero-book .hero-cta { display: none; }
}
/* tablets (author's design, 2026-11-21): the shelf on the left, its words and buttons beside it on the right */
@media (min-width: 561px) and (max-width: 760px) {
  .hero-book { --hbw: clamp(210px, 38vw, 280px); display: grid; grid-template-columns: var(--hbw) minmax(0, 1fr); column-gap: clamp(20px, 4vw, 48px);
    row-gap: 22px; align-items: start; }
  .hero-book > .hb-shelf { grid-column: 1; grid-row: 1 / span 2; }
  .hero-book > .hb-caption { grid-column: 2; grid-row: 1; align-self: end; justify-self: center; width: 100%; max-width: 320px; margin: 0; }
  .hero-book > .hero-cta { grid-column: 2; grid-row: 2; align-self: start; justify-self: center; width: 100%; max-width: 320px; }
}
/* Books Two and Three face out: "Coming soon" over the cover on hover or click, as on the book cards; no buttons */
.hb-cover .soon { border-radius: 1px 3px 3px 1px; }
.hb-cover .soon-title { font-size: clamp(22px, 2vw, 30px); }
.hb-item.open.show-soon .soon { opacity: 1; }
@media (hover: hover) { .hb-item.open:hover .soon { opacity: 1; } }
.hb-item:not(.has-inside) .hb-cover img { transform: none !important; animation: none !important; }   /* no half open under the veil */
/* under a cover that opens (a book with a preview) as it half opens: the preview's first right-hand page, set by
   site.js after the page has loaded */
.hb-item.has-inside .hb-pages { background: #f6efdf center / cover no-repeat; }
/* the shelf never jumps: every book's buttons share one place under it (Books Two and Three keep Book One's room,
   empty), and the caption always has room for its second line */
@media (min-width: 761px) {
  .hero-book { display: grid; justify-items: center; align-content: end; row-gap: 18px; }
  .hero-book > .hero-cta { grid-row: 3; grid-column: 1; }
  .hero-book > .hero-cta[hidden] { display: flex; visibility: hidden; }
  .hb-caption { min-height: 2.9em; align-content: flex-start; }
}
/* the cover flying between the shelf and the open book (site.js); the reader's book shows once it has landed */
.cover-fly { position: fixed; z-index: 45; transform-origin: 50% 50%; border-radius: 1px 3px 3px 1px; pointer-events: none; will-change: transform; }
.hero-reader .flip-stage { opacity: 0; }
.hero-reader.landed .flip-stage { opacity: 1; }
/* while the book is being taken off the shelf (and until it is back), its cover stays shut */
.hb-shelf.taking .hb-cover img { transform: none !important; animation: none !important; }
/* a quiet "Look inside" tab on Book One's cover, sitting on its bottom edge; brighter on hover (computers) */
.hb-peek { display: none; }
@media (min-width: 761px) {
  .hb-peek { display: block; position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 2; white-space: nowrap;
    padding: 6px 13px 5px; border-radius: 20px; font: 500 10px/1 var(--caps); letter-spacing: .24em; text-transform: uppercase;
    color: #fff6e0; background: rgba(11, 9, 24, .36); border: 1px solid rgba(255, 246, 224, .22); text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
    transform: translateZ(calc(var(--d) / 2 + 2px)); opacity: .72; transition: opacity .3s ease, border-color .3s ease, color .3s ease; }
  .hb-item.open:hover .hb-peek, .hb-cover.lift ~ .hb-peek { opacity: 0; }   /* while the cover swings open, it says it */
  .hb-item.open:focus-visible .hb-peek { opacity: 1; border-color: var(--gold); color: #fff6e0; }
  .hb-item:not(.open) .hb-peek { opacity: 0; }
}
/* while the book is open in the hero, the film's pause button steps aside with the words */
.film-toggle { transition: opacity .45s ease, visibility 0s; }
.hero.reading .film-toggle { opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s; }

/* ---------- Choose a book (every Buy button not tied to one book, and the phones' bottom bar; site.js openPick) ---------- */
.pick-caret { margin-left: -2px; font-size: .9em; line-height: 1; }   /* sits by the words (the button's gap is 8px) */
.pick { position: fixed; z-index: 70; padding: 16px 16px 18px; border-radius: 8px; color: #ece4d2;
  background: #15111f; border: 1px solid rgba(217, 164, 65, .38); box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .75); }
.pick[hidden] { display: none; }
.pick-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.pick-title { font: 600 12px/1 var(--caps); letter-spacing: .26em; text-transform: uppercase; color: #d9a441; }
.pick-x { width: 36px; height: 36px; margin: -8px -8px -8px 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  font: 300 28px/1 var(--display); color: #f6e2a4; }
.pick-x:hover, .pick-x:focus-visible { background: rgba(217, 164, 65, .14); }
.pick-row { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; }
/* the home page shelf's Buy: a split button, [Buy on Amazon][▾] (author, 2026-11-26): the main half buys the book
   face out (greyed with its date until it is on Amazon), the arrow opens the other two books */
.hero-book .hero-cta .split-btn { display: flex; width: 100%; min-width: 0; }
.hero-book .hero-cta .split-btn > .btn:first-child { flex: 1 1 auto; min-width: 0; width: auto; border-radius: 4px 0 0 4px; }
.hero-book .hero-cta .split-btn > .split-more { flex: 0 0 44px; width: 44px; min-width: 0; padding: 0; border-radius: 0 4px 4px 0;
  border-left: 1px solid rgba(31, 20, 5, .35); font-size: 15px; letter-spacing: 0; }
/* tablets: beside Look inside, with the larger share of the row so "Buy on Amazon" stays on one line */
@media (max-width: 760px) {
  .hero-book .hero-cta .split-btn { flex: 1.5 1 0; }
  .hero-book .hero-cta .split-btn > .split-more { flex-basis: 36px; width: 36px; }
}
.split-more .pick-caret { margin: 0; }
.split-more[aria-expanded="true"] { background: #c99336; }
/* the arrow greyed like the main half while none of the other books is out; it still opens their dates and previews */
.btn.split-more.split-soon, .btn.split-more.split-soon:hover, .btn.split-more.split-soon:active,
:root[data-theme="light"] .hero .btn.split-more.split-soon { background: rgba(160, 150, 135, .28); color: rgba(236, 228, 210, .6);
  border-color: rgba(236, 228, 210, .16); box-shadow: none; transform: none; }
.btn.split-more.split-soon[aria-expanded="true"] { background: rgba(160, 150, 135, .4); }
.pick-book { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: inherit; }
.pick-cover { display: block; }
.pick-book img { display: block; width: 100%; height: auto; aspect-ratio: 240 / 362; object-fit: cover; border-radius: 2px 3px 3px 2px; margin-bottom: 6px;
  box-shadow: 0 10px 20px -10px #000; }
.pick-num { font: 500 10px/1.2 var(--caps); letter-spacing: .18em; text-transform: uppercase; color: #d9a441; }
.pick-name { font: italic 500 19px/1.1 var(--display); color: #f5ecd9; }
.pick-acts { display: flex; flex-direction: column; align-items: flex-start; }
.pick-act { display: inline-flex; align-items: center; min-height: 28px; max-width: 100%; font: 600 10px/1.2 var(--caps); letter-spacing: .05em;
  text-transform: uppercase; color: #b5a98f; text-decoration: none; }
.pick-buy { color: #f6e2a4; }
.pick-prev { color: #d9a441; }
a.pick-act:hover, a.pick-act:focus-visible { color: #fff6e0; text-decoration: underline; text-underline-offset: 3px; }
.pick-arrow { position: absolute; left: var(--ax, 50%); bottom: -8px; width: 14px; height: 14px; margin-left: -7px; rotate: 45deg;
  background: #15111f; border-right: 1px solid rgba(217, 164, 65, .38); border-bottom: 1px solid rgba(217, 164, 65, .38); }
.pick.below .pick-arrow { bottom: auto; top: -8px; border: 0; border-left: 1px solid rgba(217, 164, 65, .38); border-top: 1px solid rgba(217, 164, 65, .38); }

/* ---------- book cards on phones and tablets (author's design, 2026-11-21) ---------- */
.book-when, .book-desc { display: none; }
@media (max-width: 760px) {
  /* under the cover (or the open book): a rule, "Book One" with its date across from it, the name, one paragraph,
     the two buttons side by side */
  .book { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0; text-align: left; align-items: baseline; }
  .book > * { grid-column: 1 / -1; }
  .book > .book-hook, .book > .book-status, .book > .book-copy { display: none; }
  .book > .book-num, .book > .book-when { margin: 22px 0 0; }
  .book > .book-num { grid-column: 1; }
  .book > .book-when { display: block; grid-column: 2; padding-left: 12px; text-align: right; white-space: nowrap;
    font: 600 11.5px/1 var(--caps); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
  .book > h3 { margin: 12px 0 10px; text-align: left; font-size: 36px; }
  .book > .book-desc { display: block; margin: 0 0 20px; color: var(--text); font-size: 17px; line-height: 1.5; text-wrap: pretty; }
  .book > .book-desc .book-line { display: block; }   /* the line from the book on its own line, then the rest */
  .book > .book-actions { justify-content: stretch; flex-wrap: nowrap; gap: 10px; }
  .book > .book-actions .btn { flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 8px; font-size: 12px; letter-spacing: .1em; }
  .book > .book-actions [data-buy] { flex-grow: 1.45; }   /* Buy the wider of the two */
  /* between the books: a thin gold rule with a diamond */
  .book-row { gap: 44px; }
  .book + .book::before { content: ""; grid-column: 1 / -1; justify-self: center; width: 230px; height: 12px; margin-bottom: 44px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 230 12'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23b08a3e' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23b08a3e'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='1' x2='0'%3E%3Cstop offset='0' stop-color='%23b08a3e' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23b08a3e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='0' y='5.5' width='96' height='1.2' fill='url(%23a)'/%3E%3Crect x='134' y='5.5' width='96' height='1.2' fill='url(%23b)'/%3E%3Cpath d='M115 0.5L120.5 6L115 11.5L109.5 6Z' fill='%23b08a3e'/%3E%3C/svg%3E") center / contain no-repeat; }
  /* a bigger book (author, 2026-11-21): the cover and the open page 300 px wide where there is room, the open page
     close to the card's right edge */
  .book-cover { width: min(300px, 100% - 38px); max-width: none; }
  .book-reader.inplace { width: min(100%, 400px); margin: 0 auto 20px; padding-right: 8px; box-sizing: border-box; }
  .book-reader.inplace .flip-stage { width: min(300px, 100% - 30px); }
  /* the open book: its arrows at the edges, the page numbers and chapter between them; × at the book's corner */
  .book-reader.inplace { position: relative; }
  .book-reader.inplace .flip-controls { justify-content: space-between; align-items: flex-start; gap: 0; margin-top: 18px; }
  .book-reader.inplace .flip-count { min-width: 0; margin-top: 9px; }
  .book-reader.inplace .flip-caption { margin: -24px 60px 0; font-size: 16px; line-height: 1.3; min-height: 2.6em; }
  /* as the book opens, the arrows and the chapter open up under it in one smooth step, so the words below glide
     down instead of jumping twice */
  .book-reader.inplace .flip-controls, .book-reader.inplace .flip-caption { animation: inplaceGrow .5s cubic-bezier(.3, .6, .2, 1) both; overflow: hidden; }
  .book-reader.inplace .reader-close { display: none; }   /* (author, 2026-11-21: no close; another cover opens that one) */
}
/* the smallest phones: the buttons' words a little tighter, so they keep their padding */
@media (max-width: 360px) {
  .book > .book-actions .btn, .hero-top-cta .btn { font-size: 10.5px; letter-spacing: .04em; padding: 0 8px; }
}
@keyframes inplaceGrow { from { max-height: 0; opacity: 0; } 60% { opacity: 0; } to { max-height: 90px; opacity: 1; } }

/* phones and tablets (author, 2026-11-21): the menu bar is frosted glass that fades away at its bottom edge, over the
   film and over the page alike; the open menu keeps its solid panel */
@media (max-width: 760px) {
  .nav:not(.open), .nav.solid:not(.open) { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-color: transparent; box-shadow: none; }
  .nav::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(100% + 26px); z-index: -1; pointer-events: none;
    /* the glass starts in the status bar's own colour (--edge, the page under the bar), so the two join without a step,
       and fades into the tinted glass lower down (author, 2026-11-23) */
    background: linear-gradient(180deg, var(--edge, #0b0918) 0%, var(--edge, #0b0918) 12%, var(--nav-tint, rgba(11, 9, 24, .42)) 72%);
    -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 58%, transparent 100%); mask-image: linear-gradient(180deg, #000 0, #000 58%, transparent 100%);
    transition: background-color .4s ease; }
  .nav.open::before { display: none; }
  /* open menu (author, 2026-11-24): the bar and the status-bar strip above it take the panel's own solid colour, so bar
     and menu read as one sheet instead of glass over the page */
  .nav.open, .nav.open.solid { background: var(--night); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--line); }
  .nav.open::after { background: var(--night); }
}
/* computers: over the film at the top, the bar gets the same frosted glass fading away at its bottom edge, so the menu's
   words never sit straight on a busy painting; once the bar turns solid (or a panel opens) its own glass takes over */
@media (min-width: 761px) {
  .nav::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: calc(100% + 34px); z-index: -1; pointer-events: none;
    background: rgba(11, 9, 24, .5); -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
    -webkit-mask-image: linear-gradient(180deg, #000 0, #000 60%, transparent 100%); mask-image: linear-gradient(180deg, #000 0, #000 60%, transparent 100%);
    transition: opacity .4s ease; }
  .nav.solid::before, .nav:has(.nav-item.sub-open)::before, .nav:has(.nav-item:hover:not(.sub-hush))::before { opacity: 0; }
}

/* ---------- the menu (author, 2026-11-22): five sections, each a full-width panel ("mega-menu") under the bar, written
   on every page by tools/site_links.py. Each panel: a large title with a short list of arrow links, a thin divider,
   then the section's own part (books, main-story cards, portraits, a grid of guides, classroom sets by book). On
   computers a panel opens on hover, on keyboard focus (site.js) or with its button; on phones and tablets the panels
   open inside the menu as plain lists. Closed panels are display: none, so their lazy pictures load only when opened. */
.nav-item { position: relative; display: flex; align-items: center; }
.sub-tog { flex: none; display: grid; place-items: center; width: 20px; height: 28px; margin-left: 2px; padding: 0; border: 0; background: none; color: var(--gold); cursor: pointer; border-radius: 4px; }
.sub-tog svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.sub-tog:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.nav-mega { display: none; }
.nav-mega ul { list-style: none; margin: 0; padding: 0; }
:where(.nav-mega) p { margin: 0; }
.nav-links .nav-mega a { white-space: normal; text-transform: none; letter-spacing: 0; opacity: 1; padding: 0; font: 400 18px/1.3 var(--body); color: var(--text); text-decoration: none; }
.nav-links .nav-mega a:hover, .nav-links .nav-mega a[aria-current="page"] { color: var(--gold-hi); }
.nav-mega img { background: rgba(217, 164, 65, .12); }
.mega-title { font: 500 46px/1.05 var(--display); color: var(--head); letter-spacing: -.01em; }
.mega-kicker { font: 600 12px/1.2 var(--caps); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.mega-arr { flex: none; width: 18px; height: 10px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.nav-links .nav-mega a:hover .mega-arr { transform: translateX(4px); }
.nav-links .mega-links a { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
/* books (The Books, Teachers): cover, Book I, title, links */
.mega-book { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: start; }
.mb-cover img { width: 96px; height: 145px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(246, 226, 164, .2), 0 16px 28px -14px rgba(0, 0, 0, .8); transition: transform .25s; }
.mb-cover:hover img { transform: translateY(-3px); }
.mb-no { font: 600 11px/1.2 var(--caps); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.mb-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: italic 500 30px/1.1 var(--display); color: var(--head); margin-top: 4px; }
/* the release date: a small pill on the title's row */
.mb-when { flex: none; padding: 4px 8px 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(217, 164, 65, .12);
  font: 600 9px/1 var(--caps); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
/* a narrow book column keeps the pill on the title's row by dropping "Coming" (the date stays) */
.mb-body { container-type: inline-size; }
@container (max-width: 203px) { .mb-coming { display: none; } }
.mb-links { margin-top: 10px; }
.nav-links .mb-links a { display: block; padding: 9px 0; border-top: 1px solid var(--line); }
/* stories: the four main-story pages */
.mega-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
.nav-links .mega-cards a { display: flex; flex-direction: column; gap: 4px; }
.mc-art { display: block; overflow: hidden; border-radius: 4px; aspect-ratio: 4 / 5; margin-bottom: 8px; box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .8); background: var(--paper); }
.mc-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.nav-links .mega-cards a:hover .mc-art img { transform: scale(1.04); }
.mc-book { font: 600 11px/1.2 var(--caps); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.mc-title { font: 500 22px/1.15 var(--display); color: var(--head); }
.nav-links .mega-cards a:hover .mc-title { color: var(--gold-hi); }
/* characters: round portraits that fade into the panel */
.mega-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.nav-links .nav-mega a.mega-all { display: inline-flex; align-items: center; gap: 10px; font: 600 12px/1.2 var(--caps); letter-spacing: .24em; text-transform: uppercase; color: var(--gold-hi); }
.mega-people { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.nav-links .mega-people a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.mp-face { display: block; width: 128px; max-width: 100%; aspect-ratio: 1; margin-bottom: 10px; }
.mp-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--paper); transition: transform .3s;
  box-shadow: 0 0 0 1px var(--line), 0 14px 28px -16px rgba(0, 0, 0, .9); }   /* dark: a paper medallion, as on /characters */
:root[data-theme="light"] .mp-face img { box-shadow: none;   /* light: the painting fades into the parchment */
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.nav-links .mega-people a:hover .mp-face img { transform: scale(1.05); }
/* the Characters panel's portraits play their clips (site.js) over the still, which keeps its paper circle and ring */
.mp-face { position: relative; }
.mp-face .person-motion { border-radius: 50%; transition: opacity .35s ease, transform .3s; }
.nav-links .mega-people a:hover .mp-face .person-motion { transform: scale(1.05); }
.mp-name { font: 500 24px/1.1 var(--display); color: var(--head); }
.nav-links .mega-people a:hover .mp-name { color: var(--gold-hi); }
.mp-say { font: 500 15px/1.3 var(--body); letter-spacing: .03em; color: var(--gold); }
/* for parents: a grid of guides and the "start here" card */
.nav-links a.mega-start { display: inline-flex; align-items: center; gap: 22px; padding: 14px 26px 14px 18px; border-radius: 14px; background: rgba(217, 164, 65, .1); border: 1px solid var(--line); }
.mega-start img { width: 56px; height: 84px; object-fit: cover; border-radius: 2px; box-shadow: 0 10px 20px -10px rgba(0, 0, 0, .8); }
.mega-start > span { display: flex; flex-direction: column; gap: 6px; }
.ms-kicker { font: 600 11px/1.2 var(--caps); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.ms-line { font: 500 22px/1.2 var(--display); color: var(--head); }
.ms-line em { font-style: italic; }
.nav-links a.mega-start:hover { border-color: var(--gold); }
.nav-links a.nav-lab { cursor: pointer; }

@media (min-width: 1261px) {
  .nav-links { gap: 34px; }
  .nav-item { position: static; }
  .nav-links .nav-item > a { position: relative; font-size: 13px; letter-spacing: .22em; padding: 10px 0; }
  /* the gold line under the open or current section, and an invisible bridge down to the panel */
  .nav-item > a::after { content: ""; position: absolute; left: 0; right: .22em; bottom: 0; height: 2px; background: var(--gold); transform: scaleX(0); transition: transform .2s; }
  .nav-item > a::before { content: ""; position: absolute; left: -14px; right: -14px; top: 100%; height: 26px; }
  .nav-item:hover:not(.sub-hush) > a::after, .nav-item.sub-open > a::after, .nav-item > a[aria-current]::after { transform: none; }
  .nav-item:hover > a, .nav-item.sub-open > a { color: var(--gold-hi); opacity: 1; }
  /* a small down arrow after each section shows it opens; it turns over while the panel is open */
  .sub-tog { width: 14px; height: 24px; margin: 0 0 0 4px; opacity: .75; transition: opacity .2s; }
  .sub-tog svg { width: 10px; height: 10px; }
  .nav-item:hover > .sub-tog, .nav-item.sub-open > .sub-tog, .sub-tog:focus-visible { opacity: 1; }
  .nav-item:hover:not(.sub-hush) > .sub-tog svg, .nav-item.sub-open > .sub-tog svg { transform: rotate(180deg); }
  .nav-mega { position: absolute; left: 0; right: 0; top: 100%; z-index: 2; max-height: calc(100vh - 80px); overflow-y: auto;
    background: var(--night); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .75); }
  .nav-item:hover:not(.sub-hush) > .nav-mega, .nav-item.sub-open > .nav-mega { display: block; animation: mega-in .2s ease both; }
  /* while the pointer is on its way down to an open panel, a section it crosses shows no panel of its own (site.js) */
  .nav.aiming .nav-item:hover:not(.sub-open) > .nav-mega { display: none; }
  .mega-in { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); max-width: 1400px; margin: 0 auto; padding: 38px var(--gutter) 44px; }
  .mega-side { padding-right: 48px; border-right: 1px solid var(--line); }
  .mega-main { padding-left: 56px; min-width: 0; }
  .mega-title { margin-bottom: 18px; }
  .nav-links .mega-side .mega-links a { padding: 14px 0; font-size: 20px; }
  .mega-kicker { margin-bottom: 22px; }
  .mega-books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
  .mega-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 48px; }
  .nav-links a.mega-start { margin-top: 32px; }
  .nav-links .mega-grid a { padding: 20px 0; font-size: 20px; }
  :root[data-theme="light"] .nav-mega { box-shadow: 0 34px 60px -34px rgba(60, 40, 10, .45); }
  /* while a panel is open the bar is solid and joins it: no frosted glass (Chrome draws the panel see-through under a
     backdrop filter), and in the light theme the bar turns parchment even over the film */
  .nav:has(.nav-item.sub-open), .nav:has(.nav-item:hover:not(.sub-hush)) { background: var(--night); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--line); }
  :root[data-theme="light"] .nav:has(.nav-item.sub-open), :root[data-theme="light"] .nav:has(.nav-item:hover:not(.sub-hush)) {
    --night: #f6efe1; --text: #3a3145; --muted: #655a6b; --head: #221b33; --gold: #875b1c; --gold-hi: #84561a;
    --line: rgba(132, 86, 26, .28); --glass: rgba(255, 250, 240, .6); --glass-strong: rgba(250, 245, 233, .92); }
}
@media (min-width: 1261px) and (max-width: 1400px) {
  .mega-main { padding-left: 40px; } .mega-side { padding-right: 32px; }
  .mega-book { grid-template-columns: 80px minmax(0, 1fr); gap: 16px; } .mb-cover img { width: 80px; height: 121px; }
  .mb-title { font-size: 26px; } .mp-face { width: 96px; } .mp-name { font-size: 21px; }
}
@keyframes mega-in { from { opacity: 0; transform: translateY(-6px); } }

/* phones and tablets: the sections open inside the menu panel, one at a time */
@media (max-width: 1260px) {
  .nav-links { max-height: calc(100svh - 64px); overflow-y: auto; overscroll-behavior: contain; }
  .nav.open .nav-links { background: var(--night); }   /* a longer panel now: solid, so the page doesn't show through */
  .nav-item { flex-wrap: wrap; }
  .nav-item > a { flex: 1; }
  .nav-item > a[aria-current] { box-shadow: inset 3px 0 0 var(--gold); }
  .sub-tog { width: 56px; height: 48px; margin: 0; }
  .sub-tog svg { width: 14px; height: 14px; }
  .nav-item.sub-open > .sub-tog svg { transform: rotate(180deg); }
  .nav-item.sub-open > .nav-mega { display: block; flex-basis: 100%; }
  .mega-in { padding: 0 var(--gutter) 18px calc(var(--gutter) + 14px); }
  .mega-title { display: none; }
  .nav-links .nav-mega a { font-size: 17px; }
  .nav-links .mega-links a { padding: 11px 0; }
  .mega-main { margin-top: 18px; }
  .mega-side:not(:has(li)) + .mega-main { margin-top: 0; }
  .mega-kicker { margin-bottom: 12px; font-size: 11px; }
  .mega-books { display: grid; gap: 16px; }
  .mega-book { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; }
  .mb-cover img { width: 52px; height: 78px; }
  .mb-title { font-size: 22px; }
  .mb-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  .nav-links .mb-links a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; }
  .nav-links .mb-links a[aria-current="page"] { border-color: var(--gold); background: rgba(217, 164, 65, .12); }
  .mega-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .mc-art { aspect-ratio: 3 / 2; margin-bottom: 4px; }
  .mc-title { font-size: 19px; }
  .mega-people { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; margin-top: 4px; }
  .mp-face { width: 72px; margin-bottom: 6px; }
  .mp-name { font-size: 19px; }
  .mp-say { font-size: 13px; }
  .mega-head { margin-bottom: 12px; } .mega-head .mega-kicker { margin: 0; }
  .mega-head .mega-kicker, .nav-links .nav-mega a.mega-all { white-space: nowrap; letter-spacing: .14em; font-size: 11px; }
  .nav-links a.mega-start { display: flex; margin-top: 14px; padding: 12px 16px; gap: 16px; }
  .mega-start img { width: 40px; height: 60px; }
  .ms-line { font-size: 19px; }

  /* the phone menu, cleaner (author, 2026-11-23): each section a full-width row with a line under it, larger caps and a
     filled triangle; each book a card (cover, number, title, date; the card's top opens the book's page) with its
     other links split along the bottom */
  .nav-links { top: calc(64px + env(safe-area-inset-top)); max-height: calc(100svh - 64px - env(safe-area-inset-top)); padding: 0;
    --card: rgba(246, 226, 164, .05); --card-line: rgba(246, 226, 164, .08); --card-shadow: 0 0 0 1px rgba(246, 226, 164, .08); }
  :root[data-theme="light"] .nav-links { --card: rgba(255, 253, 248, .8); --card-line: rgba(132, 86, 26, .12);
    --card-shadow: 0 1px 2px rgba(60, 40, 10, .05), 0 8px 20px -12px rgba(60, 40, 10, .22); }
  .nav-item { border-bottom: 1px solid var(--line); }
  .nav-links .nav-item > a.nav-lab { padding: 24px var(--gutter); font-size: 14px; letter-spacing: .26em; color: var(--head); opacity: 1; }
  .nav-links .nav-item.sub-open > a.nav-lab { color: var(--gold-hi); }
  .sub-tog { width: calc(var(--gutter) + 40px); height: 64px; padding-right: var(--gutter); place-items: center end; }
  .sub-tog svg { width: 13px; height: 13px; }
  .sub-tog svg path { fill: currentColor; stroke-width: 1.2; }
  .mega-in { padding: 0 var(--gutter) 22px; }
  .nav-links .mega-links a { padding: 14px 0; font-size: 18px; }
  .sec-books .mega-kicker { display: none; }
  .sec-books .mega-main, .sec-teachers .mega-main { margin-top: 20px; }
  .mega-books { gap: 14px; }
  .mega-book { position: relative; grid-template-columns: 44px minmax(0, 1fr); gap: 0 16px; align-items: center; padding: 16px 16px 0;
    border: 0; border-radius: 14px; background: var(--card); box-shadow: var(--card-shadow); overflow: hidden; }
  .mega-book .mb-body { display: contents; }
  .mb-cover { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .mb-cover img { width: 44px; height: 66px; box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .55); }
  .mb-cover:hover img { transform: none; }
  .mb-no { grid-column: 2; grid-row: 1; align-self: end; padding-right: 36px; }
  .mb-title { display: block; grid-column: 2; grid-row: 2; align-self: start; margin-top: 2px; padding-right: 36px; font-size: 26px; }
  .mb-when { display: block; margin-top: 4px; padding: 0; border: 0; border-radius: 0; background: none;
    font: 400 15px/1.3 var(--body); letter-spacing: 0; text-transform: none; color: var(--muted); white-space: normal; }
  .nav-mega .mb-links { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
    margin: 16px -16px 0; border-top: 1px solid var(--card-line); }
  .sec-teachers .mb-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mb-links li + li { border-left: 1px solid var(--card-line); }
  .nav-links .mb-links a { display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 8px 6px; border: 0;
    border-radius: 0; text-align: center; font-size: 17px; line-height: 1.2; }
  .nav-links .mb-links a:hover { background: rgba(217, 164, 65, .08); }
  .nav-links .mb-links a[aria-current="page"] { background: rgba(217, 164, 65, .12); }
  .nav-links .sec-teachers .mb-links a { font-size: 15px; }
  /* The Books: "Overview" becomes the card's top half, marked by an arrow; Buy on Amazon in bold */
  .sec-books .mb-links li:first-child { display: contents; }
  .sec-books .mb-links li:nth-child(2) { border-left: 0; }
  .nav-links .sec-books .mb-links li:first-child a { position: absolute; inset: 0 0 55px 0; min-height: 0; padding: 0; font-size: 0; color: transparent; background: none; }
  .nav-links .sec-books .mb-links li:first-child a::after { content: ""; position: absolute; right: 18px; top: 50%; width: 22px; height: 12px; margin-top: -6px;
    background: var(--gold); transition: transform .2s;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M1 5h15M12 1.5 16 5l-4 3.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M1 5h15M12 1.5 16 5l-4 3.5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
  .nav-links .sec-books .mb-links li:first-child a:hover::after { transform: translateX(4px); }
  .nav-links .sec-books .mb-links li:first-child a:focus-visible { outline-offset: -3px; border-radius: 14px 14px 0 0; }
  .sec-books .mega-book:has(li:first-child a[aria-current]) { box-shadow: var(--card-shadow), inset 0 0 0 1px rgba(217, 164, 65, .45); }
  .nav-links .sec-books .mb-links li:last-child a { font-weight: 700; color: var(--head); }
}

/* light theme: the panels are always parchment, even while the bar floats dark over the film (author, 2026-11-22) */
:root[data-theme="light"] .nav .nav-mega {
  --night: #f6efe1; --text: #3a3145; --muted: #655a6b; --head: #221b33; --gold: #875b1c; --gold-hi: #84561a;
  --line: rgba(132, 86, 26, .28); --glass: rgba(255, 250, 240, .6); --glass-strong: rgba(250, 245, 233, .92);
}
