/* =========================================================
   Game runtime — gamehendge/play/index.html
   ========================================================= */

body.play {
  background: var(--bg);
  color: var(--ink);
  min-height: 100svh;
  overflow-x: hidden;
}

/* ---------- Stage ---------- */
.stage {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--dur-slow) var(--ease),
              color var(--dur-slow) var(--ease);
}

/* Palette modifiers — applied to .stage based on scene.palette */
.stage.palette-default { background: var(--bg);    color: var(--ink); }
.stage.palette-cream   { background: var(--c1-bg); color: var(--c1-ink); }
.stage.palette-forest  { background: var(--c2-bg); color: var(--c2-ink); }
.stage.palette-mountain{ background: var(--c3-bg); color: var(--c3-ink); }
.stage.palette-tower   { background: var(--c4-bg); color: var(--c4-ink); }
.stage.palette-sage    { background: var(--c5-bg); color: var(--c5-ink); }

/* Atmospheric layer — each palette gets its own light + grain treatment.
   This gives every chapter a distinct "weather" without any image assets. */
.stage::before,
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity var(--dur-slow) var(--ease);
}
.stage > * { position: relative; z-index: 1; }

/* Light layer — radial vignette per chapter mood */
.stage::before {
  background:
    radial-gradient(ellipse 80% 55% at 50% 8%, rgba(109,178,139,0.06), transparent 65%),
    radial-gradient(ellipse 100% 90% at 50% 110%, rgba(0,0,0,0.55), transparent 70%);
}
.stage.palette-cream::before {
  background:
    radial-gradient(ellipse 90% 60% at 50% 5%, rgba(255,250,235,0.55), transparent 60%),
    radial-gradient(ellipse 100% 90% at 50% 105%, rgba(107,74,43,0.18), transparent 70%);
}
.stage.palette-forest::before {
  background:
    radial-gradient(ellipse 60% 35% at 70% 5%, rgba(214,177,106,0.18), transparent 65%),
    radial-gradient(ellipse 90% 70% at 30% 60%, rgba(15,40,25,0.5), transparent 70%),
    radial-gradient(ellipse 100% 90% at 50% 110%, rgba(0,0,0,0.45), transparent 70%);
}
.stage.palette-mountain::before {
  background:
    radial-gradient(ellipse 70% 40% at 50% -5%, rgba(220,235,225,0.18), transparent 65%),
    linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(15,22,18,0.55) 70%, rgba(8,12,10,0.85) 100%);
}
.stage.palette-tower::before {
  background:
    radial-gradient(ellipse 35% 30% at 60% 40%, rgba(231,185,88,0.22), transparent 65%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(0,0,0,0.7), transparent 70%);
}
.stage.palette-sage::before {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(ellipse 90% 80% at 50% 110%, rgba(26,63,55,0.3), transparent 70%);
}

/* Grain layer — subtle film noise across every palette */
.stage::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.92  0 0 0 0 0.85  0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.35;
  mix-blend-mode: overlay;
}
.stage.palette-cream::after { opacity: 0.18; mix-blend-mode: multiply; }
.stage.palette-sage::after  { opacity: 0.18; mix-blend-mode: multiply; }

/* Stage HUD bars */
.hud {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(180deg, currentColor 0%, transparent 100%);
  background: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hud__left, .hud__right { display: flex; gap: 1.4rem; align-items: center; }
.hud a, .hud button { border: 0; opacity: 0.75; }
.hud a:hover, .hud button:hover { opacity: 1; }
.hud__chapter { letter-spacing: 0.24em; }
.hud__progress {
  width: 110px;
  height: 2px;
  background: currentColor;
  opacity: 0.18;
  position: relative;
}
.hud__progress::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  background: currentColor;
  opacity: 1;
  transition: width var(--dur-slow) var(--ease);
}

/* ---------- Scene ---------- */
.scene {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--pad-inline) clamp(3rem, 6vw, 6rem);
}
@media (min-width: 960px) {
  .scene--has-media {
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
  }
}

