/* One stylesheet, no framework, no build step.
   Theme-aware: the palette flips on prefers-color-scheme, so the same markup reads
   correctly in either. Everything is driven by these variables. */

:root {
  --bg: #ffffff;
  --panel: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #1d4ed8;
  --accent-soft: #dbeafe;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --good: #15803d;
  --bad: #b91c1c;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --panel: #111c33;
    --border: #1e293b;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #60a5fa;
    --accent-soft: #172554;
    --warn: #fbbf24;
    --warn-soft: #2a2004;
    --good: #4ade80;
    --bad: #f87171;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
.bar {
  max-width: 1180px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-weight: 400; }
nav { display: flex; gap: 18px; flex-wrap: wrap; }
nav a { color: var(--muted); font-size: 14px; }
nav a.on { color: var(--accent); font-weight: 600; }

/* The assistant, promoted out of the nav and into the content. It is the one
   thing on this site a visitor cannot get from a table, so it gets the weight
   of a call to action rather than the weight of a sixth nav item. Full-width
   and above the fold on every page. */
.cta {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 0 24px;
  padding: 11px 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.cta:hover { filter: brightness(0.97); text-decoration: none; }
.cta-main { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.cta-main::after { content: " →"; }
.cta-sub { color: var(--muted); font-size: 12px; }

main { max-width: 1180px; margin: 0 auto; padding: 26px 20px 64px; }

h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 32px 0 12px; }
p.lede { color: var(--muted); margin: 0 0 22px; max-width: 70ch; }

/* stat row */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); padding: 14px 16px;
}
.stat .n { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* tables always scroll inside their own box; the page never scrolls sideways */
.scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
th {
  background: var(--panel); color: var(--muted); font-weight: 600;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel); }
td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 220px; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--border);
}
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.pill.info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.up { color: var(--good); }
.down { color: var(--bad); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

form.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input, select, button {
  font: inherit; padding: 7px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
button { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; font-weight: 600; }
button:hover { filter: brightness(1.08); }

.note {
  border-left: 3px solid var(--accent); background: var(--panel);
  padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 18px 0; max-width: 78ch;
}
.note.warn { border-left-color: var(--warn); }

footer.site {
  border-top: 1px solid var(--border); margin-top: 44px; padding: 18px 20px;
  color: var(--muted); font-size: 12.5px;
}
footer.site .bar { display: block; }

.empty { padding: 34px; text-align: center; color: var(--muted); }

/* --- the write-up on the home page ---------------------------------------
   Rendered markdown, so the selectors have to cover tags this stylesheet does
   not otherwise emit (blockquote, hr, nested lists, inline code in prose).
   Narrower than the data pages on purpose: those are wide tables, this is
   prose, and prose stops being readable somewhere around 80 characters. */
.prose { max-width: 780px; }
.prose h2 {
  margin: 34px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 20px;
  letter-spacing: -0.01em;
}
.prose h3 { margin: 22px 0 6px; font-size: 16px; }
.prose p, .prose li { line-height: 1.65; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.prose pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
}
.prose pre code { border: 0; background: none; padding: 0; }
/* Tables in the write-up scroll rather than forcing the page sideways. */
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.prose th { color: var(--muted); font-weight: 600; font-size: 13px; }
.prose blockquote {
  margin: 14px 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }
