/* ============================================================
   VK COACHING CENTRE — "The Opening Book"
   css/styles.css

   Contents
   --------
   1.  Design tokens
   2.  Reset & base
   3.  Backdrop (parchment table, grain, vignette)
   4.  Shared typography & ornament helpers
   5.  Page (paper) faces — shared content styling
   6.  Cover, endpaper, contact (leather) faces
   7.  Spread-by-spread content styles
   8.  FLAT MODE (default, no-JS / fallback): vertical stack
   9.  BOOK MODE — 3D spread (html.book-mode, wide screens)
   10. BOOK MODE — single-page (narrow screens)
   11. Controls: arrows, corners, dots, hint, toggle
   12. Accessibility: focus, skip link, sr-only
   13. Reduced motion
   14. Scroll experience: shelf, flying book, watermark, ribbon
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Faces */
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;

  /* Parchment table (page background) */
  --parchment-1: #f6f1e6;
  --parchment-2: #e8ddc7;
  --parchment-3: #d8c9ab;

  /* Leather */
  --leather-hi: #8a4a37;
  --leather-1:  #6e3b2e;
  --leather-2:  #5c2f24;
  --leather-3:  #41211a;
  --leather-4:  #2e1611;

  /* Gold foil — never flat yellow */
  --gold-pale:   #f0e0ae;
  --gold-hi:     #e3c778;
  --gold:        #c9a227;
  --gold-deep:   #9a7414;
  --gold-bronze: #6f5a1a;
  --gold-ink:    #7d5c07;   /* darker gold for small text on paper (AA) */

  /* Paper */
  --paper-1:    #faf6ec;
  --paper-2:    #f4edd9;
  --paper-3:    #eadfc4;
  --paper-edge: #d9cca9;

  /* Ink */
  --ink:       #2b2419;
  --ink-soft:  #4a3f2e;
  --ink-muted: #6b5d47;

  /* Text on leather (contact plate) */
  --plate-ink:   #f2e7c9;
  --plate-muted: #d9c89b;

  /* Type scale — fluid */
  --text-2xs:  clamp(0.62rem, 0.58rem + 0.18vw, 0.74rem);
  --text-xs:   clamp(0.72rem, 0.68rem + 0.20vw, 0.85rem);
  --text-sm:   clamp(0.86rem, 0.80rem + 0.28vw, 1.04rem);
  --text-base: clamp(1.00rem, 0.93rem + 0.32vw, 1.20rem);
  --text-lg:   clamp(1.15rem, 1.05rem + 0.45vw, 1.44rem);
  --text-xl:   clamp(1.45rem, 1.25rem + 0.90vw, 2.00rem);
  --text-2xl:  clamp(1.90rem, 1.55rem + 1.60vw, 2.80rem);
  --text-3xl:  clamp(2.40rem, 1.90rem + 2.60vw, 3.70rem);

  /* Book geometry (book mode) */
  --page-ar: 0.72;                                   /* page width / height */
  --book-h: min(84svh, 740px, 47vw);                 /* spread height       */
  --book-w: calc(var(--book-h) * var(--page-ar) * 2);/* spread width        */
  --board-lip: 7px;                                  /* leather overhang    */
  --book-thick: clamp(34px, 4.6svh, 52px);           /* flying-book depth   */

  /* Motion */
  --ease-book: cubic-bezier(0.22, 1, 0.36, 1);

  /* Grain (SVG feTurbulence, tiled) */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  --noise-coarse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.45' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}


/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--parchment-2);
  min-height: 100svh;
}

img, svg, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }   /* beats the svg/button display resets */
a { color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { line-height: 1.15; font-weight: 400; }
address { font-style: normal; }
::selection { background: var(--gold); color: var(--leather-4); }

/* Book mode fills the viewport and never scrolls */
html.book-mode, html.book-mode body { height: 100%; overflow: hidden; }


/* ============================================================
   3. BACKDROP — warm parchment table
   ============================================================ */
.backdrop, .backdrop::before, .backdrop::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.backdrop {
  z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 30%, var(--parchment-1) 0%, var(--parchment-2) 55%, var(--parchment-3) 100%);
}
/* faint paper grain over the table */
.backdrop::before {
  content: "";
  background-image: var(--noise);
  background-size: 220px 220px;
  opacity: 0.05;
  mix-blend-mode: multiply;
}
/* warm vignette so the book is the hero */
.backdrop::after {
  content: "";
  background: radial-gradient(85% 70% at 50% 46%, transparent 55%, rgba(92, 62, 32, 0.14) 100%);
}


/* ============================================================
   4. SHARED TYPOGRAPHY & ORNAMENT HELPERS
   ============================================================ */

/* Letter-spaced label (section eyebrows, small labels) */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

/* Big display heading on paper */
.page-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--ink);
  margin-top: 0.2em;
}

/* Metallic gold-foil text (large sizes only) */
.foil {
  background: linear-gradient(168deg,
    #f6ecc8 0%, var(--gold-hi) 24%, var(--gold) 46%,
    #8f6a14 62%, #d9b74a 80%, var(--gold-pale) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* faint press-in emboss around the glyphs */
  text-shadow:
    0 1px 0 rgba(255, 240, 200, 0.10),
    0 -1px 1px rgba(20, 8, 4, 0.45);
}

/* Thin gold rule with a centred lozenge ornament */
.ornament-rule {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  color: var(--gold-deep);
}
.ornament-rule::before, .ornament-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 7rem;
  background: linear-gradient(to right, transparent, currentColor 30%, currentColor 70%, transparent);
}
.ornament-rule svg { width: 5.5rem; height: 0.8rem; flex: none; }

