/* ==========================================================================
   Parker Ives Racing — No. 48
   Design tokens, base, layout and components.
   Structure: tokens -> reset -> primitives -> layout -> sections -> utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Brand — patriotic trio */
  --blue: #003da5;
  --blue-700: #002d7a;
  --blue-400: #2f6fd0;
  --blue-300: #6aa0e8;
  --red: #e4002b;
  --red-400: #ff3355;
  --white: #ffffff;

  /* Neutral ramp, cool-shifted toward the blue */
  --ink-950: #05070d;
  --ink-900: #090c14;
  --ink-850: #0d111c;
  --ink-800: #141926;
  --ink-700: #1e2534;
  --ink-600: #2c3444;
  --ink-400: #6b768c;
  --ink-300: #97a1b4;
  --ink-200: #c3cad6;
  --ink-100: #e4e8ef;
  --ink-050: #f2f4f8;

  /* Semantic — defaults are the dark theme */
  --bg: var(--ink-950);
  --bg-raised: var(--ink-900);
  --bg-sunken: #02040a;
  --fg: var(--white);
  --fg-muted: var(--ink-300);
  /* Not --ink-400: that tone measures 4.1–4.4:1 on the dark grounds, just
     under WCAG AA for body-size text. This one clears 4.6:1 on every dark
     surface the site uses. --ink-400 stays available for non-text purposes. */
  --fg-faint: #747e93;
  --line: rgb(255 255 255 / 0.1);
  --line-strong: rgb(255 255 255 / 0.22);
  --accent: var(--blue-300);
  --accent-solid: var(--blue);
  --card: rgb(255 255 255 / 0.035);
  --card-hover: rgb(255 255 255 / 0.06);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo,
    Consolas, monospace;

  /* Fluid scale — clamp(min, preferred, max) */
  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
  --t-lg: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --t-xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --t-2xl: clamp(1.625rem, 1.35rem + 1.3vw, 2.5rem);
  --t-3xl: clamp(2.125rem, 1.6rem + 2.4vw, 3.75rem);
  --t-hero: clamp(3rem, 1.6rem + 7.2vw, 9.5rem);
  --t-numeral: clamp(4rem, 2rem + 12vw, 15rem);

  /* Space */
  --gap: clamp(1rem, 0.7rem + 1.2vw, 1.75rem);
  --pad-x: clamp(1.25rem, 0.75rem + 2.4vw, 4rem);
  --section-y: clamp(4.5rem, 3rem + 7vw, 9.5rem);
  --maxw: 1320px;
  --maxw-prose: 62ch;

  /* Shape + motion */
  --r-sm: 4px;
  --r: 10px;
  --r-lg: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.45s;

  --shadow-lift: 0 1px 2px rgb(0 0 0 / 0.3), 0 18px 40px -20px rgb(0 0 0 / 0.7);

  color-scheme: dark;
}

