/* nickspicks — Broadcast Telemetry design system */
:root {
  --void: #04070D;
  --panel: #0D1626;
  --signal: #39C4FF;
  --turf: #5FFFAA;
  --flag: #FFB26A;
  --loss: #FF5D7A;
  --ice: #EEF6FF;
  --haze: #8BA3C7;
  --hairline: rgba(57, 196, 255, 0.12);
  --dim: #6E82A6;
  --font-display: "Oswald", "Arial Narrow", Arial, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Cascadia Mono", monospace;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--void);
  color: var(--haze);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--signal); text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Typography */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ice);
  line-height: 0.96;
  letter-spacing: 0.01em;
  margin: 0;
}
h1.display { font-size: clamp(2.5rem, 7vw, 4.5rem); }
h2.display { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.display .accent { color: var(--signal); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 0.9rem;
}
p { margin: 0 0 1rem; max-width: 62ch; }

/* Layout */
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
main { display: block; }
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }

/* Nav (shared across all pages) */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(4, 7, 13, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}
.nav-brand {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase; font-size: 1.15rem; letter-spacing: 0.06em;
  color: var(--ice);
}
.nav-brand span { color: var(--signal); }
.nav-links { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 0.85rem;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--haze); border-radius: 6px;
}
.nav-links a:hover { color: var(--ice); background: rgba(57, 196, 255, 0.08); }
.nav-links a[aria-current="page"] {
  color: var(--signal);
  box-shadow: inset 0 -2px 0 var(--signal);
}
.nav-live { font-family: var(--font-mono); font-size: 0.72rem; color: var(--turf); white-space: nowrap; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; flex: none;
  background: transparent; border: 1px solid var(--hairline);
  border-radius: 8px; color: var(--ice); cursor: pointer;
}
.nav-toggle:hover { border-color: var(--signal); color: var(--signal); }
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .x { display: none; }
.nav.nav-open .nav-toggle .bars { display: none; }
.nav.nav-open .nav-toggle .x { display: block; }

/* HUD panel */
.hud {
  background: rgba(13, 22, 38, 0.72);
  border: 1px solid rgba(57, 196, 255, 0.18);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  box-shadow: inset 0 1px 0 rgba(120, 190, 255, 0.08);
  position: relative;
  overflow: hidden;
}

/* Scanline sweep (decorative; added to .hud via class) */
.scanline::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 44%, rgba(57, 196, 255, 0.07) 50%, transparent 56%);
  transform: translateX(-120%);
  animation: scan 7s linear infinite;
  pointer-events: none;
}
@keyframes scan { to { transform: translateX(120%); } }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  padding: 0.3rem 0.6rem; border-radius: 4px;
  border: 1px solid rgba(139, 163, 199, 0.3); color: var(--haze);
  background: rgba(139, 163, 199, 0.07);
}
.chip--signal { color: var(--signal); border-color: rgba(57,196,255,.4); background: rgba(57,196,255,.1); }
.chip--turf   { color: var(--turf);   border-color: rgba(95,255,170,.35); background: rgba(95,255,170,.08); }
.chip--flag   { color: var(--flag);   border-color: rgba(255,178,106,.35); background: rgba(255,178,106,.08); }
.chip--loss   { color: var(--loss);   border-color: rgba(255,93,122,.35); background: rgba(255,93,122,.08); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.6rem;
  font-family: var(--font-display); font-weight: 500; font-size: 0.95rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--signal); color: var(--void);
  border: 0; border-radius: 8px; cursor: pointer;
}
.btn:hover { filter: brightness(1.12); }
.btn--ghost { background: transparent; color: var(--haze); border: 1px solid var(--hairline); }
.btn--ghost:hover { color: var(--ice); filter: none; border-color: var(--signal); }

/* Ticker */
.ticker {
  border-block: 1px solid var(--hairline);
  background: rgba(4, 7, 13, 0.85);
  overflow: hidden; white-space: nowrap;
  padding: 0.55rem 0;
}
.ticker-track { display: inline-flex; gap: 2.5rem; padding-right: 2.5rem; will-change: transform; }
.ticker span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--haze); }
.ticker .up { color: var(--turf); }
.ticker .down { color: var(--loss); }
.ticker .hi { color: var(--signal); }