/* Oldstyle figures where the font offers them */
.oldstyle { font-variant-numeric: oldstyle-nums; }

/* Drop cap on a spread's opening paragraph */
.lede::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 3.1em;
  line-height: 0.78;
  padding: 0.06em 0.12em 0 0;
  color: var(--gold-deep);
}

/* Visible, dignified placeholder styling — real data pending.
   Every element with .placeholder also carries an HTML comment
   telling the owner exactly what to put there. */
.placeholder {
  color: var(--ink-muted);
  font-style: italic;
}


/* ============================================================
   5. PAPER PAGE FACES — shared
   ============================================================ */
.face {
  position: relative; /* flat mode; book mode repositions */
}

.page, .endpaper__paper {
  background:
    /* faint grain */
    var(--noise),
    /* gentle ageing toward the edges */
    radial-gradient(130% 105% at 50% 40%, var(--paper-1) 55%, var(--paper-2) 82%, var(--paper-3) 100%);
  background-size: 220px 220px, 100% 100%;
  background-blend-mode: multiply, normal;
}

.page {
  color: var(--ink);
  padding: clamp(1.1rem, 2.4vh + 0.6rem, 2.4rem) clamp(1.1rem, 2vw + 0.5rem, 2.2rem);
  /* deckled-edge whisper + inner depth */
  box-shadow:
    inset 0 0 0 1px rgba(120, 96, 55, 0.10),
    inset 0 0 26px rgba(120, 96, 55, 0.08);
}

.page__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;               /* safety valve on short viewports */
  scrollbar-width: thin;
  scrollbar-color: var(--paper-edge) transparent;
}

/* printed page number, set into the outer corner by mode rules */
.pagenum {
  font-size: var(--text-xs);
  color: var(--ink-muted);
  font-variant-numeric: oldstyle-nums;
  letter-spacing: 0.08em;
}

.page p { font-size: var(--text-base); }
.page .small { font-size: var(--text-sm); }


/* ============================================================
   6. LEATHER FACES — cover, endpaper rim, contact board
   ============================================================ */
.leather {
  background:
    var(--noise-coarse),
    radial-gradient(115% 150% at 32% 18%, var(--leather-hi) 0%, var(--leather-1) 34%, var(--leather-2) 62%, var(--leather-3) 100%);
  background-size: 300px 300px, 100% 100%;
  background-blend-mode: overlay, normal;
  color: var(--plate-ink);
  box-shadow:
    inset 0 0 0 1px rgba(24, 10, 6, 0.55),          /* cut edge          */
    inset 0 2px 2px rgba(255, 214, 170, 0.07),       /* top bevel light   */
    inset 0 -2px 3px rgba(15, 6, 3, 0.45),           /* bottom bevel dark */
    inset 0 0 70px rgba(24, 9, 5, 0.55);             /* worn dark edges   */
}

/* ---------- Front cover ---------- */
.cover-front {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(1.4rem, 4vh, 3rem) clamp(1.2rem, 3vw, 2.6rem);
  position: relative;
  overflow: hidden;
}

/* double gold frame, pressed into the leather */
.cover-front::before {
  content: "";
  position: absolute;
  inset: clamp(10px, 2.2%, 18px);
  border: 1px solid rgba(201, 162, 39, 0.75);
  outline: 1px solid rgba(201, 162, 39, 0.38);
  outline-offset: 5px;
  box-shadow:
    0 1px 0 rgba(255, 235, 180, 0.08),
    inset 0 1px 1px rgba(20, 8, 4, 0.5);
  pointer-events: none;
}

.cover-front .corner {
  position: absolute;
  width: clamp(26px, 9%, 46px);
  height: clamp(26px, 9%, 46px);
  color: var(--gold);
  opacity: 0.9;
  pointer-events: none;
}
.cover-front .corner--tl { top: calc(clamp(10px, 2.2%, 18px) + 8px); left: calc(clamp(10px, 2.2%, 18px) + 8px); }
.cover-front .corner--tr { top: calc(clamp(10px, 2.2%, 18px) + 8px); right: calc(clamp(10px, 2.2%, 18px) + 8px); transform: scaleX(-1); }
.cover-front .corner--bl { bottom: calc(clamp(10px, 2.2%, 18px) + 8px); left: calc(clamp(10px, 2.2%, 18px) + 8px); transform: scaleY(-1); }
.cover-front .corner--br { bottom: calc(clamp(10px, 2.2%, 18px) + 8px); right: calc(clamp(10px, 2.2%, 18px) + 8px); transform: scale(-1); }

/* spine shading on the bound edge of the cover */
.cover-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    rgba(20, 8, 4, 0.42) 0%, rgba(20, 8, 4, 0.12) 3.5%, transparent 9%,
    transparent 96%, rgba(20, 8, 4, 0.18) 100%);
  pointer-events: none;
}

.cover-front__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 1.6vh, 1.1rem);
  max-width: 34ch;
}

