/* =============================================================
   DESIGN: bone paper + ink + a single vermilion accent.
   The page is calm and near-monochrome. The two interactions
   (Act 4 sign-flip, Act 5 dials) carry all the liveliness.
   Constraint: no second accent, no gradients, no shadows, no
   card fills. Effects come from type, space, motion, and ONE color.
   ============================================================= */

:root {
  /* Palette — exactly five tokens */
  --paper:     #F4F1EA;   /* warm off-white, the page */
  --paper-2:   #ECE8DE;   /* a barely-darker surface, for tiny inset moments */
  --ink:       #1A1A18;   /* the type and lines */
  --ink-soft:  #5A5A52;   /* secondary text, muted strokes */
  --ink-faint: #A8A59C;   /* hairline rules, tertiary */
  --accent:    #C8442A;   /* the ONE color. Used sparingly. */

  /* Type */
  --display: 'Space Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  --serif:   'Newsreader',    Georgia, 'Times New Roman', serif;
  --mono:    'Space Mono',    Menlo, Consolas, monospace;

  --hairline: 1px solid var(--ink-faint);
  --hairline-ink: 1px solid var(--ink);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--paper); }

/* ---------- Scroll progress: a thin vermilion stroke ---------- */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 2px;
  height: 0%;
  background: var(--accent);
  z-index: 1000;
  transition: height 80ms linear;
}

/* ============================================================= */
/* SECTION FRAMES                                                */
/* Each act gets a layout variation, not a uniform two-column.   */
/* ============================================================= */

.scroll-section {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 7rem 3.5rem;
  min-height: 100vh;
}

.scroll-section + .scroll-section {
  border-top: var(--hairline);
}

/* Default layout: two-column split with sticky graphic on right */
.scroll-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 4rem;
}

.scroll-graphic {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;   /* small viewport height — fits iOS Safari with the
                       address bar shown; no resize jank as it shows/hides */
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-text {
  position: relative;
  z-index: 10;
  padding: 28vh 0;
}

/* Layout variation — text-left graphic-right is the default.
   Apply .layout-mirror to reverse on selected acts. */
.scroll-section.layout-mirror {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.scroll-section.layout-mirror .scroll-graphic { order: -1; }

/* Hero & credits get their own treatment — no two-column. */
.scroll-section.hero,
.scroll-section.credits {
  display: block;
  max-width: 1100px;
}

/* ============================================================= */
/* TYPOGRAPHY                                                    */
/* ============================================================= */

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 400;
  margin: 0 0 1rem;
}

.scroll-text h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 2.5rem;
  color: var(--ink);
}

.scroll-step {
  min-height: 60vh;
  padding: 0 0 4rem;
  font-family: var(--serif);
  font-size: clamp(1.02rem, 1.15vw, 1.18rem);
  line-height: 1.65;
  color: var(--ink-soft);
  transition: color 600ms ease-out, opacity 600ms ease-out;
  opacity: 0.55;
}
.scroll-step.is-active {
  color: var(--ink);
  opacity: 1;
}

.scroll-step p { margin: 0 0 1rem; }
.scroll-step strong { color: var(--ink); font-weight: 600; }
.scroll-step em { font-style: italic; }

/* The ONLY highlight class — accent in italic. */
.hl,
.hl-danger,
.hl-safe {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: 14vh;
  padding-bottom: 14vh;
}

.hero-headline {
  font-family: var(--display);
  font-weight: 300;       /* light — quiet, not weight-800 */
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 2rem;
  max-width: 18ch;
  color: var(--ink);
}
.hero-headline .hl { color: var(--accent); font-style: italic; font-weight: 300; }

.hero-subhead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 5rem;
  max-width: 38ch;
}

/* Hero stage — counter sits to the right, headline reads down the left */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
  gap: 5rem;
}
.hero .scroll-graphic {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  align-items: center;
  justify-content: flex-start;
}
.hero .hero-text {
  padding: 8vh 0;
}

