/* ============================================================================
   Engine reference stylesheet — BUILD_GUIDE §5 made concrete. v3.
   Thesis: A DOCUMENT, NOT A UI (motherfuckingwebsite discipline + Gestalt).
     · One readable column. Grouping comes from whitespace and proximity,
       never from boxes. Borders exist only where a table needs ruling.
     · Two voices: Archivo for the writer, IBM Plex Mono for the instrument
       (figures, dates, run numbers, verdicts). Provenance sits directly
       under the fact it vouches for — closeness IS the grouping.
     · Color means data, nothing else. One ink button per page. Everything
       else is text.
     · The moat is visible: history leads, archives are public, donated
       counts are part of the dataset, every fact carries a cite string.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..800&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
  --s-1: 4px; --s-2: 8px; --s-3: 16px; --s-4: 24px; --s-5: 40px; --s-6: 64px;
  --face-text: "Archivo", system-ui, sans-serif;
  --face-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --page: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-muted: #898781;
  --hairline: #e1e0d9;
  --accent: #2a78d6;        /* data marks + links — the only recurring color */
  --accent-deep: #1c5cab;
  --st-good: #075207; --st-warning: #6b4a00; --st-serious: #7a2e10; --st-critical: #7c1d1d;
  --maxw: 720px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 18px/1.6 var(--face-text);
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-4); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: 39px; font-weight: 750; font-stretch: 106%; margin: 0 0 var(--s-3); }
h2 { font-size: 25px; font-weight: 700; margin: var(--s-6) 0 var(--s-3); }
h3 { font-size: 20px; font-weight: 650; margin: var(--s-5) 0 var(--s-2); }
p, ul, ol { margin: 0 0 var(--s-3); }
ul, ol { padding-left: 1.2em; }
li { margin-bottom: var(--s-1); }
a { color: var(--accent-deep); text-underline-offset: 3px; }
small, .muted { color: var(--ink-muted); font-size: 14px; }
code, .mono { font-family: var(--face-mono); font-size: 0.85em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: var(--s-5) 0; }

/* lede paragraph — the op-ed opening */
.kicker { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 62ch; }

/* ---- demo banner (reference site only) ---- */
.demo-banner {
  background: var(--ink); color: var(--page); text-align: center;
  font-family: var(--face-mono); font-size: 11px; padding: 6px var(--s-3);
}

/* ---- header: a wordmark and five links. Nothing else. ---- */
.site-header { border-bottom: 1px solid var(--ink); }
.site-header .wrap {
  display: flex; align-items: baseline; gap: var(--s-3) var(--s-4);
  padding-top: var(--s-3); padding-bottom: var(--s-3); flex-wrap: wrap;
}
.logo { font-weight: 800; font-stretch: 110%; font-size: 20px; color: var(--ink); text-decoration: none; }
.logo .tld { font-family: var(--face-mono); font-size: 12px; font-weight: 400; color: var(--ink-muted); }
.site-nav { display: flex; gap: var(--s-3); margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 16px; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }

main { padding: var(--s-5) 0 var(--s-6); }

/* ---- FactHero: headline, lede, then the figure in the instrument's voice ---- */
.fact-hero { margin-bottom: var(--s-4); }
.fact-hero .figure {
  font-family: var(--face-mono); font-weight: 600; font-variant-numeric: tabular-nums;
  font-size: 49px; letter-spacing: -0.03em; line-height: 1.1; margin: var(--s-4) 0 0;
}
.fact-hero .figure small { font-family: var(--face-text); font-size: 18px; font-weight: 450; color: var(--ink-2); letter-spacing: 0; }

/* ---- verdicts: colored text + symbol + word. Not a pill. Never color alone. ---- */
.badge { font-family: var(--face-mono); font-size: 0.85em; font-weight: 600; white-space: nowrap; }
.badge.good { color: var(--st-good); } .badge.warning { color: var(--st-warning); }
.badge.serious { color: var(--st-serious); } .badge.critical { color: var(--st-critical); }

/* ---- the signature: provenance directly under its fact (proximity = grouping) ---- */
.provenance {
  font-family: var(--face-mono); font-size: 12px; color: var(--ink-muted);
  margin: var(--s-1) 0 var(--s-4); display: flex; gap: var(--s-3); flex-wrap: wrap;
}
.provenance a { color: var(--ink-muted); }

/* fact groups: whitespace does the separating — no cards */
.fact-card { margin: 0 0 var(--s-4); }
.fact-card .fact-label { font-size: 14px; color: var(--ink-2); }
.fact-card .fact-value {
  font-family: var(--face-mono); font-weight: 600; font-variant-numeric: tabular-nums;
  font-size: 31px; letter-spacing: -0.02em;
}