.scene__media {
  position: relative;
  background: rgba(0,0,0,0.25);
  border-radius: var(--rad-md);
  overflow: hidden;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  box-shadow: 0 18px 48px rgba(0,0,0,0.35);
}
@media (min-width: 960px) {
  .scene__media {
    position: sticky;
    top: 5rem;
    margin-bottom: 0;
  }
}
.scene__media img,
.scene__media video {
  width: 100%;
  height: auto;
  max-height: 82svh;
  object-fit: cover;
  display: block;
}
.scene__media--placeholder {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 30%, rgba(255,255,255,0.06), transparent 60%),
    linear-gradient(160deg, rgba(0,0,0,0.4), rgba(0,0,0,0.1));
  border: 1px solid rgba(255,255,255,0.08);
}
.scene__media--placeholder span {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.5;
}

.scene__body {
  max-width: 64ch;
}

.scene__chapter {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0 0 1rem;
}

.scene__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-4);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 2rem;
}
.scene__title em { font-style: italic; }

.scene__prose {
  font-size: var(--step-1);
  line-height: 1.7;
}
.scene__prose p { margin: 0 0 1.2rem; }
.scene__prose p:first-child::first-letter {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 3.4em;
  float: left;
  line-height: 0.85;
  margin: 0.06em 0.12em 0 0;
  font-weight: 300;
}
.scene__prose em { font-style: italic; opacity: 0.85; }
.scene__prose strong { font-weight: 600; }

/* ---------- Choices ---------- */
.choices {
  margin: 3rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.choice {
  --choice-accent: rgba(200,203,193,0.5);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 1.1rem 1.25rem;
  background: transparent;
  border: 1px solid rgba(125,125,125,0.28);
  border-left: 2px solid var(--choice-accent);
  border-radius: var(--rad-sm);
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              border-left-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.choice:hover {
  border-color: var(--choice-accent);
  background: color-mix(in srgb, var(--choice-accent) 8%, transparent);
  transform: translateX(4px);
  box-shadow: -3px 0 0 0 var(--choice-accent);
}
.stage.palette-cream .choice:hover { background: color-mix(in srgb, var(--choice-accent) 14%, transparent); }
.stage.palette-sage  .choice:hover { background: color-mix(in srgb, var(--choice-accent) 14%, transparent); }

/* Per-axis choice accent — colors the left rail, tag, and hover */
.choice:has(.choice__tag[data-axis="wisdom"])     { --choice-accent: #8db4d4; }
.choice:has(.choice__tag[data-axis="action"])     { --choice-accent: #d68c6e; }
.choice:has(.choice__tag[data-axis="compassion"]) { --choice-accent: #6db28b; }
.choice:has(.choice__tag[data-axis="justice"])    { --choice-accent: #d6c074; }
.choice:has(.choice__tag[data-axis="resume"])     { --choice-accent: #c8cbc1; }
.choice:has(.choice__tag[data-axis="begin"])      { --choice-accent: var(--forest-bright); }
.choice:has(.choice__tag[data-axis="doubt"])      { --choice-accent: #7a857c; }
.choice--resume {
  border-left-style: dashed;
}

.choice__index {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  opacity: 0.55;
  padding-top: 0.18rem;
}
.choice__text {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.4;
  letter-spacing: -0.005em;
}
.choice__hint {
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--step--1);
  letter-spacing: 0;
  display: block;
  margin-top: 0.4rem;
  opacity: 0.6;
}
.choice__tag {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.5;
  padding-top: 0.4rem;
  white-space: nowrap;
}

/* Tag colors per axis */
.choice__tag[data-axis="wisdom"]     { color: #8db4d4; opacity: 0.85; }
.choice__tag[data-axis="action"]     { color: #d68c6e; opacity: 0.85; }
.choice__tag[data-axis="compassion"] { color: #6db28b; opacity: 0.9; }
.choice__tag[data-axis="justice"]    { color: #d6c074; opacity: 0.85; }
.choice__tag[data-axis="resume"]     { color: #c8cbc1; opacity: 0.95; letter-spacing: 0.22em; }
.choice__tag[data-axis="begin"]      { color: var(--forest-bright); opacity: 1; letter-spacing: 0.24em; }
.choice__tag[data-axis="doubt"]      { color: #7a857c; opacity: 0.7; }

/* (The stat scoreboard is gone. Icculus does not grade on points;
   he watches from the mountain and smiles. Knowledge is the
   inventory now — see .page-card, .liner, .whisper below.) */

/* ---------- Ending ---------- */
.ending {
  max-width: 66ch;
  margin: 0 auto;
  text-align: left;
}
.ending__num {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0 0 1rem;
}
.ending__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-5);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 2.5rem;
}
.ending__title em { font-style: italic; }
.ending__rule {
  height: 1px;
  background: currentColor;
  opacity: 0.3;
  margin: 2rem 0;
  border: 0;
}
.ending__moral {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-2);
  font-weight: 300;
  line-height: 1.4;
  margin: 2rem 0;
}
.ending__achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
}
.ending__achievements span {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border: 1px solid currentColor;
  border-radius: 99rem;
  opacity: 0.85;
}

/* ---------- Choice gallery (path summary at end) ---------- */
.gallery {
  margin: 3rem 0;
  border-top: 1px solid currentColor;
  padding-top: 2rem;
}
.gallery h3 {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
  opacity: 0.75;
  font-weight: 400;
}
.gallery ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}
.gallery li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid currentColor;
  border-color: rgba(125,125,125,0.25);
  font-size: var(--step--1);
}
.gallery li:first-child { border-top: 0; }
.gallery li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  opacity: 0.5;
  padding-top: 0.18rem;
}
.gallery em {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-0);
}
.gallery .gallery__scene {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-top: 0.2rem;
}

/* ---------- Restart row ---------- */
.cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.6rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  background: transparent;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.cta:hover {
  background: currentColor;
  color: var(--bg);
}
.stage.palette-cream .cta:hover { color: var(--c1-bg); }
.stage.palette-sage  .cta:hover { color: var(--c5-bg); }

/* ---------- Title screen overlay ---------- */
.title-screen {
  display: grid;
  place-items: center;
  min-height: 80svh;
  text-align: center;
}
.title-screen__inner { max-width: 60ch; padding: 0 var(--pad-inline); }
.title-screen__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0 0 1.5rem;
}
.title-screen__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-6);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
}
.title-screen__title em { font-style: italic; }
.title-screen__sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--step-2);
  font-weight: 300;
  margin: 1.5rem 0 0;
  opacity: 0.85;
}
.title-screen__lede {
  font-size: var(--step-1);
  line-height: 1.6;
  margin: 2rem auto 2.5rem;
  max-width: 50ch;
  opacity: 0.85;
}

