:root {
  --lockup-width: clamp(240px, 68vw, 440px);
  --flare-blue: rgba(90, 145, 255, 0.95);
  --flare-cyan: rgba(165, 215, 255, 1);
  --flare-white: rgba(255, 255, 255, 1);
}

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

html,
body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background-color: #000000;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.intro-active {
  overflow: hidden;
}

/* ==========================================================================
   Shared Logo Lockup Geometry (Mobile-Responsive)
   ========================================================================== */
.logo-lockup {
  position: relative;
  width: var(--lockup-width);
  aspect-ratio: 328 / 275;
  user-select: none;
  pointer-events: none;
}

.logo-layer {
  position: absolute;
  display: block;
  height: auto;
  will-change: transform, opacity, filter, mask-position, -webkit-mask-position;
}

/* 1. CADE CUNNINGHAM AS (1024x102) */
.logo-cade {
  width: 100.98%;
  left: -0.39%;
  top: 0%;
  z-index: 3;
}

/* 2. DEUCE (1024x544) */
.logo-deuce {
  width: 126.26%;
  left: -25.28%;
  top: -12.5%;
  z-index: 2;
}

/* 3. SANGFROID (1025x496) - Positioned down with clear spacing below DEUCE */
.logo-sangfroid {
  width: 111.90%;
  left: -0.55%;
  top: 46%;
  z-index: 1;
}

/* 4. SANGFROID Meaning / Definition underneath the SANGFROID graphic */
.sangfroid-meaning {
  position: absolute;
  top: 106%;
  left: 50%;
  transform: translateX(-50%);
  width: min(88vw, 480px);
  text-align: center;
  color: rgba(226, 232, 240, 0.9);
  font-size: clamp(0.78rem, 2.2vw, 0.96rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 12px rgba(59, 130, 246, 0.35);
  z-index: 4;
}

/* ==========================================================================
   Homepage (Loaded Underneath - Visible & Interactive at 4s on Black Background)
   ========================================================================== */
.homepage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: hidden;
  z-index: 1;
}

/* Post-Video Background Image (Fades in once the video ends) */
.homepage-bg {
  position: fixed;
  inset: 0;
  background-image: url("img/background.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.06);
  transition:
    opacity 1.15s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.homepage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 45%,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

.homepage.post-video .homepage-bg {
  opacity: 1;
  transform: scale(1);
}

.homepage-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 682px;
  min-height: calc(100dvh - 4rem);
  position: relative;
  z-index: 2;
}

/* Match the exact visual balance of the reference image */
.homepage .logo-lockup {
  pointer-events: auto;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.homepage.post-video .logo-lockup {
  transform: translateY(clamp(-4.2rem, -7vh, -2.5rem));
}

/* Post-Video LIVEON.png Graphic (Slides up underneath SANGFROID meaning once video ends) */
.liveon-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(var(--lockup-width) * 0.48 + 3.4rem));
  width: clamp(220px, 66vw, 430px);
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}

.liveon-graphic {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transform: translateY(56px);
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.75));
  transition:
    opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.2s,
    transform 1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.homepage.post-video .liveon-graphic {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle interactive replay button (fades in after intro finishes) */
.replay-btn {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.replay-btn.visible {
  opacity: 0.75;
  transform: translateY(0);
}

.replay-btn:hover {
  opacity: 1;
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 4px 18px rgba(59, 130, 246, 0.35);
}

/* ==========================================================================
   Intro Overlay (0s - 4s Animation Sequence)
   ========================================================================== */
.intro-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, #0a1124 0%, #040711 55%, #010206 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 0-1s: Subtle Ambient Radial Gradient Glow Emerging from Center */
.ambient-glow {
  position: absolute;
  width: min(85vw, 620px);
  height: min(85vw, 620px);
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(88, 148, 255, 0.42) 0%,
    rgba(56, 108, 235, 0.22) 32%,
    rgba(25, 52, 130, 0.08) 60%,
    rgba(0, 0, 0, 0) 75%
  );
  filter: blur(36px);
  opacity: 0;
  transform: scale(0.45);
  transition:
    opacity 0.95s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1s ease;
  pointer-events: none;
  z-index: 1;
}

/* Soft halo glow behind full logo lockup during 2-3s */
.logo-soft-glow {
  position: absolute;
  width: calc(var(--lockup-width) * 1.35);
  height: calc(var(--lockup-width) * 0.95);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(140, 195, 255, 0.5) 0%,
    rgba(75, 135, 255, 0.28) 42%,
    rgba(30, 64, 175, 0) 75%
  );
  filter: blur(28px);
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 2;
}

