/* ==========================================================================
   BMW M5 (G90) INTERACTIVE VIDEO-BACKGROUND SHOWCASE
   Awwwards-Level Responsive Dark Mode Experience (Zero-Lag Optimized)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Syncopate:wght@400;700&family=Syne:wght@500;700;800&display=swap');

:root {
  --bg-pitch: #060709;
  --bg-carbon: #0d0f13;
  --bg-surface: #14171d;
  --bg-surface-elevated: #1a1e27;
  
  /* BMW M Tri-Color System */
  --m-cyan: #0066b1;
  --m-cyan-glow: rgba(0, 102, 177, 0.55);
  --m-navy: #003366;
  --m-red: #e2231a;
  --m-red-glow: rgba(226, 35, 26, 0.6);
  --m-gold: #e5b839;
  --m-gold-glow: rgba(229, 184, 57, 0.45);
  --m-orange: #ff6600;
  --m-orange-glow: rgba(255, 102, 0, 0.5);
  
  --text-white: #ffffff;
  --text-muted: #8e9297;
  --text-dim: #545860;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.22);
  --glass-bg: rgba(14, 16, 21, 0.76);
  --glass-blur: blur(20px) saturate(180%);
  
  --font-heading: 'Syncopate', sans-serif;
  --font-display: 'Syne', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', monospace;

  --cursor-size: 8px;
  --cursor-ring-size: 38px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-size: 16px;
  background-color: var(--bg-pitch);
  color: var(--text-white);
  font-family: var(--font-sans);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  background-color: var(--bg-pitch);
  color: var(--text-white);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   AMBIENT GRAIN & PARTICLES CANVAS
   ========================================================================== */
.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  transform: translateZ(0);
}

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  transform: translateZ(0);
}

/* Custom Magnetic Cursor (Desktop) */
@media (min-width: 1024px) {
  body { cursor: none; }
  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--cursor-size);
    height: var(--cursor-size);
    background: var(--text-white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease, transform 0.1s ease;
  }
  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--cursor-ring-size);
    height: var(--cursor-ring-size);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease, background-color 0.3s ease;
  }
  body.cursor-hover .cursor-ring {
    width: 62px;
    height: 62px;
    border-color: var(--m-cyan);
    background-color: rgba(0, 102, 177, 0.12);
  }
  body.cursor-active .cursor-ring {
    width: 76px;
    height: 76px;
    border-color: var(--m-red);
    background-color: rgba(226, 35, 26, 0.18);
  }
}

@media (max-width: 1023px) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* ==========================================================================
   FIXED VIDEO BACKGROUND LAYER (GPU-ACCELERATED & ZERO-LAG)
   ========================================================================== */
.video-bg-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background-color: var(--bg-pitch);
  transform: translateZ(0);
  will-change: transform, opacity;
  transition: opacity 0.6s ease;
}

.video-bg-layer.dimmed {
  opacity: 0.35;
}

.car-video-element,
.car-canvas-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transform: translateZ(0);
  will-change: transform;
}

/* Headlight Light Rays Cone Shader Overlay */
.headlight-cone-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(200, 240, 255, 0.25) 0%, rgba(0, 102, 177, 0.1) 40%, transparent 70%);
  mix-blend-mode: screen;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.headlight-cone-overlay.active {
  opacity: 1;
}

.video-vignette-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 20vh;
  background: linear-gradient(180deg, rgba(6, 7, 9, 0.75) 0%, rgba(6, 7, 9, 0.25) 60%, transparent 100%);
  pointer-events: none;
  z-index: 3;
}

.video-vignette-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 22vh;
  background: linear-gradient(0deg, rgba(6, 7, 9, 0.8) 0%, rgba(6, 7, 9, 0.3) 60%, transparent 100%);
  pointer-events: none;
  z-index: 3;
}

.blueprint-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  background-image: 
    linear-gradient(rgba(0, 102, 177, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 177, 0.14) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 2;
}