/* Light sections re-scope the semantic tokens rather than overriding rules. */
.theme-light {
  --bg: var(--white);
  --bg-raised: var(--ink-050);
  --bg-sunken: var(--ink-100);
  --fg: var(--ink-950);
  --fg-muted: #4a5468;
  /* Clears 4.6:1 on white, --ink-050 and --ink-100 alike; the previous tone
     dropped to 4.15:1 on the raised (sticky table header) surface. */
  --fg-faint: #5d677a;
  --line: rgb(5 7 13 / 0.11);
  --line-strong: rgb(5 7 13 / 0.24);
  --accent: var(--blue);
  --accent-solid: var(--blue);
  --card: rgb(5 7 13 / 0.028);
  --card-hover: rgb(5 7 13 / 0.055);
  --shadow-lift: 0 1px 2px rgb(5 7 13 / 0.06), 0 18px 40px -22px rgb(5 7 13 / 0.28);
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */

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

* {
  margin: 0;
}

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

/* Lenis drives scrolling; disable native smoothing when it is active. */
html.lenis,
html.lenis body {
  height: auto;
}
html.lenis {
  scroll-behavior: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  background: var(--ink-950);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.6;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration-color: rgb(255 255 255 / 0.35);
  text-underline-offset: 0.22em;
}

h1,
h2,
h3,
h4 {
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

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

::selection {
  background: var(--red);
  color: var(--white);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--white);
  color: var(--ink-950);
  font-weight: 700;
  border-radius: var(--r-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus-visible {
  top: 1rem;
}

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

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */

.shell {
  width: min(100% - (var(--pad-x) * 2), var(--maxw));
  margin-inline: auto;
}

.section {
  background: var(--bg);
  color: var(--fg);
  padding-block: var(--section-y);
  position: relative;
  isolation: isolate;
}

.section--tight {
  padding-block: clamp(3rem, 2rem + 4vw, 6rem);
}

.section__head {
  display: grid;
  gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
  margin-bottom: clamp(2.5rem, 1.5rem + 3.5vw, 5rem);
}

@media (min-width: 62rem) {
  .section__head--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
    align-items: end;
    gap: clamp(2rem, 4vw, 5rem);
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7ch;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow::before {
  content: '';
  width: 2.25rem;
  height: 2px;
  background: currentColor;
  flex: none;
}

.section__title {
  font-size: var(--t-3xl);
  max-width: 18ch;
}

.section__lede {
  font-size: var(--t-lg);
  color: var(--fg-muted);
  max-width: var(--maxw-prose);
}

/* --------------------------------------------------------------------------
   4. Buttons + controls
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--red);
  --btn-fg: var(--white);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7ch;
  padding: 0.95rem 1.75rem;
  min-height: 3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: var(--t-sm);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s var(--ease),
    background-color 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.btn > * {
  position: relative;
  z-index: 1;
}

/* Wipe-fill hover, masked to the pill. */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--white);
  transform: translate3d(0, 101%, 0);
  transition: transform 0.5s var(--ease-out-expo);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -14px rgb(228 0 43 / 0.75);
}

.btn:hover::after,
.btn:focus-visible::after {
  transform: translate3d(0, 0, 0);
}

.btn:hover,
.btn:focus-visible {
  color: var(--ink-950);
}

.btn:active {
  transform: translateY(0);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  border-color: var(--line-strong);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  box-shadow: none;
  color: var(--ink-950);
}
.btn--ghost::after {
  background: var(--fg);
}
.theme-light .btn--ghost:hover,
.theme-light .btn--ghost:focus-visible {
  color: var(--white);
}

.btn--blue {
  --btn-bg: var(--blue);
}
.btn--blue:hover,
.btn--blue:focus-visible {
  box-shadow: 0 14px 30px -14px rgb(0 61 165 / 0.85);
}

.btn--lg {
  padding: 1.15rem 2.25rem;
  min-height: 3.5rem;
  font-size: var(--t-base);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    background-color 0.25s var(--ease);
}

.chip:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}

.chip[aria-pressed='true'],
.chip[aria-selected='true'] {
  background: var(--accent-solid);
  border-color: var(--accent-solid);
  color: var(--white);
}

/* Data pill used for finishing positions. */
.pos {
  display: inline-grid;
  place-items: center;
  min-width: 2.2rem;
  height: 1.9rem;
  padding-inline: 0.5rem;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  font-weight: 700;
  background: var(--card);
  color: var(--fg-muted);
  border: 1px solid var(--line);
}
.pos--1 {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
.pos--2,
.pos--3 {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

/* --------------------------------------------------------------------------
   5. Site header
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  padding-block: clamp(0.85rem, 0.6rem + 0.7vw, 1.35rem);
  transition: background-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
    border-color 0.4s var(--ease), padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  background: rgb(5 7 13 / 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: rgb(255 255 255 / 0.09);
  padding-block: 0.7rem;
}

.site-header.is-hidden {
  transform: translateY(-100%);
  transition: transform 0.4s var(--ease);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--white);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
  border-radius: var(--r-sm);
  background: linear-gradient(150deg, var(--blue) 0%, var(--blue-700) 100%);
  border: 1px solid rgb(255 255 255 / 0.16);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  position: relative;
  overflow: hidden;
}

.brand__mark::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--red);
}

.brand__text {
  display: grid;
  line-height: 1.1;
}

.brand__name {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.brand__sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.55);
}

.site-nav {
  display: none;
}

@media (min-width: 60rem) {
  .site-nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 1.6vw, 2rem);
  }
}

.site-nav__link {
  position: relative;
  padding-block: 0.35rem;
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgb(255 255 255 / 0.72);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}

.site-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out-expo);
}

.site-nav__link:hover,
.site-nav__link[aria-current='true'] {
  color: var(--white);
}

.site-nav__link:hover::after,
.site-nav__link[aria-current='true']::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-cta {
  display: none;
}
@media (min-width: 48rem) {
  .header-cta {
    display: inline-flex;
    padding: 0.7rem 1.35rem;
    min-height: 2.6rem;
  }
}

/* Mobile menu */
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: var(--r-sm);
  background: rgb(255 255 255 / 0.05);
  cursor: pointer;
}
@media (min-width: 60rem) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--white);
  transition: transform 0.35s var(--ease-out-expo), opacity 0.2s linear;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: '';
  position: absolute;
}
.nav-toggle__bars::before {
  transform: translateY(-6px);
}
.nav-toggle__bars::after {
  transform: translateY(6px);
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bars {
  background: transparent;
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bars::before {
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bars::after {
  transform: rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-content: center;
  gap: 0.5rem;
  padding: 6rem var(--pad-x) 3rem;
  background: var(--ink-950);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.6s var(--ease-out-expo);
  overflow-y: auto;
}

.mobile-nav[data-open='true'] {
  clip-path: inset(0 0 0 0);
}

.mobile-nav__link {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.6rem;
  font-size: clamp(1.75rem, 1.2rem + 3.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  opacity: 0;
  transform: translateY(1.25rem);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease-out-expo);
}

.mobile-nav[data-open='true'] .mobile-nav__link {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.06s * var(--i, 0) + 0.12s);
}

.mobile-nav__index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--red-400);
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  padding-block: clamp(7rem, 6rem + 6vw, 10rem) clamp(2.5rem, 2rem + 3vw, 5rem);
  overflow: clip;
  background: var(--ink-950);
}

