/* ANIMATIONS — reveal system, marquee, ambient motion, reduced-motion */

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes steam-drift {
  0%, 100% { transform: translateY(0) scaleY(1); opacity: 0.9; }
  50% { transform: translateY(-6px) scaleY(1.08); opacity: 0.5; }
}

.steam path {
  animation: steam-drift 3.5s var(--ease-soft) infinite;
}

.steam path:nth-child(2) {
  animation-delay: 0.6s;
}

/* ---- Scroll reveal --------------------------------------------------
   Elements start hidden via [data-reveal] and are flipped to
   .is-visible by IntersectionObserver in main.js. Text lines using
   [data-reveal-text] clip-reveal instead of fading. */
[data-reveal] {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity var(--dur-slow) var(--ease-soft), transform var(--dur-slow) var(--ease-soft);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children within a common container using CSS custom property
   set by JS (--reveal-index) for natural cascading entrances. */
[data-reveal] {
  transition-delay: calc(var(--reveal-index, 0) * 70ms);
}

[data-reveal-text] {
  display: block;
  clip-path: inset(0 0 100% 0);
  transform: translateY(0.4em);
  opacity: 0;
  transition: clip-path 0.9s var(--ease-snap), transform 0.9s var(--ease-snap), opacity 0.4s ease;
}

[data-reveal-text].is-visible {
  clip-path: inset(0 0 0% 0);
  transform: translateY(0);
  opacity: 1;
}

.hero__title-line--accent[data-reveal-text] {
  transition-delay: 0.12s;
}

/* Hero entrance choreography (runs once on load, no observer needed) */
.hero__eyebrow,
.hero__tagline,
.hero__actions,
.hero__rating {
  opacity: 0;
  transform: translateY(1rem);
  animation: hero-rise 0.9s var(--ease-soft) forwards;
}

.hero__eyebrow { animation-delay: 0.05s; }
.hero__tagline { animation-delay: 0.45s; }
.hero__actions { animation-delay: 0.6s; }
.hero__rating { animation-delay: 0.75s; }

@keyframes hero-rise {
  to { opacity: 1; transform: translateY(0); }
}

.hero__title-line[data-reveal-text] {
  animation: hero-title-in 0.9s var(--ease-snap) forwards;
  animation-delay: 0.15s;
}

.hero__title-line--accent[data-reveal-text] {
  animation-delay: 0.28s;
}

@keyframes hero-title-in {
  from { clip-path: inset(0 0 100% 0); transform: translateY(0.4em); opacity: 0; }
  to { clip-path: inset(0 0 0% 0); transform: translateY(0); opacity: 1; }
}

.hero__scroll-cue {
  animation: fade-in 1s ease 1.1s forwards;
  opacity: 0;
}

@keyframes fade-in {
  to { opacity: 1; }
}

.hero__scroll-cue span {
  position: relative;
  overflow: hidden;
}

.hero__scroll-cue span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paprika);
  transform: translateY(-100%);
  animation: cue-drip 1.8s ease-in-out infinite;
}

@keyframes cue-drip {
  0% { transform: translateY(-100%); }
  60% { transform: translateY(100%); }
  100% { transform: translateY(100%); }
}

/* ---- Tilt (subtle, pointer-tracked via JS custom properties) -------- */
[data-tilt] {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.4s var(--ease-soft);
}

/* ---- Sticky header shadow micro-transition already handled in layout */

/* ---- Reduced motion --------------------------------------------------
   Kill transforms/parallax/marquee scrolling; keep simple opacity
   fades so content still appears without motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .marquee__track {
    animation: none;
  }

  [data-reveal],
  [data-reveal-text],
  .hero__eyebrow,
  .hero__tagline,
  .hero__actions,
  .hero__rating,
  .hero__title-line {
    opacity: 1 !important;
    transform: none !important;
    clip-path: inset(0 0 0% 0) !important;
  }

  [data-tilt] {
    transform: none !important;
  }

  .magnetic {
    transform: none !important;
  }
}
