/* ============================================================
   From Exile to Transformation — shared book design system
   Source of truth: brand-spec.md (Book Design Guide + global-mkts.com/book)
   Two serif families only. Gold = accent. Navy = cover/panel ink.
   ============================================================ */

:root {
  --navy:     #1a2d4d;
  --navy-2:   #23395f;
  --navy-ink: #f5f1e8;
  --gold:     #d4af37;
  --gold-soft:#e8d491;
  --paper:    #f5f1e8;
  --surface:  #fffdf8;
  --ink:      #2c2c2c;
  --muted:    #6f6a5e;
  --border:   #e3dccb;

  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body:    'Source Serif 4', Georgia, 'Times New Roman', serif;

  --measure: 68ch;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- small-caps label utility ---- */
.eyebrow, .part-label, .dateline, .spot-label, .nav-label, .chapter-num,
.book-head, .book-foot, .foot-nav, .status-pill {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.22em;
  text-transform: lowercase;
}

/* ============================================================
   Running head + foot
   ============================================================ */
.book-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(20px, 5vw, 56px);
  background: rgba(245, 241, 232, 0.94);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  backdrop-filter: blur(12px) saturate(1.05);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--gold);
  font-size: 13px;
  color: var(--muted);
}
.book-head a {
  color: var(--navy);
  text-decoration: none;
}
.book-head a:hover { color: var(--gold); }
.book-head-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
  color: var(--navy);
}
.book-head-brand:hover { color: var(--gold); }
.book-head-brand::after { display: none !important; } /* no underline sweep on logo+title lockup */
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 42%;
  flex-shrink: 0;
  border: 1px solid rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 2px rgba(26, 45, 77, 0.06);
  background: var(--navy);
}
.book-head-title { font-size: 15px; font-weight: 600; letter-spacing: 0.16em; }
.book-head-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.book-foot {
  margin-top: 72px;
  padding: 40px clamp(20px, 5vw, 56px) 56px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}
.book-foot .foot-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
  margin: 0 auto 14px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 0 3px rgba(26, 45, 77, 0.05);
  background: var(--navy);
}
.book-foot .imprint-line {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 6px;
}
.book-foot .title { color: var(--navy); font-size: 16px; font-weight: 600; letter-spacing: 0.14em; }

/* ============================================================
   Page / chapter shell
   ============================================================ */
main {
  padding: clamp(40px, 7vw, 96px) clamp(20px, 5vw, 56px) 8px;
}

.chapter { max-width: var(--measure); margin: 0 auto; }

.chapter-head { text-align: center; margin-bottom: 48px; }
.eyebrow { color: var(--gold); font-size: 17px; letter-spacing: 0.34em; margin-bottom: 10px; }
.chapter-head h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(38px, 5.6vw, 62px);
  line-height: 1.06;
  color: var(--navy);
  letter-spacing: -0.005em;
  max-width: 18ch;
  margin: 0 auto;
}
.dateline {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.24em;
}

/* gold chapter numeral mark */
.chapter-num {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 22px;
  letter-spacing: 0.1em;
}

/* epigraph */
.epigraph {
  margin: 0 auto 44px;
  max-width: 40ch;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(21px, 2.4vw, 26px);
  line-height: 1.4;
  color: var(--navy);
}
.epigraph::before {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 26px;
}
.epigraph cite {
  display: block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  font-style: normal;
  font-size: 13px;
  color: var(--muted);
}

/* body prose */
.prose p { margin: 0 0 1.25em; text-align: justify; text-wrap: pretty; hyphens: auto; }
.prose p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.1em;
  line-height: 0.82;
  float: left;
  padding: 0.08em 0.1em 0 0;
  color: var(--navy);
}

/* subheads inside chapters — centered with a gold hairline above (book-style) */
.prose h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(25px, 3vw, 30px);
  color: var(--navy);
  margin: 2.2em 0 0.6em;
  line-height: 1.15;
  text-align: center;
}
.prose h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto 18px;
}
.prose .sub-lead { font-family: var(--font-display); font-size: 20px; font-style: italic; color: var(--navy); }

/* pull quote — gold hairlines above and below (v3 refinement) */
.pullquote {
  margin: 2.2em auto;
  max-width: 36ch;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.3;
  color: var(--navy);
}
.pullquote::before, .pullquote::after {
  content: "";
  display: block;
  width: 44px;
  height: 1px;
  background: var(--gold);
  margin: 0 auto;
}
.pullquote::before { margin-bottom: 22px; }
.pullquote::after { margin-top: 22px; }

/* ============================================================
   THE PLATE MODULE — one image treatment for the whole book
   A plate renders an image under the unified navy duotone with a
   caption. One module owns the treatment; the variants set size and
   placement only.
   · .plate            full-width editorial plate
   · .plate-inset      small plate woven into prose (--left/--right floats)
   · .plate-breakout   full-width dramatic beat
   · .plate-grid       mosaic of several images
   Crop contract: .plate-portrait = 3:4 · .plate-landscape = 16:9 ·
                  no ratio modifier = the image's own ratio (never crop).
   Tone seam: .plate--natural removes the duotone (true color).
   Markup: <figure class="plate [ratio] [tone]"><div class="plate-frame">
           <img></div><figcaption>…</figcaption></figure>
   ============================================================ */

/* ---- shared frame ---- */
.plate .plate-frame,
.plate-inset .plate-frame,
.plate-breakout .plate-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--navy);
  display: block;
  margin: 0;
}

/* ---- shared image treatment (unified duotone) ---- */
.plate img,
.plate-inset img,
.plate-breakout img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(1) contrast(1.06) brightness(1.03);
  object-fit: cover;
  object-position: center;
}

