:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --surface-2: #f3f2ef;
  --border: #e2e1dc;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #75746f;
  --link: #1c5cab;
  --zone-de: #2a78d6;
  --zone-dk: #eb6834;
  --fc-raw: #8a8984;
  --fc-a: #4a3aa7;
  --fc-b: #1baf7a;
  --grid: #e8e7e3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #1a1a19;
    --surface-2: #232321;
    --border: #383835;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --text-3: #9a998f;
    --link: #86b6ef;
    --zone-de: #3987e5;
    --zone-dk: #d95926;
    --fc-raw: #8f8e88;
    --fc-a: #9085e9;
    --fc-b: #199e70;
    --grid: #2e2e2b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1a1a19;
  --surface-2: #232321;
  --border: #383835;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --text-3: #9a998f;
  --link: #86b6ef;
  --zone-de: #3987e5;
  --zone-dk: #d95926;
  --fc-raw: #8f8e88;
  --fc-a: #9085e9;
  --fc-b: #199e70;
  --grid: #2e2e2b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 400 17px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 48px 16px 64px; }
a { color: var(--link); }

h1, h2 { font-family: Newsreader, Georgia, serif; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.12; margin: 0 0 16px; }
h2 { font-size: 27px; line-height: 1.2; margin: 56px 0 12px; }
p { margin: 0 0 16px; }

.kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; }
.tagline { font-size: 19px; color: var(--text-2); }
.window {
  font-size: 15px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; margin-top: 24px;
}

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 32px 0 8px; }
.tile { border: 1px solid var(--border); border-radius: 8px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.tile-value { font-family: Newsreader, Georgia, serif; font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 13px; line-height: 1.35; color: var(--text-2); }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

figure { margin: 24px 0 32px; }
figcaption { font-size: 14px; color: var(--text-3); margin-top: 8px; }
.chart { width: 100%; min-height: 120px; }
.chart svg { overflow: visible; }
.chart-pair { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; }
@media (max-width: 640px) { .chart-pair { grid-template-columns: 1fr; } }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.legend i.dash { background: none !important; border-top: 2px dashed; height: 0; }

details { margin-top: 10px; font-size: 14px; }
summary { cursor: pointer; color: var(--text-2); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; margin: 8px 0; }
caption { text-align: left; font-size: 14px; color: var(--text-3); padding-bottom: 6px; }
th, td { padding: 6px 14px 6px 0; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-2); }

.sources ul { padding-left: 20px; font-size: 15px; color: var(--text-2); }
.sources li { margin-bottom: 6px; }
.byline { margin-top: 32px; font-size: 15px; }

/* Observable Plot tooltip */
[aria-label="tip"] path { fill: var(--surface); stroke: var(--border); }
[aria-label="tip"] text { fill: var(--text); }
