/* ==========================================================================
   Adentra AI — animations.css
   Entrances, ambient motion, and the mandatory reduced-motion overrides.
   All animation is transform/opacity only (GPU-friendly).
   ========================================================================== */

/* ---------- Scroll-triggered entrances ----------
   Elements with [data-reveal] start hidden and rise 16px into place when
   main.js marks them .is-visible. Stagger (60ms/item) is set by JS via
   --reveal-delay on grouped items. */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--dur-slow) var(--ease-out-gentle),
    transform var(--dur-slow) var(--ease-out-gentle);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hero load sequence ----------
   Eyebrow → headline → subhead → CTA rise in sequence; the product card
   follows 200ms later with a gentle lift. Runs once on page load. */
[data-load-reveal] {
  opacity: 0;
  transform: translateY(16px);
  animation: rise-in 500ms var(--ease-out-gentle) forwards;
}
.hero__eyebrow      { animation-delay: 60ms; }
.hero__title        { animation-delay: 120ms; }
.hero__subhead      { animation-delay: 180ms; }
.hero__actions      { animation-delay: 240ms; }
.hero__media        { animation-delay: 440ms; }
.hero__media[data-load-reveal] { transform: translateY(8px); }

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

/* ---------- Ambient motion ---------- */

/* Closing CTA: very slow Ken Burns (1.0 → 1.05 over ~20s, settles). */
.closing__bg img {
  animation: ken-burns 20s var(--ease-out-gentle) forwards;
}
@keyframes ken-burns {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}

/* Success checkmark draws in calmly after submit. */
.form-card__check circle,
.form-card__check path {
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: draw-check 700ms var(--ease-out-gentle) forwards;
}
.form-card__check path { animation-delay: 350ms; }
@keyframes draw-check {
  to { stroke-dashoffset: 0; }
}

/* ==========================================================================
   Reduced motion — mandatory. Transforms, parallax, drift, Ken Burns and
   draw-on effects are disabled; only instant opacity remains.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  [data-reveal],
  [data-load-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }

  .closing__bg img,
  .form-card__check circle,
  .form-card__check path {
    animation: none;
  }
  .form-card__check circle,
  .form-card__check path { stroke-dashoffset: 0; }

  .accordion__panel,
  .accordion__chevron,
  .mobile-menu,
  .sticky-cta,
  .btn,
  .icon--arrow,
  .module-card,
  .audience-card,
  .nav__links a {
    transition: none;
  }

  .btn:hover,
  .module-card:hover,
  .audience-card:hover { transform: none; }
}
