/* ============================================================
   Traffic Championship 2026 — TrafficStars
   Design tokens + global styles
   ============================================================ */

:root {
  /* Brand palette (TrafficStars brandbook) */
  --kenobi: #1F00FF;   /* electric blue — primary */
  --kenobi-600: #1A00D6;
  --kenobi-700: #1400A8;
  --windu: #7D62F4;    /* purple */
  --tatooine: #FF550C; /* orange */
  --grogu: #84D900;    /* lime green */
  --jedi: #F7F8FA;     /* off-white */
  --white: #FFFFFF;

  /* Derived ink / broadcast darks (blue-black, not pure black) */
  --ink: #08061C;      /* deepest indigo-black */
  --ink-900: #0B0A22;
  --ink-800: #11102E;
  --ink-700: #1A1840;
  --ink-line: rgba(255,255,255,0.10);
  --ink-line-soft: rgba(255,255,255,0.06);

  /* Podium */
  --gold: #FFC83D;
  --silver: #C9D2E0;
  --bronze: #E08A3C;

  /* Semantic */
  --up: var(--grogu);
  --down: var(--tatooine);

  /* Typography */
  --font-display: "Hanken Grotesk", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Layout */
  --maxw: 1240px;
  --gutter: clamp(16px, 5vw, 64px);
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* Sticky header height */
  --header-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---- Type helpers ---- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- Layout ---- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
section { position: relative; }

/* ---- Pill / badge (brand signature) ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill--blue { background: var(--kenobi); color: var(--white); }
.pill--lime { background: var(--grogu); color: var(--ink); }
.pill--orange { background: var(--tatooine); color: var(--white); }
.pill--purple { background: var(--windu); color: var(--white); }
.pill--ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink-line); }
.pill--light { background: var(--white); color: var(--kenobi); }
.pill .star { font-size: 0.85em; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  padding: 15px 26px;
  border-radius: var(--radius-pill);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, background .18s, color .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--primary { background: var(--grogu); color: var(--ink); }
.btn--primary:hover { box-shadow: 0 10px 30px -8px rgba(132,217,0,.6); transform: translateY(-2px); }
.btn--blue { background: var(--kenobi); color: var(--white); }
.btn--blue:hover { box-shadow: 0 10px 30px -8px rgba(31,0,255,.7); transform: translateY(-2px); }
.btn--orange { background: var(--tatooine); color: var(--white); }
.btn--orange:hover { box-shadow: 0 10px 30px -8px rgba(255,85,12,.6); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink-line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.btn--lg { font-size: 18px; padding: 18px 32px; }
.btn--block { width: 100%; }

/* ---- Live dot ---- */
.live-dot {
  position: relative;
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--tatooine);
  flex: none;
}
.live-dot::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--tatooine);
  animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite;
}
.live-dot--lime { background: var(--grogu); }
.live-dot--lime::after { border-color: var(--grogu); }
@keyframes ping {
  0% { transform: scale(.6); opacity: .9; }
  80%,100% { transform: scale(1.9); opacity: 0; }
}

/* ---- Flag chip ---- */
.flag {
  display: inline-block;
  border-radius: 4px;
  object-fit: cover;
  background: var(--ink-700);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
  flex: none;
}
.flag--sq { border-radius: 50%; object-fit: cover; }

/* ---- Section labels ---- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.section-label .bar { width: 26px; height: 2px; background: currentColor; opacity: .5; }

/* ---- Scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .live-dot::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---- Surfaces ---- */
.ground-light { background: var(--jedi); color: var(--ink); }
.ground-blue { background: var(--kenobi); color: var(--white); }
.ground-dark { background: var(--ink); color: var(--white); }

.card {
  background: var(--ink-900);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
}

/* Grid texture for dark/broadcast sections */
.grid-tex {
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ---- Soccer ball spin ---- */
.sb-spin { animation: sb-roll 7s linear infinite; transform-origin: 50% 50%; }
@keyframes sb-roll { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sb-spin { animation: none; } }

/* Utility */
.up { color: var(--up); }
.down { color: var(--down); }
.muted { opacity: .6; }
