/* ==========================================================================
   One Man and a Computer: styles
   Dark, cinematic, terminal accents. Mobile-first. No inline styles needed.
   Contrast for every text/background pair is verified by tools/contrast.py
   ========================================================================== */

:root {
  --bg: #0a0b0f;
  --surface: #12141a;
  --surface-2: #181b23;
  --line: #2a2d38;
  --text: #e8e6e1;
  --muted: #8a8d98;           /* 5.9:1 on bg, 5.6:1 on surface */
  --red: #e5383b;             /* 4.6:1 on bg: large text, UI and accents only */
  --red-text: #f06b6d;        /* lighter red for small text on any surface */
  --amber: #f4a261;
  --est: #8fd6b4;
  --plaus: #f4a261;
  --spec: #c3b1e1;

  --font-display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4: clamp(2.6rem, 1.8rem + 4.2vw, 5.6rem);

  --space: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  --radius: 10px;
  --maxw: 72rem;
  --header-h: 3.5rem;
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--amber); text-underline-offset: 0.18em; }
a:hover { color: var(--text); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p, ul, ol, dl { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
strong { color: #fff; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--red-text); }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--amber); color: var(--bg); padding: 0.75rem 1rem; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- atmosphere: grain, vignette, progress ---------- */
.fx-grain, .fx-vignette { position: fixed; pointer-events: none; z-index: 60; }
.fx-grain {
  inset: -100%;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
.fx-vignette { inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%); }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-5%, 3%); } 40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 5%); } 80% { transform: translate(6%, 2%); } 100% { transform: translate(0, 0); }
}
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; background: transparent; }
.progress__bar { height: 100%; background: var(--red); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- header / nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70; height: var(--header-h);
  background: rgba(10, 11, 15, 0.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { max-width: var(--maxw); margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space); }
.nav__brand { font-family: var(--font-mono); color: var(--text); text-decoration: none; font-weight: 500; letter-spacing: 0.08em; min-height: 44px; display: inline-flex; align-items: center; gap: 0.4em; }
.nav__cursor { color: var(--red-text); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav__toggle {
  min-height: 44px; min-width: 44px; padding: 0 0.9rem; border-radius: 6px;
  background: transparent; color: var(--text); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: var(--step--1); cursor: pointer;
}
.nav__list {
  display: none; list-style: none; margin: 0; padding: 0.5rem var(--space) 1rem;
  position: absolute; top: var(--header-h); left: 0; right: 0;
  background: rgba(10, 11, 15, 0.97); border-bottom: 1px solid var(--line);
}
.nav__list.is-open { display: block; }
.nav__list a {
  display: flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none;
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.04em;
}
.nav__list a:hover, .nav__list a.is-current { color: var(--text); }
.nav__list a.is-current::before { content: "▸ "; color: var(--red-text); white-space: pre; }
html:not(.js) .nav__toggle { display: none; }
html:not(.js) .nav__list { display: flex; flex-wrap: wrap; position: static; background: none; border: 0; padding: 0; gap: 0 0.8rem; }

@media (min-width: 64rem) {
  .nav__toggle { display: none; }
  .nav__list { display: flex; position: static; background: none; border: 0; padding: 0; gap: 0.15rem 1rem; flex-wrap: wrap; justify-content: flex-end; }
}

/* ---------- scenes ---------- */
main { display: block; }
.scene { position: relative; min-height: 100vh; padding: calc(var(--header-h) + 3rem) var(--space) 4rem; border-bottom: 1px solid #15171e; }
.scene__inner { max-width: var(--maxw); margin: 0 auto; position: relative; }
.scene--about { min-height: auto; background: #07080b; }

.eyebrow { font-size: var(--step--1); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.8rem; }
.eyebrow__num { color: var(--red-text); margin-right: 0.6em; }
.lede { font-size: var(--step-1); line-height: 1.5; max-width: 48rem; color: #d6d3cc; }
.sub { font-size: var(--step-2); margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; }
.note { font-size: var(--step--1); color: var(--muted); border-left: 2px solid var(--line); padding-left: 0.8rem; }

/* slow-pulsing red line motif */
.redline { height: 1px; margin-bottom: 2rem; background: linear-gradient(90deg, transparent, var(--red) 30%, var(--red) 70%, transparent); animation: redpulse 4.5s ease-in-out infinite; }
.redline--calm { background: linear-gradient(90deg, transparent, var(--amber) 30%, var(--amber) 70%, transparent); }
@keyframes redpulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------- hero ---------- */
.scene--hero { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100svh; }
.hero { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 2rem; align-items: center; width: 100%; }
.hero__title { font-size: var(--step-4); font-weight: 800; line-height: 0.98; margin: 0 0 1.2rem; letter-spacing: -0.02em; }
.hero__hook { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.25; margin-bottom: 1.6rem; max-width: 34rem; }
.hero__meta { font-size: var(--step--1); color: var(--muted); line-height: 2.1; }
.hero__art { margin: 0; }
.hero__art svg { width: 100%; height: auto; aspect-ratio: 640 / 420; }
.thesis { border-left: 3px solid var(--red); background: linear-gradient(90deg, rgba(229, 56, 59, 0.08), transparent); padding: 0.9rem 1.1rem; margin-bottom: 1.4rem; max-width: 40rem; }
.thesis__label { font-size: var(--step--1); color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.4rem; display: flex; gap: 0.6rem; align-items: center; }
.thesis__text { margin: 0; }
.scroll-cue { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.4rem; color: var(--muted); text-decoration: none; font-size: var(--step--1); letter-spacing: 0.2em; text-transform: uppercase; min-height: 44px; min-width: 44px; }
.scroll-cue__line { width: 1px; height: 2.6rem; background: linear-gradient(var(--red), transparent); animation: cue 2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (min-width: 56rem) { .hero { grid-template-columns: 1.1fr 0.9fr; } }

/* glitch title (subtle, periodic) */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); content: attr(data-text) / "";
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
}
.glitch::before { color: var(--red); transform: translate(-2px, 0); animation: glitch-a 7s infinite steps(1); }
.glitch::after { color: var(--amber); transform: translate(2px, 0); animation: glitch-b 7s infinite steps(1); }
@keyframes glitch-a {
  0%, 91%, 100% { opacity: 0; clip-path: inset(0 0 0 0); }
  92% { opacity: 0.8; clip-path: inset(10% 0 70% 0); }
  94% { opacity: 0.8; clip-path: inset(55% 0 25% 0); transform: translate(3px, 0); }
  96% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 92%, 100% { opacity: 0; clip-path: inset(0 0 0 0); }
  93% { opacity: 0.7; clip-path: inset(68% 0 8% 0); }
  95% { opacity: 0.7; clip-path: inset(30% 0 50% 0); transform: translate(-3px, 0); }
  97% { opacity: 0; }
}

/* svg art animation hooks */
.art-pulse { stroke-dasharray: 14 400; animation: pulse-run 5s linear infinite; }
@keyframes pulse-run { from { stroke-dashoffset: 414; } to { stroke-dashoffset: 0; } }
.art-blink { animation: redpulse 2.4s ease-in-out infinite; }
.art-glow { animation: glow 6s ease-in-out infinite; transform-origin: 430px 268px; }
@keyframes glow { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
.art-band { margin: 3rem 0 0; opacity: 0.9; }
.art-band svg { width: 100%; height: auto; aspect-ratio: 1200 / 170; }
.art-map { margin: 0 0 2rem; }
.art-map svg { width: 100%; height: auto; aspect-ratio: 2 / 1; max-height: 340px; }
.art-dominoes { margin: 1rem 0 0; }
.art-dominoes svg { width: 100%; height: auto; aspect-ratio: 620 / 170; }

/* ---------- reveal on scroll (only when JS is running) ---------- */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s ease, transform 0.8s ease; }
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- tags, citations, confidence ---------- */
.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; vertical-align: 0.12em;
  padding: 0.3em 0.5em 0.25em; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap;
}
.tag--established { color: var(--est); background: rgba(143, 214, 180, 0.08); }
.tag--plausible { color: var(--plaus); background: rgba(244, 162, 97, 0.08); }
.tag--speculative { color: var(--spec); background: rgba(195, 177, 225, 0.08); border-style: dashed; }
.tag--established::before { content: "● "; }
.tag--plausible::before { content: "◐ "; }
.tag--speculative::before { content: "○ "; }
.cite { font-family: var(--font-mono); font-size: 0.78em; text-decoration: none; color: var(--amber); padding: 0.1em 0.05em; }
.cite:hover { text-decoration: underline; }
.verify { color: var(--amber); background: rgba(244, 162, 97, 0.12); padding: 0 0.3em; border-radius: 3px; font-size: 0.85em; }
.confidence { font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted); min-height: 1.65em; margin-bottom: 1.5rem; }
.confidence__level { padding: 0.15em 0.5em; border-radius: 3px; border: 1px solid var(--line); margin: 0 0.4em; color: var(--text); }
.confidence__level--high { border-color: var(--est); color: var(--est); }
.confidence__level--medium { border-color: var(--plaus); color: var(--plaus); }
.confidence__level--low { border-color: var(--spec); color: var(--spec); }
.claim { margin-bottom: 0.9em; }
.claims { list-style: none; padding: 0; margin: 1.5rem 0; }
.claims .claim { padding-left: 0; }

/* ---------- cards & grids ---------- */
.grid-2, .grid-3 { display: grid; gap: var(--space); margin: 2rem 0; }
@media (min-width: 48rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 60rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 1rem + 1vw, 1.6rem); }
.card h3 { margin-top: 0; }
.card__kicker { font-size: var(--step--1); color: var(--red-text); letter-spacing: 0.1em; margin-bottom: 0.4rem; }
.card--alert { border-color: var(--red); }
.card--open { border-style: dashed; border-color: var(--spec); margin-top: 2.5rem; }
.card--action h3 { color: var(--amber); }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--amber); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.1rem 1.3rem; margin: 2rem 0; }
.callout .claim:last-child { margin-bottom: 0; }
.actions { padding-left: 1.1em; }
.actions li { margin-bottom: 0.6em; }
.actions__links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 44px; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer;
  font: 500 var(--step--1) / 1.2 var(--font-mono); letter-spacing: 0.03em; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { border-color: var(--amber); color: var(--text); }
