/* DRIFT — DriftHead2Head.com
   Palette pulled from the trailer: wet night asphalt, chalk paint,
   the board's three lane colors, and the two team liveries. */

:root {
  --asphalt: #06080b;
  --asphalt-2: #0e1217;
  --chalk: #ebe7de;
  --chalk-dim: #a9adb3;
  --lane-blue: #2f9bff;
  --lane-yellow: #f5ce34;
  --lane-pink: #f2468f;
  --team-blue: #2a5bff;
  --team-red: #e3262e;

  --font: "Archivo", "Arial Narrow", system-ui, sans-serif;

  /* Type scale (1.333, perfect fourth) */
  --fs-sm: 0.9375rem;
  --fs-base: 1.125rem;
  --fs-md: 1.5rem;
  --fs-lg: 2rem;
  --fs-xl: clamp(2.75rem, 6.5vw, 5.75rem);

  --gutter: clamp(16px, 4vw, 56px);
  --measure: 34rem;

  --grit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 -3.2 2.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--chalk);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  overflow-x: clip;
}

img, video, svg { display: block; max-width: 100%; }
figure { margin: 0; }
h1, h2, p { margin: 0; }

::selection { background: var(--lane-yellow); color: var(--asphalt); }

:focus-visible {
  outline: 3px solid var(--lane-yellow);
  outline-offset: 3px;
}

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

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--lane-yellow); color: var(--asphalt);
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- Display type: condensed, heavy, italic, chalk-distressed ---------- */

.display {
  font-size: var(--fs-xl);
  font-weight: 900;
  font-style: italic;
  font-stretch: 62%;
  font-variation-settings: "wdth" 62;
  line-height: 0.88;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  text-wrap: balance;
  -webkit-mask-image: var(--grit);
  mask-image: var(--grit);
  -webkit-mask-size: 260px;
  mask-size: 260px;
}
.display--sm { font-size: clamp(2rem, 4vw, 3.25rem); }

.lede {
  max-width: var(--measure);
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.5;
  color: var(--chalk);
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */

.btn {
  --skew: -12deg;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 800;
  font-style: italic;
  font-variation-settings: "wdth" 80;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  color: inherit;
  background: none;
  position: relative;
  isolation: isolate;
  transition: color 0.15s, transform 0.15s;
}
.btn::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  transform: skewX(var(--skew));
  transition: background-color 0.15s, box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }

.btn--chalk { color: var(--asphalt); }
.btn--chalk::before { background: var(--chalk); }
.btn--chalk:hover::before { background: #fff; box-shadow: -6px 0 0 var(--team-blue), 6px 0 0 var(--team-red); }

.btn--ghost::before { box-shadow: inset 0 0 0 2px rgb(235 231 222 / 0.55); }
.btn--ghost:hover::before { box-shadow: inset 0 0 0 2px var(--chalk); background: rgb(235 231 222 / 0.08); }

.btn--sm { min-height: 40px; padding: 0 18px; font-size: var(--fs-sm); }

/* ---------- Top bar ---------- */

.topbar {
  position: absolute; inset: 0 0 auto; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
}
.topbar__mark img { width: 104px; height: auto; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #000 url("../media/hero-poster.jpg") center / cover no-repeat;
}
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--asphalt) 0%, rgb(6 8 11 / 0.82) 28%, rgb(6 8 11 / 0.15) 62%, rgb(6 8 11 / 0.55) 100%),
    linear-gradient(to right, rgb(6 8 11 / 0.7), transparent 60%);
}
.hero__content {
  position: relative;
  padding: 0 var(--gutter) clamp(48px, 9vh, 96px);
  max-width: 1100px;
}
.hero__logo img {
  width: min(78vw, 820px);
  height: auto;
  margin-left: -1.5%;
  filter: drop-shadow(0 10px 40px rgb(0 0 0 / 0.6));
}
.hero__tag {
  margin-top: clamp(14px, 2.4vh, 24px);
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  font-weight: 700;
  font-style: italic;
  font-variation-settings: "wdth" 75;
}
.hero__date {
  margin-top: 2px;
  font-size: clamp(1.25rem, 2.3vw, 1.75rem);
  font-weight: 700;
  font-variation-settings: "wdth" 75;
  color: var(--lane-yellow);
}
.hero__actions {
  display: flex; flex-wrap: wrap; gap: 14px 20px;
  margin-top: clamp(24px, 4vh, 40px);
  padding-left: 8px;
}

