/* BARQ Racing — site styles.
   Direction: Jordan at night, an engineering drawing, a race-car livery.
   Charcoal and cream carry the page; red is the livery and the call to act. */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Plex Arabic";
  src: url("/assets/fonts/plex-arabic-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
  --bg: #F5F1EA;
  --paper: #EDE7DC;
  --red: #B8141C;
  --red-deep: #8E0F15;
  --ink: #1A1B1E;
  --ink-2: #222327;
  --muted: #4A4D53;
  --card: #FFFFFF;
  --line: rgba(26, 27, 30, 0.14);
  --line-strong: rgba(26, 27, 30, 0.88);
  --on-dark: #F5F1EA;
  --on-dark-muted: rgba(245, 241, 234, 0.76);
  --on-dark-line: rgba(245, 241, 234, 0.2);
  --head: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ar: "Plex Arabic", "Segoe UI", Tahoma, sans-serif;
  --gutter: 20px;
  --max: 1240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.6 var(--body); text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.06; margin: 0; }
p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1100px) { :root { --gutter: 56px; } }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 50;
  background: var(--on-dark); color: var(--ink); padding: 8px 12px; text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 30; color: var(--on-dark);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-solid, .no-hero .site-header { background: rgba(26, 27, 30, 0.96); border-bottom-color: var(--on-dark-line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 36px; height: auto; }
.brand span { font-family: var(--head); font-weight: 700; font-stretch: 80%; font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.01em; }
.brand em { font-style: normal; font-weight: 500; color: var(--on-dark-muted); margin-left: 0.28em; }
.site-header :focus-visible { outline-color: var(--on-dark); }

.nav { display: flex; align-items: center; gap: 4px 24px; }
.nav a { font-size: 0.9375rem; font-weight: 500; text-decoration: none; color: var(--on-dark-muted); padding: 8px 0; transition: color .2s var(--ease); }
.nav a:hover { color: var(--on-dark); }
.nav .nav__cta { color: var(--on-dark); padding: 9px 16px; border: 1px solid var(--on-dark-line); transition: background-color .2s var(--ease), border-color .2s var(--ease); }
.nav .nav__cta:hover { background: var(--red); border-color: var(--red); }
.menu-btn { display: none; }

@media (max-width: 899px) {
  .js .menu-btn {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
    background: transparent; border: 1px solid var(--on-dark-line); color: var(--on-dark); font-weight: 600; cursor: pointer;
  }
  .js #site-nav { position: absolute; inset: 68px 0 auto 0; background: var(--ink); border-bottom: 1px solid var(--on-dark-line); display: none; }
  .js #site-nav.is-open { display: block; }
  .js .nav { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; }
  .js .nav a { display: block; padding: 14px 0; font-size: 1.0625rem; border-bottom: 1px solid var(--on-dark-line); }
  .js .nav .nav__cta { margin-top: 16px; text-align: center; background: var(--red); border-color: var(--red); }
  html:not(.js) .site-header__inner { height: auto; flex-wrap: wrap; padding-block: 12px; }
  html:not(.js) .nav { flex-wrap: wrap; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; min-height: 48px; text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  padding: 12px 24px; line-height: 1.2; border: 1px solid transparent; position: relative;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-deep); }
.btn--line { color: var(--on-dark); border-color: var(--on-dark-line); }
.btn--line:hover { border-color: var(--on-dark); background: rgba(245, 241, 234, 0.06); }
.btn--big { min-height: 56px; padding: 16px 28px; font-size: 1rem; }

/* ---------- Labels and headings ---------- */
.label { font-size: 0.9375rem; font-weight: 600; color: var(--red); display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.label::before { content: ""; width: 28px; height: 2px; background: currentColor; flex: none; }
.section h2, .home h2, .join h2 {
  font-size: clamp(2rem, 4.6vw, 3.5rem); font-stretch: 80%; font-weight: 650; letter-spacing: -0.008em; max-width: 20ch;
}
.muted { color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; color: var(--on-dark); background: var(--ink);
  display: grid; align-items: end; overflow: hidden; isolation: isolate;
}
.hero__shade {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(0deg, var(--ink) 34%, rgba(26,27,30,0.7) 58%, rgba(26,27,30,0) 82%);
}
.hero__inner { position: relative; z-index: 3; padding-top: 120px; padding-bottom: 48px; }

/* Living colour field behind the flag: soft red, green and warm light
   drifting over charcoal. Each glow moves on its own slow loop (transform only). */
.mesh { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #141518; }
.mesh i { position: absolute; display: block; border-radius: 50%; will-change: transform; }
.mesh i:nth-child(1) { width: 70vmax; height: 70vmax; right: -18vmax; top: -30vmax; background: radial-gradient(closest-side, rgba(200, 16, 46, 0.62), rgba(200, 16, 46, 0.18) 55%, transparent 72%); }
.mesh i:nth-child(2) { width: 64vmax; height: 64vmax; right: -10vmax; bottom: -36vmax; background: radial-gradient(closest-side, rgba(0, 122, 61, 0.5), rgba(0, 122, 61, 0.14) 55%, transparent 72%); }
.mesh i:nth-child(3) { width: 40vmax; height: 40vmax; left: 34%; top: 18%; background: radial-gradient(closest-side, rgba(232, 168, 104, 0.26), transparent 70%); }
.mesh i:nth-child(4) { width: 60vmax; height: 60vmax; left: -24vmax; bottom: -30vmax; background: radial-gradient(closest-side, rgba(120, 10, 38, 0.5), transparent 72%); }
.mesh i:nth-child(5) { width: 46vmax; height: 46vmax; left: -10vmax; top: -24vmax; background: radial-gradient(closest-side, rgba(72, 84, 120, 0.3), transparent 70%); }
.mesh::after {
  content: ""; position: absolute; inset: 0; opacity: 0.08;
  background: url("/assets/img/grain.png") repeat; background-size: 160px 160px;
}

/* The flag: painted on a canvas and waved in site.js */
.flag {
  position: relative; z-index: 1; width: calc(100% - var(--gutter));
  margin: 92px 0 0 calc(var(--gutter) * 0.5); transform: rotate(-3deg);
}
.flag__canvas { display: block; width: 100%; aspect-ratio: 3 / 2; }
.flag__fallback { position: absolute; left: 5%; top: 7.5%; width: 94%; height: auto; }
.flag.is-live .flag__fallback { display: none; }
.flag::after {
  content: ""; position: absolute; left: 12%; right: 4%; bottom: 2%; height: 14%; z-index: -1;
  background: radial-gradient(closest-side, rgba(0,0,0,0.5), rgba(0,0,0,0.2) 60%, transparent);
}
@media (max-width: 899px) {
  .hero { display: block; min-height: 0; }
  .hero__shade { display: none; }
  .hero__inner { padding-top: 8px; }
}
@media (min-width: 900px) {
  .flag { position: absolute; margin: 0; top: 50%; right: 2vw; width: min(44vw, 820px); transform: translateY(-48%) rotate(-2deg); }
  .hero__shade { background: linear-gradient(90deg, rgba(26,27,30,0.92) 0%, rgba(26,27,30,0.8) 26%, rgba(26,27,30,0.3) 42%, rgba(26,27,30,0) 56%); }
}

/* Speed streaks behind the flag */
.hero__streaks { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero__streaks i { position: absolute; left: 0; height: 1px; width: 34vw; background: linear-gradient(90deg, transparent, rgba(245, 241, 234, 0.26), transparent); transform: translateX(110vw); }
.hero__streaks i:nth-child(1) { top: 22%; }
.hero__streaks i:nth-child(2) { top: 41%; height: 2px; background: linear-gradient(90deg, transparent, rgba(184, 20, 28, 0.85), transparent); }
.hero__streaks i:nth-child(3) { top: 68%; width: 40vw; }
.hero__streaks i:nth-child(4) { top: 86%; width: 20vw; }

@media (prefers-reduced-motion: no-preference) {
  .flag { animation: flagin 1.8s var(--ease) .1s both; }
  .mesh i:nth-child(1) { animation: glowA 22s ease-in-out infinite alternate; }
  .mesh i:nth-child(2) { animation: glowB 26s ease-in-out infinite alternate; }
  .mesh i:nth-child(3) { animation: glowC 18s ease-in-out infinite alternate; }
  .mesh i:nth-child(4) { animation: glowB 30s ease-in-out infinite alternate-reverse; }
  .mesh i:nth-child(5) { animation: glowA 24s ease-in-out infinite alternate-reverse; }
  .hero__streaks i { animation: streak 4.6s cubic-bezier(.55,.05,.35,1) infinite; }
  .hero__streaks i:nth-child(2) { animation-duration: 3.4s; animation-delay: -1.4s; }
  .hero__streaks i:nth-child(3) { animation-duration: 5.4s; animation-delay: -3s; }
  .hero__streaks i:nth-child(4) { animation-duration: 4s; animation-delay: -2.2s; }
  .dot { animation: pulse 2.4s ease-out infinite; }
}
@keyframes flagin { from { opacity: 0; translate: 6% 0; } to { opacity: 1; translate: 0 0; } }
@keyframes glowA { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-14vmax, 10vmax, 0) scale(1.18); } }
@keyframes glowB { from { transform: translate3d(0, 0, 0) scale(1.1); } to { transform: translate3d(-12vmax, -12vmax, 0) scale(0.92); } }
@keyframes glowC { from { transform: translate3d(0, 0, 0) scale(0.9); } to { transform: translate3d(16vmax, -8vmax, 0) scale(1.2); } }
@keyframes streak { from { transform: translateX(110vw); } to { transform: translateX(-45vw); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(184, 20, 28, 0.6); } 100% { box-shadow: 0 0 0 12px rgba(184, 20, 28, 0); } }
.hero__kicker { color: var(--on-dark-muted); font-size: 0.9375rem; margin-bottom: 16px; }
.hero__title { font-weight: 700; font-stretch: 76%; font-size: clamp(2.9rem, 10.5vw, 7.25rem); line-height: 0.95; letter-spacing: -0.012em; }
.hero__title .ln { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__title .ln > span { display: block; }
.hero__lead { margin-top: 24px; max-width: 34em; color: var(--on-dark-muted); font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__status { display: inline-flex; align-items: center; gap: 10px; font-size: 0.875rem; color: var(--on-dark); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(184, 20, 28, 0.25); }
.hero__status { margin-top: 28px; }

@media (min-width: 900px) {
  .hero { align-items: center; }
  .hero__inner { padding-top: 132px; padding-bottom: 88px; }
  .hero__text { max-width: 600px; }
  .hero__title { font-size: clamp(3.25rem, 5.4vw, 5.75rem); }
}

/* Hero entrance: the headline rises line by line */
@media (prefers-reduced-motion: no-preference) {
  .hero__title .ln > span { animation: rise 1.1s var(--ease) .2s both; }
  .hero__title .ln:nth-child(2) > span { animation-delay: .32s; }
  .hero__kicker, .hero__lead, .hero__actions, .hero__status { animation: fade 1s var(--ease) .6s both; }
  .hero__actions { animation-delay: .75s; }
  .hero__status { animation-delay: .9s; }
}
@keyframes rise { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Livery band ---------- */
.livery {
  background: var(--red); color: var(--on-dark); overflow: hidden; position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%); margin-top: -1px; padding: 16px 0 40px;
}
@media (min-width: 900px) { .livery { clip-path: polygon(0 0, 100% 0, 100% 64%, 0 100%); padding: 20px 0 64px; } }
.livery__inner { display: flex; align-items: center; gap: 24px; padding-left: var(--gutter); }
@media (min-width: 1240px) { .livery__inner { padding-left: calc((100vw - var(--max)) / 2 + var(--gutter)); } }
.livery__ar { font-family: var(--ar); font-weight: 700; line-height: 1.25; font-size: clamp(3.5rem, 10vw, 7.5rem); flex: none; }
.marquee { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee__track { display: flex; width: max-content; }
.marquee__track span {
  font-family: var(--head); font-weight: 600; font-stretch: 82%; font-size: clamp(1.125rem, 2.2vw, 1.75rem);
  white-space: nowrap; padding-right: 48px; display: inline-flex; align-items: center; gap: 48px;
}
.marquee__track span::after { content: ""; width: 10px; height: 10px; background: var(--on-dark); transform: rotate(45deg); }
@media (prefers-reduced-motion: no-preference) {
  .marquee__track { animation: marquee 38s linear infinite; }
  .marquee:hover .marquee__track { animation-play-state: paused; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
@media (min-width: 900px) { .section { padding: 128px 0; } }
.section--paper { background: var(--paper); }
.section--dark { background: var(--ink); color: var(--on-dark); }
.section--dark .label { color: var(--on-dark); }
.section--dark .label::before { background: var(--red); }

.frame { position: relative; }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame::after { content: ""; position: absolute; left: -12px; bottom: -12px; width: 40%; height: 6px; background: var(--red); }

/* Why */
.split { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 7fr 5fr; gap: 72px; } }
.story { margin-top: 40px; border-top: 2px solid var(--line-strong); }
.story li { display: grid; grid-template-columns: 76px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .story li { grid-template-columns: 120px 1fr; } }
.story b { font-family: var(--head); font-weight: 700; font-stretch: 76%; font-size: 1.75rem; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
.story span { font-size: 1.0625rem; }
.split__media { aspect-ratio: 4 / 5; }
@media (max-width: 899px) { .split__media { aspect-ratio: 3 / 2; } }

.goals { margin-top: 96px; }
.goals__title { font-size: clamp(1.375rem, 2.4vw, 1.75rem); font-stretch: 85%; font-weight: 600; margin-bottom: 24px; }
.goals__list { display: grid; gap: 16px; }
@media (min-width: 900px) { .goals__list { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.goals__list li { background: var(--ink); color: var(--on-dark); padding: 32px 28px 36px; display: grid; gap: 16px; align-content: start; position: relative; overflow: hidden; }
.goals__list li::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--red); transform-origin: left; }
.goals__list h4 { font-size: 1.5rem; font-weight: 650; font-stretch: 82%; line-height: 1.1; }
.goals__list p { color: var(--on-dark-muted); }

/* Competition */
.comp-head { display: grid; gap: 32px; align-items: end; }
@media (min-width: 900px) { .comp-head { grid-template-columns: 1fr 340px; gap: 64px; align-items: center; } }
.fs-logo {
  position: relative; overflow: hidden; background: #fff; padding: 28px; width: min(300px, 100%);
  box-shadow: 0 1px 0 rgba(26,27,30,0.06), 0 24px 48px -24px rgba(26,27,30,0.35);
}
@media (min-width: 900px) { .fs-logo { width: 340px; justify-self: end; } }
.fs-logo img { width: 100%; height: auto; }
.fs-logo::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.75) 50%, transparent);
  transform: translateX(-160%) skewX(-12deg); will-change: transform;
}
.fs-logo::before { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--red); transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease) .5s; }
.fs-logo.is-in::before, html:not(.js) .fs-logo::before { transform: scaleX(1); }
@media (prefers-reduced-motion: no-preference) {
  .js .fs-logo[data-reveal] { transform: translateY(24px); }
  .js .fs-logo[data-reveal] img { clip-path: inset(0 100% 0 0); transform: scale(1.1); transition: clip-path 1.2s var(--ease) .15s, transform 1.6s var(--ease) .15s; }
  .js .fs-logo.is-in img { clip-path: inset(0 0 0 0); transform: scale(1); }
  .fs-logo.is-in::after, html:not(.js) .fs-logo::after { animation: logoSheen 6.5s cubic-bezier(.6,0,.3,1) 1.4s infinite; }
}
@keyframes logoSheen { 0% { transform: translateX(-160%) skewX(-12deg); } 35%, 100% { transform: translateX(320%) skewX(-12deg); } }
.facts { margin-top: 56px; display: grid; border-top: 2px solid var(--line-strong); }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts div { padding: 24px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .facts div { border-bottom: 0; padding: 28px 24px 0 0; } .facts div + div { padding-left: 24px; border-left: 1px solid var(--line); } }
.facts dt { font-size: 0.9375rem; color: var(--muted); }
.facts dd { font-family: var(--head); font-weight: 700; font-stretch: 76%; font-size: clamp(3rem, 7vw, 5rem); line-height: 1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.concept { margin-top: 88px; display: grid; gap: 40px; }
@media (min-width: 900px) { .concept { grid-template-columns: 5fr 7fr; gap: 72px; } }
.concept h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 650; font-stretch: 82%; margin-bottom: 20px; }
.concept__text { display: grid; gap: 16px; align-content: start; font-size: 1.0625rem; }
.events { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 640px) { .events { grid-template-columns: 1fr 1fr; } }
.events div { background: var(--bg); padding: 28px 24px; transition: background-color .3s var(--ease); }
.events div:hover { background: var(--card); }
.events dt { font-family: var(--head); font-weight: 650; font-stretch: 85%; font-size: 1.375rem; }
.events dd { margin-top: 8px; color: var(--muted); }

/* The car */
.car-head { max-width: 760px; }
.car-head__lead { margin-top: 24px; color: var(--on-dark-muted); font-size: 1.0625rem; max-width: 38em; }
.car { margin-top: 56px; display: grid; gap: 40px; }
@media (min-width: 1000px) { .car { grid-template-columns: 3fr 2fr; gap: 56px; align-items: center; } }
.car__figure figcaption { margin-top: 12px; font-size: 0.8125rem; color: var(--on-dark-muted); }
.car__svg { width: 100%; height: auto; overflow: visible; }
.d-line, .d-thin, .d-centre, .d-wire, .d-race { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.d-line { stroke: var(--on-dark); stroke-width: 2.4; }
.d-thin { stroke: var(--on-dark-muted); stroke-width: 1.2; }
.d-centre { stroke: var(--on-dark-line); stroke-width: 1; stroke-dasharray: 14 4 2 4; }
.d-wire { stroke: var(--on-dark-line); stroke-width: 1.4; stroke-dasharray: 3 5; }
.d-race { stroke: var(--red); stroke-width: 3; stroke-dasharray: 60 940; opacity: 0.55; }
.d-spoke { fill: none; stroke: var(--on-dark-muted); stroke-width: 1.4; stroke-linecap: round; }
.spin { transform-box: fill-box; transform-origin: center; }
.d-flow { fill: none; stroke: rgba(245, 241, 234, 0.28); stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 90 610; }
.car[data-active="aero"] .d-flow { stroke: var(--red); stroke-width: 2; }
.car[data-active="dynamics"] .d-spoke { stroke: var(--red); }
@media (prefers-reduced-motion: no-preference) {
  .spin { animation: spin 1.1s linear infinite; }
  .d-flow { animation: flow 3.2s linear infinite; }
  .d-flow.f2 { animation-duration: 4s; animation-delay: -1.6s; }
  .d-flow.f3 { animation-duration: 3.6s; animation-delay: -2.4s; }
  .d-race { animation: lap 2.6s linear infinite; }
}
@keyframes spin { to { transform: rotate(-360deg); } }
@keyframes flow { from { stroke-dashoffset: 700; } to { stroke-dashoffset: 0; } }
.part { transition: opacity .35s var(--ease); }
.part .d-line, .part .d-thin, .part .d-wire { transition: stroke .35s var(--ease); }
.car[data-active] .part { opacity: 0.22; }
.car[data-active="chassis"] .part-chassis,
.car[data-active="aero"] .part-aero,
.car[data-active="dynamics"] .part-dynamics,
.car[data-active="electrical"] .part-electrical,
.car[data-active="sim"] .part-sim,
.car[data-active="cost"] .part { opacity: 1; }
.car[data-active="chassis"] .part-chassis :is(.d-line, .d-thin),
.car[data-active="aero"] .part-aero :is(.d-line, .d-thin),
.car[data-active="dynamics"] .part-dynamics :is(.d-line, .d-thin),
.car[data-active="electrical"] .part-electrical :is(.d-line, .d-thin, .d-wire) { stroke: var(--red); }
.car[data-active="electrical"] .d-wire { stroke-width: 2.4; }
.car[data-active="sim"] .d-race { opacity: 1; stroke-width: 4; }
.car[data-active="cost"] .d-line { stroke: var(--red); }
@media (prefers-reduced-motion: no-preference) {
  .car[data-active="electrical"] .d-wire { animation: current 1.2s linear infinite; }
}
@keyframes lap { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
@keyframes current { to { stroke-dashoffset: -16; } }

.car__hint { font-size: 0.875rem; color: var(--on-dark-muted); margin-bottom: 12px; }
.teams { display: grid; border-top: 1px solid var(--on-dark-line); }
.teams button {
  width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--on-dark-line);
  padding: 16px 0 16px 20px; cursor: pointer; display: grid; gap: 4px; position: relative;
  transition: padding-left .3s var(--ease), background-color .3s var(--ease);
}
.teams button::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); transform: scaleY(0); transform-origin: top; transition: transform .3s var(--ease); }
.teams button b { font-family: var(--head); font-weight: 600; font-stretch: 88%; font-size: 1.1875rem; }
.teams button span { color: var(--on-dark-muted); font-size: 0.9375rem; }
.teams button:hover, .teams button[aria-pressed="true"] { padding-left: 28px; background: rgba(245, 241, 234, 0.04); }
.teams button:hover::before, .teams button[aria-pressed="true"]::before { transform: scaleY(1); }
.teams button:focus-visible { outline-color: var(--on-dark); outline-offset: -2px; }
.car__around { margin-top: 20px; color: var(--on-dark-muted); font-size: 0.9375rem; }
.car__around b { color: var(--on-dark); font-weight: 600; }

/* Draw the car when it scrolls into view */
@media (prefers-reduced-motion: no-preference) {
  .js .car__svg .d-line, .js .car__svg .d-thin { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
  .js .car__figure.is-in .d-line, .js .car__figure.is-in .d-thin { animation: draw 2s var(--ease) forwards; }
  .js .car__figure.is-in .d-thin { animation-delay: .3s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Team */
.team { display: grid; gap: 48px; }
@media (min-width: 900px) { .team { grid-template-columns: 5fr 7fr; gap: 72px; align-items: center; } }
.team__photo { aspect-ratio: 3 / 4; }
@media (max-width: 899px) { .team__photo { aspect-ratio: 4 / 5; } }
.people { margin-top: 40px; display: grid; gap: 16px; }
@media (min-width: 640px) { .people { grid-template-columns: 1fr 1fr; } }
.people div { background: var(--card); padding: 24px; border-top: 4px solid var(--ink); }
.people dt { font-size: 0.875rem; color: var(--muted); }
.people dd { margin-top: 8px; font-family: var(--head); font-weight: 650; font-stretch: 88%; font-size: 1.5rem; line-height: 1.15; }
.people dd span { display: block; font-family: var(--body); font-weight: 400; font-size: 0.9375rem; color: var(--muted); margin-top: 4px; }
.subteams { margin-top: 32px; display: grid; gap: 0 32px; border-top: 2px solid var(--line-strong); }
@media (min-width: 640px) { .subteams { grid-template-columns: 1fr 1fr; } }
.subteams li { padding: 14px 0; border-bottom: 1px solid var(--line); font-weight: 500; }

/* Home: JUST */
.home { position: relative; color: var(--on-dark); background: var(--ink); isolation: isolate; overflow: hidden; }
.home__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.home__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(26,27,30,0.9) 0%, rgba(26,27,30,0.55) 55%, rgba(26,27,30,0.2) 100%); }
.home__inner { min-height: 80svh; display: flex; align-items: center; padding-block: 96px; }
.home__card { max-width: 560px; display: grid; gap: 20px; }
.home .label { color: var(--on-dark); }
.home .label::before { background: var(--red); }
.home__card > p:not(.label) { color: var(--on-dark-muted); font-size: 1.0625rem; }
.home__facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 32px; margin-top: 12px; border-top: 1px solid var(--on-dark-line); padding-top: 20px; }
.home__facts dt { font-size: 0.8125rem; color: var(--on-dark-muted); }
.home__facts dd { font-family: var(--head); font-weight: 700; font-stretch: 78%; font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
/* Slow, endless drift on the full-bleed photos */
@media (prefers-reduced-motion: no-preference) {
  .home__img, .join__img { animation: drift 26s ease-in-out infinite alternate; }
  .join__img { animation-duration: 32s; animation-direction: alternate-reverse; }
}
@keyframes drift { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.14) translate3d(-2.5%, -1.5%, 0); } }