.cover-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  letter-spacing: 0.015em;
  line-height: 1.05;
}

.cover-sub {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-hi);
  text-indent: 0.34em; /* optically centre the tracked text */
}

.cover-tagline {
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--gold-pale);
  opacity: 0.85;
  max-width: 26ch;
}

.cover-open-cue {
  margin-top: clamp(0.4rem, 2vh, 1.4rem);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-indent: 0.3em;
  color: var(--gold-hi);
  opacity: 0.8;
}

/* emblem (gold double ring + monogram) */
.emblem { color: var(--gold); }
.emblem--cover { width: clamp(56px, 15%, 84px); margin-bottom: 0.2rem; }
.emblem--small { width: 44px; margin: 0 auto; }

/* invisible full-face button that opens the book */
.cover-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
}

/* gold shimmer sweep on hover (motion-safe only) */
@media (prefers-reduced-motion: no-preference) {
  .cover-front .shimmer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(105deg,
      transparent 42%, rgba(255, 240, 200, 0.14) 50%, transparent 58%);
    background-size: 300% 100%;
    background-position: 110% 0;
    transition: background-position 1.1s ease;
  }
  .cover-hit:hover ~ .shimmer,
  .cover-hit:focus-visible ~ .shimmer {
    background-position: -10% 0;
  }
  .cover-open-cue { animation: cue-pulse 2.8s ease-in-out infinite; }
  @keyframes cue-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
  }
}

/* ribbon bookmark peeking from the closed cover */
.cover-ribbon {
  position: absolute;
  bottom: -14px;
  right: 14%;
  width: 15px;
  height: 26px;
  background: linear-gradient(to bottom, #7c1f1f, #5d1414);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  box-shadow: 0 2px 3px rgba(20, 8, 4, 0.4);
}

/* ---------- Endpaper (inside front cover) ---------- */
.endpaper {
  padding: var(--board-lip, 7px);
  display: grid;
}
.endpaper__paper {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(1rem, 3vh, 2rem);
  box-shadow:
    inset 0 0 0 1px rgba(120, 96, 55, 0.14),
    inset 0 0 34px rgba(120, 96, 55, 0.12);
}
.bookplate {
  border: 1px solid rgba(154, 116, 20, 0.55);
  outline: 1px solid rgba(154, 116, 20, 0.3);
  outline-offset: 4px;
  padding: clamp(1rem, 3.5vh, 2.2rem) clamp(0.9rem, 2.4vw, 1.8rem);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: center;
  max-width: 30ch;
}
.bookplate__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.bookplate__line {
  font-style: italic;
  font-size: var(--text-base);
  color: var(--ink);
}
.bookplate__where {
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- Contact (inside back cover) ---------- */
.page--contact {
  padding: calc(var(--board-lip, 7px) + clamp(0.9rem, 2.6vh, 1.8rem)) clamp(1.1rem, 2.4vw, 2rem);
  display: flex;
  flex-direction: column;
}
.contact__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(0.55rem, 1.6vh, 1rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--leather-3) transparent;
}
.page--contact .eyebrow { color: var(--gold-hi); }
.contact-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
}
.contact-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.7rem;
  align-items: start;
  font-size: var(--text-sm);
  line-height: 1.5;
}
.contact-row > svg {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  color: var(--gold-hi);
}
.contact-row .label {
  display: block;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--plate-muted);
  margin-bottom: 0.15rem;
}
.contact-row a {
  color: var(--plate-ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(227, 199, 120, 0.4);
  transition: border-color 160ms ease, color 160ms ease;
}
.contact-row a:hover { color: #fff8e2; border-bottom-color: var(--gold-hi); }
.phone-list { display: flex; flex-direction: column; gap: 0.15rem; }
.phone-list a { width: fit-content; font-variant-numeric: lining-nums; }
.page--contact .placeholder { color: var(--plate-muted); }

.map-plate {
  margin-top: 0.2rem;
  border: 1px solid rgba(227, 199, 120, 0.45);
  outline: 1px solid rgba(227, 199, 120, 0.22);
  outline-offset: 3px;
  padding: clamp(0.6rem, 1.6vh, 1rem);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.map-plate svg { width: 2rem; height: 2rem; color: var(--gold-hi); flex: none; }
.map-plate .coords {
  font-size: var(--text-2xs);
  letter-spacing: 0.18em;
  color: var(--plate-muted);
  text-transform: uppercase;
}
.map-plate a {
  display: inline-block;
  font-size: var(--text-sm);
  color: var(--plate-ink);
  border-bottom: 1px solid rgba(227, 199, 120, 0.4);
  text-decoration: none;
}
.map-plate a:hover { color: #fff8e2; border-bottom-color: var(--gold-hi); }

.contact-close {
  margin-top: auto;
  padding-top: 0.5rem;
  text-align: center;
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--plate-muted);
}
.page--contact .emblem--small { color: var(--gold-hi); width: 36px; margin-top: 0.35rem; }


/* ============================================================
   7. SPREAD CONTENT
   ============================================================ */

/* ---------- Index / What we teach ---------- */
.toc { display: flex; flex-direction: column; gap: clamp(0.4rem, 1.3vh, 0.85rem); margin-top: clamp(0.5rem, 1.6vh, 1rem); }
.toc-item__row {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}
.toc-item__num {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--gold-ink);
  min-width: 1.6em;
}
.toc-item__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--ink);
  white-space: nowrap;
}
.toc-item__leader {
  flex: 1;
  border-bottom: 1px dotted rgba(125, 92, 7, 0.55);
  transform: translateY(-0.28em);
  min-width: 1.2rem;
}
.toc-item__note {
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--gold-ink);
  white-space: nowrap;
}
.toc-item__sub {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  padding-left: calc(1.6em + 0.45rem);
  line-height: 1.45;
}

