/* Crafting Error — shared typography + register tokens
   Inherits site fonts (Syne / Questrial) for chrome.
   Body + display overrides honor the book's own typography. */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;700;800&family=Questrial&family=DM+Serif+Display:ital@1&display=swap');

:root {
  /* --- Site convention layer (override surface) --- */
  --bg:           #f5f0e6;          /* cream paper */
  --bg-elevated:  #ebe5d6;
  --bg-card:      #ffffff;
  --accent:       #c92424;          /* book's crimson swatch */
  --accent-dim:   #8a1a1a;
  --text:         #0a0a0a;
  --text-dim:     #4a4a4a;
  --text-faint:   #8a8a8a;
  --border:       #d8d2c2;

  /* --- Crafting Error specific tokens --- */
  --display: 'DM Serif Display', 'Plantin MT Pro', Georgia, serif;
  --body:    'Helvetica Neue', Helvetica, Arial, sans-serif;       /* book-faithful */
  --chrome:  'Questrial', 'Helvetica Neue', sans-serif;            /* site chrome */
  --site-head: 'Syne', 'Helvetica Neue', sans-serif;               /* shared with renato.design */

  /* --- The .indd's 11-swatch palette, exposed for register-skinning --- */
  --ink-blue:    #001e91;
  --ink-magenta: #e8008a;
  --ink-red:     #c92424;
  --ink-yellow:  #ffea00;
  --ink-cyan:    #00a5dc;
  --ink-green:   #55af4b;
  --ink-orange:  #f59123;
  --paper:       #f5f0e6;
  --ink-black:   #0a0a0a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--body);
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  opacity: 0;
  animation: page-fade-in 600ms ease-out 80ms forwards;
}
@keyframes page-fade-in {
  to { opacity: 1; }
}