.blueprint-grid-overlay.active {
  opacity: 1;
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3.5rem;
  z-index: 900;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, height 0.3s ease;
}

.site-nav.scrolled {
  background: rgba(6, 7, 9, 0.9);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  height: 66px;
}

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

.m-stripe-group {
  display: flex;
  height: 20px;
  transform: skewX(-20deg);
}
.m-stripe { width: 5px; height: 100%; }
.m-stripe.cyan { background-color: var(--m-cyan); }
.m-stripe.navy { background-color: var(--m-navy); }
.m-stripe.red  { background-color: var(--m-red); }

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.22em;
  border-left: 1px solid var(--border-subtle);
  padding-left: 0.6rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
  background: rgba(20, 23, 29, 0.65);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 1.6rem;
  border-radius: 9999px;
  backdrop-filter: var(--glass-blur);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text-white); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.audio-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-white);
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.audio-toggle-btn:hover {
  border-color: var(--m-cyan);
  background: rgba(0, 102, 177, 0.15);
}

.audio-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.audio-bar {
  width: 2px;
  background: var(--text-muted);
  height: 4px;
  transition: height 0.2s ease, background 0.2s ease;
}
.audio-playing .audio-bar {
  background: var(--m-cyan);
  animation: barPulse 0.8s infinite alternate ease-in-out;
}
.audio-playing .audio-bar:nth-child(1) { animation-delay: 0.1s; }
.audio-playing .audio-bar:nth-child(2) { animation-delay: 0.3s; }
.audio-playing .audio-bar:nth-child(3) { animation-delay: 0.5s; }

@keyframes barPulse {
  0% { height: 3px; }
  100% { height: 12px; }
}

.btn-cta-magnetic {
  background: linear-gradient(135deg, #1b2029 0%, #0d1016 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-white);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 0.6rem 1.4rem;
  border-radius: 9999px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}
.btn-cta-magnetic:hover {
  border-color: var(--m-red);
  box-shadow: 0 0 20px rgba(226, 35, 26, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   SCROLL-SCRUBBED STORYBOARD TRACK (EXPANDED TO 750vh FOR SLOW SMOOTH SCRUB)
   ========================================================================== */
.story-scroll-track {
  position: relative;
  z-index: 10;
  width: 100%;
}

.story-section {
  min-height: 180vh; /* Stretched for slow cinematic scroll pace */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 4.5rem 5rem 4.5rem;
  position: relative;
}

.story-section:first-child {
  min-height: 120vh;
}

.story-content-wrap {
  width: 100%;
  max-width: 1400px;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.flex-between { justify-content: space-between; }
.flex-center  { justify-content: center; align-items: center; }
.text-center  { text-align: center; }

/* --------------------------------------------------------------------------
   SECTION 1: THE ICON UNVEILED & START / REV ENGINE BUTTON
   -------------------------------------------------------------------------- */
.m1-content {
  max-width: 950px;
  margin-top: 2rem;
}

.m-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  backdrop-filter: var(--glass-blur);
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--m-cyan);
  box-shadow: 0 0 10px var(--m-cyan);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.m1-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5.5vw, 5.4rem);
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.95);
}

.m1-title .accent-cyan {
  color: transparent;
  background: linear-gradient(90deg, #ffffff 0%, var(--m-cyan) 85%);
  -webkit-background-clip: text;
  background-clip: text;
}

.m1-sub {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  margin-bottom: 2rem;
}

/* UNIQUE INTERACTION: START / STOP ENGINE ALUMINUM PUSH BUTTON */
.ignition-panel {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
}

.engine-start-btn {
  position: relative;
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2c303a 0%, #121419 65%, #08090b 100%);
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), inset 0 2px 5px rgba(255, 255, 255, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  user-select: none;
}

.engine-start-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(226, 35, 26, 0.4);
  animation: rotateRing 12s linear infinite;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.engine-start-btn.running::before {
  border-color: var(--m-red);
  border-style: solid;
  box-shadow: 0 0 25px var(--m-red-glow);
}

@keyframes rotateRing {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.engine-start-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 35px rgba(226, 35, 26, 0.45);
}

.engine-start-btn:active {
  transform: scale(0.96);
}

.start-btn-title {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-white);
  line-height: 1.1;
}