/* ---------- Toast (save indicator) ---------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.6rem 0.9rem;
  background: rgba(0,0,0,0.7);
  color: var(--ink);
  border-radius: 2px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  z-index: 100;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Animation utility ---------- */
.scene-enter {
  opacity: 0;
  transform: translateY(14px);
}

/* =========================================================
   Ornament & decorative system
   ========================================================= */

.scene__chapter {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.8rem 0.35rem 0.4rem;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 28%, transparent);
  border-radius: 99rem;
  margin-bottom: 1.5rem;
}
.scene__chapter-glyph {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 99rem;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-size: 0.78rem;
  line-height: 1;
}
.scene__chapter-text { line-height: 1; }

/* Ornament rule — between title and prose, between ending title and prose */
.ornament {
  margin: 0 0 2.5rem;
  display: flex;
  justify-content: flex-start;
  opacity: 0.85;
}
.ornament--ending {
  justify-content: center;
  margin: 2rem 0 2.5rem;
}
.ornament__svg {
  width: 120px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 0.8;
  fill: none;
  opacity: 0.6;
}
.stage.palette-forest   .ornament__svg { stroke: var(--c2-accent); opacity: 0.7; }
.stage.palette-mountain .ornament__svg { stroke: var(--c3-accent); opacity: 0.65; }
.stage.palette-tower    .ornament__svg { stroke: var(--c4-accent); opacity: 0.75; }
.stage.palette-cream    .ornament__svg { stroke: var(--c1-accent); opacity: 0.55; }
.stage.palette-sage     .ornament__svg { stroke: var(--c5-accent); opacity: 0.55; }