/* Drop caps: subtle entrance — slight scale + opacity ease */
.dropcap, .ce-body .dropcap, .ti-body .dropcap, .cu-body .dropcap,
.je-body .dropcap, .me-body .dropcap, .pi-body .dropcap,
.ca-body .dropcap, .or-body .dropcap, .bs-col .dropcap {
  animation: dropcap-in 720ms cubic-bezier(0.2, 0.7, 0.2, 1) 200ms backwards;
}
@keyframes dropcap-in {
  from { opacity: 0; transform: scale(0.86) translateY(0.08em); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Orphan prevention — applies sitewide.
   Headings never break inside words. Paragraphs avoid widows/orphans. */
h1, h2, h3, h4, h5, h6,
.v-mark, .ce-title, .ti-title, .cu-title, .je-title,
.me-title, .pi-title, .ca-title, .toc-mark, .cover-mark {
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  -webkit-hyphens: none;
}
p {
  text-wrap: pretty;
  orphans: 2;
  widows: 2;
}

/* Body prose defaults to ragged-right on the web. Justified narrow-measure
   text creates river-tearing. Keep ragged unless a specific register
   explicitly asks for justify. */
.opener-body, .bs-col, .ce-body, .ti-body, .cu-body, .je-body,
.me-body, .pi-body, .ca-body, .or-body, .v-body {
  text-align: left;
  hyphens: none;
  -webkit-hyphens: none;
}

/* Responsive collapse — at <720px, 2-column patterns fall to 1-column */
@media (max-width: 720px) {
  .scene.verse, .scene.opener, .scene.body-spread,
  .scene.opener-cl, .scene.body-spread-cl, .scene.body {
    grid-template-columns: 1fr !important;
    padding-left: 6vw;
    padding-right: 6vw;
  }
  .v-title, .v-body, .ce-body, .cu-body, .je-body,
  .me-body, .ti-body, .opener-body-wrap {
    grid-column: 1 / -1 !important;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }
  .opener-body-wrap {
    position: static;
    width: auto;
    margin-top: 4vh;
  }
  .opener-photo {
    position: relative;
    height: 50vh;
  }
  .bs-imgwrap { float: none; width: 100%; margin: 1em 0; shape-outside: none; }
  .or-stage, .cu-body-stage, .ca-body-stage {
    grid-template-columns: 1fr !important;
  }
  .or-marginal, .cu-marginal { display: none; }
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===================================================================== */
/* WORDMARK — layered/ghost trick (Crafting Error's signature)           */
/* ===================================================================== */
.wordmark {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  line-height: 0.9;
  position: relative;
  display: inline-block;
  color: currentColor;
  letter-spacing: -0.01em;
}
.wordmark::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  color: transparent;
  -webkit-text-stroke: 1px currentColor;
  opacity: 0.5;
  transform: translate(6px, 5px);
  pointer-events: none;
  transition: transform 240ms ease-out, opacity 240ms ease-out;
}
.wordmark:hover::after {
  transform: translate(10px, 8px);
  opacity: 0.7;
}

/* Pinned page wordmark — small, top-left */
.page-wordmark {
  position: fixed;
  top: 24px;
  left: 28px;
  font-size: 22px;
  z-index: 100;
  color: currentColor;
  mix-blend-mode: difference;
}
.page-wordmark .wordmark::after {
  transform: translate(2px, 2px);
  -webkit-text-stroke: 0.5px currentColor;
}

/* ===================================================================== */
/* GENRE TAG — small label, lowercase, site convention                    */
/* ===================================================================== */
.genre-tag {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--accent);
  display: inline-block;
}

/* ===================================================================== */
/* BREADCRUMB top-strip                                                   */
/* No opaque backdrop. Each page declares its chrome color via            */
/* --chrome-fg / --chrome-halo on body. Default = light-on-dark.          */
/* ===================================================================== */
/* Chrome color is per-scene: light on dark substrates, dark on light.
   The IntersectionObserver in nav.js flips body.chrome-dark based on
   the scene's data-chrome attribute. */
:root            { --chrome-fg: rgba(255,255,255,0.95); }
body.chrome-dark { --chrome-fg: rgba(15,15,15,0.85); }

.breadcrumb {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 18px 28px;
  font-family: var(--chrome);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chrome-fg);
  z-index: 100;
  pointer-events: none;
  transition: color 220ms ease-out;
}
.breadcrumb > * { pointer-events: auto; }
.breadcrumb .crumb-mark {
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--chrome-fg);
}
.breadcrumb .crumb-mark .wordmark::after {
  transform: translate(2px, 2px);
  -webkit-text-stroke: 0.5px currentColor;
  opacity: 0.45;
}
.breadcrumb .crumb-sep { opacity: 0.5; }
.breadcrumb .crumb-toc { color: inherit; opacity: 0.85; }
.breadcrumb .crumb-toc:hover { opacity: 1; text-decoration: underline; }

/* ===================================================================== */
/* SECTION STRIP — bottom prev/next                                       */
/* ===================================================================== */
.section-strip {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 64px 14px 28px;
  font-family: var(--chrome);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chrome-fg);
  z-index: 100;
  pointer-events: none;
  transition: color 220ms ease-out;
}
.section-strip > * { pointer-events: auto; }
.section-strip a { color: inherit; }
.section-strip .strip-toc { opacity: 0.78; }

