@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

/* Stage — dark editorial theme. Chart colors live in data.js (COLORS) and mirror these tokens. */
:root {
  color-scheme: dark;
  --bg: #111215;
  --bg-2: #16171b;
  --raise: #1c1d22;
  --line: #2a2c32;
  --line-2: #3a3c43;
  --ink: #eeeae2;
  --ink-2: #bdb8ad;
  --muted: #85817a;
  --death: #ff7d66;
  --cases: #6cb3e6;
  --women: #e98fb8;
  --men: #7fa6f0;
  --display: 'Instrument Serif', Georgia, serif;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  --header: 60px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--death); outline-offset: 3px; }
::selection { background: #ff7d6640; }
.page-wrap { max-width: 1240px; margin: 0 auto; padding: 0 48px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
b { font-weight: 600; color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; height: var(--header); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font: 26px/1 var(--display); text-decoration: none; letter-spacing: -0.3px; }
.brand-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.brand-bars i { display: block; width: 4px; border-radius: 1.5px; }
.brand-bars i:nth-child(1) { height: 6px; background: #7f3536; }
.brand-bars i:nth-child(2) { height: 10px; background: #cf5847; }
.brand-bars i:nth-child(3) { height: 14px; background: #ef775c; }
.brand-bars i:nth-child(4) { height: 18px; background: #ffa487; }
.story-nav { display: flex; gap: 24px; margin-left: 24px; margin-right: auto; }
.story-nav a { font-size: 13px; color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.story-nav a:hover { color: var(--ink); }
.story-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--death); }
.lab-link { font-size: 12px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.lab-link:hover { color: var(--ink); }
.read-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--death); }

/* Chapter rail */
.rail { position: fixed; right: 30px; top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; align-items: flex-end; }
.rail a { position: relative; display: flex; align-items: center; justify-content: flex-end; padding: 6px 0 6px 14px; text-decoration: none; }
.rail i { display: block; width: 14px; height: 2px; border-radius: 2px; background: var(--line-2); transition: width .25s, background .25s; }
.rail a:hover i { background: var(--ink-2); width: 18px; }
.rail a[aria-current="true"] i { width: 30px; height: 3px; background: var(--death); }
.rail-label { position: absolute; right: calc(100% + 4px); white-space: nowrap; font-size: 12px; color: var(--ink); background: var(--raise); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px 9px; opacity: 0; transform: translateX(6px); transition: opacity .18s, transform .18s; pointer-events: none; }
.rail a:hover .rail-label, .rail a:focus-visible .rail-label { opacity: 1; transform: none; }

/* ---------- Story opening ---------- */
.opening { min-height: calc(100vh - var(--header)); display: flex; flex-direction: column; justify-content: center; padding-top: 48px; padding-bottom: 48px; position: relative; }
.eyebrow { display: flex; align-items: center; gap: 10px; font: 500 11px var(--mono); letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin: 0; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--death); box-shadow: 0 0 12px var(--death); }
h1 { font: 400 clamp(52px, 8vw, 116px)/0.96 var(--display); letter-spacing: -2px; margin: 24px 0 28px; max-width: 1040px; }
h1 em { color: var(--death); font-style: italic; }
.lede { font-size: 19px; line-height: 1.65; color: var(--ink-2); max-width: 640px; margin: 0; }
.toc { list-style: none; padding: 0; margin: 44px 0 0; display: flex; flex-wrap: wrap; gap: 8px 10px; max-width: 920px; }
.toc a { display: inline-flex; gap: 8px; align-items: baseline; text-decoration: none; border: 1px solid var(--line-2); border-radius: 20px; padding: 7px 15px; font-size: 13px; color: var(--ink-2); }
.toc a span { font: 11px var(--mono); color: var(--muted); }
.toc a:hover { border-color: var(--death); color: var(--ink); }
.story-updated { font-size: 12px; color: var(--muted); margin: 22px 0 0; }
.scroll-cue { margin: 56px 0 0; font: 11px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.opening-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 44px 0 0; max-width: 900px; padding-top: 22px; border-top: 1px solid var(--line); }
.opening-stats div { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.big-num { font: 400 54px/1 var(--display); color: var(--ink); letter-spacing: -1px; font-variant-numeric: lining-nums; }
.big-num.death { color: var(--death); }
.big-num.cases { color: var(--cases); }

/* ---------- Chapters ---------- */
.chapter { padding-top: 96px; }
.chapter-head { padding-bottom: 8px; }
.chapter-number { font: 500 11px var(--mono); letter-spacing: 1.6px; text-transform: uppercase; color: var(--death); margin: 0; }
.chapter-head h2 { font: 400 clamp(40px, 5vw, 64px)/1.02 var(--display); letter-spacing: -1px; margin: 10px 0 14px; }
.chapter-head > p:last-child { font-size: 18px; color: var(--ink-2); max-width: 660px; margin: 0; }

/* Scrollytelling: steps on the left, the graphic pinned on the right */
.scrolly { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 0 56px; position: relative; }
.scrolly .sticky { grid-column: 2; grid-row: 1; position: sticky; top: var(--header); height: calc(100vh - var(--header)); display: flex; align-items: center; }
.scrolly .steps { grid-column: 1; grid-row: 1; padding: 30vh 0 40vh; }
.graphic { margin: 0; width: 100%; min-width: 0; }
.step { min-height: 80vh; display: flex; align-items: center; }
.step:first-child { min-height: 50vh; }
.step-card { background: color-mix(in srgb, var(--raise) 94%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 24px 26px; opacity: 0.3; transition: opacity .35s, border-color .35s, box-shadow .35s; }
.step.is-active .step-card { opacity: 1; border-color: var(--line-2); box-shadow: 0 20px 50px #00000060; }
.step-card p { margin: 0 0 11px; font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.step-card p:last-child { margin-bottom: 0; }
.step-kicker { font: 500 10.5px/1.2 var(--mono) !important; letter-spacing: 1.4px; text-transform: uppercase; color: var(--death) !important; margin-bottom: 10px !important; }
.step-head { font: 400 30px/1.08 var(--display); letter-spacing: -0.4px; margin: 0 0 12px; color: var(--ink); }
.hint { font-size: 12.5px !important; color: var(--muted) !important; }

/* Prose beside a chart */
.prose-chart { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 56px; align-items: center; padding-top: 40px; padding-bottom: 32px; }
.prose p { font-size: 16.5px; line-height: 1.75; margin: 0 0 14px; color: var(--ink-2); }
.prose p.muted { font-size: 14px; color: var(--muted); }
.section-head { font: 400 36px/1.08 var(--display); letter-spacing: -0.6px; margin: 0 0 16px; }
.chart-title { font: 500 11px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.wide-chart { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); }
.full-chart { padding-top: 28px; }

/* Controls */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 22px; padding: 3px; background: var(--bg-2); flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 18px; padding: 5px 13px; font-size: 12.5px; color: var(--ink-2); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 600; }
.seg.death button[aria-pressed="true"] { background: var(--death); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip-row button { border: 1px solid var(--line-2); background: transparent; border-radius: 20px; padding: 6px 14px; font: 500 13px var(--sans); color: var(--ink-2); }
.chip-row button:hover { border-color: var(--ink-2); color: var(--ink); }
.chip-row button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.graphic-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; }
.pill { border: 1px solid var(--line-2); background: transparent; border-radius: 20px; padding: 6px 14px; font-size: 12px; color: var(--ink-2); }
.pill:hover { color: var(--ink); border-color: var(--ink-2); }

/* ---------- Maps ---------- */
.map-wrap { position: relative; width: 100%; aspect-ratio: 975 / 610; }
.map-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-overlay { pointer-events: none; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; min-height: 28px; padding: 10px 0 0; font-size: 12px; color: var(--ink-2); }
.key { display: inline-flex; align-items: center; gap: 8px; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.legend-ramp { display: inline-flex; flex-direction: column; gap: 3px; }
.bins { display: inline-flex; gap: 2px; }
.bin { display: block; width: 26px; height: 10px; }
.bin:first-child { border-radius: 4px 0 0 4px; }
.bin:last-child { border-radius: 0 4px 4px 0; }
.bin-ticks { display: flex; padding-left: 20px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bin-ticks span { width: 28px; text-align: center; }

/* Tooltips */
.chart-wrap, .dot-field { position: relative; width: 100%; }
.dot-field canvas { display: block; width: 100%; }
.tooltip { position: absolute; pointer-events: none; min-width: 200px; max-width: 280px; background: #202127f2; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 30px #00000070; padding: 12px 14px; font-size: 12px; z-index: 5; }
.tooltip h3 { font: 400 19px/1.2 var(--display); margin: 0 0 4px; display: flex; align-items: center; }
.tooltip .sub { color: var(--muted); margin: 0 0 8px; }
.tooltip dl { display: grid; grid-template-columns: auto auto; gap: 3px 16px; margin: 0; font-variant-numeric: tabular-nums; }
.tooltip dt { color: var(--muted); }
.tooltip dd { margin: 0; text-align: right; color: var(--ink); }
.tooltip .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; flex: none; }
.tooltip .tip-note { font-size: 10.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.4; }
.source-line { font-size: 10.5px; line-height: 1.5; color: var(--muted); margin: 10px 0 0; max-width: 760px; }
.source-line a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.source-line a:hover { color: var(--ink); }
.cancer-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); margin: 8px 0 0; }

/* ---------- SVG charts ---------- */
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap .grid { stroke: var(--line); }
.chart-wrap .grid.one { stroke: var(--muted); stroke-dasharray: 3 4; }
.chart-wrap .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; font-family: var(--sans); }
.chart-wrap .axis-title { font-size: 11.5px; fill: var(--muted); }
.chart-wrap .axis-line { stroke: var(--line-2); }
.chart-wrap .col-title { font: 500 11px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; fill: var(--ink-2); }
.chart-wrap .hit, .chart-wrap .hit-line { fill: transparent; stroke: transparent; }
.chart-wrap .hit-line { stroke-width: 16; }
.chart-wrap .fit { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart-wrap .dot { stroke: var(--bg); stroke-width: 2; }
.chart-wrap .dot-label { font: 600 11.5px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; pointer-events: none; }
.chart-wrap .guide { stroke: var(--line-2); stroke-dasharray: 2 5; }
.chart-wrap .guide-label { font: italic 13px var(--display); fill: var(--muted); }
.chart-wrap .row-label { font: 600 14px var(--sans); fill: var(--ink); }
.chart-wrap .row-sub { font-size: 11px; fill: var(--muted); }
.chart-wrap .strip-dot { opacity: 0.6; }
.chart-wrap .strip-dot:hover { opacity: 1; stroke: var(--ink); }
.chart-wrap .median { stroke: var(--ink); stroke-width: 2.5; }
.chart-wrap .median-label { font: 700 12px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.chart-wrap .us-line { stroke: var(--ink-2); stroke-dasharray: 3 4; }
.chart-wrap .us-label { font-size: 11px; fill: var(--ink-2); }
.chart-wrap .bar-label, .chart-wrap .b-label { font-size: 13px; fill: var(--ink); }
.chart-wrap .bar-value { font: 600 12px var(--sans); fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart-wrap .zero { stroke: var(--ink-2); stroke-width: 1; }
.chart-wrap .slope { stroke: currentColor; stroke-width: 3; }
.chart-wrap .end-a, .chart-wrap .end-b { fill: currentColor; stroke: var(--bg); stroke-width: 2; }
.chart-wrap .race-label { font: 600 13px var(--sans); fill: currentColor; }
.chart-wrap .race-val { font-size: 11.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart-wrap g.race { cursor: default; }
.chart-wrap g.race:hover .slope { stroke-width: 5; }

/* Alluvial */
.alluvial .strand { cursor: default; }
.alluvial .strand path { mix-blend-mode: screen; }
.alluvial .strand:hover { opacity: 1 !important; }
.alluvial .nl-name { font: 600 13px var(--sans); fill: var(--ink); }
.alluvial .nl-val { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; transform: translateY(15px); }
.alluvial .nl.mid .nl-name, .alluvial .nl.mid .nl-val { paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.alluvial .col-heads text { font: 500 10.5px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; fill: var(--muted); }

/* ---------- Methods, next story, footer ---------- */
.next-story { padding-top: 96px; }
.next-card { display: grid; gap: 10px; text-decoration: none; border: 1px solid var(--line-2); border-radius: 18px; padding: 30px 34px; background: linear-gradient(120deg, #ff7d6614, transparent 60%); transition: border-color .2s; }
.next-card:hover { border-color: var(--death); }
.next-kicker { font: 500 11px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--death); }
.next-title { font: 400 clamp(32px, 4vw, 48px)/1.04 var(--display); letter-spacing: -0.6px; }
.next-text { font-size: 16px; color: var(--ink-2); max-width: 640px; }
.next-back { font-size: 13px; margin: 16px 0 0; }
.next-back a { color: var(--ink-2); text-decoration: none; }
.methods { padding-top: 88px; padding-bottom: 32px; }
.methods h2 { font: 400 36px/1.1 var(--display); margin: 0 0 22px; }
.methods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.methods h3 { font: 500 11px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.methods p, .methods li { font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.methods ul { padding-left: 18px; margin: 0 0 14px; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; border-top: 1px solid var(--line); margin-top: 72px; padding-top: 30px; padding-bottom: 64px; font-size: 12px; color: var(--muted); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.footer-brand { font: 22px var(--display); color: var(--ink); }
.footer-updated { margin-right: auto; }
.load-failed main::before { content: 'Could not load the cancer data.'; display: block; padding: 40px 48px; color: var(--death); }

/* ---------- Front page ---------- */
.front { padding-bottom: 24px; }
.edition-bar { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; margin-top: 22px; padding: 10px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); font: 500 10.5px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.edition-bar .live { color: var(--death); }
.front-lead { padding: 34px 0 40px; border-bottom: 1px solid var(--line); }
.lead-grid { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(0, 2fr); gap: 48px; align-items: start; }
.lead-head { font: 400 clamp(56px, 7.4vw, 108px)/0.92 var(--display); letter-spacing: -2px; margin: 10px 0 20px; }
.lead-head a { text-decoration: none; }
.lead-head em { color: var(--death); }
.fp-kicker { display: flex; align-items: center; gap: 10px; font: 500 11px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--death); margin: 0 0 10px; }
.fp-kicker .soon { color: var(--muted); }
.fp-deck { font-size: 18px; line-height: 1.55; color: var(--ink-2); margin: 0 0 18px; }
.ticker { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px 0; margin: 22px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ticker div { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.ticker .big-num { font-size: 46px; font-variant-numeric: tabular-nums; }
.ticker-note { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }
.cta { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 20px; background: var(--death); color: #1a0d0a; border-radius: 26px; font: 600 14px var(--sans); text-decoration: none; transition: transform .2s, background .2s; }
.cta:hover { background: #ff957f; }
.cta span { transition: transform .2s; }
.cta:hover span { transform: translateX(4px); }
.cta.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.cta.ghost:hover { border-color: var(--ink-2); }
.lead-graphic .graphic-controls { justify-content: space-between; }
.front-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.front-grid > * { padding: 34px 36px 38px; min-width: 0; }
.front-grid > :first-child { padding-left: 0; }
.front-grid > :last-child { padding-right: 0; }
.front-grid > * + * { border-left: 1px solid var(--line); }
.front-grid.third { grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 0; }
.side-head { font: 400 clamp(32px, 3.2vw, 42px)/1.04 var(--display); letter-spacing: -0.6px; margin: 0 0 14px; }
.side-head a { text-decoration: none; }
.side-head a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.front-wide { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.8fr); gap: 48px; padding: 36px 0 40px; border-bottom: 1px solid var(--line); align-items: center; }
.rule-head { font: 500 11px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.updates, .coming { list-style: none; padding: 0; margin: 0; }
.updates li, .coming li { display: grid; gap: 3px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.updates li:last-child, .coming li:last-child { border-bottom: 0; }
.updates time { font: 11px var(--mono); color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; }
.updates p { font-size: 14px; margin: 0; color: var(--ink-2); }
.coming b { font: 400 20px var(--display); }
.coming span { font-size: 13px; color: var(--ink-2); }
.front-about p { font-size: 13.5px; color: var(--ink-2); margin: 0 0 12px; }

/* ---------- Explore ---------- */
.explore > .chapter-head { padding-top: 44px; }
.explore h1 { font-size: clamp(48px, 6vw, 80px); margin: 12px 0 14px; }
.explore .chapter-head p { color: var(--ink-2); font-size: 17px; margin: 0; }
.explore .chapter-head p.story-updated { font-size: 12px; color: var(--muted); margin-top: 10px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 28px; }
.pair-picker label { display: flex; align-items: center; gap: 10px; font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; }
.pair-picker select { appearance: none; min-width: 240px; border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 10px; padding: 7px 32px 7px 14px; font: 22px var(--display); color: var(--ink);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.search input { border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 20px; padding: 7px 14px; font-size: 13px; width: 210px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 26px 0 10px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font: 400 40px/1.05 var(--display); font-variant-numeric: lining-nums; }
.stat-label { font-size: 12px; color: var(--muted); }
.explore-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; margin-top: 8px; }
.explore-side { position: sticky; top: calc(var(--header) + 16px); max-height: calc(100vh - var(--header) - 32px); overflow-y: auto; padding-right: 4px; }
.rank { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.rank li { display: grid; grid-template-columns: 22px 120px 1fr 44px; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; color: var(--ink-2); counter-increment: rank; }
.rank li::before { content: counter(rank); font: 10.5px var(--mono); color: var(--muted); text-align: right; }
.rank li.is-us { font-weight: 700; color: var(--ink); }
.rank li.is-us::before { content: ''; }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-track { position: relative; display: block; height: 10px; margin: 0 5px; background: linear-gradient(var(--line-2), var(--line-2)) center / 100% 1px no-repeat; }
.rank-track i { position: absolute; top: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; }
.rank-val { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .story-nav { gap: 16px; margin-left: 12px; }
  .lab-link { display: none; }
  .lead-grid, .front-wide { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 900px) {
  :root { --header: 56px; }
  .page-wrap { padding: 0 26px 0 20px; }
  .story-nav { overflow-x: auto; scrollbar-width: none; }
  .rail { right: 6px; }
  .rail i { width: 10px; }
  .rail a[aria-current="true"] i { width: 20px; }
  .scrolly { display: block; }
  .scrolly .sticky { height: auto; top: var(--header); padding: 10px 0 6px; background: var(--bg); z-index: 2; align-items: flex-start; }
  .scrolly .steps { position: relative; z-index: 3; padding: 25vh 0 30vh; }
  .step, .step:first-child { min-height: 70vh; align-items: flex-end; }
  .step-card { opacity: 0; transition: opacity .3s; padding: 18px 20px; }
  .step.is-active .step-card { opacity: 1; }
  .prose-chart, .wide-chart, .methods-grid, .explore-grid { grid-template-columns: 1fr; gap: 26px; }
  .explore-side { position: static; max-height: none; }
  .front-grid, .front-grid.third { grid-template-columns: 1fr; }
  .front-grid > * { padding: 28px 0; }
  .front-grid > * + * { border-left: 0; border-top: 1px solid var(--line); }
  .opening-stats { grid-template-columns: 1fr; gap: 18px; }
  .summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .brand { font-size: 22px; }
  .brand-bars { display: none; }
  .story-nav a { font-size: 12.5px; }
  h1 { letter-spacing: -1px; }
  .lede { font-size: 17px; }
  .ticker .big-num { font-size: 36px; }
  .controls { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rail i, .rail-label, .step-card, .cta, .cta span { transition: none; }
}
@media (hover: none) { .rail-label { display: none; } }
.chip-row a.pill { text-decoration: none; }

/* ---------- Fan ("After a diagnosis") ---------- */
.fan .strands path { mix-blend-mode: screen; transition: opacity .2s; }
.fan .origin { fill: var(--ink); }
.fan .origin-label line { stroke: var(--muted); }
.fan .origin-label text { font: 400 22px var(--display); fill: var(--ink); }
.fan .origin-label text.sub { font: 12px var(--sans); fill: var(--muted); }
.fan .fan-axis line { stroke: var(--ink-2); }
.fan .axis-cap { font: 500 10.5px var(--mono); letter-spacing: 1.2px; text-transform: uppercase; fill: var(--muted); }
.fan .axis-tick { font-size: 11px; fill: var(--muted); }
.fan .cancer-marks text { font: italic 15px var(--display); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 5px; }
.fan .cancer-marks line { stroke: var(--muted); stroke-dasharray: 1 3; }
.fan .call-num { font: 400 46px var(--display); }
.fan .call-num.death { fill: var(--death); }
.fan .call-num.cases { fill: var(--cases); }
.fan .call-text { font-size: 13px; fill: var(--ink-2); }
.fan-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 10px; }
.fan-notes p { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); margin: 0; }
.fan-lead-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: end; margin-bottom: 18px; }
.fan-lead-head .lead-head { margin-bottom: 0; }
.fan-lead-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.cover-switch a { color: var(--ink-2); text-decoration: none; }
.cover-switch a[aria-current="true"] { color: var(--death); }

/* ---------- Cube stacks ("The weight of each cancer") ---------- */
.cube-section { padding-top: 24px; }
.cubes { position: relative; width: 100%; max-width: 1100px; margin: 0 auto; overflow: hidden; }
.cubes canvas { display: block; width: 100%; }
.cube-labels { position: absolute; inset: 0 0 auto 0; pointer-events: none; }
.cube-label { position: absolute; width: 230px; transform: translateY(-14px); }
.cube-label.left { text-align: right; }
.cube-tag { display: inline-block; font: 600 12.5px var(--mono); color: #1a0d0a; background: #8fa6bf; border-radius: 3px; padding: 3px 8px; }
.cube-label h4 { font: 400 26px/1.1 var(--display); margin: 6px 0 2px; }
.cube-label p { font-size: 12.5px; color: var(--ink-2); margin: 0; }
.cube-label .death { color: var(--death); }
.cube-notes { max-width: 760px; margin: 18px auto 0; }
.cube-notes p { font-size: 16px; line-height: 1.7; color: var(--ink-2); }

/* ---------- Linked states ---------- */
.section-deck { font-size: 16px; color: var(--ink-2); max-width: 680px; margin: 0 0 14px; }
.chart-wrap .state-shape { stroke: var(--bg); stroke-width: 0.8; }
.chart-wrap .state-bubble { fill: var(--ink); fill-opacity: 0.18; stroke: var(--ink); stroke-opacity: 0.85; stroke-width: 1.2; }
.chart-wrap .links-curves path { stroke-width: 1.1; mix-blend-mode: screen; }
.chart-wrap .state-abbr { font: 600 9.5px var(--sans); fill: var(--ink-2); }
.chart-wrap .state-val { font: 600 10px var(--sans); fill: var(--ink); }
@media (max-width: 900px) {
  .fan-notes, .fan-lead-head { grid-template-columns: 1fr; gap: 14px; }
}

/* Phones: wide SVG charts keep a readable size and scroll sideways instead of shrinking. */
@media (max-width: 700px) {
  .chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .chart-wrap > svg { min-width: 620px; }
  .chart-wrap.fan > svg, .chart-wrap.alluvial > svg { min-width: 680px; }
  .chart-wrap::after { content: 'Swipe sideways to see the whole chart →'; display: block; position: sticky; left: 0; font-size: 11px; color: var(--muted); padding-top: 6px; }
  .cube-label h4 { font-size: 20px; }
}
.scrolly .sticky > *, .prose-chart > *, .front-wide > *, .front-grid > *, .lead-grid > * { min-width: 0; }

/* Visit ticker in the header (every page but the front, which has the big one) */
.header-tick { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 20px; font-size: 12px; color: var(--muted); text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.header-tick:hover { border-color: var(--death); color: var(--ink-2); }
.header-tick b { font-weight: 600; color: var(--death); }
.header-tick .tick-cases b { color: var(--cases); }
.header-tick .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--death); box-shadow: 0 0 8px var(--death); }
.header-tick.bump .pulse, .ticker.bump .death { animation: stage-bump 1.4s ease-out; }
.story-nav + .header-tick { margin-left: 0; }
@keyframes stage-bump { 0% { transform: scale(1.8); filter: brightness(1.6); } 100% { transform: none; filter: none; } }
@media (max-width: 1180px) { .header-tick .tick-since { display: none; } }
@media (max-width: 1000px) { .header-tick .tick-cases { display: none; } }
@media (max-width: 700px) { .header-tick { padding: 4px 9px; gap: 6px; font-size: 11px; } .header-tick span:nth-child(2) { font-size: 0; } .header-tick span:nth-child(2) b { font-size: 11px; } }
@media (prefers-reduced-motion: reduce) { .header-tick.bump .pulse, .ticker.bump .death { animation: none; } }