/* Bigger, more decorative drop cap — the Gamehendge feel */
.scene__prose p:first-child::first-letter {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 4.6em;
  float: left;
  line-height: 0.78;
  margin: 0.08em 0.16em 0 0;
  color: color-mix(in srgb, currentColor 85%, transparent);
  /* faint underline ornament under the cap */
  padding: 0 0.05em 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 25%, transparent);
}
.stage.palette-forest   .scene__prose p:first-child::first-letter { color: var(--c2-accent); }
.stage.palette-mountain .scene__prose p:first-child::first-letter { color: var(--c3-accent); }
.stage.palette-tower    .scene__prose p:first-child::first-letter { color: var(--c4-accent); }
.stage.palette-cream    .scene__prose p:first-child::first-letter { color: var(--c1-accent); }
.stage.palette-sage     .scene__prose p:first-child::first-letter { color: var(--c5-accent); }

/* Block quote treatment for italic dialogue from voices/Icculus */
.scene__prose em {
  font-style: italic;
  opacity: 1;
  color: color-mix(in srgb, currentColor 80%, transparent);
}
.stage.palette-forest   .scene__prose em { color: color-mix(in srgb, var(--c2-accent) 95%, var(--c2-ink)); }
.stage.palette-mountain .scene__prose em { color: color-mix(in srgb, var(--c3-accent) 95%, var(--c3-ink)); }
.stage.palette-tower    .scene__prose em { color: color-mix(in srgb, var(--c4-accent) 90%, var(--c4-ink)); }

/* ---------- Title screen — wreath the title ---------- */
.title-screen { position: relative; }
.title-screen__inner {
  position: relative;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.title-screen__title {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0;
}
.title-screen__title em {
  background: linear-gradient(180deg, currentColor 0%, var(--forest-bright) 60%, var(--forest-mid) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--forest-bright);
}
.title-screen .ornament {
  justify-content: center;
  margin: 1.5rem 0 0;
}
.title-screen .ornament__svg {
  width: 200px;
  stroke: var(--forest-bright);
  opacity: 0.7;
}

/* ---------- Choice — more decorative number medallion ---------- */
.choice__index {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 1.7rem;
  padding: 0 0.4rem;
  border-radius: 99rem;
  background: color-mix(in srgb, var(--choice-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--choice-accent) 35%, transparent);
  color: color-mix(in srgb, var(--choice-accent) 95%, currentColor);
  opacity: 0.95;
}
.choice {
  padding: 1.2rem 1.4rem;
  border-radius: 4px;
  background: linear-gradient(180deg, color-mix(in srgb, currentColor 1.5%, transparent), transparent);
}
.choice:hover {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--choice-accent) 9%, transparent),
    color-mix(in srgb, var(--choice-accent) 3%, transparent)
  );
}

/* ---------- HUD treatment ---------- */
.hud {
  border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, currentColor 4%, transparent), transparent);
  backdrop-filter: blur(6px);
}

/* ---------- Achievement pills polish ---------- */
.ending__achievements span {
  background: color-mix(in srgb, var(--forest-bright) 6%, transparent);
  border-color: color-mix(in srgb, currentColor 35%, transparent);
}

/* ---------- Ending moral — pull quote with marks ---------- */
.ending__moral {
  position: relative;
  padding: 1.5rem 2rem;
  border-left: 2px solid var(--forest-bright);
  background: linear-gradient(90deg, color-mix(in srgb, var(--forest-bright) 5%, transparent), transparent);
}

/* ---------- Reduced motion respect ---------- */
@media (prefers-reduced-motion: reduce) {
  .stage::before, .stage::after { transition: none; }
}

/* =========================================================
   THE 27-FAN REDESIGN LAYER
   Torn pages, liner notes, whispers, the held silence,
   the Book, the night-sky rhombus, McGrupp's codas.
   ========================================================= */

/* ---------- Whisper — the world worn where you have walked ---------- */
.whisper {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  opacity: 0.55;
  margin: -1rem 0 2rem;
  padding-left: 1rem;
  border-left: 1px dashed color-mix(in srgb, currentColor 40%, transparent);
}