/* ===================================================================== */
/* RAIL — right-edge vertical nav, always visible. PRIMARY navigation.    */
/* Roman-numeral glyphs in the rail, full section name expands on hover.  */
/* ===================================================================== */
.rail {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  z-index: 101;
  user-select: none;
}
.rail-item, .rail-toc {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 26px;
  padding: 0 6px;
  color: var(--chrome-fg);
  text-decoration: none;
  position: relative;
  border-right: 1px solid transparent;
  transition: border-color 220ms ease-out, color 220ms ease-out;
}
.rail-glyph {
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  line-height: 1;
  min-width: 28px;
  text-align: right;
  opacity: 0.85;
  transition: opacity 220ms ease-out;
}
.rail-name {
  font-family: var(--chrome);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  max-width: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 280ms ease-out, max-width 320ms ease-out;
}
.rail-toc .rail-glyph { font-style: normal; font-size: 14px; }
.rail-cover .rail-glyph { font-size: 16px; }
.rail-divider {
  display: block;
  width: 18px;
  height: 1px;
  margin: 6px 6px 6px auto;
  background: var(--chrome-fg);
  opacity: 0.55;
}
.rail:hover .rail-divider { opacity: 0.9; }
.rail-item.current .rail-glyph { opacity: 1; }
.rail-item.current { border-right: 2px solid currentColor; }
.rail-item.current::before {
  /* Solid currentColor + a thin contrasting halo. mix-blend-mode:
     difference failed against photographic substrates (Chat caught
     this on Jewelry); explicit color + halo reads against anything. */
  content: '';
  position: absolute;
  right: -3px; top: 50%;
  width: 5px; height: 5px;
  margin-top: -2.5px;
  background: currentColor;
  border-radius: 50%;
  box-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.42),
    0 0 6px rgba(255, 255, 255, 0.18);
}
body.chrome-dark .rail-item.current::before {
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.55),
    0 0 6px rgba(0, 0, 0, 0.32);
}
/* Hover ANY rail item → ALL items expand to show their names */
.rail:hover .rail-name,
.rail:focus-within .rail-name {
  opacity: 1;
  max-width: 280px;
  padding-left: 0;
}
.rail:hover .rail-glyph { opacity: 1; }
.rail:hover .rail-item.current .rail-glyph { opacity: 1; }

/* When the rail expands, it gets its own dark panel + forced light text
   so it's readable regardless of whatever body bg is revealed in the
   right-side gutter when the body shifts left. Collapsed rail stays
   minimal (no backdrop, color from chrome-fg). */