/* 1-2s: Bright Horizontal Anamorphic Lens Flare Sweeping Across Screen */
.lens-flare {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(140vw, 1100px);
  height: 180px;
  transform: translate(-130%, -50%) scaleX(0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  mix-blend-mode: screen;
}

/* Horizontal streak of the lens flare */
.lens-flare::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 6px;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    rgba(59, 130, 246, 0) 0%,
    rgba(96, 165, 250, 0.65) 25%,
    rgba(255, 255, 255, 1) 50%,
    rgba(96, 165, 250, 0.65) 75%,
    rgba(59, 130, 246, 0) 100%
  );
  box-shadow:
    0 0 18px 4px rgba(147, 197, 253, 0.95),
    0 0 42px 12px rgba(59, 130, 246, 0.75);
  filter: blur(1px);
}

/* Glowing core hotspot of the lens flare */
.lens-flare::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 110px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 1) 0%,
    rgba(191, 219, 254, 0.9) 22%,
    rgba(59, 130, 246, 0.45) 52%,
    rgba(30, 58, 138, 0) 78%
  );
  filter: blur(6px);
}

/* 3-4s: Expanding Gradient Flash */
.gradient-flash {
  position: absolute;
  inset: -25%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(165, 210, 255, 0.65) 22%,
    rgba(59, 130, 246, 0.28) 48%,
    rgba(0, 0, 0, 0) 75%
  );
  opacity: 0;
  transform: scale(0.15);
  filter: blur(20px);
  pointer-events: none;
  z-index: 8;
  mix-blend-mode: screen;
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.75s ease;
}

/* ==========================================================================
   Intro Logo Layers & CSS Radial/Linear Masks + Blur Filters
   ========================================================================== */
.intro-overlay .logo-lockup {
  z-index: 4;
}

/* Stage 1 target: CADE CUNNINGHAM AS emerging from center with radial mask */
.intro-overlay .logo-cade {
  opacity: 0;
  transform: scale(0.92);
  filter: blur(8px) drop-shadow(0 0 14px rgba(147, 197, 253, 0.85));
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0, 0, 0, 0.85) 45%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0, 0, 0, 0.85) 45%, transparent 75%);
  -webkit-mask-size: 30% 300%;
  mask-size: 30% 300%;
  -webkit-mask-position: 50% 50%;
  mask-position: 50% 50%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-mask-size 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    mask-size 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stage 2 target: DEUCE revealed by horizontal lens flare sweep using mask */