/* ---- shared navy duotone overlay ---- */
.plate .plate-frame::after,
.plate-inset .plate-frame::after,
.plate-breakout .plate-frame::after,
.plate-grid .grid-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--navy);
  mix-blend-mode: color;
  opacity: 0.78;
  pointer-events: none;
}

/* ---- shared caption ---- */
.plate figcaption,
.plate-inset figcaption,
.plate-breakout figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--gold);
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  font-size: 13px;
  color: var(--muted);
}
.plate figcaption .credit,
.plate-inset figcaption .credit,
.plate-breakout figcaption .credit { color: var(--gold); }
.plate-inset figcaption { font-size: 12px; margin-top: 9px; padding-top: 8px; }

/* ---- crop contract — ratios opt in; absence means the image's own ratio ---- */
.plate-portrait img { aspect-ratio: 3 / 4; }
.plate-landscape img { aspect-ratio: 16 / 9; }
.plate.plate-landscape img { object-position: center 40%; }
.plate.plate-portrait img { object-position: center 18%; }

/* ---- variant sizes (the module's only per-variant differences) ---- */
.plate { margin: clamp(40px, 6vw, 60px) auto clamp(44px, 7vw, 72px); width: min(100%, 640px); }
.plate.plate-landscape { width: min(100%, 780px); }
.plate.plate-portrait { width: min(100%, 420px); }
.plate-inset { margin: clamp(34px, 5vw, 52px) auto; width: min(100%, 440px); }
.plate-inset.plate-portrait { width: min(100%, 320px); }
.plate-inset.plate-landscape { width: min(100%, 520px); }
.plate-tall { width: min(100%, 320px); } /* document scans: image's own ratio, never cropped */
.plate-breakout { margin: clamp(48px, 7vw, 80px) 0; width: 100%; }
.plate-breakout img { max-height: 70vh; object-position: center 38%; }

/* ============================================================
   MAGAZINE / BROCHURE IMAGE SYSTEM
   The reader starts on prose, meets a small image mid-paragraph,
   carries on, meets another between beats. Web-first, print-safe.
   All treatments live in THE PLATE MODULE above; these rules only
   float / collapse the inset variants.
   - .plate-inset--left / --right  float only on wide screens (collapse in print)
   - .plate-placeholder  clearly-marked slot for assets you supply later
   - .scrapbook-wall collage treatment (tape + polaroid + paper texture)
   ============================================================ */

/* on-image labels — figure annotations (named people in a photo),
   bottom-left / bottom-right; name in gold small-caps, role beneath,
   styled after the plate captions */
.plate-inset .fig-labels {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 8px 8px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(12, 21, 38, 0.55));
}
.plate-inset .fig-label {
  max-width: 62%;
  padding: 5px 8px;
  background: rgba(12, 21, 38, 0.78);
  border-top: 1px solid rgba(212, 175, 55, 0.65);
}
.plate-inset .fig-label b {
  display: block;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.3;
  color: var(--gold-soft);
}
.plate-inset .fig-label i {
  display: block;
  margin-top: 2px;
  font-family: var(--font-body);
  font-style: italic;
  font-variant: normal;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 9.5px;
  line-height: 1.35;
  color: rgba(245, 241, 232, 0.85);
}
.plate-inset .fig-label--right { text-align: right; }


/* float variants — wide screens only; print + narrow collapse to centered */
.plate-inset.plate-inset--left,
.plate-inset.plate-inset--right { width: min(46%, 320px); margin: 8px 0 22px; }
.plate-inset--left { float: left; margin-right: clamp(16px, 3vw, 34px); }
.plate-inset--right { float: right; margin-left: clamp(16px, 3vw, 34px); }
@media (min-width: 1100px) {
  .plate-inset--left, .plate-inset--right { width: 300px; }
}



/* every plate carries the same navy duotone — no full-color plates */

/* natural-color exemption — author/family identity images keep true color */
.plate--natural .plate-frame::after,
.plate-inset.plate--natural .plate-frame::after,
.plate-breakout.plate--natural .plate-frame::after { content: none; }
.plate--natural img,
.plate-inset.plate--natural img,
.plate-breakout.plate--natural img { filter: none; }

/* placeholder slot for assets supplied later */
.plate-placeholder {
  margin: clamp(36px, 5vw, 56px) auto;
  width: min(100%, 520px);
  border: 1px dashed rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.04);
  padding: 26px 24px;
  text-align: center;
  color: var(--muted);
}
.plate-placeholder .ph-label {
  display: block;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 8px;
}
.plate-placeholder .ph-note { font-size: 15px; line-height: 1.5; }

/* ============================================================
   TESTIMONIAL CARDS — verbatim testimonials as elegant
   typographic pull-quotes (no screenshots). On-brand
   navy/gold/cream, print-safe.
   ============================================================ */
.testimonial {
  margin: clamp(30px, 4.5vw, 48px) auto;
  width: min(100%, 640px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: clamp(22px, 3vw, 34px) clamp(24px, 3.4vw, 40px);
  position: relative;
}
.testimonial::before {
  content: "\201C";
  position: absolute;
  top: -0.12em;
  left: 0.18em;
  font-family: var(--font-display);
  font-size: clamp(72px, 11vw, 110px);
  line-height: 1;
  color: var(--gold);
  opacity: 0.20;
  pointer-events: none;
}
.testimonial .t-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(19px, 2.3vw, 24px);
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 16px;
  position: relative;
}
.testimonial .t-attr {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  font-size: 13px;
  color: var(--navy);
  border-top: 1px solid var(--gold);
  padding-top: 11px;
}
.testimonial .t-attr .t-name { color: var(--gold); font-weight: 600; }
.testimonial .t-attr .t-role { color: var(--muted); font-variant: normal; letter-spacing: 0.02em; text-transform: none; font-family: var(--font-body); font-size: 13px; }