.start-btn-sub {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  letter-spacing: 0.15em;
  color: var(--m-red);
  margin-top: 3px;
  font-weight: 700;
}

.ignition-callout {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ignition-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-white);
}

.ignition-desc {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.m1-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.m1-quick-stats {
  display: flex;
  gap: 3rem;
}

.m1-stat-item {
  display: flex;
  flex-direction: column;
}

.m1-stat-val {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-white);
}

.m1-stat-unit {
  font-size: 0.9rem;
  color: var(--m-cyan);
}

.m1-stat-lbl {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.18em;
}

.scroll-indicator-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.scroll-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.scroll-mouse-icon {
  width: 22px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 9999px;
  position: relative;
}

.scroll-mouse-wheel {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 7px;
  background: var(--m-cyan);
  border-radius: 9999px;
  animation: mouseWheelMove 1.8s infinite ease-in-out;
}

@keyframes mouseWheelMove {
  0% { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 14px); opacity: 0; }
}

/* --------------------------------------------------------------------------
   SECTION 2: X-RAY HYBRID TELEMETRY & DRIVE MODE TOGGLE
   -------------------------------------------------------------------------- */
.m2-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.m2-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}

/* Drive Mode Switcher Pill */
.drive-mode-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem auto 0 auto;
}

.drive-mode-btn {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.15em;
  transition: all 0.25s ease;
}

.drive-mode-btn.active, .drive-mode-btn:hover {
  color: var(--text-white);
  border-color: var(--m-cyan);
  background: rgba(0, 102, 177, 0.2);
  box-shadow: 0 0 15px var(--m-cyan-glow);
}

.drive-mode-btn.mode-sport.active {
  border-color: var(--m-red);
  background: rgba(226, 35, 26, 0.2);
  box-shadow: 0 0 15px var(--m-red-glow);
}

.m2-hud-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 2rem auto;
  gap: 2rem;
}

.hud-card {
  width: 380px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.8rem 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.hud-card:hover {
  transform: translateY(-4px);
}

.hud-card.card-orange {
  border-left: 4px solid var(--m-orange);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 102, 0, 0.2);
}

.hud-card.card-cyan {
  border-left: 4px solid var(--m-cyan);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 25px rgba(0, 102, 177, 0.22);
}

.hud-card-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.card-orange .hud-card-badge { color: var(--m-orange); }
.card-cyan   .hud-card-badge { color: var(--m-cyan); }

.hud-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hud-card-specs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
}

.hud-card-specs li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.hud-card-specs li span {
  color: var(--text-white);
  font-weight: 700;
}

.m2-bottom-banner {
  margin: 0 auto;
  max-width: 900px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--m-gold);
  border-radius: 9999px;
  padding: 0.85rem 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px var(--m-gold-glow);
  text-align: center;
}

.gold-stat-txt {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-white);
}
.gold-stat-txt span { color: var(--m-gold); }

/* --------------------------------------------------------------------------
   SECTION 3: AERODYNAMIC PROFILE & HEADLIGHT BEAMS
   -------------------------------------------------------------------------- */
.m3-top { max-width: 650px; }

.m3-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.2vw, 4.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 1rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}

.m3-desc {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  margin-bottom: 1.5rem;
}

.headlight-toggle-btn {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.6rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.25s ease;
}

.headlight-toggle-btn:hover, .headlight-toggle-btn.active {
  border-color: var(--m-cyan);
  background: rgba(0, 102, 177, 0.2);
  box-shadow: 0 0 15px var(--m-cyan-glow);
}

.m3-bottom-strip {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.m3-badge-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.1rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.m3-val {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-white);
}
.m3-val span { color: var(--m-cyan); font-size: 0.9rem; }

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