.hero-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-top: var(--hairline-ink);
  border-bottom: var(--hairline-ink);
  padding: 2rem 0 1.25rem;
  /* Promote to its own compositor layer so the per-frame translateY in
     costCurve.js doesn't trigger layout/paint on the whole document. */
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.hero-counter {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}
.hero-counter-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero-counter-value {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(3rem, 7.5vw, 6rem);
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  transition: color 220ms ease;
}
.hero-counter-year {
  font-family: var(--mono);
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  color: var(--ink);
  font-weight: 400;
  letter-spacing: 0.04em;
}
.hero-step {
  min-height: 40vh;
}
.hero-prompt {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
}

/* ---------- Pull quotes ---------- */
.pull-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1.85vw, 1.6rem);
  line-height: 1.45;
  padding: 1.5rem 0;
  margin: 1.75rem 0;
  border-top: var(--hairline-ink);
  border-bottom: var(--hairline-ink);
  color: var(--ink);
}
.pull-quote cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--ink-soft);
}

.caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- Caveat / definition callouts: now flat, hairline only ---------- */
.caveat-card,
.defn {
  border-top: var(--hairline);
  border-bottom: var(--hairline);
  padding: 1rem 0;
  margin: 1.25rem 0;
  background: transparent;
}
.caveat-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
}
.defn {
  font-family: var(--serif);
  font-size: 0.98rem;
  color: var(--ink);
}
.defn em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.conclusion-card {
  border-top: var(--hairline-ink);
  border-bottom: var(--hairline-ink);
  padding: 1.5rem 0;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.5vw, 1.4rem);
  line-height: 1.5;
  background: transparent;
}
.conclusion-card p { margin: 0 0 0.6rem; }
.conclusion-card p:last-child { margin: 0; }
.conclusion-tag {
  font-family: var(--display);
  font-weight: 500;
  margin-top: 1.5rem !important;
  padding-top: 1rem;
  border-top: var(--hairline);
  color: var(--accent);
}
.conclusion-tag strong {
  color: var(--accent);
  font-weight: 500;
  font-style: italic;
}

/* ============================================================= */
/* CHARTS — no cards, just titles + figure + source              */
/* ============================================================= */

.chart-frame {
  width: 100%;
  max-width: 560px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.chart-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
  font-weight: 400;
}

.chart-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  line-height: 1.55;
  padding-bottom: 0.85rem;
  border-bottom: var(--hairline);
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-source {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin: 1.25rem 0 0;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

/* Wider treatment per act */
.chart-frame-exposure,
.chart-frame-flip,
.two-camps-frame,
.two-dials-frame {
  max-width: 620px;
}

/* ============================================================= */
/* D3 chart styling — ink + accent only                          */
/* ============================================================= */

.axis path,
.axis line { stroke: var(--ink-faint); shape-rendering: crispEdges; }
.axis text { fill: var(--ink-soft); font-family: var(--mono); font-size: 10px; }
.axis-label { font-family: var(--mono); font-size: 10px; fill: var(--ink-soft); }

.gridline { stroke: var(--ink-faint); stroke-dasharray: 2,3; opacity: 0.4; }

.bar           { transition: fill 220ms ease; }
.bar-label     { font-family: var(--mono); font-size: 10px; fill: var(--ink); }

.line          { fill: none; stroke-width: 2px; }
.line-label    { font-family: var(--mono); font-size: 10.5px; fill: var(--ink); }

/* ============================================================= */
/* ACT 1 — Two Camps                                             */
/* (Lines and dividers are styled in JS via inline attrs.)       */
/* ============================================================= */

/* ============================================================= */
/* ACT 2 — Worker pictogram                                      */
/* Standing workers = vermilion (the irreducibly-human).         */
/* Fallen workers   = ink-faint (commoditized).                  */
/* ============================================================= */

.exposure-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px 0 8px;
  width: 100%;
}

.exposure-row {
  display: grid;
  grid-template-columns: 128px 1fr 42px;
  align-items: center;
  gap: 12px;
}