/* ============================================================
   ENDORSEMENTS — verbatim testimonials distributed across the
   book as clearly-separated sections. Mixed layout: text-led
   (monogram) or split (text + portrait, alternating sides).
   Navy/gold/cream, two-serif rule preserved. Print-safe.
   ============================================================ */
.endorsement {
  margin: clamp(34px, 5vw, 56px) auto;
  width: min(100%, 720px);
  display: grid;
  gap: clamp(18px, 2.6vw, 30px);
  align-items: center;
}
.endorsement--split {
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .endorsement--split { grid-template-columns: 1.05fr 0.95fr; gap: clamp(26px, 3.4vw, 44px); }
  .endorsement--right .en-portrait { order: -1; }
}
.en-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: clamp(22px, 3vw, 34px) clamp(24px, 3.4vw, 40px);
  position: relative;
}
.en-body::before {
  content: "\201C";
  position: absolute;
  top: -0.10em; left: 0.16em;
  font-family: var(--font-display);
  font-size: clamp(72px, 11vw, 110px);
  line-height: 1; color: var(--gold); opacity: 0.20; pointer-events: none;
}
.en-eyebrow {
  font-family: var(--font-display);
  font-variant: small-caps; letter-spacing: 0.20em; text-transform: lowercase;
  font-size: 12px; color: var(--gold); margin: 0 0 12px;
}
.en-quote {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(18px, 2.2vw, 23px); line-height: 1.52; color: var(--ink);
  margin: 0 0 18px; position: relative;
}
.en-attr {
  display: flex; align-items: center; gap: 14px;
  border-top: 1px solid var(--gold); padding-top: 13px;
}
.en-mono {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.04em;
}
.en-attr .en-name {
  font-family: var(--font-display); font-variant: small-caps; letter-spacing: 0.14em;
  text-transform: lowercase; font-size: 13px; color: var(--navy);
}
.en-attr .en-name b { color: var(--gold); font-weight: 600; }
.en-attr .en-role {
  display: block; font-family: var(--font-body); font-variant: normal; text-transform: none;
  letter-spacing: 0.01em; font-size: 12.5px; color: var(--muted); margin-top: 2px;
}
.en-portrait figure, .en-portrait {
  margin: 0;
}
.en-portrait .plate-frame { box-shadow: none; }
.en-portrait img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--border);
  filter: grayscale(1) contrast(1.02);
}
.en-portrait figcaption {
  margin-top: 8px; font-family: var(--font-display); font-variant: small-caps;
  letter-spacing: 0.14em; text-transform: lowercase; font-size: 11.5px; color: var(--muted);
  text-align: center;
}
@media (prefers-reduced-data: reduce) {
  .en-portrait img { filter: none; }
}
@media print {
  .endorsement { width: 100%; break-inside: avoid; }
  .endorsement--split { grid-template-columns: 1fr; }
  .endorsement--right .en-portrait { order: 0; }
  .en-portrait img { filter: none; }
}

/* ============================================================

/* a stack of testimonials shares rhythm without double margins */
.testimonial + .testimonial { margin-top: clamp(18px, 2.4vw, 26px); }

/* ============================================================
   SCRAPBOOK WALL — collage treatment for personal sections
   (daughter letters, personal color memories). Tape + polaroid
   + paper texture + handwritten caption. Mirrors the ClarityOS
   collage aesthetic without the app wrapper.
   ============================================================ */
.scrapbook-wall {
  margin: clamp(34px, 5vw, 56px) auto;
  width: min(100%, 560px);
  position: relative;
  background-color: #f3ead7;
  background-image:
    radial-gradient(ellipse at 18% 22%, rgba(222, 184, 135, 0.20) 0%, transparent 52%),
    radial-gradient(ellipse at 82% 78%, rgba(212, 175, 120, 0.14) 0%, transparent 52%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid #e3d6ba;
}
.scrapbook-wall .sb-frames {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 2.5vw, 24px);
}
.scrapbook-wall .sb-frame {
  position: relative;
  background: #fff;
  border: 7px solid #fff;
  box-shadow: 0 8px 22px rgba(26, 45, 77, 0.18), 0 2px 6px rgba(0,0,0,0.10);
}
.scrapbook-wall .sb-frame:nth-child(1) { transform: rotate(-2.4deg); }
.scrapbook-wall .sb-frame:nth-child(2) { transform: rotate(1.8deg); }
.scrapbook-wall .sb-frame:nth-child(3) { transform: rotate(1.4deg); }
.scrapbook-wall .sb-frame:nth-child(4) { transform: rotate(-1.6deg); }
.scrapbook-wall .sb-frame img {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  filter: grayscale(1) contrast(1.05) brightness(1.04);
}
/* washi tape strip */
.scrapbook-wall .sb-frame::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 74px;
  height: 22px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 242, 200, 0.72);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  background-image: repeating-linear-gradient(90deg, transparent 0 3px, rgba(0,0,0,0.04) 3px 4px);
  z-index: 5;
}
.scrapbook-wall figcaption {
  margin-top: 16px;
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: clamp(20px, 3vw, 26px);
  color: #8a6a44;
  line-height: 1.15;
}

/* ============================================================
   Photo grid plate — several photos pulled from one source (a
   multi-image collage), arranged cleanly and sharing one caption.
   Markup: <figure class="plate plate-grid" style="--cols:3">
     <div class="grid-frames"><div class="grid-frame"><img></div>...</div>
     <figcaption>...</figcaption>
   </figure>
   ============================================================ */
.plate-grid { width: min(100%, 760px); }
.plate-grid .grid-frames {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: 6px;
}
.plate-grid .grid-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--navy);
  aspect-ratio: 4 / 3;
}
.plate-grid .grid-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: grayscale(1) contrast(1.06) brightness(1.03);
}