/* --------------------------------------------------------------------------
   SECTION 4: UNLEASH THE RUSH & INTERACTIVE RPM SOUNDBOARD
   -------------------------------------------------------------------------- */
.m4-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.m4-badge {
  color: var(--m-red);
  border-color: rgba(226, 35, 26, 0.4);
}

.m4-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5.5vw, 5.4rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: 1rem;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.95);
}

.m4-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  color: var(--text-muted);
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Interactive Soundboard Controls */
.soundboard-panel {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.btn-roar-wave {
  background: radial-gradient(circle at center, #2e1010 0%, #170808 100%);
  border: 2px solid var(--m-red);
  color: var(--text-white);
  padding: 1.1rem 2.6rem;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  box-shadow: 0 0 35px var(--m-red-glow);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  user-select: none;
}

.btn-roar-wave:hover {
  transform: scale(1.06);
  box-shadow: 0 0 50px rgba(226, 35, 26, 0.85);
}
.btn-roar-wave:active { transform: scale(0.96); }

.btn-launch-mode {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--m-gold);
  color: var(--text-white);
  padding: 1.1rem 2rem;
  border-radius: 9999px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 20px var(--m-gold-glow);
  transition: all 0.2s ease;
}

.btn-launch-mode:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px var(--m-gold-glow);
}

/* STICKY BOTTOM SCRUB PROGRESS BAR */
.video-scrub-timeline {
  position: fixed;
  bottom: 1.5rem;
  left: 4.5rem;
  right: 4.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  z-index: 100;
  pointer-events: auto;
  transition: opacity 0.4s ease;
  user-select: none;
}

.video-scrub-timeline.hidden {
  opacity: 0;
  pointer-events: none;
}

.scrub-time-readout {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.scrub-track-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: height 0.2s ease, background 0.2s ease;
}

.scrub-track-bar:hover {
  height: 10px;
  background: rgba(255, 255, 255, 0.25);
}

.scrub-track-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--m-cyan) 0%, var(--m-red) 100%);
  transition: width 0.05s linear;
}

/* ==========================================================================
   POST-VIDEO FLOWING SECTIONS (SPECS, GALLERY, CTA)
   ========================================================================== */
.specs-section {
  position: relative;
  z-index: 10;
  width: 100%;
  background: var(--bg-carbon);
  padding: 7rem 4rem 4rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-head-center {
  text-align: center;
  max-width: 800px;
  margin-bottom: 4rem;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--m-cyan);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: block;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.8vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.section-desc {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.specs-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.8rem;
  width: 100%;
  max-width: 1400px;
}

.carbon-spec-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2.4rem 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.carbon-spec-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: background 0.3s ease;
}

.carbon-spec-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-active);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.85);
}

.carbon-spec-card:nth-child(1):hover::before { background: var(--m-orange); }
.carbon-spec-card:nth-child(2):hover::before { background: var(--m-cyan); }
.carbon-spec-card:nth-child(3):hover::before { background: var(--m-red); }
.carbon-spec-card:nth-child(4):hover::before { background: var(--m-gold); }

.card-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
}

.card-spec-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.card-spec-primary {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.1;
  margin-bottom: 1rem;
}
.card-spec-primary span { font-size: 1rem; color: var(--m-cyan); }

.card-spec-body {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   COLOR CUSTOMIZER & GALLERY
   -------------------------------------------------------------------------- */
.customizer-section {
  position: relative;
  z-index: 10;
  width: 100%;
  background: var(--bg-pitch);
  padding: 6rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.customizer-container {
  width: 100%;
  max-width: 1400px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
}

.gallery-stage-view {
  position: relative;
  width: 100%;
  height: 540px;
  overflow: hidden;
  background: #0a0c10;
}

.gallery-stage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-badge {
  position: absolute;
  top: 2rem;
  left: 2rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.45rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--text-white);
}

.customizer-controls-bar {
  padding: 2rem 3rem;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.color-picker-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.color-lbl {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.color-active-name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-white);
}

.swatch-group {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.swatch-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}
.swatch-btn:hover { transform: scale(1.15); }
.swatch-btn.active {
  transform: scale(1.22);
  border-color: var(--text-white);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.45);
}