/* The one load moment: the wordmark slides in sideways and catches, like a car snapping into a drift. */
@media (prefers-reduced-motion: no-preference) {
  .hero__logo img { animation: slide-in 1.1s cubic-bezier(0.2, 0.9, 0.25, 1.15) 0.15s both; }
  .hero__tag, .hero__date, .hero__actions { animation: settle 0.6s ease-out both; }
  .hero__tag { animation-delay: 0.85s; }
  .hero__date { animation-delay: 0.95s; }
  .hero__actions { animation-delay: 1.1s; }
}
@keyframes slide-in {
  0%   { transform: translateX(-40vw) skewX(-24deg); filter: blur(14px) drop-shadow(0 10px 40px rgb(0 0 0 / 0.6)); opacity: 0; }
  55%  { transform: translateX(2vw) skewX(8deg); filter: blur(0) drop-shadow(0 10px 40px rgb(0 0 0 / 0.6)); opacity: 1; }
  80%  { transform: translateX(-0.4vw) skewX(-2deg); }
  100% { transform: none; }
}
@keyframes settle {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Premise ---------- */

.premise {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  padding: clamp(80px, 12vw, 160px) var(--gutter);
  max-width: 1440px;
  margin: 0 auto;
}
.premise__copy { display: grid; gap: clamp(24px, 3vw, 36px); }

.spec {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 8px 0 0;
  max-width: var(--measure);
  border-top: 2px solid rgb(235 231 222 / 0.18);
}
.spec div {
  padding: 14px 0 12px;
  border-bottom: 2px solid rgb(235 231 222 / 0.18);
}
.spec div:nth-child(odd) { padding-right: 16px; }
.spec dt { font-size: var(--fs-sm); color: var(--chalk-dim); }
.spec dd {
  margin: 2px 0 0;
  font-size: var(--fs-md);
  font-weight: 800;
  font-style: italic;
  font-variation-settings: "wdth" 70;
  line-height: 1.15;
}
.spec div:nth-child(1) dd { color: var(--lane-blue); }
.spec div:nth-child(2) dd { color: var(--lane-yellow); }
.spec div:nth-child(3) dd { color: var(--lane-pink); }

.premise__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}
.premise__media video {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 55% 50%;
}

/* ---------- The race ---------- */

.race {
  position: relative;
  height: 460vh;
  background:
    radial-gradient(ellipse 40% 50% at 18% 12%, rgb(255 236 190 / 0.10), transparent 70%),
    radial-gradient(ellipse 35% 45% at 86% 20%, rgb(200 220 255 / 0.08), transparent 70%),
    var(--asphalt);
}
.race::before {
  /* wet asphalt grain */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 .7 0 0 0 0 .75 0 0 0 0 .8 0 0 0 .55 -.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
  opacity: 0.5;
}
.race__stage {
  position: sticky; top: 0;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.race__svg {
  width: 100%;
  height: 100%;
  padding: clamp(56px, 8vh, 96px) clamp(8px, 3vw, 48px) clamp(96px, 16vh, 160px);
}
.smoke { filter: blur(9px); }

.race__hud {
  position: absolute;
  top: clamp(20px, 4vh, 40px);
  left: var(--gutter); right: var(--gutter);
  display: flex; align-items: center; gap: 20px;
}
.race__leader {
  font-weight: 800; font-style: italic;
  font-variation-settings: "wdth" 72;
  font-size: var(--fs-md);
  min-width: 9ch;
}
.race__leader[data-lead="07"] { color: var(--lane-blue); }
.race__leader[data-lead="02"] { color: var(--team-red); }
.race__meter {
  flex: 1; height: 4px; max-width: 420px;
  background: rgb(235 231 222 / 0.16);
  transform: skewX(-20deg);
}
.race__meter span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--lane-blue), var(--lane-yellow), var(--lane-pink));
  transform-origin: left; transform: scaleX(0);
}