/* Partner */
.partner-head { max-width: 760px; }
.partner-head__lead { margin-top: 24px; color: var(--muted); font-size: 1.0625rem; max-width: 36em; }
.value { margin-top: 56px; display: grid; gap: 16px; }
@media (min-width: 768px) { .value { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .value { grid-template-columns: repeat(4, 1fr); } }
.value li { background: var(--card); padding: 28px 24px 32px; display: grid; gap: 12px; align-content: start; border-top: 4px solid var(--ink); transition: transform .35s var(--ease), border-color .35s var(--ease); }
.value li:hover { transform: translateY(-4px); border-top-color: var(--red); }
.value h3 { font-size: 1.3125rem; font-weight: 650; font-stretch: 85%; line-height: 1.15; }
.value p { color: var(--muted); }
.value .value__lead { background: var(--red); color: #fff; border-top-color: var(--red-deep); }
.value .value__lead p { color: rgba(255, 255, 255, 0.88); }
@media (min-width: 768px) { .value .value__lead { grid-column: 1 / -1; padding: 40px 36px; } .value .value__lead h3 { font-size: clamp(1.75rem, 3vw, 2.5rem); max-width: 20ch; } .value .value__lead p { max-width: 44em; font-size: 1.0625rem; } }
.roles { margin-top: 80px; display: grid; gap: 24px; }
.roles__title { font-size: clamp(1.375rem, 2.4vw, 1.75rem); font-weight: 600; font-stretch: 85%; }
.roles dl { border-top: 2px solid var(--line-strong); }
.roles dl div { display: grid; gap: 4px; padding: 20px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .roles dl div { grid-template-columns: 4fr 7fr; gap: 32px; align-items: baseline; } }
.roles dt { font-family: var(--head); font-weight: 650; font-stretch: 85%; font-size: 1.5rem; }
.roles dd { color: var(--muted); }
.roles .btn { justify-self: start; margin-top: 16px; }

/* Join */
.join { position: relative; color: var(--on-dark); background: var(--ink); isolation: isolate; overflow: hidden; }
.join__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.join__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(26,27,30,0.94) 10%, rgba(26,27,30,0.6) 60%, rgba(26,27,30,0.45) 100%); }
.join__inner { padding-block: 120px 96px; display: grid; gap: 20px; }
@media (min-width: 900px) { .join__inner { padding-block: 200px 128px; } }
.join .label { color: var(--on-dark); }
.join .label::before { background: var(--red); }
.join__inner > p:not(.label) { color: var(--on-dark-muted); max-width: 36em; font-size: 1.0625rem; }