.gallery-thumb-buttons {
  display: flex;
  gap: 0.65rem;
}

.thumb-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.thumb-btn.active, .thumb-btn:hover {
  border-color: var(--m-cyan);
  color: var(--text-white);
  background: rgba(0, 102, 177, 0.15);
}

/* --------------------------------------------------------------------------
   STICKY FOOTER CTA (M TRI-COLOR BORDER)
   -------------------------------------------------------------------------- */
.footer-cta-section {
  position: relative;
  z-index: 10;
  width: 100%;
  background: var(--bg-pitch);
  padding: 6rem 4rem 3rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.m-tricolor-cta-card {
  position: relative;
  width: 100%;
  max-width: 1400px;
  background: var(--bg-surface);
  border-radius: 24px;
  padding: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
  margin-bottom: 5rem;
}

/* Glowing BMW M Tri-Color Border */
.m-tricolor-cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(135deg, var(--m-cyan) 0%, var(--m-navy) 40%, var(--m-red) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  box-shadow: 0 0 30px rgba(0, 102, 177, 0.35);
}

.cta-left { max-width: 650px; }

.cta-title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.cta-desc {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.cta-action-buttons {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}

.btn-primary-m {
  background: var(--m-red);
  color: var(--text-white);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 1rem 2.4rem;
  border-radius: 9999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(226, 35, 26, 0.4);
  transition: all 0.25s ease;
}
.btn-primary-m:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px rgba(226, 35, 26, 0.7);
}

.btn-secondary-m {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-active);
  color: var(--text-white);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 1rem 2.4rem;
  border-radius: 9999px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-secondary-m:hover {
  border-color: var(--m-cyan);
  background: rgba(0, 102, 177, 0.15);
}

.site-footer {
  width: 100%;
  max-width: 1400px;
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.footer-social-links {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  transition: color 0.2s ease;
}
.footer-link:hover { color: var(--m-cyan); }

/* --------------------------------------------------------------------------
   MODAL & TOASTS
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 7, 0.88);
  backdrop-filter: blur(25px);
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  border-radius: 24px;
  width: 100%;
  max-width: 580px;
  padding: 3rem;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
  transform: translateY(30px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open .modal-card { transform: translateY(0) scale(1); }

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  color: var(--m-cyan);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.modal-sub {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-white);
  outline: none;
  transition: border-color 0.2s ease;
}
.form-input:focus {
  border-color: var(--m-cyan);
  box-shadow: 0 0 12px var(--m-cyan-glow);
}

.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--m-cyan);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-notice.show { transform: translateY(0); opacity: 1; }

/* ==========================================================================
   MULTI-DEVICE RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1023px) {
  .site-nav { padding: 0 2rem; }
  .nav-links { display: none; }
  .story-section { padding: 5rem 2.5rem 3rem 2.5rem; min-height: 130vh; }
  
  .m2-hud-container {
    flex-direction: column;
    gap: 1.25rem;
    align-items: stretch;
  }
  .hud-card { width: 100%; padding: 1.25rem 1.5rem; }
  
  .specs-grid-4col { grid-template-columns: repeat(2, 1fr); }
  .m-tricolor-cta-card { flex-direction: column; text-align: center; padding: 3rem 2rem; }
  .cta-action-buttons { justify-content: center; width: 100%; }
  .customizer-controls-bar { flex-direction: column; gap: 1.5rem; align-items: stretch; }
  .video-scrub-timeline { left: 2rem; right: 2rem; }
}

@media (max-width: 767px) {
  :root {
    --glass-blur: blur(8px);
  }
  .grain-overlay { display: none !important; }
  .site-nav { padding: 0 1.25rem; height: 58px; }
  .brand-sub { display: none; }
  .btn-cta-magnetic { display: none; }
  
  .story-section { padding: 4.8rem 1.25rem 4.5rem 1.25rem; min-height: 100vh; }
  .story-content-wrap { min-height: 80vh; justify-content: space-between; }

  /* Section 1 Mobile */
  .m1-content { margin-top: 0; display: flex; flex-direction: column; justify-content: space-between; min-height: 75vh; width: 100%; }
  .m1-title { font-size: 1.85rem; line-height: 1.1; margin-bottom: 0.4rem; }
  .m1-sub { font-size: 0.85rem; margin-bottom: 0.5rem; }
  .m-badge-pill { font-size: 0.62rem; padding: 0.3rem 0.75rem; margin-bottom: 0.75rem; }
  .ignition-panel {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    margin-bottom: 2.2rem;
    background: rgba(14, 17, 23, 0.85);
    backdrop-filter: var(--glass-blur);
    padding: 0.6rem 1rem;
    border-radius: 9999px;
    border: 1px solid var(--border-subtle);
    width: fit-content;
  }
  .engine-start-btn { width: 56px; height: 56px; min-width: 56px; }
  .start-btn-title { font-size: 0.52rem; }
  .start-btn-sub { font-size: 0.42rem; }
  .ignition-title { font-size: 0.72rem; }
  .ignition-desc { font-size: 0.58rem; }
  .m1-quick-stats { display: none; }
  .scroll-indicator-wrap { display: none; }

  /* Section 2 Mobile */
  .m2-title { font-size: 1.6rem; }
  .drive-mode-bar { gap: 0.4rem; margin-top: 0.6rem; }
  .drive-mode-btn { font-size: 0.6rem; padding: 0.35rem 0.8rem; }
  .m2-hud-container { flex-direction: column; gap: 0.6rem; margin: 0.75rem 0; }
  .hud-card { padding: 0.75rem 1rem; }
  .hud-card-title { font-size: 0.95rem; margin-bottom: 0.25rem; }
  .hud-card-specs { display: none; }
  .m2-bottom-banner { padding: 0.5rem 1rem; font-size: 0.68rem; margin-bottom: 2rem; }

  /* Section 3 Mobile */
  .m3-title { font-size: 1.7rem; line-height: 1.1; }
  .m3-desc { font-size: 0.78rem; margin: 0.5rem 0 0.85rem 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .headlight-toggle-btn { font-size: 0.68rem; padding: 0.45rem 0.9rem; }
  .m3-bottom-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 2.2rem; }
  .m3-badge-card { padding: 0.55rem 0.75rem; }
  .m3-val { font-size: 1.05rem; }
  .m3-lbl { font-size: 0.52rem; }

  /* Section 4 Mobile */
  .m4-wrap { display: flex; flex-direction: column; justify-content: space-between; min-height: 75vh; width: 100%; }
  .m4-title { font-size: 1.85rem; }
  .m4-sub { font-size: 0.72rem; margin-bottom: 0.5rem; }
  .soundboard-panel { flex-direction: column; gap: 0.75rem; width: 100%; max-width: 280px; margin: auto auto 2.2rem auto; }
  .btn-roar-wave, .btn-launch-mode { width: 100%; justify-content: center; padding: 0.8rem 1.4rem; font-size: 0.75rem; }

  /* Sticky Bottom Scrub Bar on Mobile */
  .video-scrub-timeline {
    left: 1rem;
    right: 1rem;
    bottom: 0.75rem;
    padding: 0.4rem 0.8rem;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .scrub-time-readout { font-size: 0.62rem; }

  /* Flowing Sections on Mobile */
  .specs-section, .customizer-section, .footer-cta-section { padding: 3.5rem 1.25rem; }
  .specs-grid-4col { grid-template-columns: 1fr; }
  .gallery-stage-view { height: 260px; }
  .customizer-controls-bar { padding: 1.25rem 1rem; }
  .m-tricolor-cta-card { padding: 2rem 1.25rem; }
  .cta-action-buttons { flex-direction: column; }
  .site-footer { flex-direction: column; gap: 1.25rem; text-align: center; }
}