.minitoc {
  margin-top: auto;
  padding-top: clamp(0.5rem, 1.6vh, 1rem);
}
.minitoc .eyebrow { display: block; margin-bottom: 0.35rem; }
.minitoc ul { display: flex; flex-direction: column; gap: 0.12rem; }
.minitoc li { display: flex; align-items: baseline; gap: 0.45rem; font-size: var(--text-sm); }
.minitoc .toc-item__leader { border-color: rgba(107, 93, 71, 0.5); }
.minitoc a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.minitoc a:hover { color: var(--gold-ink); border-bottom-color: rgba(125, 92, 7, 0.5); }
.minitoc .pg { color: var(--ink-muted); font-variant-numeric: oldstyle-nums; }

/* ---------- Mentor ---------- */
.mentor-sub {
  font-style: italic;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  margin-bottom: clamp(0.5rem, 1.6vh, 1rem);
}
.mentor-copy { display: flex; flex-direction: column; gap: 0.65em; }
.pull-line {
  margin-top: auto;
  padding-top: clamp(0.5rem, 1.5vh, 1rem);
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--gold-deep);
}

/* ---------- Results ---------- */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.5rem, 1.6vh, 1rem) 1rem;
  margin: clamp(0.5rem, 1.8vh, 1.1rem) 0;
}
.stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--gold-deep);
  font-variant-numeric: oldstyle-nums;
}
.stat__label {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 0.1rem;
}
.results-list { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.3rem; }
.results-list li {
  font-size: var(--text-sm);
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed rgba(107, 93, 71, 0.4);
}
.results-note {
  margin-top: auto;
  padding-top: 0.6rem;
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

/* ---------- Testimonials ---------- */
.quotes { display: flex; flex-direction: column; gap: clamp(0.7rem, 2.2vh, 1.4rem); margin-top: clamp(0.5rem, 1.6vh, 1rem); }
.quote { position: relative; padding-left: 1.6rem; }
.quote::before {
  content: "\201C";
  position: absolute;
  left: 0;
  top: -0.12em;
  font-family: var(--font-display);
  font-size: 2.4em;
  line-height: 1;
  color: var(--gold);
}
.quote blockquote { font-style: italic; font-size: var(--text-base); line-height: 1.5; }
.quote figcaption {
  margin-top: 0.35rem;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.quotes-note {
  margin-top: auto;
  padding-top: 0.6rem;
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--ink-muted);
}

/* ---------- Colophon ---------- */
.colophon .page__inner {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.7rem;
}
.colophon__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.colophon__line { font-style: italic; color: var(--ink); max-width: 26ch; }
.colophon .small { color: var(--ink-muted); max-width: 30ch; }
.colophon .emblem--small { color: var(--gold-deep); }


/* ============================================================
   8. FLAT MODE (default without JS; also the manual fallback)
   The same content as an elegant vertical stack of aged pages.
   ============================================================ */
html:not(.book-mode) .scene {
  max-width: 660px;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.5rem) clamp(0.8rem, 3vw, 1.5rem) 5rem;
  display: flex;
  flex-direction: column;
  gap: clamp(1.2rem, 3vw, 2rem);
}
html:not(.book-mode) .leaf { display: contents; }
html:not(.book-mode) .face {
  border-radius: 6px;
  box-shadow:
    0 1px 2px rgba(62, 38, 20, 0.18),
    0 10px 30px -12px rgba(62, 38, 20, 0.35);
}
html:not(.book-mode) .page,
html:not(.book-mode) .page--contact {
  min-height: 0;
  padding-top: clamp(1.6rem, 4vw, 2.6rem);
  padding-bottom: clamp(1.6rem, 4vw, 2.6rem);
}
html:not(.book-mode) .page__inner,
html:not(.book-mode) .contact__inner { overflow: visible; height: auto; }
html:not(.book-mode) .cover-front { min-height: clamp(380px, 60vh, 560px); }
html:not(.book-mode) .cover-hit,
html:not(.book-mode) .cover-open-cue,
html:not(.book-mode) .cover-ribbon { display: none; }
html:not(.book-mode) .endpaper { min-height: 0; }
html:not(.book-mode) .endpaper__paper { padding: clamp(1.6rem, 5vw, 2.6rem); }
html:not(.book-mode) .minitoc,
html:not(.book-mode) .pagenum { display: none; }  /* nav & page numbers are book furniture */
html:not(.book-mode) .pull-line,
html:not(.book-mode) .results-note,
html:not(.book-mode) .quotes-note,
html:not(.book-mode) .contact-close { margin-top: 1rem; }

/* book-only furniture hidden in flat mode */
html:not(.book-mode) .turn-btn,
html:not(.book-mode) .dots,
html:not(.book-mode) .open-hint,
html:not(.book-mode) .page-corner,
html:not(.book-mode) .book__shadow,
html:not(.book-mode) .book__crease { display: none; }

