:root {
  --bg: #12140f;
  --bg-2: #1b1f16;
  --ink: #e8ecd9;
  --muted: #a3ab96;
  --line: #2e3528;
  --gold: #e4b15a;
  --gold-ink: #1c160a;
  --blue: #8ec8d4;
  --green: #9dcc86;
  --red: #e48b7c;
  --lilac: #cbbbe6;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(228, 177, 90, 0.09), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  border-top: 3px solid var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

header { margin-bottom: 18px; }

.kicker {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 10px;
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(1.85rem, 4.4vw, 2.8rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
}

h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dek, .sub, .blurb, footer {
  color: var(--muted);
}

.dek { margin: 0; max-width: 68ch; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--gold);
  color: var(--gold-ink);
  padding: 8px 12px;
  z-index: 5;
  border-radius: 6px;
}

.skip:focus { top: 12px; }

a { color: var(--gold); }
a:hover { color: var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.yearbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 0 0 18px;
  background: var(--bg);
}

fieldset.yearbar {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
  flex: 1;
  min-width: 0;
}

.step {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.step:hover { border-color: var(--gold); color: var(--gold); }
.step:disabled { opacity: 0.35; cursor: default; }

.year-scroller {
  position: relative;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0 12px;
  min-width: 0;
  scrollbar-width: thin;
}

.year { position: relative; flex: 0 0 auto; }

.year input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 48px;
  padding: 6px 8px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink);
  cursor: pointer;
}

.chip .yr {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.1;
}

.chip .mark {
  min-height: 1em;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.year input:checked + .chip {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--gold-ink);
}

.year input:checked + .chip .mark { color: var(--gold-ink); }

.year input:focus-visible + .chip {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.snapshot { margin-bottom: 16px; }

.blurb {
  margin: 0 0 6px;
  max-width: 78ch;
}

.event-line {
  margin: 0 0 14px;
  max-width: 78ch;
  color: var(--gold);
}

.event-line:empty { display: none; }

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi:last-child { grid-column: 1 / -1; }

.kpi {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 11px;
  min-width: 0;
}

.value {
  margin: 4px 0 2px;
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.sub { margin: 0; font-size: 13px; min-height: 1.3em; }
.sub.up { color: var(--green); }
.sub.down { color: var(--red); }

.charts, .lower {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 12px;
  min-width: 0;
}

.card .sub { margin: 0 0 10px; }

.plot { position: relative; height: 240px; }
.plot-tall { height: 280px; }

.fallback, .noscript {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

.scroll { max-height: 460px; overflow: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }

th, td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.num { text-align: right; font-variant-numeric: tabular-nums; }

tbody tr { cursor: pointer; }
tbody tr:hover { background: rgba(232, 236, 217, 0.04); }
tbody tr[aria-selected="true"] { background: rgba(228, 177, 90, 0.14); }
tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--gold); }

.ev {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ev:hover { background: rgba(232, 236, 217, 0.04); }
.ev[aria-pressed="true"] { background: rgba(228, 177, 90, 0.14); }
.ev .when {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ev[aria-pressed="true"] .when { color: var(--ink); }

footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

footer p { margin: 0; }

@media (min-width: 800px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi:last-child { grid-column: auto; }
  .charts { grid-template-columns: 1fr 1fr; }
  .charts .wide { grid-column: 1 / -1; }
  .plot { height: 270px; }
}

@media (min-width: 1040px) {
  .kpi-grid { grid-template-columns: repeat(5, 1fr); }
  .lower { grid-template-columns: 1.35fr 0.65fr; align-items: start; }
}

@media (max-width: 420px) {
  .wrap { padding: 18px 14px 56px; }
  .chip { min-width: 62px; }
  .kicker { letter-spacing: 0.08em; }
}