/* ---- scrapbook variant — warm, personal; no navy duotone, tape + tilt ---- */
.plate-grid.scrapbook .grid-frames { gap: 14px; padding: 6px; }
.plate-grid.scrapbook .grid-frame {
  aspect-ratio: 3 / 4;
  background: #fff;
  border: 8px solid #fff;
  box-shadow: 0 10px 26px rgba(26, 45, 77, 0.16);
}
.plate-grid.scrapbook .grid-frame img { filter: grayscale(1) contrast(1.05) brightness(1.04); }
.plate-grid.scrapbook .grid-frame::after { content: none; }
.plate-grid.scrapbook .grid-frame:nth-child(1) { transform: rotate(-2.2deg); }
.plate-grid.scrapbook .grid-frame:nth-child(2) { transform: rotate(1.6deg); }
.plate-grid.scrapbook .grid-frame:nth-child(3) { transform: rotate(1.1deg); }
.plate-grid.scrapbook .grid-frame:nth-child(4) { transform: rotate(-1.4deg); }

/* orientation-correction utility — apply directly to a misoriented <img> */
.img-rotate-180 { transform: rotate(180deg); }

/* ============================================================
   ClarityOS Code interlude — a distilled principle from the
   ClarityOS™ Codes archive, distributed across relevant chapters.
   Markup: <div class="code-interlude"><span class="code-label">
   ...</span><p class="code-quote">...</p><span class="code-credit">
   ...</span></div>
   ============================================================ */
.code-interlude {
  margin: 48px auto 0;
  max-width: 46ch;
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}
.code-interlude .code-label {
  display: block;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.26em;
  text-transform: lowercase;
  color: var(--gold);
  font-size: 12px;
  margin-bottom: 12px;
}
.code-interlude .code-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(19px, 2.2vw, 23px);
  line-height: 1.4;
  color: var(--navy);
  margin: 0;
}
.code-interlude .code-credit {
  display: block;
  margin-top: 12px;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--muted);
  font-size: 12px;
}

/* gold ornament divider */
.ornament {
  display: block;
  width: 120px;
  height: 22px;
  margin: 48px auto;
  opacity: 0.85;
}
.ornament svg { width: 100%; height: 100%; display: block; }

/* ============================================================
   Framework Spotlight — the recurring navy "product" moment
   ============================================================ */
.spotlight {
  margin: 52px 0;
  background: var(--navy);
  color: var(--navy-ink);
  border-top: 3px solid var(--gold);
  padding: clamp(26px, 4vw, 44px) clamp(24px, 5vw, 48px);
  position: relative;
}
.spot-label {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.3em;
  margin-bottom: 14px;
}
.spotlight h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.1;
  margin-bottom: 14px;
}
.spotlight .quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 21px;
  line-height: 1.4;
  color: var(--gold-soft);
  margin-bottom: 18px;
}
.spotlight p { font-size: 17px; line-height: 1.62; color: rgba(245, 241, 232, 0.92); }
.spotlight .meta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
  font-size: 15px;
  color: rgba(245, 241, 232, 0.78);
}
.spotlight .meta strong { color: var(--gold); font-weight: 600; letter-spacing: 0.04em; }

/* ============================================================
   Prev / contents / next footer
   ============================================================ */
.foot-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 64px 0 8px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.foot-nav a { color: var(--navy); text-decoration: none; }
.foot-nav a:hover { color: var(--gold); }
.foot-nav .dir { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.foot-nav .prev { text-align: left; }
.foot-nav .next { text-align: right; }
.foot-nav .contents {
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 9px 14px;
  border-radius: 999px;
}
.foot-nav .contents:hover { border-color: var(--gold); color: var(--navy); }

/* ============================================================
   Home / landing page — The Two-Worlds Cover
   A gold horizon seam divides the cover into two worlds. Above:
   the title, with “to” as a gold bridge. On the seam: the
   sun-and-crescent disc. Below: the natural-color portrait plate.
   Tokens locked to brand-spec.md — navy/gold/cream, two serifs.
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background:
    radial-gradient(920px 460px at 50% 4%, rgba(212, 175, 55, 0.15), transparent 62%),
    linear-gradient(168deg, #0e1930 0%, var(--navy) 50%, #1b3055 100%);
  color: var(--navy-ink);
  padding: clamp(44px, 6vw, 76px) 24px clamp(34px, 4.5vw, 52px);
}
/* grain + lower vignette */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 62% at 50% 102%, rgba(12, 21, 38, 0.55), transparent 68%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  opacity: 0.85;
}
/* bottom trim hairline */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5) 16%, rgba(212, 175, 55, 0.5) 84%, transparent);
  pointer-events: none;
}

/* ---- atmosphere: compass rings + diamond stars ---- */
.hero-atmos { position: absolute; inset: 0; pointer-events: none; }
.hero-rings::before, .hero-rings::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(212, 175, 55, 0.10);
  border-radius: 50%;
}
.hero-rings::before { width: 440px; height: 440px; top: 0; right: -150px; }
.hero-rings::after  { width: 300px; height: 300px; top: 9%; right: -80px; opacity: 0.7; }
.hero-star {
  position: absolute;
  background: var(--gold);
  transform: rotate(45deg);
  opacity: 0.6;
  animation: star-twinkle 4.6s ease-in-out infinite;
}
.hero-star.star-1 { width: 9px; height: 9px; top: 13%; left: 10%; }
.hero-star.star-2 { width: 6px; height: 6px; top: 23%; left: 89%; animation-delay: 1.7s; }