/* Contact */
.contact { display: grid; gap: 32px; }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; align-items: end; } }
.mail {
  display: inline-block; font-family: var(--head); font-weight: 650; font-stretch: 80%;
  font-size: clamp(1.75rem, 5.4vw, 3.5rem); text-decoration: none; line-height: 1.1; word-break: break-word;
  background: linear-gradient(var(--red), var(--red)) 0 100% / 100% 3px no-repeat; padding-bottom: 6px;
  transition: color .25s var(--ease), background-size .4s var(--ease);
}
.mail:hover { color: var(--red); background-size: 30% 3px; }
.social { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px 32px; }
.social a { text-decoration: none; font-weight: 600; }
.social a span { color: var(--muted); font-weight: 400; margin-left: 8px; }
.social a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Footer: a drawing-sheet title block */
.site-footer { padding: 0 0 40px; font-size: 0.875rem; color: var(--muted); }
.titleblock { display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--line-strong); color: var(--ink); }
.titleblock div { padding: 12px 16px; border-top: 1px solid var(--line-strong); }
.titleblock div:nth-child(even) { border-left: 1px solid var(--line-strong); }
.titleblock .titleblock__name { grid-column: 1 / -1; border-top: 0; }
.titleblock dt { font-size: 0.75rem; color: var(--muted); }
.titleblock dd { margin-top: 2px; font-weight: 600; }
.titleblock__name dd { display: flex; align-items: center; gap: 12px; font-family: var(--head); font-weight: 700; font-stretch: 80%; font-size: 1.5rem; text-transform: uppercase; }
.titleblock__name img { width: 32px; height: auto; }
@media (min-width: 900px) {
  .titleblock { grid-template-columns: 2fr 3fr 2fr 1fr; }
  .titleblock div { border-top: 0; border-left: 1px solid var(--line-strong); }
  .titleblock .titleblock__name { grid-column: auto; border-left: 0; }
}
.site-footer__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; margin-top: 16px; }
.site-footer__meta p:first-child { max-width: 64em; }