.exposure-label {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.exposure-track {
  display: flex;
  gap: 1px;
  height: 30px;
  align-items: flex-end;
  border-bottom: 1px solid var(--ink-faint);
}

/* Hand-drawn stick-figure worker. Each one is a tiny SVG; the
   "hand-drawn" feel comes from a small per-instance rotation set
   inline as --tilt (computed deterministically in JS from row+idx). */
.worker {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 24px;
  background: transparent;
  border: 0;
  transform-origin: bottom center;
}
.worker svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  color: var(--ink-faint);
  transform-origin: 50% 100%;
}

.worker-human {
  fill: currentColor;
  stroke: currentColor;
  opacity: 0.32;
  /* transform-box: fill-box makes transform-origin resolve against this
     group's own bounding box — without it Safari measures the origin
     against the SVG viewport and the figures rotate around the wrong
     point (or fly off). */
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: rotate(var(--tilt, 0deg));
  transition:
    opacity         380ms ease-out,
    transform       500ms cubic-bezier(0.32, 0, 0.32, 1),
    color           380ms ease-out;
  transition-delay: calc(var(--idx, 0) * 22ms);
}

.worker-ghost {
  stroke: var(--ink-faint);
  fill: none;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition:
    opacity 380ms ease-out;
  transition-delay: calc(var(--idx, 0) * 22ms);
}

/* Active states — fallen (the displaced) */
.worker.exposed-high,
.worker.exposed-mid,
.worker.exposed-low,
.worker.fallen {
  /* the standing figure fades and slumps; the ghost-mark fades in */
}
.worker.fallen .worker-human {
  opacity: 0;
  transform: rotate(var(--tilt, 0deg)) translateY(8px) scaleY(0.35);
}
.worker.fallen .worker-ghost {
  opacity: 0.75;
}

/* Active states — standing human (the survivors) */
.worker.human svg { color: var(--accent); }
.worker.human .worker-human { opacity: 1; }

.exposure-percent {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-soft);
  text-align: left;
  opacity: 0;
  transition: opacity 380ms ease-out 200ms;
}
.exposure-row.is-revealed .exposure-percent { opacity: 1; color: var(--ink); }

/* The survivors get a faint vermilion glow on the final caption step.
   Filter on the SVG group, not the worker div, since the div is transparent. */
.exposure-grid.emphasize-human .worker.human .worker-human {
  filter: drop-shadow(0 0 1.6px rgba(200, 68, 42, 0.55));
}

/* ============================================================= */
/* ACT 4 — Sign-flip centerpiece                                 */
/* Squeeze half: ink. Rebound half: accent.                      */
/* (Stroke colors set inline by JS.)                             */
/* ============================================================= */

.supporting-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: var(--hairline);
}

.supporting-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin: 0 0 0.85rem;
}

/* stat cards — now flat, hairline-only */
.stat-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: var(--hairline);
}
.stat-card { padding: 0; }
.stat-number {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}
.stat-text {
  font-family: var(--serif);
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--ink);
}
.stat-source {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-faint);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

/* ============================================================= */
/* ACT 6 step 7 — Contestation evidence (counter-arrows beat)    */
/* ============================================================= */

.contestation-evidence {
  border-top: var(--hairline);
  border-bottom: var(--hairline);
  padding: 1.4rem 0 1.25rem;
  margin: 1.5rem 0 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}
.contestation-evidence.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.contestation-eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 1.1rem;
}

.contestation-grid {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 1.1rem;
  align-items: start;
}

/* The thin vertical hairline rule between the two columns —
   no card chrome, no fills, just the rule itself. */
.contestation-grid::after {
  content: '';
  grid-column: 2;
  grid-row: 1;
  width: 1px;
  height: 100%;
  background: var(--ink-faint);
  justify-self: center;
}

.contestation-col {
  display: flex;
  flex-direction: column;
}
.contestation-col:first-child { grid-column: 1; }
.contestation-col:last-child  { grid-column: 3; }

/* The directional arrows — the conceptual move. Each column carries
   an arrow at the top, pointing OUTWARD: ← on the left column,
   → on the right column. The reader's eye reads the two as forces
   being applied in opposite directions, away from the human-favoring
   centerline. */