.intro-overlay .logo-deuce {
  opacity: 0;
  transform: scale(0.97);
  filter: blur(6px) drop-shadow(0 0 20px rgba(96, 165, 250, 0.75));
  -webkit-mask-image: linear-gradient(
    90deg,
    #000 0%,
    #000 42%,
    rgba(0, 0, 0, 0.5) 52%,
    transparent 62%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    #000 0%,
    #000 42%,
    rgba(0, 0, 0, 0.5) 52%,
    transparent 62%,
    transparent 100%
  );
  -webkit-mask-size: 260% 100%;
  mask-size: 260% 100%;
  -webkit-mask-position: 100% 0%;
  mask-position: 100% 0%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition:
    opacity 0.25s ease,
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-mask-position 0.95s cubic-bezier(0.25, 0.8, 0.25, 1),
    mask-position 0.95s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Stage 3 target: SANGFROID slight scale + soft glow + radial mask reveal */
.intro-overlay .logo-sangfroid {
  opacity: 0;
  transform: scale(0.86) translateY(6px);
  filter: blur(7px) drop-shadow(0 0 22px rgba(147, 197, 253, 0.9));
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, #000 60%, transparent 90%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, #000 60%, transparent 90%);
  -webkit-mask-size: 40% 250%;
  mask-size: 40% 250%;
  -webkit-mask-position: 50% 50%;
  mask-position: 50% 50%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-mask-size 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    mask-size 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.intro-overlay .sangfroid-meaning {
  opacity: 0;
  transform: translate(-50%, 10px);
  filter: blur(5px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s,
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s,
    filter 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}

/* ==========================================================================
   JavaScript-Controlled Timeline States
   ========================================================================== */

/* 1. 0–1 second: Dark screen with subtle gradient glow & Cade center */
.intro-overlay.stage-1 .ambient-glow {
  opacity: 1;
  transform: scale(1);
}

.intro-overlay.stage-1 .logo-cade {
  opacity: 1;
  transform: scale(1);
  filter: blur(0px) drop-shadow(0 0 10px rgba(147, 197, 253, 0.55));
  -webkit-mask-size: 260% 300%;
  mask-size: 260% 300%;
}

/* 2. 1–2 seconds: Bright horizontal lens flare sweeps across, revealing Deuce */
.intro-overlay.stage-2 .lens-flare {
  animation: flareSweep 1s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.intro-overlay.stage-2 .logo-deuce {
  opacity: 1;
  transform: scale(1);
  filter: blur(0px) drop-shadow(0 0 14px rgba(147, 197, 253, 0.45));
  -webkit-mask-position: 0% 0%;
  mask-position: 0% 0%;
}

@keyframes flareSweep {
  0% {
    opacity: 0;
    transform: translate(-115%, -50%) scaleX(0.4);
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(35%, -50%) scaleX(1.1);
  }
}

/* 3. 2–3 seconds: Full logo visible with soft glow & slight scale SANGFROID animation */
.intro-overlay.stage-3 .logo-soft-glow {
  opacity: 1;
  transform: scale(1.08);
}

.intro-overlay.stage-3 .ambient-glow {
  transform: scale(1.2);
  filter: blur(30px);
}

.intro-overlay.stage-3 .logo-lockup {
  animation: lockupPulse 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-overlay.stage-3 .logo-sangfroid {
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: blur(0px) drop-shadow(0 0 14px rgba(147, 197, 253, 0.5));
  -webkit-mask-size: 280% 300%;
  mask-size: 280% 300%;
}

.intro-overlay.stage-3 .sangfroid-meaning {
  opacity: 1;
  transform: translate(-50%, 0);
  filter: blur(0px);
}

@keyframes lockupPulse {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

/* 4. 3–4 seconds: Light expands into a gradient flash, and intro smoothly fades away */
.intro-overlay.stage-4 .gradient-flash {
  opacity: 1;
  transform: scale(1.6);
  filter: blur(0px);
}

.intro-overlay.stage-4 .logo-cade,
.intro-overlay.stage-4 .logo-deuce,
.intro-overlay.stage-4 .logo-sangfroid {
  filter: blur(0px) drop-shadow(0 0 2px rgba(59, 130, 246, 0.15));
}

.intro-overlay.stage-fadeout {
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   Video Lightbox Popup Modal
   Video Lightbox Popup Modal (Full Screen)
   ========================================================================== */
.video-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  padding: 0;
  background: #000000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.video-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(10, 18, 40, 0.85) 0%,
    rgba(0, 0, 0, 0.94) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: #000000;
}

.video-lightbox-content {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  transform: scale(0.98);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-lightbox.is-open .video-lightbox-content {
  transform: scale(1);
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #000000;
  border: none;
}

.lightbox-video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  background: #000000;
  outline: none;
}

.video-lightbox-unmute {
  position: fixed;
  top: 1.25rem;
  right: 4.5rem;
  z-index: 10;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.video-lightbox-unmute.visible {
  opacity: 1;
  pointer-events: auto;
}

.video-lightbox-unmute:hover {
  background: rgba(59, 130, 246, 0.85);
  border-color: rgba(147, 197, 253, 0.6);
  transform: scale(1.04);
}

.video-lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.video-lightbox-close:hover {
  background: rgba(59, 130, 246, 0.85);
  border-color: rgba(147, 197, 253, 0.6);
  transform: scale(1.06);
}

/* ==========================================================================
   Mobile & Tablet Responsiveness
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --lockup-width: clamp(230px, 76vw, 360px);
  }

  .ambient-glow {
    width: 92vw;
    height: 92vw;
    filter: blur(28px);
  }

  .lens-flare {
    width: 160vw;
    height: 130px;
  }

  .lens-flare::after {
    width: 150px;
    height: 80px;
  }
}

@media (max-width: 480px) {
  :root {
    --lockup-width: clamp(210px, 80vw, 310px);
  }

  .replay-btn {
    bottom: 0.9rem;
    right: 0.9rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.72rem;
  }

  .video-lightbox-unmute {
    top: 0.9rem;
    right: 3.75rem;
    height: 2.25rem;
    padding: 0 0.85rem;
    font-size: 0.72rem;
  }

  .video-lightbox-close {
    top: 0.9rem;
    right: 0.9rem;
    width: 2.25rem;
    height: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-overlay,
  .ambient-glow,
  .logo-soft-glow,
  .gradient-flash,
  .logo-layer {
    transition-duration: 0.2s !important;
    animation-duration: 0.2s !important;
  }
}