.hero__bg {
  position: absolute;
  inset: -10% 0 -10%;
  z-index: 0;
  will-change: transform;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(115%) contrast(108%);
}

/* Ambient footage layered over the still. Fades in only once it is playing,
   so a blocked or refused autoplay is invisible rather than a black box. */
.hero__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
  pointer-events: none;
}

.hero__video.is-playing {
  opacity: 0.42;
}

/* Scrim keeps the headline at AA contrast over the photograph. Narrow screens
   get the vertical pass only — stacking it with the left-to-right gradient
   (which exists to protect the left-aligned headline on wide layouts) crushed
   the whole image to near-black on a tall, narrow viewport. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    var(--ink-950) 0%,
    rgb(5 7 13 / 0.9) 42%,
    rgb(5 7 13 / 0.62) 66%,
    rgb(5 7 13 / 0.22) 88%,
    rgb(5 7 13 / 0.05) 100%
  );
}

@media (min-width: 56rem) {
  .hero__scrim {
    background:
      linear-gradient(to top, var(--ink-950) 4%, rgb(5 7 13 / 0.55) 42%, rgb(5 7 13 / 0.15) 78%),
      linear-gradient(to right, rgb(5 7 13 / 0.9) 0%, rgb(5 7 13 / 0.35) 55%, transparent 100%);
  }
}

.hero__inner {
  position: relative;
  z-index: 3;
  width: min(100% - (var(--pad-x) * 2), var(--maxw));
  margin-inline: auto;
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.hero__kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.78);
}

@media (min-width: 48rem) {
  .hero__kicker {
    gap: 0.75rem 1.25rem;
    font-size: var(--t-sm);
    letter-spacing: 0.16em;
  }
}

.hero__kicker span {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
}

.hero__kicker .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgb(228 0 43 / 0.2);
}

.hero__title {
  font-size: var(--t-hero);
  line-height: 0.85;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  margin: 0;
}

/* Each line is a mask window; the span inside is what animates. */
.line-mask {
  display: block;
  overflow: hidden;
  padding-block: 0.02em;
}

.line-mask > span {
  display: block;
  will-change: transform;
}

.hero__title .accent {
  color: transparent;
  -webkit-text-stroke: 2px rgb(255 255 255 / 0.55);
  paint-order: stroke fill;
}

@supports not (-webkit-text-stroke: 1px black) {
  .hero__title .accent {
    color: var(--ink-300);
  }
}

.hero__meta {
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  align-items: end;
}

