/* ROB RUN Stats. Rules and tokens: docs/DESIGN.md */
@font-face { font-family: 'Sofia Sans Extra Condensed'; font-style: italic; font-weight: 800; font-display: swap; src: url('/fonts/sofia-sans-extra-condensed-800i.woff2') format('woff2'); }
@font-face { font-family: 'Sofia Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/sofia-sans.woff2') format('woff2'); }

:root {
  --bg: #171514;
  --surface: #201e1c;
  --surface-2: #2a2725;
  --line: #363230;
  --text: #ede9e4;
  --muted: #a9a39c;
  --lime: #c5fb31;
  --lime-hover: #bbff01;
  --lime-ink: #171514;
  --purple: #b07cff;
  --link: var(--lime);
  --open: var(--lime);
  --warn: #ffb020;
  --radius: 6px;
  --max: 880px;
  --wide: 1080px;
  --display: 'Sofia Sans Extra Condensed', 'Arial Narrow', sans-serif;
  --body: 'Sofia Sans', system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f0ea;
  --surface: #fbfaf7;
  --surface-2: #e9e4dc;
  --line: #d4cdc3;
  --text: #171514;
  --muted: #5d5750;
  --purple: #6a3fd1;
  --link: #2f5d00;
  --open: #3a6f00;
  --warn: #8a5200;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.55 var(--body); }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--lime); color: var(--lime-ink); padding: 8px 12px; }

h1, h2, h3 { font-weight: 700; line-height: 1.15; margin: 0 0 .5em; }
h1 { font: 800 italic clamp(2.4rem, 7vw, 3.4rem)/1 var(--display); letter-spacing: -.01em; margin-bottom: .3em; }
h2 { font-size: 1.35rem; margin-top: 2.2em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.intro { color: var(--muted); font-size: 1.08rem; max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; min-height: 56px; padding-top: 6px; padding-bottom: 6px; max-width: var(--wide); }
.site-header nav { margin-right: auto; }
.wordmark { font: 800 italic 1.6rem/1 var(--display); color: var(--text); text-decoration: none; text-transform: uppercase; }
.wordmark span { color: var(--open); }
.wordmark:hover { color: var(--text); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 6px 0; display: inline-block; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-color: var(--open); }

main { padding: 36px 0 24px; }

/* Buttons: skewed like the official site */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 20px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--lime); color: var(--lime-ink);
  font: 800 italic 1.15rem/1 var(--display); text-transform: uppercase;
  transform: skewX(-12deg); border-radius: 3px;
}
.btn > span { display: inline-block; transform: skewX(12deg); }
.btn:hover { background: var(--lime-hover); color: var(--lime-ink); }
.btn--quiet { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn--quiet:hover { background: var(--surface-2); color: var(--text); }

/* Next-event answer line */
.answer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 22px 0 8px; }
.answer__label { color: var(--muted); }
.answer__value { font: 800 italic 2.1rem/1 var(--display); }

/* Time zone switch */
.tz { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .92rem; margin: 6px 0 0; }
.tz select { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px; font: inherit; min-height: 36px; }

