:root {
  --ink-0: #131416;
  --ink-1: #1b1c1f;
  --ink-2: #25272b;
  --line: #3b3e43;
  --edge: #7d8189;
  --text: #ededed;
  --text-2: #b8babe;
  --text-3: #979aa0;
  --wet: #5aa2d8;
  --dry: #de9b4a;
  --faded: #3e4045;
  --pass: #7fd1ae;
  --partial: #e8c46a;
  --fail: #f08a8a;
  --notrun: #9a9da3;
  --focus: #ffd479;
  --obs: #b896e2;
  --series-raw: #6f7278;
  --display: "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Red Hat Mono", ui-monospace, Menlo, monospace;
  --topbar: 56px;
  --r: 0;
  --hard: 4px 4px 0 0 #000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--topbar); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--ink-0); color: var(--text);
  font: 400 16px/1.55 var(--sans); overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-weight: 400; }
h2 { font: 700 clamp(1.9rem, 3.4vw, 2.8rem)/1.08 var(--display); letter-spacing: -.01em; text-wrap: balance; }
h3 { font: 600 .82rem/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin: 0 0 .7rem; }
p { margin: 0 0 .8rem; }
a { color: var(--wet); text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a, button, summary, label { touch-action: manipulation; -webkit-tap-highlight-color: rgba(255, 212, 121, .2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 0; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
.nw { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--focus); color: #111; padding: 8px 12px; border-radius: 0; }
.skip:focus { top: 8px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
p .mono { font-size: .9em; }
/* numbers inside sentences keep the sentence's font; mono stays for stat tiles, tables and chips */
p .num, li .num { font-family: inherit; font-size: 1em; font-variant-numeric: tabular-nums; }
.eyebrow { font: 600 .75rem/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 0 0 .6rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 20px; background: var(--ink-0);
  border-bottom: 2px solid var(--edge);
}
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 1.45rem/1 var(--display); white-space: nowrap; }
.wordmark svg { width: 26px; height: 26px; color: var(--text-2); }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { color: var(--text-2); text-decoration: none; font-size: .9rem; padding: 10px 10px; border-radius: 0; white-space: nowrap; display: inline-block; line-height: 24px; min-height: 44px; min-width: 44px; text-align: center; }
.topbar nav a:hover { color: var(--text); background: var(--ink-2); }
.topbar nav a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--focus); border-radius: 0; }
.topbar nav a[hidden], section[hidden], figure[hidden], div[hidden] { display: none !important; }
.nav-short { display: none; }

/* ---------- explorer ---------- */
.explorer {
  display: grid; grid-template-columns: minmax(0, 1fr) 420px;
  height: calc(100vh - var(--topbar)); height: calc(100dvh - var(--topbar)); min-height: 560px;
  border-bottom: 2px solid var(--edge);
}
.stage {
  position: relative; overflow: hidden; min-width: 0;
  background: var(--ink-0);
}
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-canvas[hidden] { display: none; }
#flat { cursor: grab; touch-action: pan-y pinch-zoom; }
#flat.dragging { cursor: grabbing; }
.stage-focus { position: absolute; inset: 0; pointer-events: none; border-radius: 0; }
.stage-focus:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; border-radius: 0; }
.crosshair { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: var(--focus); }
.crosshair::before { left: 12px; top: 0; width: 2px; height: 26px; }
.crosshair::after { top: 12px; left: 0; height: 2px; width: 26px; }
.stage:has(.stage-focus:focus-visible) .crosshair { opacity: 1; }