@media (min-width: 56rem) {
  .hero__meta {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.hero__blurb {
  max-width: 46ch;
  font-size: var(--t-lg);
  color: rgb(255 255 255 / 0.82);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Giant 48 watermark */
.hero__numeral {
  position: absolute;
  right: calc(var(--pad-x) * -0.25);
  bottom: -0.14em;
  z-index: 1;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--t-numeral);
  line-height: 0.75;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgb(255 255 255 / 0.09);
  pointer-events: none;
  user-select: none;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  z-index: 4;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.5);
}

.scroll-cue__rail {
  width: 1px;
  height: 3rem;
  background: rgb(255 255 255 / 0.2);
  position: relative;
  overflow: hidden;
}

.scroll-cue__rail::after {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 40%;
  background: var(--red);
  animation: cue 2.2s var(--ease) infinite;
}

@keyframes cue {
  0% {
    transform: translateY(-100%);
  }
  60%,
  100% {
    transform: translateY(340%);
  }
}

/* Ticker strip beneath the hero */
.ticker {
  position: relative;
  z-index: 5;
  background: var(--blue);
  color: var(--white);
  border-block: 1px solid rgb(255 255 255 / 0.14);
  overflow: hidden;
  padding-block: 0.75rem;
}

.ticker__track {
  display: flex;
  width: max-content;
  gap: 3rem;
  animation: ticker 42s linear infinite;
}

.ticker:hover .ticker__track {
  animation-play-state: paused;
}

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker__item b {
  color: #ffd7de;
  font-weight: 700;
}

.ticker__item::after {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--red-400);
  transform: rotate(45deg);
}

@keyframes ticker {
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* --------------------------------------------------------------------------
   7. Driver / about
   -------------------------------------------------------------------------- */

.driver__grid {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
}

@media (min-width: 62rem) {
  .driver__grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
  }
}

.portrait {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--ink-850);
  aspect-ratio: 957 / 1400;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

.portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(5 7 13 / 0.85), transparent 45%);
  pointer-events: none;
}

.portrait__plate {
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 1;
  display: grid;
  gap: 0.2rem;
}

.portrait__num {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 2rem + 3vw, 4rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--white);
}

.portrait__cap {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.7);
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose p {
  font-size: var(--t-lg);
  color: var(--fg-muted);
  max-width: var(--maxw-prose);
}

.prose strong {
  color: var(--fg);
  font-weight: 600;
}

.pullquote {
  margin-block: clamp(1.75rem, 1rem + 2.5vw, 3rem);
  padding-left: clamp(1.25rem, 0.75rem + 1.5vw, 2rem);
  border-left: 3px solid var(--red);
  font-size: var(--t-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--fg);
  max-width: 30ch;
}

.pullquote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.factlist {
  display: grid;
  gap: 0;
  margin-top: clamp(2rem, 1rem + 2.5vw, 3rem);
  border-top: 1px solid var(--line);
}

.factlist div {
  display: grid;
  grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.95rem;
  border-bottom: 1px solid var(--line);
}

.factlist dt {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.factlist dd {
  margin: 0;
  font-weight: 500;
}

/* Timeline */
.timeline {
  position: relative;
  margin-top: clamp(3rem, 2rem + 4vw, 6rem);
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 2.75rem);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.55rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: var(--line);
}

@media (min-width: 48rem) {
  .timeline::before {
    left: 6.5rem;
  }
}

/* The progress rail is scrubbed by GSAP ScrollTrigger. */
.timeline__progress {
  position: absolute;
  left: 0.55rem;
  top: 0.4rem;
  width: 2px;
  height: 0;
  background: linear-gradient(to bottom, var(--blue-300), var(--red));
  z-index: 1;
}

@media (min-width: 48rem) {
  .timeline__progress {
    left: 6.5rem;
  }
}

.tl-item {
  position: relative;
  display: grid;
  gap: 0.35rem 2rem;
  padding-left: 2.25rem;
}

@media (min-width: 48rem) {
  .tl-item {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    padding-left: 0;
  }
}

.tl-item__year {
  font-family: var(--font-mono);
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-faint);
}

@media (min-width: 48rem) {
  .tl-item__year {
    text-align: right;
    padding-right: 1.5rem;
  }
}

.tl-item__body {
  position: relative;
  padding-left: 2rem;
}

@media (max-width: 47.99rem) {
  .tl-item__body {
    padding-left: 0;
  }
}

.tl-item::before {
  content: '';
  position: absolute;
  left: 0.05rem;
  top: 0.55rem;
  z-index: 2;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-strong);
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}

@media (min-width: 48rem) {
  .tl-item::before {
    left: 6rem;
  }
}