/* Gateway cards (landing) */
.gateway-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gateway-grid .hud { display: flex; flex-direction: column; gap: 0.5rem; }
.gateway-grid .go { margin-top: auto; font-family: var(--font-mono); font-size: 0.75rem; padding-top: 0.75rem; display: inline-block; min-height: 44px; }

/* Stat tiles (track record) */
.stat-tile { text-align: center; padding: 1.4rem 1rem; }
.stat-tile .label { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.25em; color: var(--haze); text-transform: uppercase; }
.stat-tile .value { font-family: var(--font-mono); font-weight: 700; font-size: clamp(2rem, 5vw, 2.8rem); color: var(--ice); line-height: 1.1; }
.stat-tile .value.up { color: var(--turf); }
.stat-tile .sub { font-family: var(--font-mono); font-size: 0.65rem; color: var(--dim); }

/* Board table */
.board-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.board-table th {
  font-family: var(--font-mono); font-weight: 400; font-size: 0.62rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim);
  text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--hairline);
}
.board-table td { padding: 0.85rem 0.9rem; border-bottom: 1px solid rgba(57, 196, 255, 0.06); vertical-align: middle; }
.board-table .game { font-family: var(--font-display); font-weight: 500; text-transform: uppercase; color: var(--ice); font-size: 1rem; }
.board-table .num { font-family: var(--font-mono); }
.board-table .best { font-family: var(--font-mono); color: var(--turf); text-align: right; white-space: nowrap; }
.board-table tr.middle-row td { background: rgba(255, 178, 106, 0.05); }
.board-table th:last-child, .board-table td:last-child { text-align: right; }

/* Filter bar (board) */
.filter-bar { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filter-bar button {
  min-height: 44px; padding: 0 1rem; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: transparent; color: var(--haze);
  border: 1px solid var(--hairline); border-radius: 6px;
}
.filter-bar button[aria-pressed="true"] { color: var(--void); background: var(--signal); border-color: var(--signal); }

/* Trust tiers (how it works) */
.tier { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.6rem; }
.tier h2 { font-family: var(--font-display); font-weight: 500; text-transform: uppercase; color: var(--ice); font-size: 1.05rem; margin: 0 0 0.2rem; }
.tier p { font-size: 0.95rem; margin: 0; }
.tier[data-trust="1"] { border-color: rgba(95, 255, 170, 0.35); }
.tier[data-trust="3"] { opacity: 0.85; }
.tier[data-trust="4"] { opacity: 0.65; }

/* Meters */
.meter { height: 4px; background: rgba(57, 196, 255, 0.12); border-radius: 2px; overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--signal), var(--turf)); border-radius: 2px; }

/* Footer */
.site-footer {
  border-top: 1px solid rgba(57, 196, 255, 0.08);
  padding: 1.2rem 0 2rem;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--dim);
}

/* Reveal defaults: hidden only when JS + motion allowed (html.motion-on set by telemetry.js) */
html.motion-on [data-reveal] { opacity: 0; }

/* Responsive */
@media (max-width: 860px) {
  .gateway-grid { grid-template-columns: 1fr; }
  .nav { position: relative; }
  .nav .wrap { flex-wrap: nowrap; padding-block: 0.5rem; }
  .nav-live { margin-left: auto; }        /* push badge + toggle to the right */
  .nav-toggle { display: inline-flex; }
  /* collapse the links into a dropdown panel below the bar */
  .nav .wrap > nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(4, 7, 13, 0.97); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--hairline);
    max-height: 0; overflow: hidden; transition: max-height 0.28s ease;
  }
  .nav.nav-open .wrap > nav { max-height: 70vh; }
  .nav-links { flex-direction: column; gap: 0; padding: 0.4rem 0; width: 100%; }
  .nav-links a { width: 100%; padding: 0 1.5rem; min-height: 48px; }
  .board-table .plain { display: none; } /* hide win-chance column on small screens */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scanline::after { animation: none; display: none; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
