/* =============================================================
   CINEMATIC SCROLL SECTION
   ============================================================= */

.cinematic-section {
  /* scroll distance - controls how long the pin lasts */
  height: 3500px;
  position: relative;
}

.cinematic-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas fills the sticky container */
#frame-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  filter: blur(0px);
  transition: filter 0.4s ease;
}

/* Live video — same position/size as canvas, crossfades on top */
.cinematic-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;           /* above image (2) and canvas (1) */
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

/* Background image — behind the video, above the canvas */
.cinematic-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

/* ── Overlay copy ──────────────────────────────────────────── */
.cinematic-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0 6vw 8vh;
  pointer-events: none;
  z-index: 5;
}

.cinematic-sub {
  font-family: 'Theinhardt', sans-serif;
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
  max-width: 36ch;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(20px);
  will-change: transform, opacity;
}

/* ── Progress bar ──────────────────────────────────────────── */
.cinematic-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 20;
}

.cinematic-progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.05s linear;
  will-change: width;
}

/* ── Subtle vignette ───────────────────────────────────────── */
.cinematic-sticky::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0, 0, 0, 0.45) 100%
  );
  pointer-events: none;
  z-index: 4;
}

/* Page-background gradient fades removed */
.cinematic-fade {
  display: none;
}

/* ── Mobile ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Shorter scroll distance on mobile */
  .cinematic-section {
    height: 2200px;
  }

  /* Use consistent 100vh sticky viewport to prevent GSAP pin spacing gaps on mobile. 
     The removed gradient fades mean full height is cleaner anyway. */
  .cinematic-sticky {
    top: 0;
  }

  /* Canvas inherits the smaller sticky height, so it draws at that size */
  #frame-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  /* Re-position overlay text inside the smaller box */
  .cinematic-overlay {
    padding: 0 5vw 5vh;
  }

  .cinematic-eyebrow {
    font-size: 0.55rem;
    letter-spacing: 0.2em;
  }

  .cinematic-headline {
    font-size: clamp(1.6rem, 7vw, 2.8rem);
    margin-bottom: 0.8rem;
  }

  .cinematic-sub {
    font-size: 0.8rem;
  }
}
