/* Hero Section */
.hero-scroll-container {
  height: 500vh;
  position: relative;
}

.hero-viewport {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--color-bg-dark);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s;
}

.hero-video.loaded {
  opacity: 1;
}

/* Dark, mostly-desaturated overlay with just a hint of blue -
   tuned to keep the video's own color (sunset, metal, sky) coming through. */
.hero-darken {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6,7,10,0.55) 0%, rgba(6,7,10,0.08) 28%, rgba(6,7,10,0.14) 58%, rgba(6,7,10,0.72) 100%),
    linear-gradient(0deg, rgba(33,36,49,0.14), rgba(33,36,49,0.14));
  z-index: var(--z-hero-overlay, 5);
  pointer-events: none;
}

.hero-placeholders {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-placeholder__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.8s ease, transform 6s ease;
}

.hero-placeholder__slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: var(--z-hero-content, 10);
}

/* Desktop: each slide is scroll-scrubbed by JS (opacity + translateY set
   per-frame in scroll-video.js), so no CSS transition here - it would lag
   behind the scroll instead of tracking it 1:1. Position varies per slide
   via the modifier classes below. */
.hero-slide {
  position: absolute;
  max-width: 560px;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-slide--pos-left {
  left: 10vw;
  top: 40%;
}

.hero-slide--pos-right {
  right: 10vw;
  top: 30%;
  text-align: right;
}

.hero-slide--pos-bottom {
  left: 10vw;
  bottom: 16vh;
}

.hero-slide--pos-center {
  left: 50%;
  top: 28%;
  text-align: center;
}

.hero-slide--pos-right .hero-slide__description {
  margin-left: auto;
}

.hero-slide--pos-center .hero-slide__description {
  margin-left: auto;
  margin-right: auto;
}

/* Mobile fallback only (desktop is driven by inline styles from JS) */
.hero-slide.active {
  opacity: 1;
}

.hero-slide__eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 16px;
}

.hero-slide__heading {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 64px);
  color: var(--color-text-light);
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero-slide__description {
  font-family: var(--font-body);
  font-size: 16.5px;
  color: rgba(240, 237, 232, 0.8);
  line-height: 1.7;
  max-width: 480px;
}

/* Corner viewfinder frame - quiet decorative motion, parallaxes with scroll via JS */
.hero-frame {
  position: absolute;
  inset: 24px;
  z-index: 6;
  pointer-events: none;
}

.hero-frame__corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(236, 237, 239, 0.4);
  border-style: solid;
  border-width: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero-frame.visible .hero-frame__corner {
  opacity: 1;
}

.hero-frame__corner--tl { top: 0; left: 0; border-top-width: 1.5px; border-left-width: 1.5px; }
.hero-frame__corner--tr { top: 0; right: 0; border-top-width: 1.5px; border-right-width: 1.5px; }
.hero-frame__corner--bl { bottom: 0; left: 0; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.hero-frame__corner--br { bottom: 0; right: 0; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* HUD route readout - swaps text per active slide, drifts gently with scroll */
.hero-hud {
  position: absolute;
  right: 32px;
  bottom: 40px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(236, 237, 239, 0.75);
  will-change: transform;
}

.hero-hud__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 0 rgba(234, 92, 31, 0.6);
  animation: huddotpulse 2s ease-out infinite;
  flex-shrink: 0;
}

@keyframes huddotpulse {
  0% { box-shadow: 0 0 0 0 rgba(234, 92, 31, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(234, 92, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 92, 31, 0); }
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 1;
  transition: opacity 0.5s;
}

.scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-indicator__text {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.scroll-indicator__arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(45deg);
  animation: bounceDown 1.5s ease infinite;
}

@keyframes bounceDown {
  0%, 100% {
    transform: rotate(45deg) translateY(0);
  }
  50% {
    transform: rotate(45deg) translateY(6px);
  }
}

.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--color-accent);
  z-index: 20;
  width: 0%;
  transition: none;
}

@media (max-width: 767px) {
  /* Scroll-scrubbed on phones too: the section is tall, the viewport sticks, the slides fade in turn.
     The video fills only the top part of the screen (--hero-media-h) so it keeps its detail,
     and the slide copy sits in its own area underneath instead of over the picture. */
  .hero-scroll-container {
    height: 420vh;
    height: 420svh;
  }

  .hero-viewport {
    --hero-media-h: 56svh;
    height: 100vh;
    height: 100svh;
  }

  .hero-video,
  .hero-placeholders {
    inset: 0 0 auto 0;
    height: 56vh;
    height: var(--hero-media-h);
  }

  /* Darkens the top (under the nav) and melts the bottom of the picture into the page colour */
  .hero-darken {
    inset: 0 0 auto 0;
    height: var(--hero-media-h);
    background:
      linear-gradient(180deg, rgba(6,7,10,0.5) 0%, rgba(6,7,10,0.05) 26%, rgba(6,7,10,0.05) 62%, var(--color-bg-dark) 100%);
  }

  .hero-content {
    position: absolute;
    inset: 0;
    padding: 0;
  }

  .hero-slide,
  .hero-slide--pos-left,
  .hero-slide--pos-right,
  .hero-slide--pos-bottom,
  .hero-slide--pos-center {
    position: absolute;
    left: 22px;
    right: 22px;
    top: calc(var(--hero-media-h) + 6px);
    bottom: auto;
    max-width: none;
    text-align: left;
  }

  .hero-slide__eyebrow {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .hero-slide__heading {
    font-size: clamp(22px, min(6.8vw, 3.5svh), 31px);
    line-height: 1.12;
    margin-bottom: 10px;
  }

  .hero-slide__description {
    max-width: none;
    margin: 0;
    font-size: clamp(13px, min(3.9vw, 1.9svh), 15px);
    line-height: 1.5;
    color: rgba(240, 237, 232, 0.88);
  }

  .hero-slide--pos-right .hero-slide__description,
  .hero-slide--pos-center .hero-slide__description {
    margin-left: 0;
    margin-right: 0;
  }

  .scroll-indicator {
    bottom: calc(1.5svh + env(safe-area-inset-bottom, 0px));
  }

  .scroll-indicator__text {
    font-size: 10px;
  }

  .hero-progress {
    display: block;
    height: 2px;
  }

  .hero-frame {
    inset: 14px 14px auto 14px;
    height: calc(var(--hero-media-h) - 28px);
  }

  .hero-hud {
    display: none;
  }
}