/* ---- top strip: imprint lockup + overline ---- */
.hero-strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 1180px;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.24em;
  text-transform: lowercase;
  color: rgba(245, 241, 232, 0.7);
  font-size: 13px;
}
.imprint {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.imprint-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 42%;
  border: 1px solid rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.08);
  background: #0f1a2e;
  flex-shrink: 0;
}
.imprint-name {
  display: block;
  color: var(--gold-soft);
  font-size: 15px;
  letter-spacing: 0.28em;
  line-height: 1.25;
}
.imprint-tag {
  display: block;
  margin-top: 3px;
  font-family: var(--font-body);
  font-variant: normal;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.03em;
  color: rgba(245, 241, 232, 0.6);
  font-size: 12.5px;
}
.hero-overline {
  color: var(--gold-soft);
  font-size: 13px;
  letter-spacing: 0.3em;
  line-height: 1.5;
  text-align: right;
}

/* ---- the sky world: title, with “to” as the bridge ---- */
.hero-title {
  position: relative;
  z-index: 2;
  margin-top: clamp(46px, 6vw, 78px);
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
}
.hero-title .tl {
  display: block;
  font-size: clamp(44px, 8.2vw, 112px);
  line-height: 0.98;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.hero-title .tl-to { margin-top: 0.1em; }
.bridge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 26px);
  max-width: min(80vw, 620px);
  margin: clamp(8px, 1.4vw, 16px) auto 0;
}
.bridge-word {
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
  font-size: clamp(26px, 3.6vw, 46px);
  line-height: 1;
  letter-spacing: 0.05em;
  padding: 0 2px;
  white-space: nowrap;
}
.bridge-rule {
  flex: 1 1 0;
  min-width: 44px;
  height: 1px;
}
.bridge-rule:first-child { background: linear-gradient(90deg, transparent, var(--gold)); }
.bridge-rule:last-child  { background: linear-gradient(90deg, var(--gold), transparent); }
.hero-author {
  position: relative;
  z-index: 2;
  margin-top: clamp(22px, 2.8vw, 32px);
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.38em;
  text-transform: lowercase;
  color: var(--gold-soft);
  font-size: clamp(15px, 1.9vw, 19px);
}

/* ---- the seam: sun-and-crescent disc on the world-line ---- */
.world-line {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1180px;
  margin-top: clamp(38px, 5vw, 58px);
}
.wl-rule {
  flex: 1 1 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.9) 7%, rgba(212, 175, 55, 0.9) 93%, transparent);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.22);
}
.disc {
  flex: 0 0 auto;
  width: clamp(96px, 12vw, 128px);
  height: clamp(96px, 12vw, 128px);
  margin: 0 clamp(18px, 3vw, 34px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #16263f 0%, #0e1930 72%);
  box-shadow:
    0 0 0 8px rgba(212, 175, 55, 0.06),
    0 0 34px rgba(212, 175, 55, 0.24);
}

/* ---- the grounded world: portrait plate ---- */
.hero-plate {
  position: relative;
  z-index: 2;
  width: min(252px, 54vw);
  margin: clamp(36px, 5vw, 54px) auto 0;
}
.hero-plate-frame {
  position: relative;
  border: 1px solid rgba(212, 175, 55, 0.7);
  padding: 10px;
  background: rgba(212, 175, 55, 0.05);
}
.hero-plate-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  pointer-events: none;
}
.hero-plate img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 8;
  object-fit: cover;
  object-position: center 18%;
  filter: contrast(1.03) saturate(0.92);
}

.status-pill {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin-top: clamp(26px, 3.6vw, 40px);
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: var(--gold-soft);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.18em;
  background: rgba(212, 175, 55, 0.07);
}

/* ---- bottom strip: the book's tail band ---- */
.hero-strip--bottom {
  justify-content: center;
  margin-top: clamp(28px, 4vw, 44px);
}
.hero-award {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.26em;
  text-transform: lowercase;
  color: rgba(245, 241, 232, 0.58);
  font-size: 12px;
  line-height: 1.8;
  max-width: 48ch;
}

/* wide screens: fill the viewport and center the two worlds */
@media (min-width: 900px) {
  .hero {
    min-height: calc(100vh - 60px);
    min-height: calc(100svh - 60px);
    justify-content: center;
  }
}