/* gentle reveal on scroll (JS adds .in-view; motion-safe only) */
@media (prefers-reduced-motion: no-preference) {
  html:not(.book-mode) .face.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 600ms ease, transform 600ms var(--ease-book);
  }
  html:not(.book-mode) .face.reveal.in-view {
    opacity: 1;
    transform: none;
  }
}


/* ============================================================
   9. BOOK MODE — two-page 3D spread (wide screens)
   ============================================================ */
@media (min-width: 841px) {

  html.book-mode .scene {
    position: relative;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  html.book-mode .book-float { will-change: transform; }

  html.book-mode .book {
    position: relative;
    width: var(--book-w);
    height: var(--book-h);
    perspective: 2600px;               /* shared vanishing point for the leaves */
    transform: translateX(-25%);       /* closed: the cover sits centred; JS animates this */
  }

  /* soft contact shadow under the book */
  html.book-mode .book__shadow {
    position: absolute;
    left: -4%;
    right: -4%;
    bottom: -6.5%;
    height: 13%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(43, 26, 15, 0.42), transparent 72%);
    filter: blur(9px);
    transform: translateX(12%) scaleX(0.55);   /* hugs the closed cover; JS opens it up */
    z-index: 0;
    pointer-events: none;
  }

  /* ---------- leaves ---------- */
  html.book-mode .leaf {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
  }
  /* stacking before JS takes over (closed book, cover on top) */
  html.book-mode .leaf--cover        { z-index: 14; }
  html.book-mode .leaf[data-leaf="1"] { z-index: 13; }
  html.book-mode .leaf[data-leaf="2"] { z-index: 12; }
  html.book-mode .leaf[data-leaf="3"] { z-index: 11; }

  /* boards (cover + back) overhang the paper slightly */
  html.book-mode .leaf--cover {
    top: calc(-1 * var(--board-lip));
    height: calc(100% + 2 * var(--board-lip));
    width: calc(50% + var(--board-lip));
  }

  html.book-mode .leaf .face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
  }
  html.book-mode .leaf .face--back {
    transform: rotateY(180deg);
  }

  /* page-curl light & shade, driven by --curl (0→1→0) from JS */
  html.book-mode .leaf .face::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: var(--curl, 0);
    background: linear-gradient(to right,
      rgba(58, 40, 20, 0.16), transparent 28%,
      transparent 60%, rgba(58, 40, 20, 0.30) 96%);
    z-index: 5;
  }

  /* ---------- static back board: the contact page ---------- */
  html.book-mode .face--board {
    position: absolute;
    top: calc(-1 * var(--board-lip));
    left: 50%;
    width: calc(50% + var(--board-lip));
    height: calc(100% + 2 * var(--board-lip));
    z-index: 1;
    border-radius: 4px 12px 12px 4px;
    /* stacked page edges peeking beneath the book */
    box-shadow:
      3px 3px 0 -1px #efe7cf, 3.5px 3.5px 0 0 rgba(90, 65, 35, 0.25),
      6px 6px 0 -1px #e6dcbd, 6.5px 6.5px 0 0 rgba(90, 65, 35, 0.2),
      14px 18px 34px -6px rgba(43, 26, 15, 0.4);
  }

  /* rounded corners: fronts show at visual right, backs at visual left */
  html.book-mode .leaf .face--front { border-radius: 4px 12px 12px 4px; }
  html.book-mode .leaf .face--back  { border-radius: 12px 4px 4px 12px; }

  /* paper pages sit inside the boards — inset by the lip */
  html.book-mode .leaf:not(.leaf--cover) .face {
    box-shadow:
      inset 0 0 0 1px rgba(120, 96, 55, 0.10),
      inset 0 0 26px rgba(120, 96, 55, 0.08);
  }
  html.book-mode .leaf:not(.leaf--cover) { padding: 0; }

  /* gutter shadow near the spine on every open page */
  html.book-mode .leaf .face--front .page__inner,
  html.book-mode .leaf .face--front.page { background-clip: padding-box; }
  html.book-mode .leaf .face--front::before,
  html.book-mode .face--board::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 14%;
    background: linear-gradient(to right, rgba(70, 48, 24, 0.16), transparent);
    pointer-events: none;
    z-index: 4;
  }
  html.book-mode .leaf .face--back::before {
    content: "";
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 14%;
    background: linear-gradient(to left, rgba(70, 48, 24, 0.16), transparent);
    pointer-events: none;
    z-index: 4;
  }
  /* the cover's own faces don't need a paper gutter */
  html.book-mode .leaf--cover .face--front::before { display: none; }

  /* page numbers in the outer bottom corners */
  html.book-mode .face--front .pagenum { position: absolute; bottom: 0.7rem; right: 1.1rem; z-index: 4; }
  html.book-mode .face--back  .pagenum { position: absolute; bottom: 0.7rem; left: 1.1rem;  z-index: 4; }

  /* the centre crease over an open spread */
  html.book-mode .book__crease {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 7%;
    transform: translateX(-50%);
    background: linear-gradient(to right,
      transparent, rgba(46, 26, 16, 0.14) 42%, rgba(46, 26, 16, 0.26) 50%,
      rgba(46, 26, 16, 0.14) 58%, transparent);
    z-index: 22;
    pointer-events: none;
    opacity: 0;
    transition: opacity 500ms ease 250ms;
  }
  html.book-mode .scene:not([data-pos="0"]) .book__crease { opacity: 1; }

  /* endpaper fills its face */
  html.book-mode .endpaper { height: 100%; }

  /* single-page-mode furniture not used here */
  html.book-mode .face.is-current { visibility: visible; }
}