/* ---------- Scroll reveals (only when JS is running) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .d1 { transition-delay: .08s; } .js .d2 { transition-delay: .16s; } .js .d3 { transition-delay: .24s; } .js .d4 { transition-delay: .32s; }
  .js .frame[data-reveal] { transform: none; opacity: 1; }
  .js .frame[data-reveal] img { clip-path: inset(0 0 100% 0); transform: scale(1.08); transition: clip-path 1.2s var(--ease), transform 1.6s var(--ease); }
  .js .frame[data-reveal].is-in img { clip-path: inset(0 0 0 0); transform: scale(1); }
  .js .frame[data-reveal]::after { transform: scaleX(0); transform-origin: left; transition: transform .8s var(--ease) .9s; }
  .js .frame[data-reveal].is-in::after { transform: scaleX(1); }
  .js .goals__list li::before { transform: scaleX(0); transition: transform .9s var(--ease) .4s; }
  .js .goals__list li.is-in::before { transform: scaleX(1); }
}
.frame[data-reveal] { overflow: visible; }

/* ---------- Simple pages (privacy, 404) ---------- */
.no-hero main { padding-top: 68px; }
.page { padding: 56px 0 80px; }
@media (min-width: 768px) { .page { padding: 96px 0 120px; } }
.page h1 { font-size: clamp(2.25rem, 6vw, 4rem); font-weight: 700; font-stretch: 80%; max-width: 18ch; }
.page h2 { font-size: 1.25rem; margin-top: 40px; }
.page .prose { margin-top: 24px; display: grid; gap: 16px; max-width: 40em; color: var(--muted); font-size: 1.0625rem; }
.page .prose a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
.page .meta { margin-top: 16px; color: var(--muted); font-size: 0.875rem; }
.page .eyebrow { color: var(--red); font-weight: 600; margin-bottom: 16px; }
.page .btn--line { color: var(--ink); border-color: var(--line-strong); }
.page .btn--line:hover { background: var(--ink); color: var(--on-dark); }