/* quotable citation slip — dotted rules above and below, nothing boxed */
.quotable {
  margin: var(--s-5) 0; padding: var(--s-3) 0;
  border-top: 2px dotted var(--ink-muted); border-bottom: 2px dotted var(--ink-muted);
  font-size: 20px; line-height: 1.5;
}
.quotable strong { font-family: var(--face-mono); font-size: 0.88em; }

/* ---- the one button (Fitts). Everything else is a link. ---- */
.cta {
  display: inline-block; background: var(--ink); color: var(--page);
  font: 700 20px var(--face-text); text-decoration: none; text-align: center;
  padding: var(--s-3) var(--s-5); border: 0; cursor: pointer; min-height: 44px;
}
.cta:hover { background: #2b2a28; }
@media (max-width: 720px) { .cta { display: block; width: 100%; } }
.text-action { font-size: 16px; }

/* layouts collapse to the single column; .cols kept for compatibility */
.cols { display: block; }
.rail { margin-top: var(--s-5); }

/* ---- tables: the one place ruling is earned ---- */
.rank-table { overflow-x: auto; margin: var(--s-4) 0 var(--s-2); }
.rank-table table { border-collapse: collapse; width: 100%; }
.rank-table th {
  text-align: left; font-family: var(--face-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-muted);
  padding: var(--s-2) var(--s-3) var(--s-2) 0; border-bottom: 2px solid var(--ink);
}
.rank-table td { padding: var(--s-2) var(--s-3) var(--s-2) 0; border-bottom: 1px solid var(--hairline); vertical-align: baseline; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table td.num { font-family: var(--face-mono); font-size: 15px; font-variant-numeric: tabular-nums; text-align: right; }
.rank-table a { color: var(--ink); font-weight: 600; }

/* ---- filters: plain links in a row; the current one is just bold ---- */
.filter-bar { display: flex; gap: var(--s-3); flex-wrap: wrap; margin: var(--s-3) 0; font-size: 16px; }
.filter-bar .chip { color: var(--ink-2); text-decoration: none; }
.filter-bar .chip:hover { text-decoration: underline; }
.filter-bar .chip[aria-current="true"] { color: var(--ink); font-weight: 700; text-decoration: none; }

/* ---- sparkline: data ink is content ---- */
.spark { display: inline-block; vertical-align: middle; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--accent); }

/* ---- claim/dispute: a sentence with a hairline above, not a box ---- */
.claim-bar { border-top: 1px solid var(--hairline); padding-top: var(--s-3); margin-top: var(--s-5); }

/* ---- sponsor: one labeled line. Quiet is the point. ---- */
.sponsor-slot { margin: var(--s-5) 0 0; font-size: 15px; color: var(--ink-2); }
.sponsor-slot .slot-label {
  display: inline; font-family: var(--face-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); margin-right: var(--s-2);
}

/* ---- email capture ---- */
.email-capture { display: flex; gap: var(--s-2); flex-wrap: wrap; max-width: 480px; margin: var(--s-3) 0; }
.email-capture input[type="email"] {
  flex: 1 1 240px; font: 400 16px var(--face-text); padding: var(--s-2) var(--s-3);
  border: 1px solid var(--ink-2); background: var(--page); min-height: 44px;
}
.email-capture button {
  font: 700 16px var(--face-text); color: var(--page); background: var(--ink);
  border: 0; padding: var(--s-2) var(--s-4); cursor: pointer; min-height: 44px;
}

/* ---- forms ---- */
.form-grid { display: grid; gap: var(--s-3); max-width: 560px; margin: var(--s-4) 0; }
.form-grid label { font-weight: 600; font-size: 16px; display: grid; gap: var(--s-1); }
.form-grid input, .form-grid select, .form-grid textarea {
  font: 400 16px var(--face-text); padding: var(--s-2) var(--s-3);
  border: 1px solid var(--ink-2); background: var(--page); min-height: 44px;
}
.form-grid textarea { min-height: 96px; }

/* panels become plain sections; notice keeps a hairline for standing warnings */
.panel { margin: var(--s-3) 0; }
.notice { border-left: 3px solid var(--st-warning); padding-left: var(--s-3); font-size: 15px; color: var(--ink-2); margin: var(--s-4) 0; }

/* ---- footer: plain lists under one rule ---- */
.site-footer { border-top: 1px solid var(--ink); margin-top: var(--s-6); padding: var(--s-5) 0; color: var(--ink-2); font-size: 15px; }
.site-footer .cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
@media (max-width: 720px) { .site-footer .cols3 { grid-template-columns: 1fr; } }
.site-footer h4 {
  margin: 0 0 var(--s-2); font-family: var(--face-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.site-footer a { color: var(--ink-2); }
.studio-line { margin-top: var(--s-4); font-family: var(--face-mono); font-size: 11px; color: var(--ink-muted); }
