/*
 * fpv-race-pits design tokens — the single source of truth for colour, type, spacing, radius, elevation and
 * motion. Server-rendered pages and the React app both load this file. Values follow the fpv-race-pits design
 * system (the desktop app's default skin: pit mint on ink navy, gold for the leader, purple for PB); align
 * any future change here — nothing else hard-codes a colour or a size.
 *
 * Organisations re-theme a site by overriding --brand, --brand-ink and --accent (set inline from their
 * branding settings); the rest derives from those.
 */

@font-face {
  font-family: "Archivo";
  src: url("/brand/fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("/brand/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  src: url("/brand/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: url("/brand/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/brand/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("/brand/fonts/archivo-latin-wdth-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("/brand/fonts/archivo-latin-ext-wdth-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ── Brand: one signal colour ── */
  --brand: #2ef2c2;            /* pit mint: action and emphasis */
  --brand-ink: #03130f;        /* text on --brand */
  --accent: #35d6ff;           /* ice cyan: mint's partner glow, data links, focus */
  --brand-grad: linear-gradient(135deg, #7dffe1, #2ef2c2 55%, #16c3ea);
  --brand-soft: color-mix(in oklab, var(--brand) 14%, transparent);
  --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);

  /* ── Race semantics ── */
  --live: #ff3d5e;             /* on air / running clock */
  --leader: #ffc53d;           /* gold: the leader only */
  --fastest: #b88cff;          /* purple: fastest lap of the session */
  --pb: #b88cff;               /* purple: personal best */
  --warn: #ffc53d;
  --danger: #ff5470;
  --ok: #4ade80;
  --info: #5ab8ff;
  --gold: #ffe08a;
  --gold-2: #c98a12;
  --silver: #f1f5fa;
  --silver-2: #8e9bb0;
  --bronze: #f6c39a;
  --bronze-2: #a85e2a;
  /* Lane colours, Raceband order (pilots only). */
  --lane-1: #ff5468; --lane-2: #ff9a2e; --lane-3: #ffd83d; --lane-4: #4ade80;
  --lane-5: #35d6ff; --lane-6: #5b95ff; --lane-7: #b88cff; --lane-8: #ff72b8;

  /* ── Surfaces: ink-navy night ── */
  --bg: #05080f;
  --bg-raised: #080d17;
  --surface: #0c121c;
  --surface-2: #141c29;
  --surface-3: #1b2535;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: #24314a;
  --text: #f2f6fb;
  --text-2: #97a5bc;
  --text-3: #6f7d94;
  --scrim: rgba(5, 8, 15, 0.74);
  --grid: rgba(46, 242, 194, 0.035);
  --glass: linear-gradient(160deg, rgb(16 24 38 / 90%), rgb(7 11 20 / 92%));

  /* ── Type ── */
  --font-display: "Archivo", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --display-stretch: 112%;     /* Archivo's width axis */
  --display-style: italic;     /* wide, forward-leaning headlines */
  --display-weight: 800;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --fs-3xl: clamp(2rem, 1.3rem + 3vw, 3.5rem);
  --fs-hero: clamp(2.5rem, 1.2rem + 5.6vw, 5.6rem);
  --lh-tight: 1.0;
  --lh-snug: 1.2;
  --lh-body: 1.6;
  --tracking-display: -0.02em;
  --tracking-label: 0.04em;

  /* ── Space (8 px grid, 4 px half-steps) ── */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 7rem;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --page: 1240px;

  /* ── Radius ── */
  --r-xs: 6px;                 /* lap chips */
  --r-sm: 8px;
  --r-md: 12px;                /* app */
  --r-lg: 18px;                /* cards */
  --r-xl: 22px;
  --r-pill: 999px;

  /* ── Elevation ── */
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 30px 80px -30px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 0 1px color-mix(in oklab, var(--brand) 45%, transparent), 0 10px 36px -10px color-mix(in oklab, var(--brand) 55%, transparent);

  /* ── Motion ── */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 150ms;
  --t-med: 240ms;
  --t-slow: 500ms;

  color-scheme: dark;
}

/* Light surfaces (sites that choose light, and the light mode of the design system). */
:root[data-mode="light"] {
  --brand-on-light: #007a62;
  --bg: #f3f6f9;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #edf1f5;
  --surface-3: #e2e8ef;
  --line: rgba(10, 17, 28, 0.08);
  --line-strong: #d3dce5;
  --text: #0a111c;
  --text-2: #4f5d71;
  --text-3: #6b778a;
  --scrim: rgba(243, 246, 249, 0.8);
  --grid: rgba(0, 134, 107, 0.05);
  --glass: linear-gradient(160deg, rgb(255 255 255 / 92%), rgb(243 246 249 / 94%));
  --live: #db1238;
  --pb: #7a3ae6;
  --fastest: #7a3ae6;
  --leader: #a35f00;
  --danger: #d3123e;
  --ok: #13834f;
  --shadow-1: 0 1px 2px rgba(10, 17, 28, 0.06);
  --shadow-2: 0 18px 40px -18px rgba(10, 17, 28, 0.25);
  --lane-1: #e0302b; --lane-2: #d06a00; --lane-3: #a08200; --lane-4: #1e9447;
  --lane-5: #0b8bb8; --lane-6: #1667e8; --lane-7: #9a3fd0; --lane-8: #d63a80;
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --t-fast: 0ms;
    --t-med: 0ms;
    --t-slow: 0ms;
  }
}
