/* ------------------------------------------------------------------
 * animations.css — reveal/parallax/stagger fallback + hero ambience.
 *
 * GSAP path (html.anim-gsap): all reveal/stagger transforms & opacity
 *   are driven by GSAP tweens directly — NO CSS transitions, NO initial
 *   hidden states set here (GSAP's fromTo sets them at tween start).
 *
 * Fallback path (html.anim-fallback or JS disabled): CSS transitions
 *   handle the reveal via an `.is-visible` class toggle.
 *
 * Reduced motion: everything visible, no animation.
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-stagger], [data-stagger] > *, [data-parallax] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Fallback reveal — ONLY when the anim runtime has explicitly signalled
 * that it loaded without GSAP. `html.no-js` (JS disabled OR anim-runtime
 * not loaded on this page) keeps content fully visible. */
html.anim-fallback [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
html.anim-fallback [data-reveal="left"]  { transform: translate3d(-36px, 0, 0); }
html.anim-fallback [data-reveal="right"] { transform: translate3d(36px, 0, 0); }
html.anim-fallback [data-reveal="fade"]  { transform: none; }
html.anim-fallback [data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
html.anim-fallback [data-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
html.anim-fallback [data-stagger].is-visible > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
html.anim-fallback [data-stagger].is-visible > *:nth-child(1)  { transition-delay: 0.00s; }
html.anim-fallback [data-stagger].is-visible > *:nth-child(2)  { transition-delay: 0.06s; }
html.anim-fallback [data-stagger].is-visible > *:nth-child(3)  { transition-delay: 0.12s; }
html.anim-fallback [data-stagger].is-visible > *:nth-child(4)  { transition-delay: 0.18s; }
html.anim-fallback [data-stagger].is-visible > *:nth-child(5)  { transition-delay: 0.24s; }
html.anim-fallback [data-stagger].is-visible > *:nth-child(6)  { transition-delay: 0.30s; }
html.anim-fallback [data-stagger].is-visible > *:nth-child(7)  { transition-delay: 0.36s; }
html.anim-fallback [data-stagger].is-visible > *:nth-child(8)  { transition-delay: 0.42s; }
html.anim-fallback [data-stagger].is-visible > *:nth-child(9)  { transition-delay: 0.48s; }
html.anim-fallback [data-stagger].is-visible > *:nth-child(10) { transition-delay: 0.54s; }

/* GSAP path: let GSAP own the transforms — make sure browsers
 * don't inherit any transition that would compete with the tween. */
html.anim-gsap [data-reveal],
html.anim-gsap [data-stagger] > * {
  transition: none !important;
}

/* Hero gradient mesh backdrop — three soft orbs drifting at different speeds.
 * Pure CSS keyframes, GPU-composited. */
.page-hero { position: relative; overflow: hidden; isolation: isolate; }
.page-hero::before,
.page-hero::after,
.page-hero > .hero-glow {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
}
.page-hero::before {
  top: -180px;
  right: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(25, 106, 229, 0.28) 0%, transparent 70%);
  animation: heroGlowDrift 22s ease-in-out infinite alternate;
}
.page-hero::after {
  bottom: -220px;
  left: -140px;
  width: 580px;
  height: 580px;
  background: radial-gradient(circle, rgba(92, 52, 177, 0.22) 0%, transparent 70%);
  animation: heroGlowDrift 28s ease-in-out infinite alternate-reverse;
}
.page-hero > .hero-glow {
  top: 30%;
  left: 35%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 211, 2, 0.14) 0%, transparent 70%);
  animation: heroGlowDrift 32s ease-in-out infinite alternate;
}
.page-hero > .container { position: relative; z-index: 1; }

@keyframes heroGlowDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(40px, -30px, 0) scale(1.08); }
  100% { transform: translate3d(-30px, 40px, 0) scale(0.94); }
}

/* Admission dot pulsing halo. */
@keyframes admissionPulse {
  0%   { box-shadow: 0 0 0 0 rgba(25, 106, 229, 0.45), 0 10px 24px -8px rgba(25,106,229,0.55); }
  70%  { box-shadow: 0 0 0 18px rgba(25, 106, 229, 0), 0 10px 24px -8px rgba(25,106,229,0.55); }
  100% { box-shadow: 0 0 0 0 rgba(25, 106, 229, 0), 0 10px 24px -8px rgba(25,106,229,0.55); }
}

@media (prefers-reduced-motion: reduce) {
  .page-hero::before,
  .page-hero::after,
  .page-hero > .hero-glow { animation: none !important; }
}

/* GPU hints for the testimonial carousel track — avoid repaints. */
.testimonial-carousel__track { will-change: transform; transform: translateZ(0); backface-visibility: hidden; }
