/* ═══════════════════════════════════════════════════════
   FORMULA 1 — SCROLLYTELLING STYLESHEET
   ═══════════════════════════════════════════════════════ */

/* ─── RESET ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

body {
  background: transparent;
  color: #d6dde3;
  font-family: 'Crimson Pro', Georgia, serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes liquidPan {
  0% { transform: scale(1.1) translate(0%, 0%); }
  50% { transform: scale(1.1) translate(-2%, 2%); }
  100% { transform: scale(1.1) translate(0%, 0%); }
}

#liquid-bg {
  position: fixed;
  top: -10%; left: -10%;
  width: 120%; height: 120%;
  background: radial-gradient(circle at 20% 30%, rgba(200, 30, 20, 0.45) 0%, transparent 60%),
              radial-gradient(circle at 80% 80%, rgba(40, 50, 110, 0.45) 0%, transparent 60%),
              radial-gradient(circle at 50% 10%, rgba(120, 20, 30, 0.3) 0%, transparent 50%),
              radial-gradient(circle at 10% 90%, rgba(10, 20, 40, 0.6) 0%, transparent 50%),
              linear-gradient(135deg, #0a0e14 0%, #1a0a0a 50%, #060e14 100%);
  z-index: -999;
  animation: liquidPan 25s ease-in-out infinite;
  pointer-events: none;
}

/* ─── DESIGN TOKENS ──────────────────────────────────── */
:root {
  --bg: #0a0d0f;
  --red: #c0392b;
  --red-bright: #ff1a00;
  --text: #d6dde3;
  --text-muted: #6b7c8a;
  --surface: #1a2a35;
  --font-hed: 'Barlow Condensed', Impact, sans-serif;
  --font-body: 'Crimson Pro', Georgia, serif;
  --font-mono: 'Space Mono', monospace;
}

/* ─── LOADER ─────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transition: opacity 0.9s ease;
}

#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

#loader-bar-track {
  width: 220px;
  height: 2px;
  background: rgba(192, 57, 43, 0.18);
}

#loader-bar {
  height: 100%;
  width: 0%;
  background: var(--red-bright);
  transition: width 0.08s linear;
}

/* ─── NAV GRADIENT (always visible behind nav) ──────── */
#nav-gradient {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom,
      rgba(10, 13, 15, 0.4) 0%,
      rgba(10, 13, 15, 0.0) 100%);
  z-index: 98;
  pointer-events: none;
}

/* ─── NAV ────────────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  background: rgba(10, 13, 15, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#nav.visible {
  opacity: 1;
  pointer-events: all;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  color: var(--red);
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
}

.nav-links {
  display: flex;
  gap: 36px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.3s ease;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.95);
}

.nav-links a:hover {
  color: var(--red);
}

/* ─── HERO (canvas-driven) ───────────────────────────── */
#hero-wrapper {
  height: 500vh;
  position: relative;
  mask-image: linear-gradient(to top, transparent 0%, black 15%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, black 15%);
}

#hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Dark gradient over frames so text is always readable */
#canvas-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10, 13, 15, 0.55) 0%, transparent 18%, transparent 72%, rgba(10, 13, 15, 0.90) 100%),
    linear-gradient(160deg, rgba(10, 13, 15, 0.42) 0%, transparent 60%);
  z-index: 2;
  pointer-events: none;
}

/* Radial gradient to hide "Veo" watermark in bottom-right */
#watermark-cover {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 220px;
  height: 100px;
  background: radial-gradient(ellipse at 100% 100%,
      rgba(10, 13, 15, 1.0) 0%,
      rgba(10, 13, 15, 0.85) 35%,
      rgba(10, 13, 15, 0.30) 60%,
      transparent 80%);
  z-index: 3;
  pointer-events: none;
}



/* Hero scenes system — each scene is absolute, full-inset */
.hero-scene {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 40px;
  pointer-events: none;
}