/* section shell on home */
.section { max-width: 1060px; margin: 0 auto; padding: clamp(56px, 8vw, 96px) 24px; }
.section-head { text-align: center; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head .eyebrow { margin-bottom: 12px; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.05;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
.section-head .lede {
  max-width: 54ch;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* blurb */
.blurb { max-width: 64ch; margin: 0 auto; }
.blurb p { margin-bottom: 1.25em; text-align: justify; text-wrap: pretty; hyphens: auto; color: var(--ink); }
.blurb .lead {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.4vw, 24px);
  line-height: 1.45;
  color: var(--navy);
  text-align: left;
  hyphens: manual;
}

/* dedication */
.dedication {
  background:
    radial-gradient(700px 280px at 50% 0%, rgba(212, 175, 55, 0.12), transparent 65%),
    var(--navy);
  color: var(--navy-ink);
  text-align: center;
  padding: clamp(56px, 8vw, 96px) 24px;
  position: relative;
}
.dedication-inner { max-width: 560px; margin: 0 auto; }
.dedication .ornament { opacity: 1; margin-bottom: 28px; }
.dedication h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.25;
  color: #fff;
  margin-bottom: 20px;
  text-wrap: balance;
}
.dedication p { color: rgba(245, 241, 232, 0.82); font-size: 18px; line-height: 1.55; max-width: 42ch; margin: 0 auto; }

/* TOC parts */
.toc { display: grid; gap: 18px; }
.part-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(18px, 3vw, 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: clamp(24px, 4vw, 36px);
  transition: border-color 280ms var(--ease), box-shadow 280ms var(--ease);
}
.part-card:hover {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--border));
  box-shadow: 0 10px 36px rgba(26, 45, 77, 0.05);
}
.part-card .roman {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(42px, 6vw, 60px);
  color: var(--gold);
  line-height: 1;
  min-width: 0.9em;
}
.part-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 3.2vw, 30px);
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 4px;
}
.part-card .part-theme {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: var(--gold);
  font-size: 13px;
}
.part-card .part-when {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  margin: 10px 0 14px;
}
.part-card .part-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--muted);
  margin-bottom: 18px;
  padding-left: 14px;
  border-left: 2px solid var(--gold);
}
.part-card ul { list-style: none; }
.part-card li { border-top: 1px solid var(--border); }
.part-card li a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 4px;
  text-decoration: none;
  color: var(--ink);
}
.part-card li a:hover { color: var(--navy); }
.part-card li a:hover .ch { color: var(--gold); }
.part-card .ch {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.part-card .ch-title { font-size: 18px; line-height: 1.3; }
.part-card li .ch-title b { font-weight: 600; color: var(--navy); }

/* Pyramid Operating System diagram */
.pyramid-diagram {
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.pyr-tier {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  padding: 22px 26px;
  transition: border-color 280ms var(--ease), box-shadow 280ms var(--ease);
}
.pyr-tier:hover {
  border-left-color: var(--gold-soft);
  box-shadow: 0 10px 36px rgba(26, 45, 77, 0.05);
}
.pyr-label {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.28em;
  text-transform: lowercase;
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 14px;
}
.pyr-playbooks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pb-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--navy);
  font-family: var(--font-display);
  font-variant: small-caps;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  transition: background 240ms var(--ease), color 240ms var(--ease);
}
.pb-chip:hover {
  background: rgba(212, 175, 55, 0.14);
  color: var(--navy);
}
.pyr-signature {
  margin: 42px 0 16px;
  padding: 26px;
  background: var(--navy);
  color: var(--navy-ink);
  border-radius: 12px;
  text-align: center;
}
.pyr-signature-inner { max-width: 620px; margin: 0 auto; }
.pyr-sig-label {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.24em;
  text-transform: lowercase;
  color: var(--gold-soft);
  font-size: 13px;
  display: block;
  margin-bottom: 8px;
}
.pyr-sig-tagline {
  color: rgba(245, 241, 232, 0.88);
  font-size: 16px;
  line-height: 1.5;
  font-style: italic;
}

/* appendix OS sections */
.appendix { display: grid; gap: 44px; }
.pyr-os-section {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.pyr-os-section:first-child { border-top: none; }
.pyr-os-section h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 28px);
  color: var(--navy);
  margin-bottom: 10px;
}
.pyr-os-section h3 em {
  font-style: italic;
  color: var(--muted);
  font-weight: 400;
}
.pyr-os-section .fw-what,
.pyr-os-section .fw-quote,
.pyr-os-section p { font-size: 15px; line-height: 1.55; }
.pyr-os-section .fw-quote { font-family: var(--font-display); font-style: italic; color: var(--muted); margin-bottom: 8px; }
.pyr-playbook {
  margin-top: 24px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
}
.pyr-playbook h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--navy);
  margin-bottom: 6px;
}
.pyr-playbook .fw-quote { font-size: 14px; }
.pyr-playbook .fw-what { font-size: 14px; }

/* editorial review strip */
.review-strip {
  background:
    radial-gradient(640px 240px at 50% 100%, rgba(212, 175, 55, 0.1), transparent 70%),
    var(--navy);
  color: var(--navy-ink);
  padding: clamp(48px, 7vw, 72px) 24px;
  text-align: center;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
}
.review-strip-inner { max-width: 600px; margin: 0 auto; }
.review-strip h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.6vw, 36px);
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.review-strip p { color: rgba(245, 241, 232, 0.86); font-size: 17px; line-height: 1.55; margin-bottom: 22px; text-wrap: pretty; }
.review-strip .meta-row { font-family: var(--font-display); font-variant: small-caps; letter-spacing: 0.18em; text-transform: lowercase; color: var(--gold-soft); font-size: 13px; line-height: 2.1; }
.review-strip a { color: var(--gold-soft); text-underline-offset: 3px; }

/* misc */
.note {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  margin-top: 26px;
}
a.back-contents {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
a.back-contents:hover { color: var(--gold); }

/* ============================================================
   Motion system — reading progress, chapter reveals, hovers.
   Quiet, serving reading: 200–700ms, --ease only.
   ============================================================ */

/* ---- reading progress bar (child of sticky .book-head) ---- */
.reading-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transform: scaleX(0);
  transform-origin: 0 0;
  pointer-events: none;
  z-index: 30;
}

/* ---- chapter-head entrance cascade ---- */
@keyframes book-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chapter-head > *,
.chapter-head + .epigraph {
  opacity: 0;
  animation: book-rise 700ms var(--ease) forwards;
}
.chapter-head > *:nth-child(1) { animation-delay: 60ms; }
.chapter-head > *:nth-child(2) { animation-delay: 150ms; }
.chapter-head > *:nth-child(3) { animation-delay: 240ms; }
.chapter-head > *:nth-child(4) { animation-delay: 330ms; }
.chapter-head + .epigraph { animation-delay: 460ms; }

/* ---- cover hero cascade (home) — one orchestrated load ----
   1  top strip fades down   2  title lines rise in sequence
   3  the world-line draws   4  the disc settles on the seam
   5  the portrait plate rises  6  pill + tail band settle */
.hero-strip--top,
.hero-title .tl,
.hero-title .bridge,
.hero-author,
.hero-plate,
.status-pill,
.hero-strip--bottom {
  opacity: 0;
  animation: book-rise 800ms var(--ease) forwards;
}
.hero-strip--top     { animation-delay: 140ms; }
.hero-title .tl-from { animation-delay: 300ms; }
.hero-title .bridge  { animation-delay: 420ms; }
.hero-title .tl-to   { animation-delay: 540ms; }
.hero-author         { animation-delay: 660ms; }
.hero-plate          { animation-delay: 820ms; }
.status-pill         { animation-delay: 980ms; }
.hero-strip--bottom  { animation-delay: 1100ms; }