.rail:hover {
  background: rgba(14, 14, 20, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 18px 16px 18px 22px;
  border-radius: 6px 0 0 6px;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.22);
}
.rail:hover .rail-item,
.rail:hover .rail-toc {
  color: rgba(255, 255, 255, 0.97);
  opacity: 1;
}
.rail:hover .rail-item.current { color: #fff; }
.rail:hover .rail-divider { background: rgba(255, 255, 255, 0.55); }

/* Body push: when the rail expands, body content slides left so the
   drawer doesn't overlap text. CSS :has() drives it. */
body { transition: padding-right 320ms ease-out; }
body:has(.rail:hover) { padding-right: 220px; }

@media (max-width: 820px) {
  .rail { gap: 2px; padding: 10px 8px; }
  .rail-glyph { font-size: 13px; }
  .breadcrumb .crumb-mark { font-size: 13px; }
}

/* ===================================================================== */
/* ===================================================================== */
/* APHORISM / INTERLUDE REGISTER                                          */
/* ===================================================================== */
/* Shared register for the small aphorism pages (Mirror, Memory, Nipple, */
/* Correction, TV) plus the short bridge essays between named chapters.  */
/* Cream paper, italic display title, single tight column of body, drop  */
/* cap on lead char. Each page sets its own --aphorism-accent for the    */
/* drop cap + title accent so the cluster reads as a sequence rather     */
/* than a uniform stack.                                                 */
.aphorism-page {
  background: var(--paper);
  color: var(--text);
  min-height: 100vh;
  padding: 18vh 6vw 12vh 6vw;
  position: relative;
  /* overflow-x only — overflow: hidden killed vertical scrolling
     and intro (long body + epigraph + footnote) couldn't reach
     its own bottom. The inertia ::before only travels ~11px so
     vertical bleed at edges isn't visible during normal reading. */
  overflow-x: hidden;
  isolation: isolate;
  /* Aphorism pages are ALL cream/paper grounds. Force the chrome
     (rail, breadcrumb, prev/next strip injected by nav.js) to its
     dark register so it doesn't disappear into the page. This is
     the single source of truth — future aphorism pages get correct
     chrome just by carrying class="aphorism-page". Do NOT also add
     `chrome-dark` to body; let this rule own it.
     If a future aphorism wants dark chrome for an inverted-ground
     register, override this on that page only. */
  --chrome-fg: rgba(15, 15, 15, 0.85);
}
.aphorism-page::before {
  content: '';
  position: absolute;
  inset: -4%;
  background: radial-gradient(
    ellipse 80% 60% at 30% 20%,
    var(--aphorism-tint, rgba(232, 0, 138, 0.06)),
    transparent 70%
  );
  transform: translate3d(var(--amb-x, 0px), var(--amb-y, 0px), 0);
  will-change: transform;
  z-index: -1;
  pointer-events: none;
}
/* Aphorism with photographic substrate.
   Phil's hard rule (2026-05-12): every page whose print spread carries
   a photograph must carry that photograph on the web. The aphorisms
   that opt into this set --aphorism-photo per page (inline) and the
   shared treatment is a fixed photo behind a translucent paper card
   that holds the text. Per-page printers can override layout further
   (e.g. Nipple's right-aligned column with magenta dropcap block) by
   adding inline style on top. */
.aphorism-page.with-photo {
  background: #0a0a0a;
  padding: 0;
  /* The cream-paper rule above forces dark chrome. But on a photo
     substrate the chrome lives over the dark photo, not the paper —
     dark on dark = invisible. Flip back to white-on-dark and put a
     strong halo on the chrome so it reads against any region of the
     photo (light or dark). Phil's rule (2026-05-12): if I can't see
     it it is not there. */
  --chrome-fg: rgba(255, 255, 255, 0.96);
}
.aphorism-page.with-photo .rail,
.aphorism-page.with-photo .breadcrumb,
.aphorism-page.with-photo .section-strip,
.aphorism-page.with-photo .scroll-cue {
  text-shadow:
    0 0 6px rgba(0, 0, 0, 0.62),
    0 1px 2px rgba(0, 0, 0, 0.70);
}
.aphorism-page.with-photo .rail-divider {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.55);
}
.aphorism-page.with-photo::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--aphorism-photo, none);
  background-size: cover;
  background-position: center;
  z-index: -2;
  pointer-events: none;
}
/* Photo credit — small, near-invisible line in the page's lower-right
   that names the print page + image file. Doubles as provenance and
   accessibility hint for screen readers. Phil's hard rule
   (2026-05-12): if the print has a photograph, the web page has a
   photograph; this credit makes the photograph's print origin
   legible. Uses var(--chrome-fg) so it adapts to dark/light scenes. */
.photo-credit {
  position: fixed;
  bottom: 16px;
  right: 22px;
  z-index: 3;
  font-family: var(--chrome);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chrome-fg);
  opacity: 0.55;
  text-shadow:
    0 0 6px rgba(0,0,0,0.4),
    0 1px 2px rgba(0,0,0,0.45);
  pointer-events: none;
  user-select: none;
}
.photo-credit-sep { margin: 0 0.5em; opacity: 0.55; }
.photo-credit-mark { font-style: italic; opacity: 0.78; }

/* Screen-reader-only utility for chapter pages that don't visually
   render an <h1> but still need one for landmark navigation. */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
body.chrome-dark .photo-credit {
  text-shadow:
    0 0 6px rgba(255,255,255,0.32),
    0 1px 2px rgba(255,255,255,0.20);
}

/* Subtitle (e.g. Fertilization's "(Plastic Sex)") — sits below the
   title in an italic ultra-light register that echoes the print's
   subtitle pattern. */
.aphorism-page .aphorism-subtitle {
  font-family: var(--display);
  font-style: italic;
  font-weight: 200;
  font-size: clamp(15px, 1.4vw, 22px);
  line-height: 1.3;
  color: var(--text-dim);
  margin-top: -0.4em;
  margin-bottom: 1.6em;
}