/* Scene 0: center (opening) */
#hs-0 {
  align-items: center;
  text-align: center;
}

.hs-tagline {
  font-family: var(--font-body);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(0.95rem, 1.8vw, 1.35rem);
  color: var(--text);
  letter-spacing: 0.05em;
  opacity: 0;
  margin-bottom: 20px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

#hero-title {
  font-family: var(--font-hed);
  font-weight: 900;
  font-size: clamp(5rem, 15vw, 15rem);
  text-transform: uppercase;
  color: var(--text);
  line-height: 0.88;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(28px);
  margin-bottom: 22px;
  /* Use drop-shadow so the internal overflow:hidden wrappers don't clip the glow */
  filter: drop-shadow(0 4px 32px rgba(0, 0, 0, 0.6));
}

/* ─── HERO SHUTTER TEXT (Vanilla Translation) ─────────── */
@keyframes shutterSliceLeftRight {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes shutterSliceRightLeft {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translateX(-100%);
    opacity: 0;
  }
}

@keyframes shutterMainFadeIn {
  0% {
    opacity: 0;
    filter: blur(10px);
  }

  100% {
    opacity: 1;
    filter: blur(0px);
  }
}

.shutter-char-wrap {
  position: relative;
  display: inline-block;
  overflow: hidden;
  padding: 0 0.1vw;
}

.shutter-slice {
  position: absolute;
  inset: 0;
  line-height: inherit;
  font-weight: inherit;
  font-size: inherit;
  pointer-events: none;
  opacity: 0;
}

.shutter-slice-top {
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  color: var(--red);
}

.is-animating .shutter-slice-top {
  animation-name: shutterSliceLeftRight;
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
  animation-fill-mode: forwards;
}

.shutter-slice-mid {
  clip-path: polygon(0 35%, 100% 35%, 100% 65%, 0 65%);
  color: var(--text-muted);
}

.is-animating .shutter-slice-mid {
  animation-name: shutterSliceRightLeft;
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
  animation-fill-mode: forwards;
}

.shutter-slice-bot {
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  color: var(--red-bright);
}

.is-animating .shutter-slice-bot {
  animation-name: shutterSliceLeftRight;
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
  animation-fill-mode: forwards;
}

.shutter-main-char {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
}

.is-animating .shutter-main-char {
  animation-name: shutterMainFadeIn;
  animation-duration: 0.8s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}

.hs-subline {
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 1.1vw, 0.8rem);
  color: var(--text-muted);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

/* Scene 1: bottom-left stat */
.hs-bottom-left {
  align-items: flex-start;
  justify-content: flex-end;
  text-align: left;
  padding: 0 56px 72px;
}

/* Scene 2: right-center stat */
.hs-right {
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  padding: 0 56px 0 0;
}

/* Scene 3 & 4: center-bottom prose */
.hs-center-low {
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding-bottom: 100px;
}

.hs-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 8px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

.hs-stat {
  font-family: var(--font-hed);
  font-weight: 900;
  font-size: clamp(5rem, 13vw, 12rem);
  color: var(--red-bright);
  line-height: 0.9;
  margin-bottom: 16px;
  text-shadow: 0 0 60px rgba(255, 26, 0, 0.4), 0 4px 24px rgba(0, 0, 0, 0.8);
}

.hs-unit {
  font-size: 0.35em;
  color: var(--red);
  vertical-align: super;
  margin-left: 4px;
}

.hs-body {
  font-family: var(--font-body);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  color: var(--text);
  line-height: 1.5;
  max-width: 380px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.hs-prose {
  font-family: var(--font-body);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.3rem, 2.5vw, 2.2rem);
  color: var(--text);
  line-height: 1.4;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
  margin-bottom: 8px;
}

.hs-prose--large {
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
}

/* ─── SHARED SECTION STYLES ──────────────────────────── */
section {
  position: relative;
  background: var(--bg);
  padding: 130px 0 160px;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 56px;
}