.btn--primary { background: var(--amber); color: var(--bg); border-color: var(--amber); font-weight: 600; }
.btn--primary:hover { background: #f7b882; color: var(--bg); }
.btn--ghost { background: transparent; }
.btn--chip { min-height: 44px; padding: 0.4rem 0.85rem; border-radius: 999px; }
.btn--chip.is-active, .btn--chip[aria-pressed="true"] { border-color: var(--red); background: rgba(229, 56, 59, 0.12); }

/* ---------- pathways ---------- */
.pathways { display: grid; gap: 0.9rem; margin: 2rem 0; }
.pathway { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pathway[open] { border-color: #3a3e4c; }
.pathway summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
  padding: 1rem 1.2rem; min-height: 44px; border-radius: var(--radius);
}
.pathway summary::-webkit-details-marker { display: none; }
.pathway summary:hover { background: var(--surface-2); }
.pathway__head { display: flex; flex-direction: column; gap: 0.15rem; }
.pathway__num { color: var(--red-text); font-size: var(--step--1); letter-spacing: 0.15em; }
.pathway__title { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; line-height: 1.2; }
.pathway__hook { color: var(--muted); font-size: var(--step--1); }
.pathway__chev { width: 12px; height: 12px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.25s; margin-right: 0.3rem; }
.pathway[open] .pathway__chev { transform: rotate(225deg); }
.pathway__body { padding: 0.2rem 1.2rem 1.2rem; border-top: 1px solid var(--line); }
.pathway__h { font-family: var(--font-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 1.4rem 0 0.6rem; font-weight: 500; }
.pathway__h--protect { color: var(--est); }
.pathway__body .claims { margin: 0; }

.leftout { margin-top: 2.5rem; border: 1px solid var(--red); border-radius: var(--radius); padding: 1.4rem; background: repeating-linear-gradient(-45deg, rgba(229, 56, 59, 0.035) 0 10px, transparent 10px 20px); }
.leftout h3 { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.leftout__icon { font-size: var(--step--1); background: var(--text); color: var(--bg); padding: 0.15em 0.45em; letter-spacing: 0.08em; }
.leftout__list li { margin-bottom: 0.4em; }

/* ---------- cascade ---------- */
.cascade { display: grid; gap: var(--space); margin: 2rem 0; align-items: start; }
@media (min-width: 60rem) { .cascade { grid-template-columns: 1.25fr 1fr; } }
.cascade__figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.cascade__figure svg { width: 100%; height: auto; aspect-ratio: 600 / 510; }
.cascade__figure figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.8rem; }
.cascade__panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.cascade__h { margin-top: 0; }
.cascade__help { color: var(--muted); font-size: var(--step--1); }
.cascade__buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.cascade__log { list-style: none; padding: 0; margin: 0; font-size: var(--step--1); min-height: 6rem; }
.cascade__log li { padding: 0.45rem 0; border-bottom: 1px dashed var(--line); color: #d6d3cc; }
.cascade__log .t { color: var(--red-text); margin-right: 0.5em; }
#cascade-svg .edge { transition: stroke 0.4s, stroke-width 0.4s; }
#cascade-svg .edge.is-hot { stroke: var(--red); stroke-width: 2.6; marker-end: url(#arrow-hot); stroke-dasharray: 6 6; animation: flow 0.8s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -12; } }
#cascade-svg .node circle { transition: stroke 0.4s, fill 0.4s; }
#cascade-svg .node.is-failed circle { stroke: var(--red); fill: #2a0e10; stroke-width: 2.4; }
#cascade-svg .node.is-origin circle { stroke: var(--red); fill: #3d1114; stroke-width: 3.2; }
#cascade-svg .node.is-failed .node__status, #cascade-svg .node.is-origin .node__status { fill: var(--red-text); }

/* ---------- timeline ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.5rem; }
.timeline { list-style: none; padding: 0 0 0 1.4rem; margin: 0; border-left: 1px solid var(--line); }
.timeline__item { position: relative; padding: 0 0 1.8rem 1rem; }
.timeline__item::before { content: ""; position: absolute; left: calc(-1.4rem - 5px); top: 0.45rem; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
.timeline__item[data-domain="cyber"]::before, .timeline__item[data-domain="ai-agents"]::before { border-color: var(--red); }
.timeline__item[data-domain="infrastructure"]::before { border-color: var(--amber); }
.timeline__date { font-family: var(--font-mono); font-size: var(--step--1); color: var(--amber); letter-spacing: 0.05em; }
.timeline__title { font-size: var(--step-1); margin: 0.15rem 0 0.3rem; }
.timeline__meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-bottom: 0.4rem; display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; }
.timeline__lesson { color: #d6d3cc; font-style: italic; border-left: 2px solid var(--red); padding-left: 0.7rem; margin: 0.4rem 0; }
.timeline__item[hidden] { display: none; }

.stamp { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--spec); border: 2px dashed var(--spec); padding: 0.3em 0.6em; border-radius: 4px; font-weight: 500; }
.scenario__disclaimer { color: var(--spec); font-family: var(--font-mono); font-size: var(--step--1); border: 1px dashed var(--spec); border-radius: var(--radius); padding: 0.9rem 1rem; }
.scenario { list-style: none; padding: 0; display: grid; gap: var(--space); margin: 1.5rem 0 0; }
@media (min-width: 56rem) { .scenario { grid-template-columns: repeat(3, 1fr); } }
.scenario__item { background: var(--surface); border: 1px dashed #4a4560; border-radius: var(--radius); padding: 1.2rem; position: relative; }
.scenario__window { font-family: var(--font-mono); color: var(--spec); font-size: var(--step--1); letter-spacing: 0.08em; }
.scenario__item h4 { font-size: var(--step-1); margin: 0.3rem 0 0.6rem; }
.scenario__anchors { font-size: 0.8rem; color: var(--muted); margin: 0.8rem 0 0; }

/* ---------- stats & charts ---------- */
.stats { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin: 2rem 0 3rem; min-height: 10rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.3rem; }
.stat__value { font-family: var(--font-display); font-size: var(--step-3); font-weight: 800; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat__value .u { color: var(--red-text); }
.stat__label { font-size: var(--step--1); color: #d6d3cc; line-height: 1.4; }
.stat__src { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); margin-top: auto; }

.chart-pair, .chart-grid { display: grid; gap: var(--space); margin: 2rem 0; }
@media (min-width: 60rem) {
  .chart-pair, .chart-grid { grid-template-columns: 1fr 1fr; }
  .chart-slot--wide { grid-column: 1 / -1; }
}
.chart-slot { min-height: 28rem; }
.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; height: 100%; display: flex; flex-direction: column; }
.chart__title { font-size: var(--step-1); margin-bottom: 0.3rem; }
.chart__tags { margin-bottom: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chart__canvas { position: relative; height: 300px; }
.chart-slot--wide .chart__canvas { height: 360px; }
.chart__canvas canvas { width: 100% !important; height: 100% !important; }
.chart__loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--font-mono); font-size: var(--step--1); }
.chart__summary { font-size: var(--step--1); color: #d6d3cc; margin: 0.9rem 0 0.6rem; }
.chart details { font-size: var(--step--1); }
.chart summary { cursor: pointer; color: var(--amber); font-family: var(--font-mono); min-height: 44px; display: flex; align-items: center; }
.chart figcaption { font-size: 0.78rem; color: var(--muted); margin-top: auto; padding-top: 0.6rem; font-family: var(--font-mono); }
.table-wrap { overflow-x: auto; max-height: 22rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-family: var(--font-mono); position: sticky; top: 0; background: var(--surface-2); }
td.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ---------- objections ---------- */
.objections { display: grid; gap: 0.8rem; margin: 1.5rem 0; }
.objection { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.objection summary { list-style: none; cursor: pointer; padding: 1rem 1.2rem; display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: baseline; min-height: 44px; }
.objection summary::-webkit-details-marker { display: none; }
.objection summary:hover { background: var(--surface-2); }
.objection__n { font-family: var(--font-mono); color: var(--red-text); font-size: var(--step--1); }
.objection__q { font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; line-height: 1.3; }
.objection__body { padding: 0 1.2rem 1.2rem; display: grid; gap: 1rem; }
@media (min-width: 48rem) { .objection__body { grid-template-columns: 1fr 1fr; } }
.objection__label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.3rem; }
.objection__label--right { color: var(--est); }
.objection__label--resp { color: var(--amber); }
.objection__refs { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); margin: 0; }
.objection[open] .pathway__chev { transform: rotate(225deg); }
.open-questions li { margin-bottom: 0.5em; }

/* ---------- sources ---------- */
.taglegend { display: grid; grid-template-columns: auto 1fr; gap: 0.7rem 1rem; align-items: baseline; }
.taglegend dd { margin: 0; color: #d6d3cc; font-size: var(--step--1); }
.sources { font-size: var(--step--1); padding-left: 0; list-style: none; counter-reset: none; columns: 1; }
@media (min-width: 64rem) { .sources { columns: 2; column-gap: 2.5rem; } }
.sources li { break-inside: avoid; margin-bottom: 0.8rem; display: grid; grid-template-columns: 2.8rem 1fr; gap: 0.3rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.sources li:target { background: rgba(244, 162, 97, 0.1); outline: 1px solid var(--amber); border-radius: 4px; }
.sources .n { font-family: var(--font-mono); color: var(--amber); }
.sources a { word-break: break-word; }
.sources .meta { color: var(--muted); }

/* ---------- footer, consent ---------- */
.site-footer { padding: 2rem var(--space) 3rem; text-align: center; color: var(--muted); font-size: var(--step--1); background: #07080b; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.consent { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 90; max-width: 40rem; margin: 0 auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.consent p { font-size: var(--step--1); }
.consent__buttons { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.notfound__code { font-family: var(--font-mono); color: var(--red-text); letter-spacing: 0.3em; }

/* ---------- reduced motion: disable animation and grain ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fx-grain { display: none; }
  html.js .reveal { opacity: 1; transform: none; }
  .glitch::before, .glitch::after { display: none; }
  .redline { opacity: 0.6; }
}

/* ---------- print ---------- */
@media print {
  .fx-grain, .fx-vignette, .progress, .site-header, .scroll-cue, .consent, .filters, .cascade__buttons { display: none !important; }
  body { background: #fff; color: #000; }
  .scene { min-height: 0; padding: 1rem 0; }
  html.js .reveal { opacity: 1; transform: none; }
  details > *:not(summary) { display: block; }
  a { color: #000; }
}