.controls { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; pointer-events: none; }
.controls > * { pointer-events: auto; }
.seg { display: inline-flex; margin: 0; padding: 3px; border: 2px solid var(--edge); border-radius: 0; background: var(--ink-1); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg input + span { display: block; padding: 8px 13px; border-radius: 0; font-size: .82rem; color: var(--text-2); white-space: nowrap; transition: background-color .15s, color .15s; }
.seg input:checked + span { background: var(--text); color: var(--ink-0); font-weight: 500; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg label:hover input + span { color: var(--text); }
.seg input:checked:hover + span { color: var(--ink-0); }
.lbl-short { display: none; }
.chip-btn { border: 2px solid var(--edge); background: var(--ink-1); border-radius: 0; padding: 8px 14px; font-size: .82rem; color: var(--text-2); min-height: 44px; }
.chip-btn:hover { color: var(--text); border-color: var(--text-3); }
.chip-btn.busy { opacity: .6; cursor: progress; }

.legend { position: absolute; left: 14px; bottom: 44px; padding: 4px 12px 10px; border: 2px solid var(--edge); border-radius: 0; background: var(--ink-1); font-size: .78rem; color: var(--text-2); max-width: min(270px, calc(100% - 90px)); }
.legend .row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.legend .sw { width: 12px; height: 12px; border-radius: 0; flex: none; box-shadow: inset 0 0 0 1px rgba(237, 237, 237, .4); }
.legend .ramp { height: 10px; width: 180px; max-width: 100%; border-radius: 0; margin: 4px 0 2px; }
.legend .ramp-lab { display: flex; justify-content: space-between; width: 180px; max-width: 100%; font-family: var(--mono); font-size: .75rem; }
.legend-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 32px; padding: 4px 0; background: none; border: 0; color: var(--text); font-weight: 500; text-align: left; }
.legend-title .chev { width: 7px; height: 7px; flex: none; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(-135deg); margin-top: 4px; transition: transform .15s ease-out; }
.legend.collapsed .legend-title .chev { transform: rotate(45deg); margin-top: -3px; }
.legend.collapsed { padding-bottom: 4px; }
.legend.collapsed .legend-body { display: none; }
.legend-note { margin: 4px 0 0; font-size: .75rem; color: var(--text-3); line-height: 1.35; }
.legend.pre .legend-body .sw, .legend.pre .legend-body .ramp { opacity: .5; }
.legend .legend-pre { margin: 0 0 4px; color: var(--text-2); }
.zoom { position: absolute; right: 14px; bottom: 44px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 44px; height: 44px; border: 2px solid var(--edge); border-radius: 0; background: var(--ink-1); font-size: 1.2rem; color: var(--text-2); }
.zoom button:hover { color: var(--text); border-color: var(--text-3); }
.hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); text-align: center; margin: 0; padding: 3px 12px; border-radius: 0; background: var(--ink-0); font-size: .75rem; color: var(--text-2); pointer-events: none; }
.stage-cta { position: absolute; left: 14px; bottom: 44px; z-index: 4; box-shadow: var(--hard); }
.stage-cta[hidden] { display: none; }
.tooltip { position: absolute; z-index: 5; pointer-events: none; max-width: 240px; padding: 8px 10px; border-radius: 0; background: var(--ink-0); border: 2px solid var(--edge); font-size: .8rem; line-height: 1.4; }
.tooltip b { font-weight: 600; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-2); font-family: var(--mono); font-size: .85rem; background: var(--ink-0); z-index: 6; transition: opacity .4s; }
.loading.done { opacity: 0; pointer-events: none; }
.load-err { max-width: 34ch; text-align: center; font-family: var(--sans); font-size: .95rem; color: var(--text); padding: 0 16px; }
.load-err p { margin-bottom: 1rem; }
.loading[hidden] { display: none; }

/* ---------- panel ---------- */
.panel { border-left: 2px solid var(--edge); background: var(--ink-1); overflow-y: auto; overflow-x: hidden; overflow-wrap: break-word; padding: 24px 24px 32px; min-width: 0; }
.panel .grade { margin: 6px 0 12px; }
.panel h1 { font: 700 clamp(1.9rem, 2.6vw, 2.35rem)/1.06 var(--display); letter-spacing: -.01em; margin: 0 0 1.1rem; text-wrap: balance; scroll-margin-top: 40px; }
.panel .lead-sub { margin: -.4rem 0 1.1rem; color: var(--text-2); font-size: .95rem; line-height: 1.45; }
.panel .window-note { margin: -.2rem 0 1rem; padding-left: 12px; border-left: 6px solid var(--edge); color: var(--text-2); font-size: .9rem; line-height: 1.45; }
.panel h1 em { font-style: normal; font-weight: 500; color: var(--text-2); }
.panel h1.tile-h { font: 600 .8rem/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin: 0 0 .7rem; }
.panel .back { background: none; border: 0; padding: 8px 0; color: var(--text-2); font-size: .875rem; margin-bottom: 8px; min-height: 44px; }
.panel .back:hover { color: var(--text); }
.agg { margin: 0 0 1rem; }
.agg svg, .series svg { width: 100%; max-width: 560px; height: auto; display: block; }
.agg-caption { font-size: .8rem; color: var(--text-3); margin-top: 6px; }
/* inline SVG charts: one viewBox unit = one CSS pixel, colours from the tokens */
.chart .axis text { font: 400 12px var(--mono); fill: var(--text-3); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .band { fill: rgba(184, 186, 190, .28); }
.chart .agg-line { stroke: var(--text); stroke-width: 2.5; stroke-linecap: square; }
.chart .end-label { font: 500 12.5px var(--sans); fill: var(--text); }
.chart .raw { fill: none; stroke: var(--series-raw); stroke-width: .9; }
.chart .run { fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linejoin: round; }
.chart .trend { stroke-width: 2.4; stroke-dasharray: 7 4; stroke-linecap: round; stroke: var(--text-2); }
.chart .trend.wet { stroke: var(--wet); } .chart .trend.dry { stroke: var(--dry); }
.verdict { display: inline-flex; align-items: center; gap: 8px; font: 600 .8rem/1.3 var(--sans); font-variant-numeric: tabular-nums; padding: 6px 10px; border-radius: 0; background: var(--ink-2); border: 2px solid var(--edge); margin-bottom: .8rem; }
.verdict::before { content: ""; width: 8px; height: 8px; border-radius: 0; background: var(--notrun); }
.verdict.wet::before { background: var(--wet); } .verdict.dry::before { background: var(--dry); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 0; border: 1px solid var(--text); background: var(--text); color: var(--ink-0); font-weight: 500; font-size: .92rem; text-decoration: none; }
.btn:hover { background: #fff; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--text-3); background: var(--ink-2); }
.btn, .chip-btn, .zoom button, .topbar nav a, .panel .back, .card summary, .legend-title, .checks summary {
  transition: background-color .18s ease-out, color .18s ease-out, border-color .18s ease-out, transform .12s ease-out;
}
.btn:active, .chip-btn:active, .zoom button:active { transform: scale(.97); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.1rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: .4rem 0 1rem; }
.split > div { padding: 14px; border-radius: 0; background: var(--ink-2); border: 2px solid var(--edge); border-top: 8px solid; }
.split .w { border-color: var(--wet); } .split .d { border-color: var(--dry); }
.split .big { font: 700 2.6rem/1 var(--display); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.split .w .big { color: var(--wet); } .split .d .big { color: var(--dry); }
/* version comparison (GLDAS-2.1 vs 2.0): neutral colours, because blue/amber mean wetting/drying everywhere else */
.split .v21 { border-color: var(--focus); } .split .v21 .big { color: var(--text); }
.split .v20 { border-color: var(--text-3); } .split .v20 .big { color: var(--text-2); }
.split small { display: block; font-size: .8rem; color: var(--text-2); margin-top: 6px; line-height: 1.35; }
.detective { border-left: 6px solid var(--focus); padding: 4px 0 4px 12px; color: var(--text-2); font-size: .92rem; }
.detective strong, .detective .num { color: var(--text); font-weight: 600; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--edge); border: 2px solid var(--edge); border-radius: 0; overflow: hidden; margin: .8rem 0 1rem; }
.stats > div { background: var(--ink-1); padding: 10px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; }
.stats > div.wide { grid-column: 1 / -1; }
.stats dt { font-size: .75rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.stats dd { margin: 2px 0 0; font: 500 1rem/1.3 var(--mono); }
.stats dd .unit { display: block; font: 400 .75rem/1.3 var(--sans); color: var(--text-3); margin-top: 1px; }
.series { margin: .4rem 0 .6rem; min-height: 210px; }
.series-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .75rem; color: var(--text-3); }
.series-legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--text-2); vertical-align: middle; margin-right: 5px; }
.series-legend i.raw { border-color: var(--series-raw); } .series-legend i.run { border-color: var(--text); }
.series-legend i.trend { border-top-style: dashed; } .series-legend i.trend.wet { border-color: var(--wet); } .series-legend i.trend.dry { border-color: var(--dry); }
.pill { display: inline-block; font: 600 .75rem/1 var(--sans); padding: 5px 8px; border-radius: 0; border: 2px solid var(--edge); color: var(--text-2); margin: 0 6px 6px 0; }
.pill.wet { color: var(--wet); border-color: var(--wet); }
.pill.dry { color: var(--dry); border-color: var(--dry); }
.linkish { background: none; border: 0; padding: 0; color: var(--wet); text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--text); }

