/*
 * The Compound — shared design tokens + component primitives.
 *
 * Source of truth: DESIGN.md at repo root. Tokens copied verbatim from
 * StarLizard's web/public/_shared.css (football is the reference
 * implementation). Do NOT introduce hex literals in HTML — every color
 * must reference a token here. CI hex-lint enforces this.
 */

:root {
  /* Color tokens — verbatim from StarLizard _shared.css */
  --bg: #0b0b0d;
  --surface: #17171e;
  --surface-2: #22222b;
  --surface-glass: rgba(23, 23, 30, 0.55); /* translucent surface — lets bg art show through */
  --border: #34343f;
  --border-soft: #272730;
  --text: #ececf1;
  --muted: #a8a8b3;
  --dim: #74747f;
  --accent: #f0b840;
  --accent-soft: rgba(240, 184, 64, 0.14);
  --accent-line: rgba(240, 184, 64, 0.40);
  --signal-pos: var(--accent);
  --signal-pos-soft: var(--accent-soft);
  --signal-neg: var(--muted);
  --signal-neg-soft: rgba(168, 168, 179, 0.12);

  /* Spacing scale (DESIGN.md §Spacing) */
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 80px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
}

/* Type families */
.font-display { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; font-variation-settings: 'SOFT' 50, 'WONK' 0; }
.font-mono    { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'tnum', 'zero'; }

/* Smallcaps label */
.smallcaps {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Eyebrow (smallcaps in accent) */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Hairlines */
.hairline      { background: var(--border); height: 1px; border: 0; }
.hairline-soft { background: var(--border-soft); height: 1px; border: 0; }
.hairline-gold { background: var(--accent); height: 1px; border: 0; opacity: 0.85; }

/* Status bar — 30px tall, surface bg, live dot */
.status-bar {
  height: 30px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.status-bar .left,
.status-bar .right { display: flex; align-items: center; gap: var(--space-3); }
.status-bar b      { color: var(--accent); font-weight: 700; }
.status-bar .sep   { color: var(--muted); }
.status-bar .utc   { color: var(--accent); font-weight: 700; }
.live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }

/* Site nav (desktop) — pixel-matches StarLizard's football site-nav
   so the chrome reads identically across /, /tennis, /404, and /football.
   Source: web/public/variant-final.html .site-nav rules in StarLizard. */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 14px clamp(48px, 6.5vw, 100px);
  gap: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
}
.wordmark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.twitter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}
.twitter:hover { color: var(--accent); }

/* Body-class active state — drives chrome highlighting by data-page.
   Adds the gold underline that the football nav uses for the current
   section. */
body[data-page="homepage"] .nav-home,
body[data-page="football"] .nav-football,
body[data-page="tennis"]   .nav-tennis,
body[data-page="how-it-works"] .nav-how {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-soft);
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.site-footer .footer-mail,
.mobile-footer .footer-mail { color: var(--accent); text-decoration: none; }
.site-footer .footer-mail:hover,
.mobile-footer .footer-mail:hover { text-decoration: underline; }

/* Panel primitive — 1px border + 2px TOP stripe (border by default, accent for .gold) */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--border);
}
.panel.gold::before { background: var(--accent); }

/* Panel header — smallcaps + numeric ID */
.panel-h {
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border-soft);
  font-family: 'JetBrains Mono', monospace;
  font: 700 9px/1.0 'JetBrains Mono', monospace;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-h .title { color: var(--text); }
.panel-h .id    { color: var(--accent); }
.panel-body     { padding: var(--space-4); }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px var(--space-2);
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill-gold { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.pill-dim  { background: rgba(255, 255, 255, 0.04); color: var(--muted); border: 1px solid var(--border); }

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #1a1100;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 8px 16px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--accent-soft); }
.btn-text {
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-text:hover { color: var(--text); }

/* Interaction states — static muted-mono, no spinners */
.state {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-style: italic;
  letter-spacing: 0.10em;
  color: var(--muted);
  padding: 20px 18px;
}
.state-error { color: var(--signal-neg); }

/* Focus-visible — global accessibility (DESIGN.md §Accessibility) */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Selection */
::selection { background: var(--accent-soft); color: var(--text); }
