/* Self-hosted Formula 1 Broadcast Typography — 100% first-party & CSP-safe */
@font-face {
  font-family: 'Unbounded Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('/fonts/unbounded-latin-ext-wght-normal.woff2') format('woff2');
  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: 'Unbounded Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url('/fonts/unbounded-latin-wght-normal.woff2') format('woff2');
  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: 'Titillium Web';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/titillium-web-latin-ext-400-normal.woff2') format('woff2');
  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: 'Titillium Web';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/titillium-web-latin-400-normal.woff2') format('woff2');
  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: 'Titillium Web';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/fonts/titillium-web-latin-ext-600-normal.woff2') format('woff2');
  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: 'Titillium Web';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('/fonts/titillium-web-latin-600-normal.woff2') format('woff2');
  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: 'Titillium Web';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/titillium-web-latin-ext-700-normal.woff2') format('woff2');
  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: 'Titillium Web';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/titillium-web-latin-700-normal.woff2') format('woff2');
  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: 'Caveat Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url('/fonts/caveat-latin-ext-wght-normal.woff2') format('woff2');
  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: 'Caveat Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url('/fonts/caveat-latin-wght-normal.woff2') format('woff2');
  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: 'Geist Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/geist-mono-latin-ext-wght-normal.woff2') format('woff2');
  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: 'Geist Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/geist-mono-latin-wght-normal.woff2') format('woff2');
  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;
}

