:root {
  --bg: #f7f5f0; --surface: #ffffff; --ink: #1a1d21; --muted: #5d636b; --faint: #8a9098;
  --line: #e2ded5; --accent: #9a5b13; --accent-ink: #ffffff; --ok: #1f6f43; --err: #a32020;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416; --surface: #1a1d20; --ink: #ecebe6; --muted: #a7acb2; --faint: #7b8188;
    --line: #2c3035; --accent: #e0a35a; --accent-ink: #1a1206; --ok: #6fcf97; --err: #ff8a80;
  }
}
:root[data-theme="dark"] {
  --bg: #121416; --surface: #1a1d20; --ink: #ecebe6; --muted: #a7acb2; --faint: #7b8188;
  --line: #2c3035; --accent: #e0a35a; --accent-ink: #1a1206; --ok: #6fcf97; --err: #ff8a80;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--accent); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font: 600 15px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.brand img { width: 26px; height: 26px; flex: none; }
nav a { color: var(--muted); text-decoration: none; font-size: 15px; margin-left: 20px; }
nav a:hover, nav a[aria-current] { color: var(--ink); }
.hero { padding: 72px 0 48px; }
.eyebrow { font: 500 13px/1 var(--mono); color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin: 0 0 18px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(34px, 6vw, 54px); letter-spacing: -.01em; max-width: 18ch; }
.lede { font-size: clamp(18px, 2.4vw, 21px); color: var(--muted); max-width: 40em; margin: 22px 0 0; }
.cta { display: inline-block; margin-top: 32px; background: var(--accent); color: var(--accent-ink);
  padding: 13px 22px; border-radius: 6px; text-decoration: none; font-weight: 600; }
section { padding: 44px 0; border-top: 1px solid var(--line); }
h2 { font-size: 28px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.card h3 { font-size: 19px; margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.prose { max-width: 40em; }
.prose p, .prose li { color: var(--ink); }
.prose h2 { margin-top: 8px; }
.note { color: var(--muted); font-size: 15px; }
form { display: grid; gap: 14px; max-width: 560px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } nav a { margin-left: 14px; } }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 11px 12px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 0;
  border-radius: 6px; padding: 13px 22px; cursor: pointer; justify-self: start; }
button[disabled] { opacity: .6; cursor: default; }
.hp { position: absolute; left: -9999px; }
.status { font-size: 15px; min-height: 1.5em; margin: 0; }
.status.ok { color: var(--ok); } .status.err { color: var(--err); }
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--faint); font-size: 13.5px; }
footer p { margin: 6px 0; max-width: 60em; }
.chart { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 8px; }
.chart svg { display: block; font-family: var(--sans); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; color: var(--muted); margin-top: 12px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: -8px; }
.sw.a { background: var(--accent); } .sw.b { background: var(--muted); }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t td { padding: 5px 0; border-bottom: 1px solid var(--line); }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
/* inline SVG charts (build/svg.py) */
.chart svg text { font-size: 12.5px; }
.k-g { stroke: var(--line); stroke-width: 1; } .k-g.z { stroke: var(--faint); stroke-width: 1.2; }
.k-t { fill: var(--faint); } .k-t.b { fill: var(--ink); font-weight: 600; font-size: 13.5px; }
.k-a.f { fill: var(--accent); } .k-b.f { fill: var(--faint); opacity: .75; }
.k-a.ln { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
.k-b.ln { fill: none; stroke: var(--faint); stroke-width: 2; stroke-dasharray: 5 4; }
.k-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.sw.dot { background: var(--surface); border: 2px solid var(--ink); border-radius: 50%; }
/* story pages */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 30px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.stat b { display: block; font: 600 28px/1.1 var(--mono); color: var(--ink); }
.stat span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); }
.odo { font: 600 clamp(34px, 7.5vw, 64px)/1 var(--mono); letter-spacing: .02em; color: var(--ink);
  font-variant-numeric: tabular-nums; margin: 26px 0 8px; }
.tbl { overflow-x: auto; margin-top: 18px; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 520px; }
.tbl th, .tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { font-weight: 600; color: var(--muted); font-size: 13.5px; }
.callout { background: var(--surface); border-left: 3px solid var(--accent); padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 24px 0; }
.callout p { margin: 0; }
.report-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 26px; }
.report-box h2 { margin-bottom: 8px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; max-width: none; margin-top: 16px; }
.inline-form input { flex: 1 1 260px; width: auto; }
.links { columns: 2 260px; padding-left: 18px; } .links li { margin: 4px 0; }
.faq dt { font-weight: 600; margin-top: 16px; } .faq dd { margin: 4px 0 0; color: var(--muted); }