.aphorism-page.with-photo > .aphorism-stage {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 12vh auto 10vh auto;
  padding: 9vh 7vw 8vh 7vw;
  background: rgba(245, 240, 230, 0.94);
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  border-radius: 2px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
/* Title containment. Long names (Disappointments, Masquerades,
   Fertilization) were spilling out of the card right edge. Hard-wrap
   on long words; .long-title scales the heading down further so a
   single long word still fits one line. Generalizes — any future
   section whose label is ≥ 11 chars inherits the smaller scale. */
.aphorism-page .aphorism-title {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  text-wrap: balance;
}
.aphorism-page.long-title .aphorism-title {
  font-size: clamp(46px, 7vw, 92px);
  line-height: 0.96;
}
/* Epigraph at the top of a long body (Fertilization). Italic display
   register, indented, with the attribution flush right under the
   quote. Lives inside .aphorism-body. */
.aphorism-page .aphorism-epigraph {
  margin: 0 0 1.6em 0;
  padding-left: 1.2em;
  border-left: 2px solid var(--aphorism-accent, var(--ink-magenta));
  font-family: var(--display);
  font-style: italic;
  font-size: 1.04em;
  line-height: 1.5;
  color: var(--text-dim);
}
.aphorism-page .aphorism-epigraph cite {
  display: block;
  margin-top: 0.6em;
  font-family: var(--chrome);
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}
/* Footnotes block — sits below the body, set apart with a hairline
   rule, smaller type, ordered list with the marker superscripted.
   Tuned to feel like the .indd's 8pt Helvetica Neue inline-footnote
   treatment (subordinate to the prose, not a page-wide stack).
   Constrained to the body column so the apparatus stays calm. */
.aphorism-footnotes,
.aphorism-page .aphorism-footnotes {
  max-width: 38em;
  margin: 4.2em auto 0 auto;
  padding: 1.1em 7vw 0 7vw;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
}
body.chrome-dark .aphorism-footnotes,
body.chrome-dark .aphorism-page .aphorism-footnotes {
  border-top-color: rgba(245, 240, 230, 0.16);
}
.aphorism-footnotes ol,
.aphorism-page .aphorism-footnotes ol {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 0.55em;
}
.aphorism-footnotes li,
.aphorism-page .aphorism-footnotes li {
  font-family: var(--body);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 0.005em;
  color: var(--text-dim);
  padding-left: 1.6em;
  text-indent: -1.6em;
}
.aphorism-footnotes sup,
.aphorism-page .aphorism-footnotes sup {
  font-size: 0.86em;
  color: var(--aphorism-accent, var(--ink-magenta));
  margin-right: 0.45em;
  font-feature-settings: "sups";
}
/* Inline footnote-reference marker. The body keeps a small <sup> next
   to the cited word; the hover-tooltip + bidirectional syllabus link
   live on this element via JS in nav.js. */
.fn-ref {
  font-family: var(--display);
  font-size: 0.62em;
  font-style: italic;
  color: var(--aphorism-accent, var(--ink-magenta));
  vertical-align: super;
  line-height: 0;
  cursor: pointer;
  padding: 0 1px;
  border-radius: 2px;
  transition: background 140ms ease-out;
}
.fn-ref:hover, .fn-ref:focus {
  background: rgba(232, 0, 138, 0.16);
  outline: none;
}
/* Tooltip injected near the marker on hover/focus/tap. */
.fn-tooltip {
  position: fixed;
  z-index: 999;
  max-width: 320px;
  background: rgba(15, 15, 18, 0.96);
  color: rgba(245, 240, 230, 0.96);
  font-family: var(--body);
  font-size: 12px;
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: 5px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}
.fn-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.fn-tooltip sup {
  color: var(--ink-magenta);
  margin-right: 0.4em;
}
.fn-tooltip .fn-syllabus-link {
  display: block;
  margin-top: 8px;
  font-family: var(--chrome);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245, 240, 230, 0.55);
  text-decoration: none;
}
.fn-tooltip .fn-syllabus-link::before { content: "→ "; }
.fn-tooltip .fn-syllabus-link:hover { color: var(--ink-magenta); }
/* Syllabus entry highlight target — when arrived via fragment, the
   target entry pulses briefly. */