.section-header {
  margin-bottom: 90px;
}

.section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.section-headline {
  font-family: var(--font-hed);
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 8rem);
  text-transform: uppercase;
  color: var(--text);
  line-height: 0.9;
  letter-spacing: 0.02em;
  /* slide-in state */
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-headline.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ─── SCROLL BEAT (fade-up) ──────────────────────────── */
.scroll-beat {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-beat.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── HISTORY ─────────────────────────────────────────── */
.history-beats {
  display: flex;
  flex-direction: column;
}

.history-beats .scroll-beat {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  padding: 48px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.history-beats .scroll-beat:last-child {
  margin-bottom: 0;
}

.beat-marker {
  display: block;
  width: 2px;
  min-height: 44px;
  background: var(--red);
  flex-shrink: 0;
  margin-top: 4px;
}

.history-beats p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1.15rem, 2.2vw, 1.75rem);
  line-height: 1.65;
  color: var(--text);
  max-width: 680px;
}

/* ─── CURTAIN GATEWAY ───────────────────────────────────
   The cursain wrapper has clip-path + fixed height.
   The panel inside is position:fixed at the bottom
   so it slides up as the wrapper enters the viewport.
   After the wrapper scrolls past, the circuits section
   (normal flow, z-index:2) covers it completely.
   ──────────────────────────────────────────── */
#circuits-curtain-wrapper {
  position: relative;
  height: 200vh;
  /* clip-path creates the reveal window */
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%);
}

#circuits-curtain-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

.curtain-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.35) saturate(0.6);
}

.curtain-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      #0a0d0f 0%,
      rgba(10, 13, 15, 0.4) 30%,
      #080b0d 100%);
}

.curtain-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 48px;
  z-index: 2;
}

.curtain-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.curtain-title {
  font-family: var(--font-hed);
  font-weight: 900;
  font-size: clamp(4rem, 13vw, 13rem);
  text-transform: uppercase;
  color: var(--text);
  line-height: 0.9;
  letter-spacing: 0.03em;
  margin-bottom: 32px;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.curtain-divider {
  width: 56px;
  height: 2px;
  background: var(--red);
  margin-bottom: 28px;
}

.curtain-sub {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  color: var(--text-muted);
  line-height: 1.6;
}

/* Start hidden — JS drives the fade-in as panel reveals */
.curtain-content {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}


/* History background: Fixed canvas for interactive scroll-driven sparks */
#history-sparks {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  /* JS fades it in */
}

#section-history {
  position: relative;
  z-index: 2;
  background: transparent;
  margin-top: -65vh; /* Massive overlap directly bypassing the dead scrub space */
  padding-top: 60px;
}

.section-history-inner {
  position: relative;
  z-index: 1;
}

/* Circuits (normal flow) and all sections after cover the fixed panel */
#section-circuits,
#section-timeline,
#section-drivers,
#section-manifesto,
#footer {
  position: relative;
  z-index: 2;
}

#section-circuits {
  background: transparent;
}

/* Pseudo element that reaches UP over the curtain to dissolve its bottom bounding box */
#section-circuits::before {
  content: "";
  position: absolute;
  top: -300px;
  left: 0;
  width: 100%;
  height: 300px;
  background: linear-gradient(to bottom, transparent 0%, #080b0d 100%);
  z-index: 10;
  pointer-events: none;
}

#section-drivers {
  background: transparent;
}

/* ─── ELEGANT CAROUSEL ────────────────────────────────── */
.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 700px;
  overflow: hidden;
  background: transparent;
}

.carousel-bg-wash {
  position: absolute;
  inset: 0;
  transition: background 0.8s ease;
}

.carousel-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

@media (min-width: 900px) {
  .carousel-inner {
    flex-direction: row;
  }
}

.carousel-content {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 40px;
  z-index: 2;
  position: relative;
  min-width: 0;
}

@media (min-width: 900px) {
  .carousel-content {
    padding: 10%;
    flex: 0 0 50%;
    max-width: 50%;
  }
}

