/* ==========================================================================
   SEGAL — Animation System
   Two mechanisms: (1) scroll-triggered reveals via IntersectionObserver
   (js/reveal.js toggles .is-visible), (2) one-time hero load sequence.
   All motion is stripped under prefers-reduced-motion.
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

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

/* Stagger children within a revealed group */
.reveal-group.is-visible > * {
  transition-delay: calc(var(--reveal-index, 0) * 70ms);
}

/* ---- Hero load sequence (runs once, not scroll-triggered) ---- */

.hero__eyebrow,
.hero__heading-line,
.hero__description,
.hero__actions {
  opacity: 0;
  transform: translateY(14px);
  animation: hero-in var(--duration-slow) var(--ease-out) forwards;
}

.hero__eyebrow { animation-delay: 80ms; }
.hero__heading-line:nth-child(1) { animation-delay: 180ms; }
.hero__heading-line:nth-child(2) { animation-delay: 260ms; }
.hero__description { animation-delay: 380ms; }
.hero__actions { animation-delay: 480ms; }

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

/* ---- Reduced motion: strip everything to instant end-states ---- */

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-group > *,
  .hero__eyebrow,
  .hero__heading-line,
  .hero__description,
  .hero__actions {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .photo-tile img,
  .nav__link::after,
  .nav,
  .nav__logo,
  .nav__mobile,
  .btn {
    transition: none !important;
  }
}