/* ---------- Liner notes — canon provenance ---------- */
.liner {
  margin-top: 3.5rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
}
.liner__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  border-radius: 99rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
  transition: opacity var(--dur) var(--ease);
}
.liner__chip:hover { opacity: 1; }
.liner__mark {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 99rem;
  display: inline-block;
}
.liner__mark--core      { background: var(--forest-bright); }
.liner__mark--extension { background: #d6c074; }
.liner__mark--branch    { background: transparent; border: 1px solid currentColor; opacity: 0.7; }
.liner__note {
  max-width: 58ch;
  margin-top: 0.9rem;
  padding: 1rem 1.25rem;
  border-left: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  background: color-mix(in srgb, currentColor 4%, transparent);
  font-family: var(--font-body);
  font-size: var(--step--1);
  line-height: 1.6;
  opacity: 0.85;
}
.liner__tagline {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

/* ---------- Torn page card ---------- */
.page-card {
  margin: 3rem 0 0;
  padding: 1.8rem 2rem 1.5rem;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-left: 2px solid #d6c074;
  background:
    linear-gradient(170deg, color-mix(in srgb, #d6c074 7%, transparent), transparent 60%);
  position: relative;
}
.page-card--new::after {
  content: "new";
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #d6c074;
}
.page-card__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 0 0 0.8rem;
}
.page-card__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: var(--step-2);
  margin: 0 0 0.8rem;
}
.page-card__text {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-1);
  line-height: 1.55;
  margin: 0 0 1rem;
}
.page-card__footnote {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  opacity: 0.5;
  margin: 0;
}

/* ---------- McGrupp's coda ---------- */
.mcgrupp {
  margin: 2rem 0 0;
  padding: 1.4rem 2rem;
  border-left: 2px solid var(--forest-bright);
  background: linear-gradient(90deg, color-mix(in srgb, var(--forest-bright) 6%, transparent), transparent);
}
.mcgrupp__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 0 0 0.6rem;
}
.mcgrupp__text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: var(--step-1);
  line-height: 1.55;
  margin: 0;
}

/* ---------- Held silence ---------- */
.choices.is-held {
  opacity: 0;
  pointer-events: none;
}
.choices.is-revealed {
  opacity: 1;
  transition: opacity 2200ms var(--ease);
}
.silence-cue {
  font-family: var(--font-mono);
  font-size: var(--step-0);
  letter-spacing: 0.6em;
  opacity: 0.4;
  margin: 2.5rem 0 0;
  animation: silence-breathe 4s ease-in-out infinite;
}
.silence-cue.is-done { display: none; }
@keyframes silence-breathe {
  0%, 100% { opacity: 0.18; }
  50%      { opacity: 0.5; }
}

/* ---------- Locked choice — words not yet earned ---------- */
.choice--locked {
  opacity: 0.45;
  cursor: not-allowed;
  border-style: dashed;
}
.choice--locked:hover {
  transform: none;
  box-shadow: none;
  background: transparent;
  border-color: rgba(125,125,125,0.28);
}

/* ---------- Step into yesterday ---------- */
.cta--yesterday { border-style: dashed; }

/* ---------- Title screen — pages held ---------- */
.title-screen__pages {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  opacity: 0.55;
  margin-top: 2rem;
}

/* ---------- HUD buttons ---------- */
.hud__right button {
  letter-spacing: 0.12em;
}
#hud-audio { opacity: 0.5; }
#hud-audio.is-on { opacity: 1; color: var(--forest-bright); }