/* ---------- Coming soon + team login ---------- */
.soon-page { background: #141518; color: var(--on-dark); }
.soon { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; isolation: isolate; padding: 96px var(--gutter) 72px; }
.soon .mesh { z-index: -1; }
.soon__inner { max-width: 620px; text-align: center; display: grid; justify-items: center; gap: 20px; }
.soon__logo { width: clamp(150px, 24vw, 220px); height: auto; filter: drop-shadow(0 24px 40px rgba(0,0,0,0.45)); }
.soon__ar { font-family: var(--ar); font-weight: 700; font-size: clamp(2.5rem, 7vw, 4rem); line-height: 1.2; color: var(--on-dark); }
.soon__title { font-weight: 700; font-stretch: 78%; font-size: clamp(2.25rem, 6.4vw, 4.25rem); line-height: 1; }
.soon__lead { color: var(--on-dark-muted); font-size: 1.0625rem; max-width: 34em; }
.soon__contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; margin-top: 8px; font-weight: 600; }
.soon__contact a { text-decoration: none; border-bottom: 1px solid var(--on-dark-line); padding-bottom: 2px; transition: border-color .25s var(--ease); }
.soon__contact a:hover { border-color: var(--red); }
.soon__foot { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 0.8125rem; color: var(--on-dark-muted); }
.soon :focus-visible { outline-color: var(--on-dark); }
@media (prefers-reduced-motion: no-preference) {
  .soon__inner > * { animation: fade 1s var(--ease) both; }
  .soon__inner > :nth-child(2) { animation-delay: .1s; } .soon__inner > :nth-child(3) { animation-delay: .2s; }
  .soon__inner > :nth-child(4) { animation-delay: .3s; } .soon__inner > :nth-child(5) { animation-delay: .4s; }
  .soon__logo { animation: fade 1s var(--ease) both, float 7s ease-in-out 1s infinite; }
}
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