.carousel-content-inner {
  max-width: 640px;
  /* Increased from 480px to accommodate wide text */
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.carousel-collection-num {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.carousel-num-line {
  width: 40px;
  height: 1px;
  background: var(--text-muted);
}

.carousel-num-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.carousel-title {
  font-family: var(--font-hed);
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  text-transform: uppercase;
  color: var(--text);
  line-height: 0.9;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
  overflow-wrap: break-word;
  hyphens: auto;
  min-height: 1.8em;
  display: flex;
  align-items: flex-end;
}

.carousel-subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 24px;
  transition: color 0.5s ease;
}

.carousel-description {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 300;
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 48px;
  min-height: 140px;
}

.carousel-nav-arrows {
  display: flex;
  gap: 16px;
}

.carousel-arrow-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-arrow-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.carousel-image-container {
  flex: 1;
  position: relative;
  padding: 40px 40px 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

@media (min-width: 900px) {
  .carousel-image-container {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

.carousel-image-frame {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 4/5;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85);
}

.carousel-image-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background 0.8s ease;
}

.carousel-frame-corner {
  position: absolute;
  width: 80px;
  height: 80px;
  border: 1px solid transparent;
  transition: border-color 0.8s ease;
  pointer-events: none;
}

.carousel-frame-corner--tl {
  top: 40px;
  left: 40px;
  border-bottom: none;
  border-right: none;
}

.carousel-frame-corner--br {
  bottom: 120px;
  right: 40px;
  border-top: none;
  border-left: none;
}

.carousel-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  height: 72px;
  background: rgba(8, 11, 13, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.carousel-progress-item {
  flex: 1;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 24px;
  cursor: pointer;
  text-align: left;
}

.carousel-progress-item:last-child {
  border-right: none;
}

.carousel-progress-track {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  margin-bottom: 10px;
  position: relative;
}

.carousel-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  transition: width 0.1s linear, background-color 0.8s ease;
}

.carousel-progress-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.carousel-progress-item.active .carousel-progress-label {
  color: var(--text);
}

/* JS Transition states */
.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s;
}

.transitioning {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.carousel-image-frame.visible .carousel-image {
  transform: scale(1);
  transition: transform 7s linear;
}

.carousel-image-frame.transitioning .carousel-image {
  transform: scale(1.04);
  transition: none;
}

/* ─── TIMELINE ────────────────────────────────────────── */
#section-timeline {
  background: transparent;
}

.timeline {
  position: relative;
  padding-left: 72px;
}

.timeline-line {
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(107, 124, 138, 0.2);
  /* Dark track */
}

.timeline-line-fill {
  width: 100%;
  height: 0%;
  /* Driven by JS */
  background: var(--red-bright);
  box-shadow: 0 0 15px rgba(255, 26, 0, 0.8), 0 0 30px rgba(255, 26, 0, 0.4);
  /* The transition helps smooth out non-GSAP scroll events slightly */
  transition: height 0.1s ease-out;
}

.timeline-entry {
  padding: 48px;
  margin-bottom: 24px;
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.timeline-entry:last-child {
  margin-bottom: 0;
}

/* dot on the timeline line */
.timeline-entry::before {
  content: '';
  position: absolute;
  left: -76px;
  top: 68px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 10px rgba(255, 26, 0, 0.5);
  opacity: 0;
  transition: opacity 0.5s ease 0.6s;
}

.timeline-entry.visible::before {
  opacity: 1;
}

.timeline-year {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  color: var(--red-bright);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.timeline-desc {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  color: var(--text);
  max-width: 660px;
  line-height: 1.65;
}

/* ─── DRIVERS / STATS ─────────────────────────────────── */
#section-drivers {
  background: #080b0d;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.stat-card {
  padding: 64px 52px;
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.stat-card.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* stagger delays */
.stat-card:nth-child(1) {
  transition-delay: 0ms;
}

.stat-card:nth-child(2) {
  transition-delay: 80ms;
}

.stat-card:nth-child(3) {
  transition-delay: 160ms;
}

.stat-card:nth-child(4) {
  transition-delay: 240ms;
}

.stat-card:nth-child(5) {
  transition-delay: 320ms;
}

.stat-card:nth-child(6) {
  transition-delay: 400ms;
}

.stat-number {
  display: block;
  font-family: var(--font-hed);
  font-weight: 900;
  font-size: clamp(4rem, 7vw, 7rem);
  color: var(--red-bright);
  line-height: 1;
  margin-bottom: 20px;
}

.stat-unit {
  font-size: 0.45em;
  vertical-align: super;
  color: var(--red);
  margin-left: 2px;
}

.stat-desc {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(0.95rem, 1.4vw, 1.2rem);
  color: var(--text-muted);
  line-height: 1.65;
}


/* ─── MANIFESTO ───────────────────────────────────────── */
#section-manifesto {
  background: transparent;
  /* deep black for dot contrast */
  padding: 180px 0 200px;
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
  /* contains the canvas */
  overflow: hidden;
}

/* Pseudo element blurs the strict top baseline between Carousel (#080b0d) and Manifesto (#000) */
#section-manifesto::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 350px;
  background: linear-gradient(to bottom, #080b0d 0%, transparent 100%);
  z-index: 10;
  pointer-events: none;
}

/* Animated Three.js canvas — sits as full-bleed background */
#manifesto-dots {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  /* subtle — text must remain readable */
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 75%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 75%, transparent 100%);
}