:root {
  color-scheme: dark;

  /* Official Formula1.com Dark-First Palette */
  --color-canvas: #15151e;
  --color-canvas-deep: #0b0b10;
  --color-surface: #21212b;
  --color-surface-elevated: #2a2a36;
  --color-wash: #1b1b26;
  --color-wash-strong: #272734;
  --color-ink: #ffffff;
  --color-ink-secondary: #d4d4df;
  --color-ink-muted: #9e9eb0;
  --color-rule: rgb(255 255 255 / 14%);
  --color-rule-strong: rgb(255 255 255 / 32%);
  --color-accent: #e10600;
  --color-accent-bright: #ff1801;
  --color-accent-text: #ff5b54;
  --color-accent-soft: rgb(225 6 0 / 16%);
  --color-action: #e10600;
  --color-action-hover: #ff1801;
  --color-focus: #6cb4ff;
  --color-success: #00d27a;
  --color-success-bright: #00e686;
  --color-success-soft: rgb(0 210 122 / 14%);
  --color-warning: #ffb800;
  --color-muted-danger: rgb(225 6 0 / 16%);
  --color-carbon: #0b0b10;
  --color-carbon-elevated: #21212b;
  --color-carbon-rule: rgb(255 255 255 / 14%);
  --color-carbon-muted: #9e9eb0;
  --color-inverse: #15151e;
  --color-overlay: rgb(5 5 10 / 74%);

  /* Team Crimson Gradient Stops (Luminous Scuderia / DevRace Red Hero) */
  --color-hero-crimson-start: #700610;
  --color-hero-crimson-mid: #be0d1b;
  --color-hero-crimson-end: #eb1a2a;

  /* Feather-Light Formula 1 Diagonal Speed-Stripe Background */
  --bg-f1-stripes: linear-gradient(
    -48deg,
    transparent 0 18%,
    rgb(255 255 255 / 4.2%) 18% 23.5%,
    transparent 23.5% 25.5%,
    rgb(255 255 255 / 2.6%) 25.5% 27.5%,
    transparent 27.5% 56%,
    rgb(255 255 255 / 4.2%) 56% 61.5%,
    transparent 61.5% 63.5%,
    rgb(255 255 255 / 2.6%) 63.5% 65.5%,
    transparent 65.5% 100%
  );

  /* Typography */
  --font-display: 'Unbounded Variable', 'Titillium Web', system-ui, sans-serif;
  --font-ui: 'Titillium Web', system-ui, -apple-system, sans-serif;
  --font-script: 'Caveat Variable', cursive;
  --font-mono: 'Geist Mono Variable', ui-monospace, 'SF Mono', monospace;
  --text-xs: .75rem;
  --text-small: .875rem;
  --text-body: 1rem;
  --weight-medium: 600;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Formula1.com Geometry */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2.25rem;
  --space-7: 3.5rem;
  --space-8: 5.5rem;
  --radius-control: 8px;
  --radius-panel: 12px;
  --radius-pill: 999px;
  --size-control: 2.75rem;
  --width-content: 80rem;
  --gutter: clamp(1rem, 3.2vw, 2.5rem);

  /* Crisp Physics & Elevation */
  --ease-spring: cubic-bezier(0.2, 0.9, 0.3, 1);
  --shadow-menu: 0 24px 48px -12px rgb(0 0 0 / 64%);
  --shadow-card: 0 18px 40px -24px rgb(0 0 0 / 65%);

  /* Systemic Z-index Scale */
  --z-header: 20;
  --z-popover: 30;
  --z-toast: 40;
  --z-skip: 50;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background: var(--color-canvas-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.site-shell {
  display: flex;
  flex-direction: column;
  min-block-size: 100dvh;
  margin: 0;
  color: var(--color-ink);
  background: var(--color-canvas);
  font: 400 var(--text-body)/1.56 var(--font-ui);
}
.site-shell > #main-content { flex: 1 0 auto; min-inline-size: 0; }
.site-shell [hidden] { display: none !important; }
.site-frame {
  inline-size: min(var(--width-content), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}
.site-shell :focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.site-shell :where(h1, h2, h3) {
  font-family: var(--font-display);
  color: var(--color-ink);
  text-wrap: balance;
}
.site-shell :where(p) { text-wrap: pretty; }
.site-shell :where(code, pre, kbd, samp) { font-family: var(--font-mono); }

/* Signature Formula1.com Red Double-Bar Slanted Section Divider */
.f1-divider {
  display: block;
  inline-size: 100%;
  block-size: 16px;
  margin: 0;
  border: 0;
  background: linear-gradient(
    to bottom,
    var(--color-accent) 0 6px,
    transparent 6px 11px,
    var(--color-accent) 11px 15px,
    transparent 15px
  );
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
}
.f1-divider-wrap {
  padding-block: 0;
  background: transparent;
}

/* Motorsport Sector Kicker (Slanted red racing slash + crisp uppercase label) */
.sector-label {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font: 700 .78rem/1 var(--font-ui);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-ink-secondary);
}
.sector-label::before {
  content: "";
  inline-size: 5px;
  block-size: .95rem;
  background: var(--color-accent);
  transform: skewX(-18deg);
  flex: none;
}

/* Authentic Formula1.com Pill CTAs */
:is(.ui-button, .action, .primary, .secondary), :where(.site-shell main button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-block-size: var(--size-control);
  padding: .65rem 1.45rem;
  border: 1.5px solid var(--button-border, transparent);
  border-radius: var(--radius-pill);
  background: var(--button-background, var(--color-surface));
  color: var(--button-color, var(--color-ink));
  font: 700 .9rem/1.1 var(--font-ui);
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform .16s var(--ease-spring),
    background-color .16s var(--ease-spring),
    border-color .16s var(--ease-spring),
    color .16s var(--ease-spring);
}
:is(.ui-button, .action, .primary, .secondary):hover, :where(.site-shell main button):hover {
  background: var(--button-hover, var(--color-surface-elevated));
  border-color: var(--button-border-hover, var(--button-border, transparent));
}
:is(.ui-button, .action, .primary, .secondary):active, :where(.site-shell main button):active {
  transform: translateY(1px);
}
:where(.site-shell button):disabled { opacity: .42; cursor: default; transform: none; }

:where(.ui-button--primary, .action, .primary, .site-shell main button) {
  --button-background: var(--color-action);
  --button-hover: var(--color-action-hover);
  --button-color: #ffffff;
}
.ui-button--white {
  --button-background: #ffffff;
  --button-hover: #e8e8f0;
  --button-color: #15151e;
}
.ui-button--ink {
  --button-background: var(--color-canvas-deep);
  --button-border: rgb(255 255 255 / 26%);
  --button-border-hover: #ffffff;
  --button-hover: var(--color-surface-elevated);
  --button-color: #ffffff;
}
.ui-button--outline, .secondary {
  --button-background: transparent;
  --button-border: rgb(255 255 255 / 62%);
  --button-border-hover: #ffffff;
  --button-color: #ffffff;
  --button-hover: #ffffff;
}
.ui-button--outline:hover, .secondary:hover {
  color: var(--color-inverse);
}
.ui-button--ghost-dark {
  --button-background: rgb(255 255 255 / 6%);
  --button-border: rgb(255 255 255 / 55%);
  --button-border-hover: #ffffff;
  --button-color: #ffffff;
  --button-hover: #ffffff;
}
.ui-button--ghost-dark:hover {
  color: var(--color-inverse);
}

/* Dark Formula 1 Form Controls */
:where(.site-shell main :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea)) {
  inline-size: 100%;
  min-inline-size: 0;
  min-block-size: var(--size-control);
  padding: .62rem .85rem;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: var(--radius-control);
  background: var(--color-canvas-deep);
  color: var(--color-ink);
  font: inherit;
  transition: border-color .16s var(--ease-spring), box-shadow .16s var(--ease-spring);
}
:where(.site-shell main :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea)):hover {
  border-color: rgb(255 255 255 / 45%);
}
:where(.site-shell main :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea)):focus {
  outline: none;
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgb(225 6 0 / 35%);
}
:where(.site-shell main) :where(input, textarea)::placeholder { color: var(--color-ink-muted); opacity: .78; }
:where(.site-shell main select option) { background: var(--color-surface); color: var(--color-ink); }

/* Formula 1 Broadcast Country Flags (SVG 4:3 + ISO Code) */
.country-badge {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  flex: none;
  vertical-align: middle;
}
.country-flag-svg {
  display: block;
  inline-size: 20px;
  block-size: 15px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 20%);
  flex: none;
}
.country-code {
  font: 700 .7rem/1 var(--font-mono);
  letter-spacing: .06em;
  color: var(--color-ink-muted);
}
.country-badge.is-iso-only {
  padding: .16rem .34rem;
  border-radius: 3px;
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 18%);
  font: 700 .68rem/1 var(--font-mono);
  letter-spacing: .06em;
  color: #ffffff;
}
.meta-pipe-item {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

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