/* ── Rubik (self-hosted variable font, 300–900, upright + italic) ── */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/rubik-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Rubik';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/rubik-latin-wght-italic.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/rubik-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, 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: 'Rubik';
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/rubik-latin-ext-wght-italic.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Brand tokens ── */
:root {
  color-scheme: dark;

  /* Logo palette — the wordmark's vertical yellow-to-amber gradient */
  --ir-yellow: #ffe600;
  --ir-gold: #ffc200;
  --ir-amber: #ffaf19;
  --ir-gradient: linear-gradient(180deg, var(--ir-yellow) 10%, var(--ir-amber) 90%);
  /* Infra-red: a sparing accent (live dot, incidents, heat glow, hover) — never a surface colour */
  --ir-red: #ff3b3b;

  /* Surfaces — dark-first: calm at night, lets yellow and pink carry signal */
  --bg: #0e0b14;
  --surface: #17131f;
  --surface-raised: #211b2c;
  --border: #322a40;
  --text: #f6f3fa;
  --text-muted: #a9a1b6;
  --on-accent: #0e0b14;

  /* Roles */
  --route: var(--ir-gold);
  --maneuver: var(--ir-yellow);
  --focus: var(--ir-yellow);
  --danger: var(--ir-red);

  /* Type */
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  --fs-display: clamp(2.5rem, 1.4rem + 5vw, 4.75rem);

  /* Space & shape */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --radius-sm: 0.5rem;
  --radius: 0.875rem;
  --radius-pill: 999px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max-width: 72rem;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--ir-yellow);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ── Type ── */
h1,
h2,
h3 {
  line-height: 1.1;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.eyebrow {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ir-yellow);
}

.text-gradient {
  background: var(--ir-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Numbers that change while driving must not jitter */
.num {
  font-variant-numeric: tabular-nums;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3rem;
  padding: 0 var(--space-6);
  border: 0;
  border-radius: var(--radius-pill);
  font: italic 700 var(--fs-base) / 1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background-color 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--ir-gradient);
  color: var(--on-accent);
}

.btn-primary:hover {
  filter: brightness(1.08) saturate(1.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--border);
}

.btn-ghost:hover {
  background: var(--surface-raised);
}

/* ── Layout helpers ── */
.container {
  width: min(100% - 2 * var(--gutter), var(--max-width));
  margin-inline: auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