/* Region table */
.regions { width: 100%; border-collapse: collapse; margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.regions th, .regions td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.regions tr:last-child > * { border-bottom: 0; }
.regions thead th { font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--bg); padding-top: 10px; padding-bottom: 10px; }
.regions tbody th { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.regions tbody th small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.rel { display: block; font: 800 italic 1.6rem/1.05 var(--display); font-variant-numeric: tabular-nums; }
.rel--open { color: var(--open); }
.rel--wipe { color: var(--purple); }
.abs { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
@media (max-width: 560px) {
  .regions thead { display: none; }
  .regions, .regions tbody, .regions tr, .regions th, .regions td { display: block; width: 100%; }
  .regions tr { border-bottom: 1px solid var(--line); }
  .regions tr:last-child { border-bottom: 0; }
  .regions th, .regions td { border: 0; padding: 8px 16px; }
  .regions tbody th { padding-top: 14px; }
  .regions td:last-child { padding-bottom: 14px; }
  .regions td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .82rem; }
}

/* Timeline */
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline > li:first-child { border-top: 0; }
.timeline .day { font-weight: 700; }
.timeline ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.timeline li li { display: grid; grid-template-columns: 4.2rem 1fr; gap: 10px; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot--open { background: var(--open); }
.dot--wipe { background: var(--purple); }
.timeline .past { opacity: .5; }
.timeline .also { color: var(--muted); margin-left: 14px; white-space: nowrap; }
@media (max-width: 560px) { .timeline .also { display: block; margin-left: 0; } }
@media (max-width: 560px) { .timeline > li { grid-template-columns: 1fr; } }

.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; margin-top: 10px; }

/* Panels and lists */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.note { border-left: 3px solid var(--purple); background: var(--surface); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--muted); }
.note strong { color: var(--text); }
.links { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.links li { padding: 14px 16px; border-top: 1px solid var(--line); }
.links li:first-child { border-top: 0; }
.links a { font-weight: 700; }
.links p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.prose { max-width: 66ch; }
.prose li { margin-bottom: .4em; }

/* Calculator */
.calc fieldset { border: 0; padding: 0; margin: 0 0 14px; display: flex; gap: 8px 20px; flex-wrap: wrap; }
.calc legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.calc .choice { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.calc input[type="radio"] { accent-color: var(--open); width: 18px; height: 18px; }
.fields { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.field { display: grid; gap: 4px; }
.field label { font-size: .9rem; color: var(--muted); }
.field input, .field select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; min-height: 44px; font: inherit; max-width: 100%;
}
.field input[type="number"] { width: 5.5rem; }
.result { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.result .rel { font-size: 2rem; }
.actions { display: flex; gap: 12px 16px; flex-wrap: wrap; margin-top: 14px; }

/* FAQ */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; color: var(--link); font-weight: 400; font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: '−'; }
details > div { padding: 0 0 14px; color: var(--muted); max-width: 66ch; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }
.site-footer p { max-width: 70ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 10px 0 0; padding: 0; }

/* ---- Hub additions ---- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap--wide { max-width: var(--wide); }
.site-footer .wrap, .live .wrap { max-width: var(--wide); }
h1, h2, h3 { scroll-margin-top: 110px; }
/* On phones the header wraps to three rows: let it scroll away. */
@media (max-width: 760px) { .site-header { position: static; } h1, h2, h3 { scroll-margin-top: 12px; } }

/* Search */
.search { position: relative; flex: 0 1 220px; min-width: 130px; }
.search input { width: 100%; min-height: 38px; padding: 6px 30px 6px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: .95rem; }
.search input::placeholder { color: var(--muted); }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 600 .75rem/1 var(--body); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; pointer-events: none; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.search__results { position: absolute; right: 0; top: calc(100% + 6px); width: min(420px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgb(0 0 0 / .35); z-index: 30; }
.search__results a { display: block; padding: 8px 10px; border-radius: 4px; color: var(--text); text-decoration: none; }
.search__results a small { display: block; color: var(--muted); font-size: .85rem; }
.search__results li[aria-selected="true"] a, .search__results a:hover { background: var(--surface-2); }
.search__results .empty { padding: 10px; color: var(--muted); }
.theme { display: inline-grid; place-items: center; width: 38px; height: 38px; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.theme:hover { color: var(--text); background: var(--surface); }

/* Live strip: the three answers, on every page */
.live { background: var(--surface); border-bottom: 1px solid var(--line); font-size: .9rem; }
.live .wrap { display: flex; gap: 2px 26px; flex-wrap: wrap; min-height: 36px; align-items: center; padding-top: 5px; padding-bottom: 5px; }
.live a { color: var(--muted); text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live a:hover { color: var(--text); }
.live b { color: var(--text); font-weight: 700; }
.pip { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 8px; vertical-align: 1px; }
.pip--ok { background: var(--open); }
.pip--warn { background: var(--warn); border-radius: 1px; transform: rotate(45deg); }
@media (max-width: 560px) { .live a:nth-child(3) { display: none; } }

/* Source labels: how much to trust a number */
.tag { display: inline-block; font-size: .75rem; font-weight: 600; line-height: 1; padding: 4px 7px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); vertical-align: 2px; white-space: nowrap; }
.tag--live { color: var(--open); border-color: currentColor; }
.tag--est { color: var(--purple); border-color: currentColor; }

/* Board: one panel, three answers */
.board { display: grid; grid-template-columns: 1.15fr 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 20px; }
.board > * { padding: 18px 20px; border-left: 1px solid var(--line); min-width: 0; color: inherit; text-decoration: none; display: block; }
.board > *:first-child { border-left: 0; }
.board a:hover { background: var(--surface-2); color: inherit; }
@media (max-width: 760px) { .board { grid-template-columns: 1fr; } .board > * { border-left: 0; border-top: 1px solid var(--line); } .board > *:first-child { border-top: 0; } }
.stat__label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .92rem; }
.stat__value { display: block; font: 800 italic clamp(2.2rem, 5vw, 3rem)/1 var(--display); font-variant-numeric: tabular-nums; margin: 8px 0 4px; min-height: 1em; }
.stat__value--text { font-size: clamp(1.7rem, 3.6vw, 2.1rem); line-height: 1.05; }
.stat__sub { display: block; color: var(--muted); font-size: .88rem; min-height: 1.4em; }
.spark { display: block; width: 100%; height: 40px; margin-top: 10px; }
.spark path { fill: none; stroke: var(--open); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 18px 0 0; padding: 0; }
.stats > div { padding: 14px 16px; border-left: 1px solid var(--line); min-width: 0; }
.stats > div:first-child { border-left: 0; }
.stats dt { color: var(--muted); font-size: .88rem; }
.stats dd { margin: 4px 0 0; font: 800 italic 1.7rem/1.05 var(--display); font-variant-numeric: tabular-nums; }
.stats dd small { display: block; font: 400 .82rem/1.3 var(--body); color: var(--muted); margin-top: 3px; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .stats > div:nth-child(odd) { border-left: 0; } .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); } }

.hero-num { font: 800 italic clamp(3.4rem, 12vw, 5.6rem)/.95 var(--display); font-variant-numeric: tabular-nums; margin: 14px 0 6px; min-height: .95em; }

/* Chart */
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-top: 2.2em; }
.chart-head h2 { margin: 0; }
.ranges { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ranges button { background: transparent; color: var(--muted); border: 0; border-left: 1px solid var(--line); padding: 0 14px; min-height: 38px; font: 600 .9rem var(--body); cursor: pointer; }
.ranges button:first-child { border-left: 0; }
.ranges button:hover { color: var(--text); }
.ranges button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.chart { position: relative; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 8px 4px 0; }
.chart svg { display: block; width: 100%; height: auto; aspect-ratio: 1040 / 340; touch-action: pan-y; }
@media (max-width: 560px) { .chart svg { aspect-ratio: 1040 / 520; } }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font: 400 12px var(--body); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .chart .axis { font-size: 26px; } }
.chart .line { fill: none; stroke: var(--open); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--open); opacity: .1; }
.chart .cross { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .mark { fill: var(--open); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .drop { fill: var(--warn); opacity: .16; }
.chart__tip { position: absolute; top: 8px; pointer-events: none; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px; font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; z-index: 2; }
.chart__tip b { display: block; font-size: 1rem; }
.chart__empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); padding: 16px; text-align: center; }