.tl-item[data-highlight='true']::before {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 0 5px rgb(228 0 43 / 0.16);
}

.tl-item__title {
  font-size: var(--t-xl);
  margin-bottom: 0.35rem;
}

.tl-item__text {
  color: var(--fg-muted);
  max-width: 58ch;
}

.tl-item__tag {
  display: inline-block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* People cards */
.people {
  display: grid;
  gap: var(--gap);
  margin-top: clamp(3rem, 2rem + 4vw, 5.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.person {
  padding: clamp(1.35rem, 1rem + 1vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease),
    transform 0.5s var(--ease-out-expo);
}

.person:hover {
  background: var(--card-hover);
  border-color: var(--line-strong);
  transform: translateY(-4px);
}

.person__name {
  font-size: var(--t-lg);
  margin-bottom: 0.15rem;
}

.person__role {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.person__body {
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   8. Record — stats, seasons, results
   -------------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.stat {
  background: var(--bg);
  padding: clamp(1.35rem, 1rem + 1.5vw, 2.25rem);
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.stat__value {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 1.8rem + 3.4vw, 4.25rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.stat__value .suffix {
  color: var(--red);
}

.stat__label {
  font-weight: 700;
  font-size: var(--t-base);
}

.stat__detail {
  font-size: var(--t-sm);
  color: var(--fg-faint);
  line-height: 1.5;
}

.record__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-block: clamp(2.5rem, 1.5rem + 3vw, 4rem) 1.5rem;
}

.record__controls-label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-right: 0.4rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
  font-size: var(--t-sm);
}

table.data caption {
  text-align: left;
  padding: 1rem 1.15rem;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
  border-bottom: 1px solid var(--line);
}

table.data th,
table.data td {
  padding: 0.9rem 1.15rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

table.data thead th {
  position: sticky;
  top: 0;
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  white-space: nowrap;
  z-index: 1;
}

table.data tbody tr {
  transition: background-color 0.2s linear;
}

table.data tbody tr:hover {
  background: var(--card);
}

table.data tbody tr:last-child td {
  border-bottom: 0;
}

table.data .cell-season {
  font-family: var(--font-mono);
  font-weight: 700;
  white-space: nowrap;
}

table.data .cell-result {
  font-weight: 700;
  white-space: nowrap;
}

table.data .cell-note {
  color: var(--fg-faint);
}

.is-champion .cell-result {
  color: var(--red);
}

.results-feed {
  display: grid;
  gap: 1px;
  margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem);
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.result-row {
  display: grid;
  gap: 0.25rem 1.25rem;
  padding: 1.1rem clamp(1rem, 0.75rem + 1vw, 1.5rem);
  background: var(--bg);
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  transition: background-color 0.25s var(--ease);
}

.result-row:hover {
  background: var(--card);
}

.result-row__date {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
  min-width: 5.5rem;
}

.result-row__event {
  font-weight: 700;
}

.result-row__meta {
  font-size: var(--t-sm);
  color: var(--fg-faint);
}

.result-row__finish {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: end;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 40rem) {
  .result-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .result-row__date {
    grid-column: 1 / -1;
  }
}

/* Machinery comparison */
.machinery {
  margin-top: clamp(3rem, 2rem + 4vw, 5.5rem);
}

/* --------------------------------------------------------------------------
   10. Media gallery
   -------------------------------------------------------------------------- */

.gallery {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  grid-auto-flow: dense;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-sunken);
  aspect-ratio: 3 / 2;
  cursor: pointer;
  text-align: left;
  isolation: isolate;
}

.tile--tall {
  aspect-ratio: 3 / 4;
}

@media (min-width: 48rem) {
  .tile--wide {
    grid-column: span 2;
  }
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 0.9s var(--ease-out-expo), filter 0.6s var(--ease);
  filter: saturate(102%);
}

.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.07);
}

.tile__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(5 7 13 / 0.9), rgb(5 7 13 / 0.1) 55%, transparent);
  opacity: 0.85;
  transition: opacity 0.5s var(--ease);
}

.tile:hover .tile__veil {
  opacity: 1;
}

.tile__caption {
  position: absolute;
  inset: auto 0 0;
  padding: clamp(1rem, 0.75rem + 1vw, 1.5rem);
  display: grid;
  gap: 0.25rem;
  color: var(--white);
}

.tile__title {
  font-size: var(--t-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tile__sub {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.65);
}

.tile__zoom {
  position: absolute;
  right: 0.9rem;
  top: 0.9rem;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgb(5 7 13 / 0.6);
  border: 1px solid rgb(255 255 255 / 0.25);
  color: var(--white);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease-out-expo);
}

.tile:hover .tile__zoom,
.tile:focus-visible .tile__zoom {
  opacity: 1;
  transform: scale(1);
}

.tile.is-hidden {
  display: none;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 3rem);
  background: rgb(2 4 10 / 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.lightbox[data-open='true'] {
  opacity: 1;
  visibility: visible;
}

.lightbox__figure {
  position: relative;
  display: grid;
  gap: 1rem;
  max-width: min(100%, 68rem);
  max-height: 100%;
  transform: scale(0.96);
  transition: transform 0.45s var(--ease-out-expo);
}

.lightbox[data-open='true'] .lightbox__figure {
  transform: scale(1);
}

.lightbox__figure img {
  max-height: min(72vh, 40rem);
  width: auto;
  margin-inline: auto;
  border-radius: var(--r);
  object-fit: contain;
}

.lightbox__cap {
  color: rgb(255 255 255 / 0.78);
  text-align: center;
  font-size: var(--t-sm);
  max-width: 60ch;
  margin-inline: auto;
}

.lightbox__cap b {
  display: block;
  color: var(--white);
  font-size: var(--t-lg);
  margin-bottom: 0.25rem;
}

.lightbox__btn {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 0.25);
  background: rgb(255 255 255 / 0.07);
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.25s var(--ease);
}

.lightbox__btn:hover {
  background: rgb(255 255 255 / 0.16);
}

.lightbox__btn--prev {
  left: -1rem;
}
.lightbox__btn--next {
  right: -1rem;
}

@media (max-width: 52rem) {
  .lightbox__btn--prev {
    left: 0.25rem;
  }
  .lightbox__btn--next {
    right: 0.25rem;
  }
}

.lightbox__close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 0.25);
  background: rgb(255 255 255 / 0.07);
  color: var(--white);
  cursor: pointer;
}