.race__captions {
  list-style: none; margin: 0; padding: 0;
  position: absolute;
  left: var(--gutter); right: var(--gutter);
  bottom: clamp(24px, 5vh, 56px);
  display: grid;
}
.race__captions li {
  grid-area: 1 / 1;
  align-self: end;
  font-size: clamp(2.25rem, 6vw, 5rem);
  font-weight: 900; font-style: italic;
  font-variation-settings: "wdth" 62;
  line-height: 0.9;
  text-transform: uppercase;
  max-width: 14ch;
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.35s, transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
  text-shadow: 0 4px 30px rgb(0 0 0 / 0.8);
  -webkit-mask-image: var(--grit); mask-image: var(--grit);
  -webkit-mask-size: 260px; mask-size: 260px;
}
.race__captions li.is-on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .race__captions li { transition: none; transform: none; }
}

/* ---------- Pick your car ---------- */

.garage {
  padding: clamp(80px, 12vw, 160px) 0 clamp(64px, 9vw, 120px);
}
.garage__title { padding: 0 var(--gutter); margin-bottom: clamp(28px, 4vw, 48px); }

.garage__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: clamp(420px, 70vh, 760px);
}
.car { position: relative; overflow: hidden; }
.car img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.car--07 { clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%); margin-right: -6%; z-index: 1; }
.car--02 { clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%); margin-left: -6%; }
.car--07 img { object-position: 30% 50%; }
.car--02 img { object-position: 60% 50%; }
.car:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .car:hover img { transform: none; } }

.car::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(6 8 11 / 0.85), transparent 45%);
}
.car figcaption {
  position: absolute; z-index: 1;
  bottom: clamp(16px, 3vw, 36px);
  display: grid;
}
.car--07 figcaption { left: var(--gutter); }
.car--02 figcaption { right: var(--gutter); text-align: right; }

.car__num {
  font-size: clamp(5rem, 14vw, 12rem);
  font-weight: 900; font-style: italic;
  font-variation-settings: "wdth" 62;
  line-height: 0.8;
  -webkit-mask-image: var(--grit); mask-image: var(--grit);
  -webkit-mask-size: 260px; mask-size: 260px;
}
.car--07 .car__num { color: var(--team-blue); text-shadow: 0 0 40px rgb(42 91 255 / 0.5); }
.car--02 .car__num { color: var(--team-red); text-shadow: 0 0 40px rgb(227 38 46 / 0.5); }
.car__name { font-weight: 700; font-size: var(--fs-base); margin-top: 6px; }

.garage__note {
  padding: clamp(24px, 3vw, 36px) var(--gutter) 0;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  color: var(--chalk-dim);
}

/* ---------- Trailer ---------- */

.reel {
  padding: 0 var(--gutter) clamp(80px, 12vw, 160px);
  max-width: 1440px; margin: 0 auto;
}
.reel__poster {
  display: block; position: relative; width: 100%;
  padding: 0; border: 0; background: #000;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.reel__poster img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.3s, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reel__poster:hover img { opacity: 1; transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) { .reel__poster:hover img { transform: none; } }
.reel__play {
  position: absolute; left: 50%; top: 50%;
  width: clamp(76px, 9vw, 112px); aspect-ratio: 1;
  translate: -50% -50%;
  display: grid; place-items: center;
  color: var(--asphalt);
}
.reel__play::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--chalk);
  transform: skewX(-12deg);
  box-shadow: -8px 0 0 var(--team-blue), 8px 0 0 var(--team-red);
}
.reel__play svg { margin-left: 6px; }
.reel__caption {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 32px;
  margin-top: 20px;
}
.reel__caption p { color: var(--chalk-dim); }

/* ---------- Signup ---------- */

.signup {
  position: relative;
  min-height: 92svh;
  display: grid; align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.signup__bg {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
  opacity: 0.55;
}
.signup::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, var(--asphalt), transparent 30%, transparent 70%, var(--asphalt)),
    linear-gradient(to right, rgb(6 8 11 / 0.94) 0%, rgb(6 8 11 / 0.82) 38%, rgb(6 8 11 / 0.2) 78%);
}
.signup__inner {
  padding: clamp(80px, 12vw, 160px) var(--gutter);
  display: grid; gap: clamp(20px, 2.5vw, 28px);
  max-width: 820px;
}