.contestation-arrow {
  font-family: var(--mono);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 0.55rem;
}
.contestation-arrow-left  { text-align: left;  }
.contestation-arrow-right { text-align: right; }

.contestation-col:first-child  { text-align: left;  }
.contestation-col:last-child   { text-align: left;  } /* keep body legible — only the arrow mirrors */

.contestation-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
}

.contestation-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.contestation-number {
  font-family: var(--mono);
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
  /* count-up will overwrite textContent each frame */
}

.contestation-body {
  font-family: var(--serif);
  font-size: 0.93rem;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 0.7rem;
}

.contestation-source {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

@media (max-width: 700px) {
  /* On mobile, columns stack vertically. The "outward" gesture
     survives the stacking by re-aiming the arrows up/down — Dial A
     up (pushed away from human), Dial B down (pushed away from
     complement). */
  .contestation-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .contestation-grid::after {
    width: 100%;
    height: 1px;
    grid-column: 1;
    grid-row: 2;
  }
  .contestation-col:first-child  { grid-column: 1; grid-row: 1; }
  .contestation-col:last-child   { grid-column: 1; grid-row: 3; }
  .contestation-arrow-left::before  { content: '\2191'; }   /* ↑ */
  .contestation-arrow-right::before { content: '\2193'; }   /* ↓ */
  .contestation-arrow-left,
  .contestation-arrow-right {
    font-size: 0;   /* hide the original glyph */
  }
  .contestation-arrow-left::before,
  .contestation-arrow-right::before {
    font-size: 1.6rem;
    font-family: var(--mono);
    color: var(--accent);
  }
}

/* ============================================================= */
/* ACT 5 — Two Dials (custom drag knobs, no <input type=range>)  */
/* ============================================================= */

.two-dials-widget {
  margin: 0 0 1.5rem;
}

.dial-group {
  padding: 1.1rem 0;
  border-top: var(--hairline);
  transition: opacity 320ms ease;
  opacity: 0.65;
}
.dial-group:last-of-type { border-bottom: var(--hairline); }
.dial-group.is-active { opacity: 1; }

.dial-label {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}
.dial-letter {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.12rem 0.4rem;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
.dial-question {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.005em;
}

.dial-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.4fr minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}
.dial-anchor {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.anchor-bad  { text-align: right; }
.anchor-good { text-align: left; color: var(--accent); }

/* Custom dial track — built as SVG. The wrapper carries the
   pointer events and keyboard focus state. */
.dial-knob {
  position: relative;
  width: 100%;
  height: 44px;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;  /* no gray flash on iOS tap */
  -webkit-user-select: none;
  user-select: none;                          /* no text selection while dragging */
  cursor: ew-resize;
  outline: none;
}
.dial-knob:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.dial-knob svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dial-current {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 0.6rem;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Outcome — restrained box; the accent earns its appearance */
.dial-outcome {
  margin-top: 1.5rem;
  padding: 1rem 0;
  border-top: var(--hairline-ink);
  border-bottom: var(--hairline-ink);
  text-align: left;
  transition: border-color 420ms ease;
}
.dial-outcome.outcome-good { border-color: var(--accent); }
.dial-outcome.outcome-bad  { border-color: var(--ink); }

.dial-status-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  display: block;
  margin-bottom: 0.45rem;
}
.dial-status {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  color: var(--ink);
  letter-spacing: -0.005em;
  transition: color 420ms ease;
  font-style: italic;
}
.outcome-good .dial-status { color: var(--accent); font-style: italic; }

.dial-caveat {
  text-align: left !important;
  margin-top: 0.85rem !important;
  font-size: 0.78rem !important;
  color: var(--ink-faint) !important;
  font-family: var(--mono) !important;
  font-style: normal !important;
  border-bottom: none !important;
  border-top: none !important;
  letter-spacing: 0.02em;
  padding-bottom: 0 !important;
}

.uncertainty-beat {
  border-top: var(--hairline);
  border-bottom: var(--hairline);
  padding: 1.1rem 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}
.uncertainty-beat.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.uncertainty-eyebrow {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
  display: block;
}

/* ============================================================= */
/* ACT 6 — Jordan flowchart (revealed on step 5)                  */
/* ============================================================= */

#jordan-flowchart {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: var(--hairline);
}
#jordan-flowchart.visible { display: block; }

.flow-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.flow-box {
  border: 1px solid var(--ink);
  padding: 0.65rem 0.55rem;
  font-size: 0.78rem;
  text-align: center;
  font-family: var(--mono);
  color: var(--ink);
  line-height: 1.3;
}
.flow-box.flow-end {
  border-color: var(--accent);
  color: var(--accent);
}
.flow-arrow {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 1.1rem;
}
.flow-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.6rem 0 0;
  text-align: center;
}