.lightbox__close:hover {
  background: rgb(255 255 255 / 0.16);
}

/* --------------------------------------------------------------------------
   11. News
   -------------------------------------------------------------------------- */

.news-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.article {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--card);
  transition: transform 0.5s var(--ease-out-expo), border-color 0.35s var(--ease);
}

.article:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
}

.article__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-sunken);
}

.article__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out-expo);
}

.article:hover .article__media img {
  transform: scale(1.06);
}

.article__body {
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.article__meta .kind {
  color: var(--red);
}

.article__title {
  font-size: var(--t-xl);
}

.article__excerpt {
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   12. Partners + sponsorship
   -------------------------------------------------------------------------- */

/* Rules come from each cell's own outline rather than a background showing
   through 1px gaps, so a part-filled final row leaves no orphaned block. */
.logo-wall {
  display: grid;
  gap: 1px;
  padding: 1px;
  background: transparent;
  grid-template-columns: repeat(auto-fit, minmax(min(50%, 11rem), 1fr));
}

.logo-cell {
  outline: 1px solid var(--line);
  background: var(--bg);
  min-height: 7.5rem;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.4rem;
  padding: 1.25rem;
  text-align: center;
  transition: background-color 0.3s var(--ease);
}

.logo-cell:hover {
  background: var(--card-hover);
}

.logo-cell__mark {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 0.9rem + 0.7vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg);
}

.logo-cell__name {
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--fg);
}