.gate { position: absolute; top: 16px; right: var(--gutter); z-index: 5; }
.gate summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  font-size: 0.8125rem; font-weight: 600; color: var(--on-dark-muted); border: 1px solid var(--on-dark-line);
  background: rgba(20, 21, 24, 0.5); transition: color .2s var(--ease), border-color .2s var(--ease);
}
.gate summary::-webkit-details-marker { display: none; }
.gate summary:hover, .gate[open] summary { color: var(--on-dark); border-color: rgba(245, 241, 234, 0.45); }
.gate__form {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(300px, calc(100vw - 2 * var(--gutter)));
  display: grid; gap: 10px; padding: 20px; background: var(--ink); border: 1px solid var(--on-dark-line);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6);
}
@media (prefers-reduced-motion: no-preference) { .gate[open] .gate__form { animation: fade .35s var(--ease) both; } }
.gate__form label { font-size: 0.875rem; font-weight: 600; }
.gate__form input {
  font: inherit; font-size: 1rem; color: var(--on-dark); background: #101113; border: 1px solid var(--on-dark-line);
  min-height: 44px; padding: 8px 12px;
}
.gate__form input:focus { outline: 2px solid var(--on-dark); outline-offset: 1px; border-color: transparent; }
.gate__form .btn { justify-content: center; border: 0; cursor: pointer; }
.gate__error { color: #ff9a9e; font-size: 0.875rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