/* Shared book-mode rules (both spread and single) */
html.book-mode .scene { position: relative; }

/* ============================================================
   10. BOOK MODE — single page at a time (narrow screens)
   ============================================================ */
@media (max-width: 840px) {

  html.book-mode {
    --page-h: min(76svh, 620px, calc(94vw / var(--page-ar)));
  }

  html.book-mode .scene {
    position: relative;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  html.book-mode .book {
    position: relative;
    width: calc(var(--page-h) * var(--page-ar));
    height: var(--page-h);
    perspective: 1800px;
  }

  html.book-mode .book__shadow {
    position: absolute;
    left: -3%;
    right: -3%;
    bottom: -5.5%;
    height: 11%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(43, 26, 15, 0.4), transparent 72%);
    filter: blur(8px);
    z-index: 0;
    pointer-events: none;
  }

  html.book-mode .leaf { display: contents; }

  html.book-mode .face {
    position: absolute;
    inset: 0;
    visibility: hidden;
    transform-origin: left center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
    border-radius: 5px 10px 10px 5px;
    box-shadow:
      2.5px 2.5px 0 -1px #efe7cf, 3px 3px 0 0 rgba(90, 65, 35, 0.25),
      5px 5px 0 -1px #e6dcbd, 5.5px 5.5px 0 0 rgba(90, 65, 35, 0.2),
      10px 14px 26px -6px rgba(43, 26, 15, 0.38);
  }
  html.book-mode .face.is-current { visibility: visible; }

  /* curl shade while a page flips */
  html.book-mode .face::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: var(--curl, 0);
    background: linear-gradient(to right,
      rgba(58, 40, 20, 0.14), transparent 30%,
      transparent 62%, rgba(58, 40, 20, 0.28) 96%);
    z-index: 5;
  }

  /* faint spine edge on the left of every page */
  html.book-mode .face:not(.cover-front)::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 12%;
    background: linear-gradient(to right, rgba(70, 48, 24, 0.14), transparent);
    pointer-events: none;
    z-index: 4;
  }

  html.book-mode .pagenum { position: absolute; bottom: 0.7rem; right: 1rem; z-index: 4; }
  html.book-mode .endpaper { height: 100%; }
  html.book-mode .book__crease { display: none; }
}


/* ============================================================
   11. CONTROLS — arrows, corners, dots, hint, flat toggle
   ============================================================ */

/* side arrows */
.turn-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(125, 92, 7, 0.45);
  color: var(--gold-ink);
  background: rgba(250, 246, 236, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 180ms ease, border-color 180ms ease, opacity 250ms ease;
  z-index: 40;
}
.turn-btn svg { width: 18px; height: 18px; }
.turn-btn:hover:not(:disabled) { background: rgba(250, 246, 236, 0.95); border-color: var(--gold-deep); }
.turn-btn:disabled { opacity: 0.25; cursor: default; }
.turn-btn--prev { left: max(10px, calc(50% - var(--book-w) / 2 - 72px)); }
.turn-btn--next { right: max(10px, calc(50% - var(--book-w) / 2 - 72px)); }
@media (max-width: 840px) {
  .turn-btn { width: 40px; height: 40px; }
  .turn-btn--prev { left: max(6px, calc(50% - var(--page-h) * var(--page-ar) / 2 - 58px)); }
  .turn-btn--next { right: max(6px, calc(50% - var(--page-h) * var(--page-ar) / 2 - 58px)); }
}
/* hidden while the book is closed — the cover is the button */
.scene[data-pos="0"] .turn-btn { opacity: 0; pointer-events: none; }

/* clickable page corners (a subtle lifted fold) */
.page-corner {
  position: absolute;
  bottom: 0;
  width: 52px;
  height: 52px;
  z-index: 26;
  opacity: 0.7;
  transition: opacity 180ms ease, transform 180ms ease;
}
.page-corner::before {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 30px;
  height: 30px;
  background: linear-gradient(315deg, var(--paper-3) 0%, var(--paper-2) 46%, rgba(120, 96, 55, 0.28) 50%, transparent 54%);
  border-radius: 0 0 8px 0;
  box-shadow: -2px -2px 4px rgba(90, 65, 35, 0.18);
}
.page-corner--next { right: 2px; }
.page-corner--prev { left: 2px; transform: scaleX(-1); }
.page-corner:hover { opacity: 1; transform: translateY(-2px); }
.page-corner--prev:hover { transform: scaleX(-1) translateY(-2px); }
.scene[data-pos="0"] .page-corner { display: none; }
.page-corner:disabled { display: none; }