/* All manifesto content sits above the canvas */
.manifesto-inner {
  position: relative;
  z-index: 1;
}


.manifesto-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.manifesto-line-wrap {
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 56px;
}

#manifesto-red-line {
  width: 2px;
  height: 0;
  background: var(--red);
  transition: height 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#manifesto-red-line.drawn {
  height: 80px;
}

.manifesto-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.manifesto-line {
  font-family: var(--font-body);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 2.4rem);
  color: var(--text);
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px 40px;
  margin: 12px 0;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* stagger manifesto lines */
.manifesto-text .scroll-beat:nth-child(1) {
  transition-delay: 0ms;
}

.manifesto-text .scroll-beat:nth-child(2) {
  transition-delay: 180ms;
}

.manifesto-text .scroll-beat:nth-child(3) {
  transition-delay: 360ms;
}

.manifesto-text .scroll-beat:nth-child(4) {
  transition-delay: 540ms;
}

/* ─── FOOTER ──────────────────────────────────────────── */
#footer {
  background: transparent;
  padding: 80px 56px 56px;
  position: relative;
  z-index: 10;
  box-shadow: inset 0 100px 100px -40px rgba(0,0,0,0.9);
}

#footer-map-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85; /* Glow looks best with slight transparency */
}

.footer-tagline {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 48px 0 24px;
}

.footer-top-line {
  width: 100%;
  height: 1px;
  background: var(--red);
  margin-bottom: 44px;
  opacity: 0.7;
}

.footer-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-left,
.footer-right {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.footer-right {
  text-align: right;
}

.footer-center {
  display: flex;
  gap: 28px;
}

.footer-center a {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.footer-center a:hover {
  color: var(--text);
}

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  #nav {
    padding: 20px 24px;
  }

  .nav-links {
    gap: 20px;
  }

  .section-inner {
    padding: 0 24px;
  }

  #footer {
    padding: 0 24px 48px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 16px;
  }

  .footer-right {
    text-align: center;
  }

  .footer-center {
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }

  .timeline {
    padding-left: 40px;
  }

  .timeline-entry::before {
    left: -44px;
  }
}

@media (max-width: 480px) {
  .circuit-name {
    font-size: clamp(2.5rem, 12vw, 5rem);
  }

  .stat-card {
    padding: 44px 28px;
  }
}

