:root {
  --bg: #070b12;
  --bg-2: #0b111b;
  --panel: #0e1520;
  --line: #1b2533;
  --text: #e7edf4;
  --muted: #8b98a9;
  --faint: #5d6a7b;
  --accent: #7fe0ab;
  --accent-ink: #062014;
  --warn: #e9c46a;
  --south: #7fe0ab;
  --ahead: rgba(127, 224, 171, 0.14);
  --radius: 18px;
  --radius-s: 12px;
  color-scheme: dark;
}
:root.red {
  --bg: #060000;
  --bg-2: #0b0101;
  --panel: #100202;
  --line: #2b0707;
  --text: #ff5b4d;
  --muted: #b53a30;
  --faint: #7a241d;
  --accent: #ff3b2f;
  --accent-ink: #1a0000;
  --warn: #ff3b2f;
  --south: #ff3b2f;
  --ahead: rgba(255, 59, 47, 0.14);
}

* { 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 16px/1.6 "Hanken Grotesk", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  transition: background-color .4s ease, color .4s ease;
}
a { color: var(--accent); text-underline-offset: 3px; }
button, select { font: inherit; color: inherit; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 10; background: var(--panel); padding: 8px 12px; border-radius: 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1080px; margin: 0 auto; padding: 18px 20px 0;
}
.brand { display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.brand b { font-weight: 700; font-size: 17px; }
.mark {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--accent);
  box-shadow: inset 0 -6px 10px -4px var(--accent);
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; color: var(--muted);
  transition: border-color .2s, color .2s, transform .15s;
}
.chip:hover { border-color: var(--faint); color: var(--text); }
.chip:active { transform: translateY(1px); }
.chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

main { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.replay {
  margin: 16px 0 0; padding: 12px 16px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 14px;
}
.replay b { color: var(--accent); font-weight: 700; }
.hero {
  position: relative; overflow: hidden;
  margin-top: 18px; border-radius: 26px;
  min-height: 460px;
  background: radial-gradient(120% 90% at 50% 120%, var(--bg-2) 0%, var(--bg) 70%);
  border: 1px solid var(--line);
  display: grid; align-items: end;
}
#sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-text { position: relative; padding: 40px clamp(20px, 5vw, 56px) 40px; max-width: 760px; }
.eyebrow { margin: 0 0 10px; color: var(--muted); font-weight: 500; letter-spacing: 0.01em; }
h1 {
  margin: 0; font-weight: 800; letter-spacing: -0.035em; line-height: 1.02;
  font-size: clamp(38px, 7vw, 76px); text-wrap: balance;
}
.lede { margin: 16px 0 0; max-width: 56ch; color: var(--muted); font-size: clamp(16px, 2vw, 19px); text-wrap: pretty; }
.lede b { color: var(--text); font-weight: 600; }
.locate { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.primary {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px;
  padding: 12px 20px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: transform .15s, filter .2s;
}
.primary:hover { filter: brightness(1.06); }
.primary:active { transform: translateY(1px) scale(0.99); }
.pick select {
  appearance: none; background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 38px 11px 18px; cursor: pointer; color: var(--text);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.pick select option { background: var(--panel); color: var(--text); }
.status { min-height: 1.6em; margin: 12px 0 0; color: var(--faint); font-size: 14px; }
.ping { margin-top: 6px; }

.facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px;
}
.fact {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: grid; gap: 2px; min-width: 0;
}
.fact .k { color: var(--muted); font-size: 13px; }
.fact .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.fact .s { color: var(--faint); font-size: 13px; line-height: 1.35; }
.fact.good .v { color: var(--accent); }
.fact.bad .v { color: var(--warn); }

.panel {
  margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 3vw, 28px);
}
.panel h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.015em; }
.body { margin: 0 0 14px; color: var(--muted); max-width: 70ch; }
.body b { color: var(--text); font-weight: 600; }
.fine { margin: 12px 0 0; color: var(--faint); font-size: 13px; max-width: 80ch; }
svg { display: block; width: 100%; height: auto; overflow: visible; }

.bars { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.bars li { display: grid; grid-template-columns: 200px 1fr 64px; align-items: center; gap: 14px; }
.bars .lbl b { display: block; font-weight: 600; }
.bars .lbl span { color: var(--faint); font-size: 13px; }
.track { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.fill { height: 100%; border-radius: 999px; background: var(--accent); width: 0; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.pct { text-align: right; font-weight: 700; font-size: 18px; }

.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; color: var(--faint); font-size: 13px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.legend .south { background: var(--south); }
.legend .ahead { background: var(--ahead); border: 1px solid var(--line); }
.axis { fill: var(--faint); font: 500 11px "JetBrains Mono", monospace; }
.gridline { stroke: var(--line); stroke-width: 1; }

.how .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.how .cols p { margin: 6px 0 0; color: var(--muted); }
.how .cols b { color: var(--text); display: block; margin-bottom: 4px; }

.foot { max-width: 1080px; margin: 0 auto; padding: 26px 20px 48px; color: var(--faint); font-size: 13px; }
.foot p { margin: 4px 0; }

@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how .cols { grid-template-columns: 1fr; gap: 6px; }
  .bars li { grid-template-columns: 1fr 56px; }
  .bars .track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 520px) {
  .hero { min-height: 440px; border-radius: 20px; }
  .top { padding: 14px 16px 0; }
  main { padding: 0 16px; }
  .fact .v { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