.signup__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: end;
  max-width: 560px;
  margin-top: 12px;
}
.field { display: grid; gap: 6px; }
.field__label { font-size: var(--fs-sm); color: var(--chalk-dim); }
.field input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  font: inherit;
  color: var(--chalk);
  background: rgb(6 8 11 / 0.7);
  border: 2px solid rgb(235 231 222 / 0.4);
  border-radius: 0;
}
.field input::placeholder { color: rgb(235 231 222 / 0.38); }
.field input:focus-visible { outline: none; border-color: var(--lane-yellow); }
.field input:user-invalid { border-color: var(--lane-pink); }

.signup__status { grid-column: 1 / -1; min-height: 1.55em; font-weight: 600; }
.signup__status[data-state="ok"] { color: var(--lane-yellow); }
.signup__status[data-state="error"] { color: var(--lane-pink); }
.signup__fine { font-size: var(--fs-sm); color: var(--chalk-dim); }

.hp { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */

.footer {
  padding: clamp(48px, 7vw, 80px) var(--gutter) 40px;
  display: grid; gap: 10px;
  border-top: 2px solid rgb(235 231 222 / 0.1);
}
.footer img { width: 140px; height: auto; margin-bottom: 10px; }
.footer p { color: var(--chalk-dim); font-size: var(--fs-sm); }
.footer__small { opacity: 0.7; }
.footer .footer__credit {
  margin-top: 22px; padding-top: 18px;
  border-top: 2px solid rgb(235 231 222 / 0.1);
  text-align: center; font-size: 0.8125rem; line-height: 1.35;
}
.footer__credit a {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  color: var(--chalk-dim); text-decoration: none;
}
.footer .footer__credit img { width: 53px; height: 40px; margin: 0; flex: none; }
.footer__credit span { min-width: 0; text-align: left; }
.footer__credit strong { color: var(--chalk); font-weight: 600; transition: color 0.15s; }
.footer__credit a:hover { color: var(--chalk); }
.footer__credit a:hover strong { color: #fff; }

/* ---------- Trailer dialog ---------- */

.player {
  width: min(1280px, 100vw - 32px);
  padding: 0; border: 0;
  background: #000;
  color: var(--chalk);
  overflow: visible;
}
.player::backdrop { background: rgb(0 0 0 / 0.88); backdrop-filter: blur(6px); }
.player__frame { aspect-ratio: 16 / 9; width: 100%; background: #000; }
.player__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.player__bar { position: absolute; right: 0; top: -52px; }
.player__close {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: none; color: var(--chalk); cursor: pointer;
}
.player__close:hover { color: #fff; }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .premise { grid-template-columns: 1fr; }
  .premise__media { aspect-ratio: 16 / 11; clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%); }

  .garage__split { grid-template-columns: 1fr; height: auto; }
  .car { aspect-ratio: 4 / 3; }
  .car--07, .car--02 { margin: 0; }
  .car--07 { clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%); margin-bottom: -8%; }
  .car--02 { clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%); }

  .race { height: 400vh; }
  .race__svg { padding: 72px 8px 132px; }
  .race__captions li { max-width: 11ch; }
}

@media (max-width: 520px) {
  .topbar__mark img { width: 84px; }
  .hero__content { padding-bottom: 40px; }
  .hero__actions { padding-left: 6px; }
  .hero__actions .btn { flex: 1 1 100%; justify-content: center; }
  .signup__form { grid-template-columns: 1fr; }
  .signup__form .btn { justify-content: center; margin: 0 6px; }
  .spec dd { font-size: 1.25rem; }
}

/* Hero background video pause control */
.hero__toggle {
  position: absolute; z-index: 2;
  right: var(--gutter); bottom: clamp(48px, 9vh, 96px);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 2px solid rgb(235 231 222 / 0.35); border-radius: 50%;
  background: rgb(6 8 11 / 0.4); color: var(--chalk);
  cursor: pointer;
}
.hero__toggle:hover { border-color: var(--chalk); }
.hero__toggle .i-play { display: none; }
.hero__toggle[aria-pressed="true"] .i-play { display: block; }
.hero__toggle[aria-pressed="true"] .i-pause { display: none; }
@media (max-width: 520px) { .hero__toggle { top: 72px; bottom: auto; } }