/* ---------- Overlays — the Book, the Rhombus ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 5, 3, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  animation: overlay-in 320ms var(--ease);
}
@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.overlay__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 88svh;
  overflow-y: auto;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--forest-bright) 30%, transparent);
  padding: clamp(2rem, 5vw, 3.5rem);
}
.overlay__close {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  opacity: 0.6;
  z-index: 2;
}
.overlay__close:hover { opacity: 1; }
.overlay__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--forest-bright);
  margin: 0 0 1rem;
}
.overlay__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-4);
  line-height: 1.05;
  margin: 0 0 1.5rem;
}
.overlay__lede {
  font-size: var(--step-0);
  line-height: 1.65;
  opacity: 0.8;
  max-width: 56ch;
  margin: 0 0 2.5rem;
}
.overlay__footer {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  opacity: 0.6;
  margin: 2.5rem 0 0;
}

/* The Book — page grid */
.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.book-page {
  border: 1px dashed color-mix(in srgb, currentColor 25%, transparent);
  padding: 1.2rem 1.4rem;
  min-height: 7.5rem;
}
.book-page--held {
  border-style: solid;
  border-left: 2px solid #d6c074;
  background: linear-gradient(170deg, color-mix(in srgb, #d6c074 6%, transparent), transparent 70%);
}
.book-page h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: var(--step-1);
  margin: 0 0 0.6rem;
}
.book-page p {
  font-size: var(--step--1);
  line-height: 1.55;
  margin: 0;
  opacity: 0.9;
}
.book-page__folded { opacity: 0.4; font-style: italic; }

/* The Rhombus — night-sky constellation */
.overlay__panel--map { width: min(680px, 100%); }
.skymap {
  margin: 0 auto;
  background:
    radial-gradient(ellipse 80% 55% at 50% 20%, rgba(109,178,139,0.07), transparent 65%),
    #040604;
}
.skymap svg { width: 100%; height: auto; display: block; }
.skymap__rhombus {
  fill: rgba(109, 178, 139, 0.03);
  stroke: rgba(169, 205, 184, 0.35);
  stroke-width: 1;
}
.skymap__edge {
  stroke: rgba(200, 203, 193, 0.07);
  stroke-width: 1;
}
.skymap__edge--walked {
  stroke: rgba(109, 178, 139, 0.35);
}
.skymap__star {
  fill: rgba(200, 203, 193, 0.18);
}
.skymap__star.is-seen {
  fill: #e7e2d3;
  filter: drop-shadow(0 0 4px rgba(231, 226, 211, 0.8));
}
.skymap__star.is-ending { fill: rgba(214, 192, 116, 0.25); }
.skymap__star.is-ending.is-seen {
  fill: #d6c074;
  filter: drop-shadow(0 0 5px rgba(214, 192, 116, 0.9));
}
.skymap__star.is-true { fill: rgba(169, 205, 184, 0.25); }
.skymap__star.is-true.is-seen {
  fill: #a9cdb8;
  filter: drop-shadow(0 0 8px rgba(169, 205, 184, 1));
}
.skymap__label {
  fill: #a9cdb8;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-anchor: middle;
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .silence-cue { animation: none; }
  .overlay { animation: none; }
}

/* ---------- Ask McGrupp — first-timer glossary ---------- */
.gloss {
  position: relative;
  font: inherit;
  color: inherit;
  padding: 0;
  border: 0;
  border-bottom: 1px dotted color-mix(in srgb, currentColor 45%, transparent);
  cursor: help;
  display: inline;
  text-align: inherit;
}
.gloss:hover {
  border-bottom-color: currentColor;
}
.gloss-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 0.6rem);
  z-index: 50;
  width: min(34ch, 74vw);
  padding: 1rem 1.2rem;
  background: var(--bg-elev);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--forest-bright) 35%, transparent);
  border-left: 2px solid var(--forest-bright);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-style: normal;
  font-weight: 400;
  line-height: 1.55;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  animation: overlay-in 200ms var(--ease);
}
.gloss-pop__eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--forest-bright);
  margin-bottom: 0.5rem;
}

/* ---------- Epigraphs — verbatim narration lines, cited ---------- */
.epigraph {
  margin: -0.8rem 0 2rem;
  padding: 0 0 0 1.2rem;
  border-left: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  max-width: 54ch;
}
.epigraph__text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: var(--step-0);
  line-height: 1.55;
  opacity: 0.75;
  margin: 0 0 0.45rem;
}
.epigraph__cite {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
}
.ending .epigraph { margin: 0 0 1.5rem; }

/* ---------- The Four Tellings ---------- */
.title-screen__telling {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin: 2.2rem 0 0;
}
.title-screen__telling strong {
  color: var(--forest-bright);
  font-weight: 500;
}
.title-screen__telling-tag { opacity: 0.6; }
.title-screen__telling-note {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: var(--step--1);
  letter-spacing: 0;
  text-transform: none;
  max-width: 52ch;
  margin: 0.7rem auto 0;
  opacity: 0.65;
  line-height: 1.5;
}
.scene__prose .telling-coda {
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  font-style: italic;
  opacity: 0.85;
}

/* ---------- HUD on small screens ---------- */
@media (max-width: 640px) {
  .hud__chapter { display: none; }
  .hud__left, .hud__right { gap: 1rem; }
}

/* ---------- Title legend for first shows ---------- */
.title-screen__legend {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.08em;
  opacity: 0.5;
  margin-top: 1.4rem;
}

