/* =============================================================================
   hero.css — pinned full-viewport hero with a CSS sticky reveal (UI-002 / KD-2).
   The <img> poster is the LCP; the video (if present) fades in over it. The feed
   slides up over the pinned hero. Creatures are clipped to this band (KD-6).
   ========================================================================== */

.hero {
  position: sticky;
  top: 0;
  z-index: var(--z-scene);
  height: 100svh;
  min-height: 30rem;
  overflow: hidden; /* clips the creature layer to the hero band */
  display: grid;
  place-items: start center;
}

/* --- Media (poster = LCP; video fades over it) --------------------------- */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__poster,
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__video {
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease);
}
.hero__video.is-playing {
  opacity: 1;
}

/* A whisper-soft top band ONLY behind the copy keeps the title legible over the
   brightest frame, without dimming the whole cinematic hero (KD-2 / §3). */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 60%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgb(var(--c-ink) / 0.55) 0%,
    rgb(var(--c-ink) / 0.22) 45%,
    transparent 100%
  );
}
/* A floor fade where the feed meets the hero. */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(0deg, var(--bg-midnight) 0%, transparent 100%);
}

/* --- Creature band ------------------------------------------------------- */
.hero__creatures {
  position: absolute;
  inset: 0;
  z-index: var(--z-creature);
  pointer-events: none;
}

/* --- Copy: site title (home <h1>) + manifesto tagline -------------------- */
.hero__copy {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: clamp(5rem, 14vh, 9rem) var(--space-m) 0;
  /* Wide enough that longer quotes breathe (≈2–3 lines on desktop) instead of
     squeezing into a narrow column; on mobile 85vw keeps comfortable side
     margins so lines wrap early rather than clipping at the hero edge. */
  max-width: min(85vw, 40rem);
  animation: hero-rise var(--dur-3) var(--ease-out) both;
}
.hero__title {
  font-size: var(--step-6);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  text-shadow: var(--text-shadow-hero);
}
.hero__tagline {
  margin-top: var(--space-s);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--step-2);
  font-weight: 400;
  line-height: var(--leading-snug);
  color: var(--accent-gold);
  text-shadow: var(--text-shadow-hero);
}
/* Scroll cue pinned to the hero floor (over the ::after floor fade for contrast).
   Brighter than the old dim wordmark and sat low so it's easy to spot. */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 4.5vh, 3rem);
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  letter-spacing: var(--tracking-wide);
  text-transform: lowercase;
  color: var(--text);
  text-shadow: var(--text-shadow-hero);
  transition: opacity var(--dur-2) var(--ease);
}
.hero__scroll-chevron {
  font-size: 1.2em;
  line-height: 1;
  animation: hero-scroll-bob 2.4s var(--ease) infinite;
}

@keyframes hero-scroll-bob {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.75;
  }
  50% {
    transform: translateY(0.4rem);
    opacity: 1;
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(1.4rem);
  }
}
@keyframes hero-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(0.3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__copy {
    animation: none;
  }
  .hero__scroll-chevron {
    animation: none;
  }
}