/* ---------- case files ---------- */
.cases, .method { padding: 72px 20px; max-width: 1240px; margin: 0 auto; }
.section-head { max-width: 720px; margin-bottom: 32px; }
.lede { color: var(--text-2); font-size: 1.05rem; margin-top: 14px; max-width: 68ch; text-wrap: pretty; }
.notice { border: 1px dashed var(--line); border-radius: 0; padding: 12px 14px; color: var(--text-2); font-size: .9rem; margin-bottom: 20px; }
.featured { margin-bottom: 20px; }
.featured-after { margin: 20px 0 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 20px; }
.card { overflow-wrap: break-word; position: relative; display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 0; background: var(--ink-1); border: 2px solid var(--edge); min-width: 0; }
.card.wetting { border-top: 8px solid var(--wet); }
.card.drying { border-top: 8px solid var(--dry); }
.card.local { border-style: dashed; }
.card.observation { border-top: 8px solid var(--obs); }
.card-kind { font: 600 .75rem/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-kind .dot { width: 8px; height: 8px; border-radius: 0; background: var(--notrun); }
.card.wetting .dot { background: var(--wet); } .card.drying .dot { background: var(--dry); } .card.retraction .dot { background: var(--fail); } .card.observation .dot { background: var(--obs); }
.card h3.card-title { font: 600 1.7rem/1.1 var(--display); letter-spacing: 0; text-transform: none; color: var(--text); margin: 0; text-wrap: balance; }
.card .place { color: var(--text-2); font-size: .9rem; margin: -8px 0 0; }
.card .headline { font-size: 1rem; margin: 0; }
.nums { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .78rem; color: var(--text-3); }
.nums b { display: block; font: 500 1.05rem/1.2 var(--mono); color: var(--text); }
.grade { margin: 2px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font: 600 .8rem/1.3 var(--sans); font-variant-numeric: tabular-nums; color: var(--text-2); }
.grade-note { margin: -6px 0 0; font-size: .8rem; color: var(--text-3); }
.panel .grade-note { margin: -4px 0 12px; }
.grade-bars { display: flex; gap: 3px; }
/* each status has its own shape as well as its colour: solid = pass, half = partial, hatched = fail, outline = not run */
.grade-bars i { width: 18px; height: 8px; border-radius: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--notrun); }
.grade-bars i.pass { background: var(--pass); box-shadow: none; }
.grade-bars i.partial { background: linear-gradient(90deg, var(--partial) 50%, transparent 50%); box-shadow: inset 0 0 0 1px var(--partial); }
.grade-bars i.fail { background: repeating-linear-gradient(135deg, var(--fail) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--fail); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checks li { font-size: .88rem; overflow-wrap: break-word; }
.chk-row, .checks summary { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 44px; padding: 4px 0; }
.checks summary { cursor: pointer; list-style: none; border-radius: 0; }
.checks summary::-webkit-details-marker { display: none; }
.checks summary::after { content: ""; width: 7px; height: 7px; margin: 0 6px 4px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform .15s ease-out; }
.checks details[open] > summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.checks summary:hover .chk-name { color: #fff; }
.checks summary:hover::after { border-color: var(--text); }
.checks .status { justify-self: start; }
.checks .detail { margin: 0 0 8px calc(92px + 10px); color: var(--text-2); font-size: .82rem; line-height: 1.45; max-width: 72ch; }
.status { display: inline-flex; align-items: center; gap: 5px; font: 700 .75rem/1 var(--sans); text-transform: uppercase; letter-spacing: .04em; padding: 4px 7px; border-radius: 0; border: 1px solid currentColor; min-width: 88px; justify-content: center; }
.status svg { width: 10px; height: 10px; }
.status.pass { color: var(--pass); } .status.partial { color: var(--partial); } .status.fail { color: var(--fail); } .status.not_run { color: var(--notrun); }
.user { background: var(--ink-2); border-radius: 0; padding: 14px; font-size: .9rem; }
.user .who { font-weight: 600; }
.user .decision { margin: 6px 0; }
.user .why { color: var(--text-2); font-size: .85rem; margin: 0; }
.user-label { font: 600 .75rem/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.card details.more { font-size: .85rem; color: var(--text-2); }
.card details.more > summary { cursor: pointer; color: var(--text); padding: 11px 0; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; border-radius: 0; }
.card details.more > summary::-webkit-details-marker { display: none; }
.card details.more > summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 6px 4px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(45deg); transition: transform .15s ease-out; }
.card details.more[open] > summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
.card details.more > summary:hover { color: #fff; }
.card details.more > summary:hover::after { border-color: var(--text); }
.card details.more ul { margin: 6px 0 0; padding-left: 18px; }
.card details.more li { margin-bottom: 6px; }
.agree { font: 600 .75rem/1 var(--sans); padding: 2px 6px; border-radius: 0; border: 1px solid; margin-left: 4px; white-space: nowrap; }
.agree.yes { color: var(--pass); } .agree.partly { color: var(--partial); } .agree.no { color: var(--fail); }
.card-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.src { display: inline-block; padding: 12px 4px; margin: -12px 0; }
.evidence { font: 500 .78rem/1.45 var(--sans); color: var(--text-2); padding: 6px 8px; border-radius: 0; background: var(--ink-2); }

/* the retraction case: the detector rejecting its own result */
.card.retraction { border-color: var(--fail); }
.card .col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card .col:last-child { flex: 1; }
.card.is-featured { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; padding: 32px; }
.card.is-featured .col:first-child { position: sticky; top: calc(var(--topbar) + 20px); align-self: start; }
.card.is-featured h3.card-title { font-size: 2.4rem; }
.stamp {
  justify-self: start; align-self: start; display: inline-block;
  border: 2px solid var(--fail); background: var(--fail); color: #111; border-radius: 0; padding: 6px 12px;
  font: 700 .8rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase;
}
.card.retraction .headline { font-size: 1.08rem; }

/* ---------- soil water + forecast lab ---------- */
.story { padding: 72px 20px; max-width: 1240px; margin: 0 auto; border-top: 2px solid var(--edge); }
.story-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.fig { margin: 0; min-width: 0; }
.fig img { display: block; width: 100%; height: auto; border-radius: 0; border: 2px solid var(--edge); background: var(--ink-1); }
.fig figcaption { font-size: .85rem; color: var(--text-2); margin-top: 10px; line-height: 1.45; max-width: 75ch; }
.fig-link { display: block; cursor: zoom-in; }
/* 44px tall tap target; the negative margin keeps the caption line height unchanged */
.fig-open { white-space: nowrap; display: inline-block; padding: 12px 0; margin: -12px 0; }
.story-grid > .fig { position: sticky; top: calc(var(--topbar) + 16px); }
.steps { display: grid; gap: 16px; min-width: 0; }
.step { padding: 24px; border-radius: 0; background: var(--ink-1); border: 2px solid var(--edge); min-width: 0; overflow-wrap: anywhere; }
.step-n { font: 600 .75rem/1.2 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 0 0 6px; }
.step h3.step-t { font: 600 1.45rem/1.15 var(--display); letter-spacing: 0; text-transform: none; color: var(--text); margin: 0 0 .5rem; text-wrap: balance; }
.step .split { margin-bottom: .6rem; }
.step .split .big { font-size: 2.1rem; }
.step .stats { margin: .6rem 0 .8rem; }
.step .verdict { margin-bottom: 0; }
.step .table-wrap { margin-top: .4rem; }
table.mini th[scope="row"] { font: 400 .85rem/1.3 var(--sans); text-transform: none; letter-spacing: 0; color: var(--text); white-space: normal; text-align: left; background: transparent; }
table.mini td.dry-t { color: var(--dry); }
tbody th[scope="row"], tfoot th[scope="row"] { font: 400 .85rem/1.3 var(--sans); text-transform: none; letter-spacing: 0; color: var(--text); text-align: left; background: transparent; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; margin-bottom: 36px; }
.how { margin: 0 0 1rem; padding-left: 20px; display: grid; gap: 10px; }
.how li { color: var(--text-2); font-size: .95rem; }
.how strong { color: var(--text); font-weight: 600; }
.findings { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: .95rem; }
.lab .stats dd { font-size: .95rem; }
.lab-h { margin-bottom: .7rem; }
#labTable td { font-size: .82rem; }
#labTable .sd { color: var(--text-3); font-size: .75rem; }
#labTable tr.hl > * { background: linear-gradient(rgba(255, 212, 121, .08), rgba(255, 212, 121, .08)) var(--tbl-bg); }
#labTable tr.hl > th { box-shadow: inset 3px 0 0 var(--focus); }
#labTable tfoot > tr > * { border-top: 1px solid var(--line); border-bottom: 0; color: var(--text-2); }
.table-note { margin-top: 10px; max-width: 75ch; }
.fig-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin: 32px 0; max-width: 980px; }
.limits { max-width: 75ch; }
.cross { color: var(--text-2); font-size: .92rem; max-width: 75ch; }
.nc { text-transform: none; }

/* ---------- method ---------- */
.method { border-top: 2px solid var(--edge); }
.method-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.dl dd .tech { display: block; margin-top: 4px; font: 400 .78rem/1.45 var(--mono); color: var(--text-3); }
.method-grid h3 { margin-top: 8px; }
.method-grid h3 + *, .method-grid .table-wrap { margin-bottom: 28px; }
.dl { margin: 0; display: grid; gap: 14px; }
.dl dt { font: 600 .75rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.dl dd { overflow-wrap: anywhere; margin: 3px 0 0; color: var(--text); font-size: .95rem; }
/* wide tables: the first column stays put while the rest scrolls; a soft edge shows there is more to the right */
.table-wrap {
  --tbl-bg: var(--ink-0);
  overflow-x: auto; border: 2px solid var(--edge); border-radius: 0;
  background:
    linear-gradient(to left, var(--tbl-bg) 40%, transparent) right center / 32px 100% no-repeat local,
    linear-gradient(to left, rgba(184, 186, 190, .22), transparent) right center / 18px 100% no-repeat scroll;
  background-color: var(--tbl-bg);
}
.step .table-wrap { --tbl-bg: var(--ink-1); }
.table-wrap thead th:first-child, .table-wrap tbody > tr > :first-child { position: sticky; left: 0; z-index: 1; background-color: var(--tbl-bg); }
.table-wrap thead th:first-child { background-color: var(--ink-1); }
.table-wrap.is-scrollable tbody > tr > :first-child, .table-wrap.is-scrollable thead th:first-child { box-shadow: inset -2px 0 0 var(--edge); }
.scroll-note { margin: 0 0 6px; font-size: .8rem; color: var(--text-3); }
.scroll-note[hidden] { display: none; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font: 600 .75rem/1.2 var(--sans); color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; background: var(--ink-1); }
td { font-family: var(--mono); }
tr:last-child > td, tbody tr:last-child > th { border-bottom: 0; }
.caveats { margin: 0; padding-left: 18px; color: var(--text-2); }
.caveats li { margin-bottom: 8px; }
.credits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--edge); font-size: .9rem; color: var(--text-2); }
.credits strong { color: var(--text); font-weight: 500; }
.credit-sub { margin: 0 0 .3rem; }
.credit-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; overflow-wrap: anywhere; }
.caveats li { max-width: 75ch; }

