:root {
  --m-blue: #1e5aa8;
  --m-light: #52b7e8;
  --m-red: #e2231a;
}

/* native smooth-scroll deliberately NOT used — it fights GSAP's
   ScrollTrigger scrub on the pinned helmet360/hero sections, causing
   stutter during the scrub. GSAP owns scroll-linked motion instead. */
html {
  scroll-behavior: auto;
}

body {
  background: #000;
}

/* big outlined "Performance" word, echoes the outlined title treatment in the reference layout */
.text-outline {
  -webkit-text-stroke: 1.5px #ffffff;
  color: transparent;
}

@media (max-width: 767px) {
  .text-outline {
    -webkit-text-stroke: 1px #ffffff;
  }
}

.hero-title .line-inner {
  will-change: transform;
}

/* rider head-turn: two-zone trigger, plays through the frame sequence */
.rider-stage {
  opacity: 0;
}
#rider-canvas {
  filter: saturate(1.05) contrast(1.03);
}
.rider-overlay {
  background:
    linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0.75) 28%, rgba(0, 0, 0, 0.15) 58%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 22%);
}

/* helmet 360: scroll-pinned rotation with feature callouts */
#helmet360-canvas {
  filter: saturate(1.05) contrast(1.03);
}
.helmet360-vignette {
  background:
    linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.35) 22%, rgba(0, 0, 0, 0) 42%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 76%, rgba(0, 0, 0, 0.55) 100%),
    radial-gradient(ellipse 80% 75% at center, transparent 55%, rgba(0, 0, 0, 0.3) 100%);
}
.helmet-callout {
  position: relative;
  will-change: opacity;
}
/* legibility backdrop behind each callout, same treatment as the hero specs box */
.helmet-callout::before {
  content: "";
  position: absolute;
  inset: -0.75rem -1rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
  z-index: -1;
}

/* helmet 360: preload progress ring, fades out once the sequence is ready */
.helmet360-loader {
  transition: opacity 0.5s ease;
}
.helmet360-loader.is-loaded {
  opacity: 0;
}
.helmet360-loader-ring {
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--m-light);
  animation: helmetLoaderSpin 0.85s linear infinite;
}
@keyframes helmetLoaderSpin {
  to { transform: rotate(360deg); }
}
.callout-connector,
.connector-source {
  opacity: 0;
}
.connector-source {
  filter: drop-shadow(0 0 4px currentColor);
}

/* subtle legibility backdrop behind the spec numbers */
.specs {
  position: relative;
}
.specs::before {
  content: "";
  position: absolute;
  inset: -1rem -1rem;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
  border-radius: 0.5rem;
}

@media (min-width: 768px) {
  .specs::before {
    inset: -1.5rem -1rem;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.55), transparent 85%);
  }
}

/* tricolor top bar segments */
.stripe {
  transform: scaleX(0);
}
.stripe-blue { background: var(--m-blue); }
.stripe-light { background: var(--m-light); }
.stripe-red { background: var(--m-red); }

/* mobile menu overlay */
.mobile-menu {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}
.mobile-menu-link {
  opacity: 0.9;
  transition: opacity 0.2s ease;
}
.mobile-menu-link:active {
  opacity: 0.6;
}
.mobile-menu-btn[aria-expanded="true"] .mobile-menu-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}
.mobile-menu-btn[aria-expanded="true"] .mobile-menu-bar:last-child {
  width: 1.5rem;
  transform: translateY(-3.5px) rotate(-45deg);
}

/* CTA button in navbar */
.cta-btn {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 1px solid var(--m-light);
}
.cta-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--m-light);
  transform: translateX(-101%);
  transition: transform 0.35s ease;
  z-index: 0;
}
.cta-btn:hover::before {
  transform: translateX(0);
}
.cta-btn:hover {
  color: #000;
}

/* explore link glow ring */
.arrow-box {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.explore-link:hover .arrow-box,
.heritage-link:hover .arrow-box,
.models-link:hover .arrow-box {
  border-color: var(--m-red);
  box-shadow: 0 0 14px rgba(82, 183, 232, 0.45);
}

/* solid CTA button, used for the primary action in the closing CTA section */
.cta-btn-solid {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--m-red);
  border: 1px solid var(--m-red);
  transition: background 0.3s ease, color 0.3s ease;
}
.cta-btn-solid:hover {
  background: transparent;
  color: var(--m-red);
}

/* models section: blend the product photo into the page background */
.models-media {
  aspect-ratio: 4 / 5;
}
.models-media-fade {
  background:
    linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 18%),
    linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0) 18%),
    linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0) 12%),
    linear-gradient(to left, #000 0%, rgba(0, 0, 0, 0) 12%);
}

/* gallery bento grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 220px;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 260px;
    gap: 1rem;
  }
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.gallery-item:hover img {
  transform: scale(1.06);
}
.gallery-item-tall {
  grid-row: span 2;
}
.gallery-item-wide {
  grid-column: span 2;
}
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 35%);
  pointer-events: none;
}
/* video feature: full-bleed autoplay video, cropped to always cover the frame.
   The parent gets its own stacking context (isolation) so the shadow overlay
   composites cleanly against the cross-origin iframe instead of z-fighting it. */
.video-feature-frame {
  isolation: isolate;
  background: #000000;
}
.video-feature-frame iframe.video-feature-iframe {
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw; /* 16:9 */
  min-height: 100%;
  min-width: 177.78vh; /* 16:9 */
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 1.2s ease;
}
/* the iframe itself fades in once the YouTube chrome (title/controls/end-card)
   flash has settled, rather than masking it with an overlay.
   Selector specificity matches the base rule above so this override actually wins. */
.video-feature-frame iframe.video-feature-iframe.is-visible {
  opacity: 1;
}
.video-feature-shadow {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, 0.4) 100%);
}

.gallery-caption {
  position: absolute;
  left: 1rem;
  bottom: 0.85rem;
  z-index: 1;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

/* video band: ambient looping clip, faded into the page at the left/right edges */
.video-frame {
  background: #000;
}
.video-fade-x {
  background:
    linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0) 12%, rgba(0, 0, 0, 0) 88%, #000 100%);
}

/* CTA section ambient glow */
.cta-section {
  position: relative;
}
.cta-glow {
  background:
    radial-gradient(ellipse 60% 80% at 20% 20%, rgba(30, 90, 168, 0.35), transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(226, 35, 26, 0.25), transparent 60%);
}

/* footer */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-link {
  color: var(--color-mist, #b8bec7);
  transition: color 0.2s ease;
}
.footer-link:hover {
  color: #fff;
}
.footer-social {
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.footer-social:hover {
  border-color: var(--m-light);
  color: var(--m-light);
}

/* ambient pulse on accent stripes + cta, subtle, looping */
@keyframes mGlowPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(82, 183, 232, 0); }
  50% { box-shadow: 0 0 18px rgba(82, 183, 232, 0.35); }
}
.pulse-glow {
  animation: mGlowPulse 3.2s ease-in-out infinite;
}

/* scroll cue line loop */
@keyframes scrollLine {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0); opacity: 0; }
}
.scroll-line {
  animation: scrollLine 2.2s ease-in-out infinite;
}

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