.logo-cell__role {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.exposure {
  display: grid;
  gap: var(--gap);
  margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.exposure__item {
  display: grid;
  gap: 0.4rem;
  padding-top: 1.1rem;
  border-top: 2px solid var(--red);
}

.exposure__stat {
  font-family: var(--font-mono);
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.exposure__label {
  font-weight: 700;
  font-size: var(--t-sm);
}

.exposure__note {
  font-size: var(--t-sm);
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Tier cards */
.tiers {
  display: grid;
  gap: var(--gap);
  margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  align-items: start;
}

.tier {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}

.tier:hover,
.tier.is-open {
  border-color: var(--line-strong);
}

.tier.is-open {
  background: var(--card-hover);
}

.tier__toggle {
  width: 100%;
  display: grid;
  gap: 0.5rem;
  padding: clamp(1.35rem, 1rem + 1.2vw, 2rem);
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.tier__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.tier__name {
  font-size: var(--t-xl);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.tier__sign {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  align-self: center;
}

.tier__sign::before,
.tier__sign::after {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  height: 2px;
  background: var(--red);
  transition: transform 0.4s var(--ease-out-expo);
}

.tier__sign::after {
  transform: rotate(90deg);
}

.tier.is-open .tier__sign::after {
  transform: rotate(0deg);
}

.tier__kicker {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.tier__summary {
  font-size: var(--t-sm);
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Open by default so the packages are fully readable without JavaScript;
   initTiers() collapses them on load and drives max-height from the measured
   content height. (The grid 0fr -> 1fr idiom resolves to a zero-height track
   here because the inner wrapper's overflow:hidden zeroes its contribution.) */
.tier__panel {
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out-expo);
}

.tier__list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0 clamp(1.35rem, 1rem + 1.2vw, 2rem) clamp(1.35rem, 1rem + 1.2vw, 2rem);
  list-style: none;
}

.tier__list li {
  position: relative;
  padding-left: 1.6rem;
  font-size: var(--t-sm);
  line-height: 1.6;
  color: var(--fg-muted);
}

.tier__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--red);
  transform: rotate(45deg);
}

/* --------------------------------------------------------------------------
   13. Contact
   -------------------------------------------------------------------------- */

.contact__grid {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
}

@media (min-width: 62rem) {
  .contact__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.field label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.field .req {
  color: var(--red);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--fg);
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--fg-faint);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card-hover);
}

.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: 3px solid var(--red-400);
  outline-offset: 2px;
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field__error {
  font-size: var(--t-xs);
  color: var(--red-400);
  min-height: 1.1em;
}

.field.is-invalid input,
.field.is-invalid textarea,
.field.is-invalid select {
  border-color: var(--red-400);
}

.form-row {
  display: grid;
  gap: 0 1rem;
}

@media (min-width: 40rem) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-note {
  font-size: var(--t-xs);
  color: var(--fg-faint);
  margin-top: 0.75rem;
  max-width: 46ch;
}

.form-status {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-size: var(--t-sm);
}

.form-status[hidden] {
  display: none;
}

.form-status.is-ok {
  border-color: rgb(60 200 120 / 0.6);
}

.form-status.is-error {
  border-color: var(--red-400);
}

.contact-cards {
  display: grid;
  gap: var(--gap);
  align-content: start;
}

.contact-card {
  display: grid;
  gap: 0.4rem;
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}

.contact-card__label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.contact-card__value {
  font-size: var(--t-lg);
  font-weight: 700;
  word-break: break-word;
}

.contact-card__value a {
  text-decoration: none;
  border-bottom: 2px solid var(--red);
}

.contact-card__note {
  font-size: var(--t-sm);
  color: var(--fg-muted);
}

/* --------------------------------------------------------------------------
   13b. Social links
   -------------------------------------------------------------------------- */

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
}

.social-link {
  display: grid;
  place-items: center;
  /* 44px: the minimum comfortable touch target, so the icons stay tappable
     without the glyphs themselves having to be large. */
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    background-color 0.25s var(--ease), transform 0.35s var(--ease-out-expo);
}

.social-link:hover,
.social-link:focus-visible {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-3px);
}

.footer__social {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.footer__social svg {
  flex: none;
  opacity: 0.7;
  transition: opacity 0.2s var(--ease), color 0.2s var(--ease);
}

.footer__social:hover svg {
  opacity: 1;
  color: var(--red-400);
}

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--bg-sunken);
  color: var(--white);
  border-top: 1px solid rgb(255 255 255 / 0.09);
  padding-block: clamp(3rem, 2rem + 4vw, 5rem) 2rem;
}

.footer__grid {
  display: grid;
  gap: clamp(2rem, 1rem + 3vw, 3.5rem);
}

@media (min-width: 52rem) {
  .footer__grid {
    grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  }
}

.footer__title {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.66);
  margin-bottom: 1rem;
}

.footer__links {
  display: grid;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer__links a {
  font-size: var(--t-sm);
  text-decoration: none;
  color: rgb(255 255 255 / 0.78);
  transition: color 0.2s var(--ease);
}

.footer__links a:hover {
  color: var(--white);
}

.newsletter {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.newsletter input {
  flex: 1 1 12rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.05);
  color: var(--white);
}

.newsletter input::placeholder {
  color: rgb(255 255 255 / 0.58);
}

.newsletter button {
  flex: none;
  padding: 0.85rem 1.5rem;
  min-height: 0;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.09);
  font-size: var(--t-xs);
  color: rgb(255 255 255 / 0.66);
}