/* =========================================================
   THE SHOW — overture, narrator, chant, segue, performance
   ========================================================= */

.overture {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% 30%, rgba(109,178,139,0.06), transparent 65%),
    #050705;
  transition: opacity 1200ms var(--ease);
}
.overture--out { opacity: 0; pointer-events: none; }
.overture__inner { text-align: center; padding: 0 var(--pad-inline); max-width: 46ch; }
.overture__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--forest-pale);
  opacity: 0.7;
  margin: 0 0 1.6rem;
  animation: overture-breathe 5s ease-in-out infinite;
}
@keyframes overture-breathe { 0%,100% { opacity: 0.45; } 50% { opacity: 0.85; } }
.overture__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-5);
  color: var(--ink);
  margin: 0 0 1.4rem;
}
.overture__title em { font-style: italic; color: var(--forest-bright); }
.overture__lede {
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink-soft);
  opacity: 0.85;
  margin: 0 0 2.6rem;
}
.overture__band {
  display: inline-flex;
  align-items: center;
  padding: 1rem 2.2rem;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--forest-bright);
  border: 1px solid var(--forest-bright);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.overture__band:hover {
  background: var(--forest-bright);
  color: #050705;
  box-shadow: 0 0 44px rgba(109,178,139,0.35);
}
.overture__quiet {
  display: block;
  margin: 1.4rem auto 0;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border-bottom: 1px dotted currentColor;
}
.overture__quiet:hover { color: var(--ink-soft); }

/* ---------- The narrator — the voice over the vamp ---------- */
.narrator {
  font-family: var(--font-mono);
  font-style: italic;
  font-size: var(--step-0);
  line-height: 1.6;
  letter-spacing: 0.01em;
  max-width: 46ch;
  margin: 0 0 2.4rem;
  padding: 1rem 1.3rem;
  color: color-mix(in srgb, currentColor 88%, transparent);
  background: color-mix(in srgb, currentColor 5%, transparent);
  border-left: 2px solid color-mix(in srgb, var(--forest-bright) 70%, currentColor);
  border-radius: 0 var(--rad-md) var(--rad-md) 0;
}
.narrator__mic { opacity: 0.5; margin-right: 0.3rem; }
.narrator__cite {
  font-style: normal;
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  opacity: 0.5;
  white-space: nowrap;
}
.ending .narrator { margin-bottom: 2rem; }

/* ---------- The chant — a pulse in the corner of the room ---------- */
.chant {
  position: fixed;
  right: clamp(1rem, 3vw, 2.4rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 40;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2000ms var(--ease);
}
.chant--on {
  opacity: 0.5;
  animation: chant-pulse 1.9s ease-in-out infinite;
}
.chant--off { opacity: 0; }
.chant--turn { animation: chant-pulse 0.6s ease-in-out infinite; opacity: 0.9; }
.chant--dying {
  animation: none;
  opacity: 0.12;
  letter-spacing: 0.6em;
  transition: opacity 2400ms var(--ease), letter-spacing 2400ms var(--ease);
}
@keyframes chant-pulse {
  0%, 100% { opacity: 0.22; }
  18%      { opacity: 0.62; }
  36%      { opacity: 0.3; }
  54%      { opacity: 0.55; }
}

/* ---------- The segue — the setlist writing itself ---------- */
.segue {
  position: fixed;
  top: 4.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
}
.segue--show { animation: segue-pass 2.4s var(--ease) forwards; }
@keyframes segue-pass {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  18%  { opacity: 0.75; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 0.75; }
  100% { opacity: 0; transform: translateX(-50%) translateY(4px); }
}

/* ---------- Performance reveal ---------- */
.perf-hidden { opacity: 0; transform: translateY(10px); }
.perf-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .chant--on, .chant--turn { animation: none; opacity: 0.4; }
  .overture__eyebrow { animation: none; }
  /* the reveal still breathes, but without movement */
  .perf-hidden { transform: none; }
  .perf-in { transform: none; transition: opacity 450ms ease; }
}

/* ---------- The setlist poster overlay ---------- */
.overlay__panel--setlist { width: min(560px, 100%); text-align: center; }
.setlist-poster {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid color-mix(in srgb, var(--forest-bright) 30%, transparent);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.cta-row--overlay { justify-content: center; margin-top: 1.6rem; }