/* the seam reveals as a fade, then its line draws and the disc settles */
.world-line {
  opacity: 0;
  animation: fade-in 600ms var(--ease) 600ms forwards;
}
.wl-rule {
  animation: rule-draw 1150ms var(--ease) 620ms both;
  transform-origin: left center;
}
.wl-rule:last-child { transform-origin: right center; }
.disc {
  animation:
    book-rise 700ms var(--ease) 760ms backwards,
    disc-breathe 6.5s ease-in-out 1.6s infinite;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes rule-draw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes star-twinkle {
  0%, 100% { opacity: 0.22; transform: rotate(45deg) scale(0.82); }
  50%      { opacity: 0.8;  transform: rotate(45deg) scale(1); }
}
@keyframes disc-breathe {
  0%, 100% { box-shadow: 0 0 0 7px rgba(212, 175, 55, 0.05), 0 0 24px rgba(212, 175, 55, 0.16); }
  50%      { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0.10), 0 0 48px rgba(212, 175, 55, 0.3); }
}

/* ---- gold underline sweeps ---- */
.book-head a,
.foot-nav .prev,
.foot-nav .next,
a.back-contents {
  position: relative;
}
.book-head a::after,
.foot-nav .prev::after,
.foot-nav .next::after,
a.back-contents::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 320ms var(--ease);
}
.book-head a:hover::after,
.foot-nav .prev:hover::after,
.foot-nav .next:hover::after,
a.back-contents:hover::after {
  transform: scaleX(1);
}

/* TOC rows — gold underline sweeps under the chapter title */
.part-card li a .ch-title b {
  position: relative;
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: left bottom;
  transition: background-size 360ms var(--ease), color 200ms var(--ease);
}
.part-card li a:hover .ch-title b {
  background-size: 100% 1px;
}

/* ---- scroll reveals (applied only when JS is on) ---- */
.js-enabled .spotlight,
.js-enabled .pullquote,
.js-enabled .prose h2,
.js-enabled .part-card,
.js-enabled .plate {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}
.js-enabled .is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* pb-chip transitions live with .pb-chip base styles above */

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 700px) {
  body { font-size: 17.5px; }
  .book-head-meta { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .book-head-title { letter-spacing: 0.1em; font-size: 13px; }
  .foot-nav { grid-template-columns: 1fr 1fr; }
  .foot-nav .contents { display: none; }
  .part-card { grid-template-columns: 1fr; }
  .part-card .roman { font-size: 44px; }
  .hero-overline { display: none; }
  .imprint-tag { display: none; }
  .imprint-mark { width: 44px; height: 44px; }
  .hero-award { letter-spacing: 0.2em; font-size: 11px; }
  .hero-star.star-1 { top: 9%; left: 7%; }
  .hero-star.star-2 { top: 18%; left: 91%; }
  .blurb p { text-align: left; hyphens: manual; }
  .prose p { text-align: left; hyphens: manual; }
}

/* selection + image defaults */
::selection {
  background: color-mix(in srgb, var(--gold) 35%, transparent);
  color: var(--navy);
}
img { max-width: 100%; height: auto; }

.listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 0;
  padding: 8px 18px 8px 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent);
  background:
    radial-gradient(circle at 18px 50%, rgba(212, 175, 55, 0.16), transparent 55%),
    transparent;
  color: var(--navy);
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.22em;
  font-size: 14px;
  cursor: pointer;
  border-radius: 999px;
  transition: color 280ms var(--ease), border-color 280ms var(--ease), box-shadow 280ms var(--ease);
}
.listen-btn::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.14);
}
.listen-btn:hover {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 10px 28px rgba(26, 45, 77, 0.08);
}
.listen-solo {
  display: inline-flex;
  align-items: center;
  margin: 22px 0 0 14px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.22em;
  font-size: 14px;
}
.listen-solo:hover { color: var(--gold); }
.listen-btn[aria-pressed="true"] {
  color: var(--gold);
  border-color: var(--gold);
}
.listen-btn[aria-pressed="true"]::before {
  animation: listen-pulse 2.6s var(--ease) infinite;
}
@keyframes listen-pulse {
  0%, 100% { box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.16); }
  50% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0.05); }
}

.audio-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  width: min(920px, calc(100% - 28px));
  z-index: 40;
  transform: translate(-50%, 140%);
  transition: transform 520ms var(--ease);
}
.audio-bar.visible { transform: translate(-50%, 0); }
.audio-bar-glow {
  position: absolute;
  inset: -18px 8% auto;
  height: 48px;
  background: radial-gradient(ellipse at 50% 100%, rgba(212, 175, 55, 0.22), transparent 70%);
  pointer-events: none;
}
.audio-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px 14px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(35, 57, 95, 0.55), transparent 40%),
    rgba(15, 26, 46, 0.92);
  box-shadow:
    0 22px 50px rgba(10, 16, 28, 0.38),
    inset 0 1px 0 rgba(246, 231, 171, 0.12);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  color: var(--navy-ink);
}
.audio-bar-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.audio-play {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f6e7ab, var(--gold) 46%, #9a7b1c);
  border: 0;
  color: var(--navy);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  box-shadow: 0 0 0 1px rgba(246, 231, 171, 0.35), 0 8px 20px rgba(212, 175, 55, 0.22);
}
.audio-play-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.35);
  opacity: 0;
}
.audio-bar.is-playing .audio-play-ring {
  animation: listen-pulse 2.6s var(--ease) infinite;
  opacity: 1;
}
.audio-info { flex: 1; min-width: 0; }
.audio-kicker {
  display: block;
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 2px;
}
.audio-chapter {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #f5f1e8;
  line-height: 1.2;
}
.audio-line {
  display: block;
  margin: 6px 0 8px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  line-height: 1.35;
  color: rgba(246, 231, 171, 0.86);
  max-height: 2.7em;
  overflow: hidden;
}
.audio-line[hidden] { display: none; }
.audio-progress-wrap {
  width: 100%;
  height: 3px;
  background: rgba(245, 241, 232, 0.12);
  border-radius: 99px;
  cursor: pointer;
}
.audio-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #9a7b1c, var(--gold), #f6e7ab);
  border-radius: 99px;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
}
.audio-time {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(245, 241, 232, 0.5);
}
.audio-speeds {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.35);
}
.audio-speeds-label {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--gold);
  padding: 0 8px 0 10px;
}
.audio-speed {
  min-width: 38px;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: rgba(245, 241, 232, 0.68);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 6px 8px;
}
.audio-speed:hover { color: var(--gold); }
.audio-speed.is-active,
.audio-speed[aria-pressed="true"] {
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold);
}
.audio-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.audio-skip, .audio-mute, .audio-next, .audio-follow {
  background: transparent;
  border: 1px solid rgba(245, 241, 232, 0.14);
  border-radius: 999px;
  color: rgba(245, 241, 232, 0.72);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  text-decoration: none;
  line-height: 1.2;
}
.audio-skip:hover, .audio-mute:hover, .audio-next:hover, .audio-follow:hover {
  color: var(--gold);
  border-color: rgba(212, 175, 55, 0.4);
}
.audio-mute { min-width: 34px; }
.audio-volume {
  width: 64px;
  accent-color: var(--gold);
  cursor: pointer;
}
.audio-next { color: var(--gold); }
.audio-follow[aria-pressed="true"] { color: var(--gold); border-color: rgba(212, 175, 55, 0.45); }
.can-seek { cursor: pointer; }

body.audio-playing .prose p,
body.audio-playing .prose h2 {
  transition: opacity 480ms var(--ease), filter 480ms var(--ease);
  opacity: 0.38;
}
body.audio-playing .prose p.is-listening,
body.audio-playing .prose h2.is-listening {
  opacity: 1;
  filter: none;
}
.prose p.is-listening,
.prose h2.is-listening,
.chapter-head h1.is-listening {
  scroll-margin-top: 96px;
  scroll-margin-bottom: 160px;
}
.prose p.is-listening {
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 18%, transparent), transparent 82%);
  box-shadow: inset 3px 0 0 var(--gold);
}
.prose h2.is-listening { color: color-mix(in srgb, var(--gold) 50%, var(--navy)); }
.chapter-head h1.is-listening { color: color-mix(in srgb, var(--gold) 36%, var(--navy)); }
.pullquote.is-listening,
.epigraph.is-listening {
  color: color-mix(in srgb, var(--gold) 28%, var(--navy));
}
.pullquote.is-listening::before,
.pullquote.is-listening::after,
.epigraph.is-listening::before {
  width: 72px;
  background: var(--gold);
}
.spotlight.is-listening {
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.45);
}

@media (max-width: 760px) {
  .audio-bar { bottom: 10px; width: calc(100% - 16px); }
  .audio-bar-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 14px 12px;
  }
  .audio-speeds { order: 3; flex: 1 1 100%; justify-content: space-between; }
  .audio-controls { order: 4; width: 100%; }
  .audio-volume { width: 52px; }
  .audio-chapter { font-size: 16px; }
}
body.audio-visible { padding-bottom: 168px; }

@media (prefers-reduced-motion: reduce) {
  .listen-btn[aria-pressed="true"]::before,
  .audio-bar.is-playing .audio-play-ring { animation: none; }
  body.audio-playing .prose p,
  body.audio-playing .prose h2 { transition: none; }
}

@media print {
  .listen-btn, .audio-bar { display: none !important; }
}

@media print {
  body { background: #fff; font-size: 12pt; }
  .book-head { position: static; }
  .chapter { max-width: 100%; }
  .spotlight { break-inside: avoid; }
  .foot-nav, .book-foot { display: none; }
  .reading-progress { display: none; }
  .chapter-head > *, .chapter-head + .epigraph,
  .hero-strip--top, .hero-title .tl, .hero-title .bridge, .hero-author,
  .world-line, .wl-rule, .disc, .hero-plate, .status-pill,
  .hero-strip--bottom { opacity: 1 !important; transform: none !important; animation: none !important; }
  .js-enabled .spotlight, .js-enabled .pullquote,
  .js-enabled .prose h2, .js-enabled .part-card,
  .js-enabled .plate { opacity: 1 !important; transform: none !important; }
  /* print safety: collapse floats + breakouts to centered blocks */
  .plate-inset--left, .plate-inset--right { float: none !important; width: min(100%, 440px) !important; margin: 40px auto !important; }
  .plate-breakout { width: 100% !important; margin: 40px auto !important; }
  .plate-placeholder, .scrapbook-wall, .plate-inset { break-inside: avoid; }
}

/* narrow screens: floats collapse to centered insets */
@media (max-width: 700px) {
  .plate-inset--left, .plate-inset--right { float: none; width: min(100%, 440px); margin: 34px auto; }
  .plate-inset--left, .plate-inset--right { float: none !important; }
  .scrapbook-wall .sb-frames { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chapter-head > *, .chapter-head + .epigraph,
  .hero-strip--top, .hero-title .tl, .hero-title .bridge, .hero-author,
  .world-line, .wl-rule, .disc, .hero-plate, .status-pill,
  .hero-strip--bottom { opacity: 1 !important; transform: none !important; }
  .js-enabled .spotlight, .js-enabled .pullquote,
  .js-enabled .prose h2, .js-enabled .part-card,
  .js-enabled .plate { opacity: 1 !important; transform: none !important; }
}