.footer__legal {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer__legal a {
  color: inherit;
  text-decoration: none;
}
.footer__legal a:hover {
  color: var(--white);
}

/* --------------------------------------------------------------------------
   15. CTA band
   -------------------------------------------------------------------------- */

.cta-band {
  position: relative;
  overflow: clip;
  background: var(--blue);
  color: var(--white);
  padding-block: clamp(3.5rem, 2.5rem + 5vw, 7rem);
  isolation: isolate;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: repeating-linear-gradient(
    115deg,
    rgb(255 255 255 / 0.05) 0 2px,
    transparent 2px 26px
  );
}

.cta-band::after {
  content: '';
  position: absolute;
  right: -6%;
  bottom: -45%;
  z-index: -1;
  width: 46rem;
  height: 46rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(228 0 43 / 0.5), transparent 62%);
  pointer-events: none;
}

.cta-band__inner {
  display: grid;
  gap: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  align-items: center;
}

@media (min-width: 56rem) {
  .cta-band__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.cta-band__title {
  font-size: var(--t-2xl);
  max-width: 20ch;
}

.cta-band__text {
  margin-top: 0.75rem;
  color: rgb(255 255 255 / 0.85);
  max-width: 50ch;
}

/* --------------------------------------------------------------------------
   16. Progressive image loading + reveal states
   -------------------------------------------------------------------------- */

/* Blur-up: the holder paints a 20px-wide LQIP as its background, which the
   browser upscales into a soft placeholder, and the real image cross-fades over
   it. No backdrop-filter overlay — that stalls mid-transition on composited
   layers and leaves a permanent haze over the photograph. */
/* Every use of the holder sits inside a parent that already defines the box
   (an aspect-ratio card, the hero backdrop). Filling that parent absolutely is
   what makes object-fit: cover work — left in flow the holder has auto height,
   collapses to the image's own aspect ratio, and the art stops short of the
   container it was meant to cover. */
.img-holder {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.img-holder img {
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.img-holder img.is-loaded {
  opacity: 1;
}

/* Elements GSAP will animate start hidden, but only when JS is running so the
   no-JS document stays fully readable. */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 1.75rem, 0);
}

.js [data-reveal='fade'] {
  transform: none;
}

/* --------------------------------------------------------------------------
   17. Rive stage
   -------------------------------------------------------------------------- */

.rive-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  background: linear-gradient(150deg, rgb(0 61 165 / 0.18), transparent 65%);
  border: 1px solid var(--line);
}

.rive-stage canvas {
  width: 100%;
  height: 100%;
}

/* CSS-only stand-in shown until (or unless) a .riv file is supplied. */
/* Caption under the Rive stand-in. */
.stage-label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.rive-stage__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}

.rive-stage[data-rive-loaded='true'] .rive-stage__fallback {
  display: none;
}

.pulse-ring {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 2px solid var(--red);
  position: relative;
}

.pulse-ring::before,
.pulse-ring::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--blue-300);
  animation: ripple 2.6s var(--ease) infinite;
}

.pulse-ring::after {
  animation-delay: 1.3s;
}

@keyframes ripple {
  from {
    transform: scale(1);
    opacity: 0.8;
  }
  to {
    transform: scale(2.1);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   18. Scroll progress bar
   -------------------------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 95;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.scroll-progress__bar {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--blue), var(--red));
}

/* --------------------------------------------------------------------------
   19. Reduced motion + print
   -------------------------------------------------------------------------- */

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

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .ticker__track {
    animation: none;
    transform: none;
  }

  .scroll-cue {
    display: none;
  }
}

@media print {
  .site-header,
  .mobile-nav,
  .scroll-progress,
  .track__stage,
  .lightbox,
  .scroll-cue,
  .ticker {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .section {
    background: #fff;
    color: #000;
    padding-block: 1.5rem;
    break-inside: avoid;
  }
}

/* Honour forced-colors / Windows high contrast. */
@media (forced-colors: active) {
  .btn,
  .chip,
  .tier,
  .article,
  .stat {
    border: 1px solid CanvasText;
  }
  .btn::after {
    display: none;
  }
}
