/* ==========================================================================
   Component: Hero Carousel (Home)
   ========================================================================== */

.hero-carousel {
  position: relative;
  /* Cancels main's --header-height padding-top (base.css) so the hero
     photo starts at viewport y=0, visible behind the fixed, transparent
     header. */
  margin-top: calc(-1 * var(--header-height));
  height: 100vh;
  min-height: 560px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--color-text);
}

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

.hero-carousel__slide {
  position: absolute;
  inset: 0;
  background-color: var(--color-surface);
  opacity: 0;
  transform: scale(1);
  transform-origin: center;
  transition: opacity var(--duration-hero-fade) var(--ease-standard);
}

/* The <picture> is a pure passthrough — the <img> is what actually fills
   the slide (object-fit: cover reproduces the old background-size: cover
   crop exactly), so Ken Burns can keep animating transform: scale() on
   .hero-carousel__slide above without knowing an <img> is involved. */
.hero-carousel__slide picture {
  display: contents;
}

.hero-carousel__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-carousel__slide.is-active {
  opacity: 1;
  /* Ken Burns micro-zoom — only runs while the slide is active; removing
     .is-active drops the animation and the slide reverts to scale(1)
     instantly (no transition), so the zoom always restarts clean on its
     next turn. See js/hero-carousel.js goTo() for the reflow that
     guarantees the keyframes restart from 1.0 every time. */
  animation: hero-ken-burns var(--duration-hero-zoom) ease-out forwards;
}

@keyframes hero-ken-burns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(var(--hero-zoom-scale));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel__slide.is-active {
    animation: none;
  }
}

.hero-carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay-hero);
  z-index: 1;
  pointer-events: none;
}

.hero-carousel__content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  /* Subtle hero parallax (v1.2) — see js/hero-carousel.js setupHeroParallax.
     Only this outer wrapper carries the parallax drift; the staggered
     headline/subhead/CTA reveal below applies its own transform to each
     child independently, and the two compose without conflict. */
  transform: translateY(var(--hero-parallax-y, 0px));
}

/* Staggered reveal (v1.2, supersedes v1.1's single "content fades in as one
   block" treatment) — headline, subhead and CTA pair fade up individually
   with progressively later start times so the eye is led top-to-bottom,
   most-important-first. Default state (no JS / reduced motion / repeat
   session) is fully visible immediately: only .hero-carousel--reveal-pending
   (added by js/hero-carousel.js, only while the one-time centered logo
   badge is playing) hides them. */
.hero-carousel__headline,
.hero-carousel__subhead,
.hero-carousel__ctas {
  opacity: 1;
  transform: translateY(0);
}

.hero-carousel--reveal-pending .hero-carousel__headline,
.hero-carousel--reveal-pending .hero-carousel__subhead,
.hero-carousel--reveal-pending .hero-carousel__ctas {
  opacity: 0;
  transform: translateY(16px);
}

.hero-carousel--reveal-done .hero-carousel__headline,
.hero-carousel--reveal-done .hero-carousel__subhead,
.hero-carousel--reveal-done .hero-carousel__ctas {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--duration-500) var(--ease-standard),
    transform var(--duration-500) var(--ease-standard);
}

/* 0ms / +120ms / +220ms stagger for headline, subhead and CTA pair. */
.hero-carousel--reveal-done .hero-carousel__headline {
  transition-delay: 0ms;
}

.hero-carousel--reveal-done .hero-carousel__subhead {
  transition-delay: 120ms;
}

.hero-carousel--reveal-done .hero-carousel__ctas {
  transition-delay: 220ms;
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel__content {
    transform: none;
  }
}

.hero-carousel__headline {
  font-size: var(--fs-h1);
  margin-bottom: var(--space-3);
}

.hero-carousel__subhead {
  font-size: var(--fs-body-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  max-width: 46ch;
}

.hero-carousel__ctas {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.hero-carousel__dots {
  position: absolute;
  z-index: 2;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-1);
}

.hero-carousel__dot {
  width: 10px;
  height: 10px;
  background: rgba(245, 245, 245, 0.35);
  transition: background-color var(--duration-base) var(--ease-standard);
}

.hero-carousel__dot.is-active {
  background: var(--color-primary);
}

.hero-carousel__scroll-indicator {
  position: absolute;
  z-index: 2;
  bottom: var(--space-3);
  right: var(--container-padding);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-faint);
}

/* Rotated vertical "SCROLL" label — never moves/bounces on its own; only
   the guide line beneath it animates. */
.hero-carousel__scroll-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  font-weight: var(--fw-medium);
}

.hero-carousel__scroll-line {
  position: relative;
  width: 1px;
  height: 32px;
  background: var(--color-text-faint);
  overflow: hidden;
}

/* A short brighter segment quietly travels top->bottom and fades, on a
   1.8s loop — reinforces the "scroll down" meaning without the label
   itself moving. Static line only under reduced motion. */
.hero-carousel__scroll-line-pulse {
  position: absolute;
  top: -10px;
  left: 0;
  width: 1px;
  height: 10px;
  background: var(--color-primary);
  animation: hero-scroll-pulse 1.8s ease-in-out infinite;
}

@keyframes hero-scroll-pulse {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(42px);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel__scroll-line-pulse {
    animation: none;
    opacity: 0;
  }
}

@media (max-width: 1024px) {
  .hero-carousel {
    height: 85vh;
    min-height: 480px;
  }

  .hero-carousel__content {
    max-width: 560px;
  }
}

@media (max-width: 767px) {
  .hero-carousel {
    height: 70vh;
    min-height: 420px;
    text-align: center;
  }

  .hero-carousel__content {
    max-width: 100%;
    margin-inline: auto;
  }

  .hero-carousel__subhead {
    margin-inline: auto;
  }

  .hero-carousel__ctas {
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  /* Mobile: single emphasized primary CTA + secondary demoted to a small
     text link. */
  .hero-carousel__cta-secondary {
    background: transparent;
    border-color: transparent;
    color: var(--color-text-muted);
    padding: 0;
    font-size: var(--fs-caption);
    text-decoration: underline;
  }

  .hero-carousel__cta-secondary:hover,
  .hero-carousel__cta-secondary:focus-visible {
    color: var(--color-primary);
    border-color: transparent;
  }

  .hero-carousel__scroll-indicator {
    display: none;
  }
}
