:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --line: #e6e5e0;
  --accent: #0f6fde;
  --accent-soft: #e4efff;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --heat-0: #ececea;
  --heat-1: #b9d4fb;
  --heat-2: #6fa6f2;
  --heat-3: #2b7ce3;
  --heat-4: #0b4fa8;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1a1a19;
    --text: #ececea;
    --muted: #9a9a94;
    --line: #2c2c2a;
    --accent: #5ea2ff;
    --accent-soft: #14253d;
    --warn: #f1b45c;
    --warn-soft: #3a2a0d;
    --heat-0: #232322;
    --heat-1: #1f3b66;
    --heat-2: #2a5aa0;
    --heat-3: #3c7fd9;
    --heat-4: #7db4ff;
  }
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 720px; margin: 0 auto; padding: 48px 20px 24px; }
footer { max-width: 720px; margin: 0 auto; padding: 24px 20px 48px; color: var(--muted); font-size: 0.875rem; border-top: 1px solid var(--line); }
footer p { margin: 0 0 6px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header { margin-bottom: 32px; }
h1 { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 8px; }
h2 { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 14px; }
.lede { margin: 0 0 16px; color: var(--muted); max-width: 60ch; }
section { margin-bottom: 44px; }
.note { color: var(--muted); font-size: 0.875rem; margin: 10px 0 0; }
.muted { color: var(--muted); }

.freshness {
  display: inline-block; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px;
  font-size: 0.8125rem; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.freshness.stale { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

.hero {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 8px 28px; align-items: center;
  padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.index { grid-row: 1 / 3; display: flex; align-items: baseline; gap: 10px; }
.index-value { font-size: 4.5rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.index-label { font-size: 0.8125rem; line-height: 1.25; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.pill.quiet { background: var(--heat-0); color: var(--muted); }
.probabilities { display: flex; gap: 24px; margin: 0; }
.probabilities div { display: flex; flex-direction: column; }
.probabilities dt { font-size: 0.75rem; color: var(--muted); }
.probabilities dd { margin: 0; font-size: 1.375rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.last-reset { margin: 0; }
.last-reset .more { margin-left: 8px; font-size: 0.9375rem; white-space: nowrap; }
.big { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.01em; }
.crumb { margin: 0 0 12px; font-size: 0.875rem; }
.history h3 { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin: 28px 0 6px; }
.records { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.records li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.records time { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.records .kind { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.records .kind .meta { font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.records .kind.suspected, .records .kind.unknown { color: var(--muted); }
.records .quote { margin: 0; }
.records .update .quote { color: var(--muted); font-size: 0.9375rem; }
.records .detail { margin: 4px 0 0; color: var(--muted); font-size: 0.875rem; }
.records .source { font-size: 0.8125rem; }

.factors { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 0.9375rem; }
.factors th, .factors td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.factors thead th { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.factors .num { text-align: right; font-variant-numeric: tabular-nums; }
.factors .zero td { color: var(--muted); }
.factors .neg .contribution { color: var(--warn); }
.factors .key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; }
.factors .baseline td { font-style: italic; }

.stats { display: flex; gap: 28px; margin-bottom: 14px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 1.375rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.75rem; color: var(--muted); }
.heatmap-scroll { overflow-x: auto; }
.months { display: grid; grid-auto-flow: column; grid-auto-columns: 16px; gap: 3px; width: max-content; margin-bottom: 4px; font-size: 0.6875rem; color: var(--muted); }
.months span { white-space: nowrap; overflow: visible; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 16px); grid-auto-columns: 16px; gap: 3px; width: max-content; }
.heatmap span { width: 16px; height: 16px; border-radius: 3px; background: var(--heat-0); }
.heatmap span[data-level="1"] { background: var(--heat-1); }
.heatmap span[data-level="2"] { background: var(--heat-2); }
.heatmap span[data-level="3"] { background: var(--heat-3); }
.heatmap span[data-level="4"] { background: var(--heat-4); }
.heatmap span.future { visibility: hidden; }

@media (max-width: 560px) {
  main { padding-top: 32px; }
  .hero { grid-template-columns: 1fr; }
  .index { grid-row: auto; }
  .index-value { font-size: 3.5rem; }
  .probabilities { gap: 18px; }
  .records li { grid-template-columns: 1fr; }
}