.syl-entry:target {
  background: rgba(232, 0, 138, 0.08);
  animation: syllabus-pulse 1.8s ease-out 1;
}
@keyframes syllabus-pulse {
  0%   { background: rgba(232, 0, 138, 0.36); }
  100% { background: rgba(232, 0, 138, 0.08); }
}
.aphorism-stage {
  max-width: 880px;
  margin: 0 auto;
  position: relative;
}
.aphorism-roman {
  position: absolute;
  top: 0; right: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-faint);
}
.aphorism-eyebrow {
  font-family: var(--chrome);
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--aphorism-accent, var(--ink-magenta));
  margin-bottom: 2.4em;
}
.aphorism-title {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(72px, 11vw, 168px);
  line-height: 0.92;
  color: var(--ink-black);
  letter-spacing: -0.012em;
  margin-bottom: 0.6em;
}
.aphorism-body {
  max-width: 32em;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.62;
  text-align: left;
  hyphens: none;
  margin-top: 5vh;
}
.aphorism-body p { margin: 0 0 0.95em 0; }
.aphorism-body p em { font-style: italic; color: var(--aphorism-accent, var(--ink-magenta)); }
.aphorism-body .dropcap {
  font-family: var(--display);
  font-style: italic;
  font-size: 7.2em;
  line-height: 0.74;
  float: left;
  padding: 0.04em 0.14em 0 0;
  color: var(--aphorism-accent, var(--ink-magenta));
  position: relative;
  z-index: 2;
  margin-left: -0.14em;
  margin-top: -0.06em;
}
.aphorism-body .dropcap::after {
  content: attr(data-letter);
  position: absolute; top: 0; left: 0;
  color: transparent;
  -webkit-text-stroke: 0.8px currentColor;
  opacity: 0.5;
  transform: translate(5px, 4px);
  pointer-events: none;
}
.aphorism-footnote {
  margin-top: 4em;
  padding-top: 1em;
  border-top: 1px solid var(--border, rgba(0,0,0,0.12));
  font-family: var(--body);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 32em;
}
.aphorism-footnote sup { font-size: 0.75em; color: var(--aphorism-accent, var(--ink-magenta)); }

/* =====================================================================
   QUOTED. — block-quote eyebrow.
   Print uses curly quotes alone (the "sport of search" — attribution is
   intentionally omitted). The audiobook prepends a spoken "Quoted." cue
   before every block-quoted passage so listeners hear the words as
   borrowed without forging unknown sources. The web edition carries
   the same cue as a small + tracked label, set like a footnote, so the
   three editions stay coherent and the audio surface — when it lands —
   doesn't introduce a marker the page hasn't trained the reader on.
   Skipped when an element opts out via [data-quoted-cue="off"].
   ===================================================================== */
blockquote.ce-pullquote::before,
blockquote.je-pullquote::before,
blockquote.ca-quote::before,
blockquote.intro-epigraph::before,
blockquote.aphorism-epigraph::before {
  content: "Quoted.";
  display: block;
  margin-bottom: 0.9em;
  font-family: var(--chrome);
  font-style: normal;
  font-weight: 400;
  font-size: 9.5px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0.78;
}
blockquote.aphorism-epigraph::before {
  margin-left: -0.05em;
}
blockquote[data-quoted-cue="off"]::before { content: none; }
body.chrome-dark blockquote.ce-pullquote::before,
body.chrome-dark blockquote.je-pullquote::before,
body.chrome-dark blockquote.ca-quote::before,
body.chrome-dark blockquote.intro-epigraph::before,
body.chrome-dark blockquote.aphorism-epigraph::before {
  color: rgba(245, 240, 230, 0.55);
}