/* progress dots — one per spread */
.dots {
  position: absolute;
  left: 50%;
  bottom: max(14px, 3.6svh);
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  z-index: 40;
  transition: opacity 300ms ease;
}
.scene[data-pos="0"] .dots { opacity: 0; pointer-events: none; }
.dot {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--gold-deep);
  background: transparent;
  transform: rotate(45deg);            /* tiny lozenge, not a plain dot */
  transition: background-color 200ms ease, transform 200ms ease;
}
.dot:hover::before { background: rgba(154, 116, 20, 0.4); }
.dot[aria-current="true"]::before { background: var(--gold-deep); transform: rotate(45deg) scale(1.25); }

/* "tap to open" hint under the closed book */
.open-hint {
  position: absolute;
  left: 50%;
  bottom: max(14px, 3.6svh);
  transform: translateX(-50%);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  transition: opacity 300ms ease;
  z-index: 40;
}
.scene:not([data-pos="0"]) .open-hint { opacity: 0; pointer-events: none; }

/* flat/book toggle — quiet, fixed in the corner */
.flat-toggle {
  position: fixed;
  right: 12px;
  bottom: 10px;
  z-index: 50;
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 6px 8px;
  opacity: 0.65;
  transition: opacity 160ms ease;
}
.flat-toggle:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
html:not(.book-mode) .flat-toggle { position: fixed; }


/* ============================================================
   12. ACCESSIBILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  background: var(--leather-2);
  color: var(--gold-pale);
  padding: 0.55rem 1rem;
  font-size: var(--text-sm);
  border-radius: 4px;
  text-decoration: none;
  transform: translateY(-300%);
  transition: transform 200ms ease;
}
.skip-link:focus-visible { transform: none; }

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
  border-radius: 2px;
}
.leather :focus-visible,
.page--contact :focus-visible { outline-color: var(--gold-hi); }
.cover-hit:focus-visible { outline-offset: -6px; }

.face { scroll-margin-top: 2rem; }   /* pleasant anchor jumps in flat mode */


/* ============================================================
   13. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ============================================================
   14. SCROLL EXPERIENCE (html.scroll-mode, wide screens only)
   The page becomes a tall scroll track; the scene is pinned.
   js/book.js scrubs one master timeline through:
   shelf → the book flies out → cover → open → page turns.
   ============================================================ */

/* In scroll mode the document scrolls again (book mode normally locks it) */
html.scroll-mode { height: auto; overflow-y: auto; overflow-x: hidden; }
html.scroll-mode body { height: auto; overflow: visible; }

/* invisible spacer that provides the scroll distance (JS sets exact height) */
.scroll-track { display: none; }
html.scroll-mode .scroll-track {
  display: block;
  width: 1px;
  height: 760svh;
  visibility: hidden;
  pointer-events: none;
}

/* the stage is pinned and gains a vanishing point for the flying book */
html.scroll-mode .scene {
  position: fixed;
  inset: 0;
  perspective: 2400px;
}

/* the real book hides until the flying book lands on it (GSAP then owns this) */
html.scroll-mode .book-float { opacity: 0; visibility: hidden; }

/* ---------- 14a. The library shelf ---------- */
.shelf { display: none; }
html.scroll-mode .shelf {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
}
.shelf__wall {
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 100% at 50% 18%, #2b1b10 0%, #1a0f08 62%, #100905 100%);
}
.shelf__wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  background-size: 220px 220px;
  opacity: 0.07;
}
.shelf__unit {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(6px, 2vw, 28px);
  will-change: transform;
}
.shelf__board {
  flex: none;
  height: clamp(13px, 2.2svh, 21px);
  border-radius: 2px;
  background: linear-gradient(#6b4527 0%, #4a2d18 20%, #35200e 62%, #241407 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 10px 18px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 2;
}
.shelf__row {
  flex: none;
  height: clamp(120px, 25svh, 250px);
  display: flex;
  align-items: flex-end;
  padding: 0 0.6vw;
  position: relative;
}
/* shadow cast by the board above onto the row of books */
.shelf__row::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 30px;
  background: linear-gradient(rgba(0, 0, 0, 0.55), transparent);
  pointer-events: none;
  z-index: 1;
}
.shelf__books {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
  overflow: hidden;
}
/* the dark gap our book is pulled from */
.shelf__slot {
  flex: none;
  width: clamp(46px, 6svh, 66px);
  height: 96%;
  margin: 0 3px;
  background: linear-gradient(#0c0704, #1b100a 70%, #22150c);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.85);
}
/* generated book spines (see buildShelf in js/book.js) */
.spine {
  flex: none;
  position: relative;
  border-radius: 2px 2px 0 0;
  box-shadow:
    inset 0 -8px 12px rgba(0, 0, 0, 0.28),
    inset 0 2px 3px rgba(255, 255, 255, 0.05),
    1px 0 2px rgba(0, 0, 0, 0.4);
}
.shelf__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(85% 75% at 50% 46%, transparent 42%, rgba(5, 2, 1, 0.62) 100%),
    linear-gradient(to top, rgba(5, 2, 1, 0.5), transparent 22%);
  pointer-events: none;
}