/* ============================================================= */
/* ACT 8 — Methodology                                            */
/* ============================================================= */

.credits {
  padding: 7rem 3.5rem;
  background: var(--paper);
  display: block;
}
.credits-inner {
  max-width: 720px;
  margin: 0 auto;
}
.credits h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 1.5rem;
  letter-spacing: -0.015em;
}
.credits h3 {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 2.5rem 0 0.85rem;
  font-weight: 400;
  padding-top: 1rem;
  border-top: var(--hairline);
}

.credits-lede {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 2rem;
}
.credits-lede em { font-style: italic; color: var(--ink); }

.credits-list {
  font-family: var(--serif);
  font-size: 0.96rem;
  line-height: 1.6;
  padding-left: 1.25rem;
  color: var(--ink);
}
.credits-list li { margin-bottom: 0.6rem; }
.credits-list strong { color: var(--ink); font-weight: 600; }

.credits-note {
  font-family: var(--serif);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-soft);
  font-style: italic;
  margin: 1.5rem 0 0;
}

.credits-note code,
code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
  background: transparent;
  padding: 0;
}

.credits a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
}

.back-to-top {
  margin-top: 4rem;
  text-align: center;
}
.back-to-top a {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
}

/* ============================================================= */
/* MOBILE                                                         */
/* ============================================================= */

@media (max-width: 900px) {
  .scroll-section {
    grid-template-columns: 1fr;
    padding: 4rem 1.5rem;
    gap: 1.5rem;
  }
  .scroll-section.hero { grid-template-columns: 1fr; padding: 5rem 1.5rem; }
  .hero .scroll-graphic, .scroll-graphic {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    height: 55vh;
    height: 55svh;
    background: var(--paper);
    /* On mobile the chart is pinned to the top and the text scrolls in the
       space below it. The opaque chart MUST sit above the text — otherwise
       text scrolls over the chart and (because it's on top) both hides the
       visuals and intercepts pointer events. */
    z-index: 20;
    padding: 1rem 0;
    border-bottom: var(--hairline);
    /* Anchor tall charts to the TOP of the pinned area rather than centering
       them — centering pushes content (titles, top rows, the first dial)
       above the visible band where it's clipped and unreachable. */
    align-items: flex-start;
    overflow: hidden;
  }
  /* The Act-5 dials are interactive AND taller than the pinned band, so they
     can't live in a fixed-height clipped container on mobile. Let this one
     act flow naturally — the whole widget renders and every control is
     reachable. (Trade-off: the dial-group highlight on scroll steps isn't
     visible on mobile, but the widget itself works, which matters more.) */
  #act-5 .scroll-graphic {
    position: static;
    height: auto;
    overflow: visible;
    border-bottom: none;
    padding-bottom: 2rem;
  }
  .scroll-section.layout-mirror .scroll-graphic { order: 0; }
  .scroll-text { padding: 4vh 0; position: relative; z-index: 1; }
  .scroll-step { min-height: 50vh; padding-bottom: 2rem; }
  .hero-text { padding: 2vh 0 0; }
  .stat-card-row { grid-template-columns: 1fr; }
  .credits { padding: 4rem 1.5rem; }
  .exposure-row { grid-template-columns: 92px 1fr 34px; gap: 6px; }
  .exposure-label { font-size: 8.5px; }
  .exposure-track { height: 24px; }
  .worker { height: 20px; }
  .dial-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .anchor-bad, .anchor-good { text-align: center; }
}