/* ---------- brutalist surface: square blocks, hard shadows, inverted states, no glow ---------- */
a { text-decoration-thickness: 2px; }
h2, .panel h1:not(.tile-h) { text-transform: uppercase; letter-spacing: 0; line-height: .98; }
.panel h1:not(.tile-h) { font-size: clamp(1.75rem, 2.3vw, 2.1rem); }
.eyebrow { display: block; width: fit-content; background: var(--text); color: var(--ink-0); padding: 4px 7px; font-weight: 700; }
.topbar { background: var(--ink-0); }
.topbar nav a:hover { background: var(--ink-2); color: var(--text); }
.topbar nav a[aria-current] { background: var(--text); color: var(--ink-0); box-shadow: none; }
.seg { padding: 0; gap: 0; background: var(--ink-1); }
.seg label + label input + span { box-shadow: inset 2px 0 0 var(--edge); }
.seg input + span { padding: 10px 14px; }
.seg input:checked + span { background: var(--text); color: var(--ink-0); font-weight: 700; box-shadow: none; }
.btn { border-width: 2px; font-weight: 700; box-shadow: var(--hard); }
.btn:hover { background: var(--focus); border-color: var(--focus); color: #111; }
.btn.ghost { border-color: var(--edge); }
.btn.ghost:hover { background: var(--text); border-color: var(--text); color: var(--ink-0); }
.btn:active, .chip-btn:active, .zoom button:active { transform: translate(3px, 3px); box-shadow: none; }
.chip-btn, .zoom button { box-shadow: var(--hard); }
.chip-btn:hover, .zoom button:hover { background: var(--text); color: var(--ink-0); border-color: var(--text); }
.legend, .tooltip { box-shadow: var(--hard); }
.legend .sw, .legend .ramp { border-radius: 0; }
.hint { border: 2px solid var(--edge); }
.card, .step, .fig img, .table-wrap { box-shadow: var(--hard); }
.card h3.card-title { font-weight: 700; }
.card-kind { color: var(--text-2); font-weight: 700; }
.user { border-left: 6px solid var(--edge); }
.evidence { border: 2px solid var(--line); }
.status { border-width: 2px; }
.grade-bars i { height: 10px; }
th { background: var(--ink-2); }
thead th { border-bottom: 2px solid var(--edge); }
.story, .method { border-top: 2px solid var(--edge); }
.credits { border-top: 2px solid var(--edge); }
.checks summary:hover .chk-name, .card details.more > summary:hover { color: var(--focus); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .explorer { grid-template-columns: minmax(0, 1fr) 360px; }
  .method-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 900px) {
  .card.is-featured { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .card.is-featured .col:first-child { position: static; }
}
@media (max-width: 820px) {
  .explorer { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .stage { height: 62vh; height: 62svh; min-height: 380px; }
  /* the panel spans the full width here: keep its text to a readable measure, centred */
  .panel { border-left: 0; border-top: 2px solid var(--edge); overflow: visible; padding: 24px max(16px, calc((100% - 640px) / 2)) 32px; }
  .credits { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cases, .method, .story { padding: 48px 16px; }
  .story-grid, .lab-grid, .fig-row { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .story-grid > .fig { position: static; }
  .topbar .nav-long { display: none; }
  .topbar .nav-short { display: inline; }
  .topbar { padding: 0 12px; }
  .topbar nav a { padding: 10px 9px; font-size: .82rem; min-width: 0; }
  .card.is-featured { padding: 24px; }
  .card.is-featured h3.card-title { font-size: 1.8rem; }
  /* the reasoning text judges most need to read: no smaller than 15px on phones and tablets */
  .small, .card details.more, .user .why, .fig figcaption, .credits, .checks li { font-size: .9375rem; }
  .checks .detail { font-size: .875rem; }
  .how li, .findings, .cross, .dl dd { font-size: 1rem; }
  .agg-caption { font-size: .8125rem; }
}
@media (max-width: 820px) {
  .stage.pre .legend { display: none; }
}
@media (min-width: 821px) {
  .stage-cta { display: none !important; }
}
@media (max-width: 480px) {
  .wordmark span { font-size: 1.2rem; }
  .topbar { gap: 8px; }
  .topbar nav { gap: 0; }
  .topbar nav a { padding: 10px 9px; font-size: .8rem; }
  .topbar .nav-explorer { display: none; }
  .step { padding: 16px; }
  .step .split .big { font-size: 1.8rem; }
  .seg input + span { padding: 8px 11px; font-size: .8rem; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .controls { left: 10px; right: 10px; top: 10px; flex-wrap: nowrap; }
  .legend { bottom: 40px; left: 10px; font-size: .75rem; padding: 2px 10px 8px; max-width: min(230px, calc(100% - 76px)); }
  .legend .row { line-height: 1.45; gap: 6px; }
  .legend .ramp, .legend .ramp-lab { width: 150px; }
  .legend-note { font-size: .75rem; }
  .legend .q-note { display: none; } /* the panel explains q right below the map */
  .zoom { right: 10px; bottom: 40px; }
  .stage-cta { left: 10px; bottom: 40px; max-width: calc(100% - 76px); }
  .card { padding: 20px; }
  .checks .detail { margin-left: 0; }
  .chk-row, .checks summary { grid-template-columns: 92px minmax(0, 1fr) auto; }
  th, td { padding: 8px; }
  .table-wrap tbody > tr > th[scope="row"] { white-space: normal; min-width: 9ch; }
}
/* touch screens: every control at least 44 px tall */
@media (pointer: coarse) {
  .seg input + span { padding-top: 12px; padding-bottom: 12px; }
  .legend-title { min-height: 44px; }
}
@media (max-width: 350px) {
  .wordmark span { display: none; }
}