/* Data tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-top: 12px; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: right; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; }
.table thead th { font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--bg); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody th { font-weight: 600; }
.table td[colspan] { white-space: normal; text-align: left; color: var(--muted); }
.table--text th, .table--text td { text-align: left; white-space: normal; vertical-align: top; }

/* Status signal */
.signal { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); background: var(--surface); padding: 18px 20px; margin-top: 20px; min-height: 108px; }
.signal--ok { border-left-color: var(--open); }
.signal--warn { border-left-color: var(--warn); }
.signal__icon { flex: none; width: 28px; height: 28px; margin-top: 4px; color: var(--muted); }
.signal--ok .signal__icon { color: var(--open); }
.signal--warn .signal__icon { color: var(--warn); }
.signal__title { font: 800 italic clamp(1.7rem, 4.5vw, 2.3rem)/1.05 var(--display); margin: 0 0 4px; }
.signal p { margin: 0; color: var(--muted); max-width: 62ch; }

/* News and link grids */
.news { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.news li { display: grid; grid-template-columns: 6.2rem 1fr; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .92rem; padding-top: 2px; }
.news a { font-weight: 700; }
.news p { grid-column: 2; margin: 0; color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) { .news li { grid-template-columns: 1fr; } .news p { grid-column: 1; } }
.tiles { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); gap: 1px; overflow: hidden; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .tiles { grid-template-columns: 1fr; } }
.tiles li { background: var(--surface); }
.tiles a { display: block; padding: 14px 16px; height: 100%; text-decoration: none; color: var(--text); }
.tiles a:hover { background: var(--surface-2); }
.tiles b { display: block; font: 800 italic 1.35rem/1.1 var(--display); text-transform: uppercase; color: var(--link); }
.tiles span { display: block; color: var(--muted); font-size: .92rem; margin-top: 3px; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 40px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

/* Wiki articles */
.crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 14px; padding: 0; color: var(--muted); font-size: .9rem; }
.crumbs li + li::before { content: '/'; margin-right: 8px; color: var(--line); }
.crumbs a { color: var(--muted); }
.article { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 0 48px; align-items: start; }
.article > .prose { grid-column: 1; }
.toc { grid-column: 2; grid-row: 1 / span 20; position: sticky; top: 118px; border-left: 1px solid var(--line); padding-left: 16px; font-size: .92rem; }
.toc h2 { font-size: .85rem; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }
@media (max-width: 860px) { .article { grid-template-columns: 1fr; } .toc { grid-column: 1; grid-row: auto; position: static; border-left: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; } }
.prose h2 { margin-top: 1.8em; }
.prose sup a { text-decoration: none; font-size: .8em; padding: 0 2px; }
.facts { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 16px 0; padding: 0; display: grid; grid-template-columns: max-content 1fr; }
.facts dt, .facts dd { padding: 9px 14px; border-top: 1px solid var(--line); margin: 0; }
.facts dt { color: var(--muted); }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
.refs { font-size: .92rem; color: var(--muted); padding-left: 1.4em; }
.refs li { margin-bottom: .3em; }
.updated { color: var(--muted); font-size: .9rem; }