/* dust motes drifting in the shelf light (fade away with the shelf) */
.motes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.motes i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 224, 170, 0.5);
  filter: blur(0.5px);
  opacity: 0;
  animation: mote-drift var(--mt, 16s) linear var(--md, 0s) infinite;
}
.motes i:nth-child(1) { left: 22%; top: 64%; --mt: 15s; --md: 0s;   }
.motes i:nth-child(2) { left: 35%; top: 40%; --mt: 19s; --md: 3s;  width: 2px; height: 2px; }
.motes i:nth-child(3) { left: 48%; top: 72%; --mt: 13s; --md: 6s;   }
.motes i:nth-child(4) { left: 57%; top: 33%; --mt: 21s; --md: 1.5s; }
.motes i:nth-child(5) { left: 66%; top: 58%; --mt: 17s; --md: 8s;  width: 4px; height: 4px; }
.motes i:nth-child(6) { left: 74%; top: 45%; --mt: 14s; --md: 4s;   }
.motes i:nth-child(7) { left: 41%; top: 25%; --mt: 22s; --md: 10s; width: 2px; height: 2px; }
.motes i:nth-child(8) { left: 82%; top: 68%; --mt: 18s; --md: 7s;   }
@keyframes mote-drift {
  0%   { transform: translate3d(0, 0, 0);       opacity: 0; }
  12%  { opacity: 0.4; }
  60%  { opacity: 0.15; }
  100% { transform: translate3d(34px, -70px, 0); opacity: 0; }
}

/* ---------- 14b. The flying book (3D box for the flight only) ---------- */
.flybook { display: none; }
html.scroll-mode .flybook {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--book-w) / 2 + var(--board-lip));
  height: calc(var(--book-h) + 2 * var(--board-lip));
  z-index: 8;
  cursor: pointer;
  will-change: transform;
}
.fb-box {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}
.fb-face {
  position: absolute;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.fb-face--front {
  inset: 0;
  transform: translateZ(calc(var(--book-thick) / 2));
  border-radius: 4px 12px 12px 4px;
}
.fb-face--back {
  inset: 0;
  transform: rotateY(180deg) translateZ(calc(var(--book-thick) / 2));
  border-radius: 12px 4px 4px 12px;
}
.fb-face--spine {
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--book-thick);
  transform: rotateY(-90deg) translateZ(calc(var(--book-thick) / 2));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 10% 0;
  border-radius: 3px;
}
.fb-spine-band {
  display: block;
  width: 68%;
  height: 3px;
  border-top: 1px solid rgba(201, 162, 39, 0.9);
  border-bottom: 1px solid rgba(201, 162, 39, 0.55);
}
.fb-spine-band--top { margin-bottom: auto; margin-top: 4%; }
.fb-spine-band--bot { margin-top: auto; margin-bottom: 4%; }
.fb-spine-title {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2.2svh, 1.35rem);
  letter-spacing: 0.16em;
  white-space: nowrap;
}
.fb-spine-year {
  font-family: var(--font-display);
  font-size: clamp(0.55rem, 1.3svh, 0.8rem);
  letter-spacing: 0.1em;
  color: var(--gold-hi);
}
/* the block of pages: fore-edge, head and tail */
.fb-face--edge,
.fb-face--top,
.fb-face--bot {
  background:
    repeating-linear-gradient(to bottom,
      rgba(120, 96, 55, 0.22) 0 1px, transparent 1px 3px),
    linear-gradient(to right, #e6dcc0, #f6efdb 35%, #efe6cb);
}
.fb-face--edge {
  top: 1.5%;
  bottom: 1.5%;
  right: 0;
  width: var(--book-thick);
  transform: rotateY(90deg) translateZ(calc(var(--book-thick) / 2));
}
.fb-face--top,
.fb-face--bot {
  left: 1%;
  right: 1%;
  height: var(--book-thick);
  background:
    repeating-linear-gradient(to right,
      rgba(120, 96, 55, 0.18) 0 1px, transparent 1px 3px),
    linear-gradient(to right, #e6dcc0, #f6efdb 35%, #efe6cb);
}
.fb-face--top { top: 0; transform: rotateX(90deg) translateZ(calc(var(--book-thick) / 2)); }
.fb-face--bot { bottom: 0; transform: rotateX(-90deg) translateZ(calc(var(--book-thick) / 2)); }

/* soft ground shadow that stays level while the box rotates */
.fb-shadow {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -7%;
  height: 12%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.5), transparent 70%);
  filter: blur(7px);
}

/* ---------- 14c. Engraved seal watermark ---------- */
.watermark { display: none; }
html.scroll-mode .watermark {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 0;
  color: #8a6a2a;
  opacity: 0;               /* GSAP fades it in as the shelf recedes */
  pointer-events: none;
}
.watermark svg {
  width: min(160svh, 150vw, 1500px);
  height: auto;
  opacity: 0.075;
}

/* ---------- 14d. Bookmark-ribbon progress ---------- */
.bookmark-ribbon { display: none; }
html.scroll-mode .bookmark-ribbon {
  display: block;
  position: fixed;
  top: 0;
  right: clamp(18px, 4.5vw, 84px);
  width: 16px;
  height: 88svh;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}
.bookmark-ribbon__inner {
  position: absolute;
  inset: 0;
  transform: translateY(-101%);
  background: linear-gradient(to right, #8c2626, #5d1414 75%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 12px), 0 100%);
  box-shadow: inset -3px 0 4px rgba(20, 8, 4, 0.35);
}

/* scroll-mode chrome details */
html.scroll-mode .open-hint { z-index: 6; }
html.scroll-mode .cover-open-cue { display: none; }  /* the fixed hint does this job */