/* ===================================================================== */
/* CONCORDANCE FOOTER — site standard                                     */
/* ===================================================================== */
.concordance {
  padding: 64px 28px 80px 28px;
  text-align: center;
  font-family: var(--chrome);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.concordance a {
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* ===================================================================== */
/* SCROLL CUE — large chevron at first-viewport on scrollable chapter    */
/* pages. Tells the reader the content continues below. Fades as they    */
/* scroll. Injected by nav.js when scrollHeight > innerHeight.           */
/* ===================================================================== */
/* ===================================================================== */
/* PAGE SEARCH — injected by nav.js on every section page.                */
/* Magnifier toggle in the upper-right next to the rail; click expands    */
/* to a panel that filters the book's full-text search index.             */
/* ===================================================================== */
.page-search-toggle {
  position: fixed;
  top: 22px;
  right: 86px;
  z-index: 102;
  width: 34px; height: 34px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--chrome-fg);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.78;
  transition: opacity 220ms ease-out, background 220ms ease-out;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.page-search-toggle:hover {
  opacity: 1;
  background: rgba(0,0,0,0.18);
}
.page-search-toggle[hidden] { display: none !important; }

.page-search-panel {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 103;
  width: 380px;
  max-width: 86vw;
  max-height: 78vh;
  background: rgba(15, 15, 18, 0.94);
  color: rgba(245, 240, 230, 0.92);
  border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  padding: 14px 14px 10px 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.page-search-panel[hidden] { display: none !important; }
.page-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font-family: var(--body);
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.page-search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}
.page-search-close {
  width: 28px; height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  color: inherit;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.page-search-close:hover { background: rgba(255, 255, 255, 0.16); }
.page-search-results {
  list-style: none;
  margin: 0; padding: 0;
  max-height: 56vh;
  overflow-y: auto;
}
.page-search-results li {
  padding: 8px 6px;
  border-radius: 3px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 140ms ease-out;
}
.page-search-results li:hover { background: rgba(255, 255, 255, 0.08); }
.page-search-results .label {
  font-family: var(--display);
  font-style: italic;
  font-size: 14px;
  margin-bottom: 2px;
  color: rgba(245, 240, 230, 0.96);
}
.page-search-results .snip {
  font-family: var(--body);
  font-size: 11.5px;
  line-height: 1.45;
  color: rgba(245, 240, 230, 0.62);
}
.page-search-results .snip mark {
  background: rgba(232, 0, 138, 0.36);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}
.page-search-empty {
  font-family: var(--display);
  font-style: italic;
  font-size: 13px;
  color: rgba(245, 240, 230, 0.55);
  text-align: center;
  padding: 10px 0 6px 0;
}

.scroll-cue {
  position: fixed;
  left: 50%;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(48px, 6vw, 80px);
  line-height: 1;
  color: var(--chrome-fg);
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  z-index: 95;
  user-select: none;
  transition: opacity 320ms ease-out;
  will-change: transform, opacity;
}
.scroll-cue-down {
  bottom: 22px;
  transform: translateX(-50%);
  animation: scroll-cue-beckon 2.4s cubic-bezier(0.4, 0, 0.4, 1) infinite;
}
.scroll-cue-up {
  bottom: 22px;
  transform: translateX(-50%);
  animation: scroll-cue-beckon-up 2.4s cubic-bezier(0.4, 0, 0.4, 1) infinite;
}
@keyframes scroll-cue-beckon-up {
  0%, 100% { transform: translate(-50%, 0);     }
  50%      { transform: translate(-50%, -12px); }
}
@keyframes scroll-cue-beckon {
  0%, 100% { transform: translate(-50%, 0);    }
  50%      { transform: translate(-50%, 12px); }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-cue-down { animation: none; }
}

/* ===================================================================== */
/* RESET LINKS / BUTTONS for clickable surfaces                           */
/* ===================================================================== */
.surface-click {
  cursor: pointer;
  position: absolute;
  inset: 0;
}
