/* ==========================================================================
   Global Animation System - YCHI Autism Center
   Lightweight scroll-reveal animations. No external library added.
   Reuses animate.css (already loaded in the site) as the animation engine,
   and only adds a tiny CSS layer + JS (global-animate.js) to trigger it
   when elements enter the viewport. Total added weight: <2 KB.
   ========================================================================== */

/* Elements waiting to be revealed start slightly hidden.
   IMPORTANT: opacity 0 is only applied once JS confirms it can run
   (class added by global-animate.js), so if JS fails to load for any
   reason, nothing on the page stays invisible. */
.ga-ready [data-animate] {
  opacity: 0;
}

.ga-ready [data-animate].ga-in-view {
  opacity: 1;
}

/* Respect users who prefer reduced motion: show content immediately,
   no animation at all. */
@media (prefers-reduced-motion: reduce) {
  .ga-ready [data-animate] {
    opacity: 1 !important;
    animation: none !important;
  }
}

/* Small performance safeguard: once an element has finished animating,
   free up the browser from tracking it as an animation layer. */
[data-animate].ga-done {
  animation-fill-mode: both;
  will-change: auto;
}
