/* ==========================================================================
   GSAP Scroll Animation Utilities
   ==========================================================================
   Structural/safety CSS only. The actual from/to animation values (opacity,
   position, scale, clip-path, color) are set by animations.js at runtime
   via GSAP — this file just provides:
     1. Overflow/clipping guards so transformed or scaled elements can never
        cause horizontal scroll.
     2. will-change hints for smoother compositing on the properties GSAP
        animates.
     3. A reduced-motion fallback in case JS is slow to attach.
   It does NOT touch any of your existing selectors, so nothing here can
   change your current layout — these classes only do something once you
   add them to an element yourself.
   ========================================================================== */

/* Belt-and-suspenders: scale/parallax/clip-path effects should never be able
   to introduce a horizontal scrollbar, even on narrow viewports. */
html, body {
  overflow-x: hidden;
}

/* -------------------- Text & Headings -------------------- */

/* .anim-fade-up / .anim-fade-left / .anim-fade-right
   No structural CSS needed — GSAP animates opacity/x/y directly and sets
   the resting state on scrollTrigger enter. Kept here only as documented
   hooks so the stylesheet is the single place listing every anim-* class. */
.anim-fade-up,
.anim-fade-left,
.anim-fade-right {
  will-change: transform, opacity;
}

/* .anim-text-reveal — split into word/char <span> units by animations.js.
   overflow:hidden lets each unit slide up out of a "mask" instead of just
   fading, without affecting the heading's own box size or your typography.
   Deliberately no `display` override here — headings are block by default
   anyway, and forcing it would fight any element that's intentionally
   inline/flex/grid at equal CSS specificity (source order would let this
   stylesheet win and silently change that element's layout). */
.anim-text-reveal {
  overflow: hidden;
}
.anim-text-unit {
  display: inline-block;
  will-change: transform, opacity;
}

/* -------------------- Images & Media -------------------- */

/* .anim-img-zoom — apply to a fixed-size wrapper (a card's image container,
   a figure, etc.), NOT loosely to a bare <img> with no clipping ancestor,
   or the zoomed image can spill past its box. If your element already sits
   inside a wrapper with overflow:hidden (very common for image cards),
   you're already covered and this is a no-op. No `display` override, for
   the same reason as .anim-text-reveal above. */
.anim-img-zoom {
  overflow: hidden;
}
.anim-img-zoom img {
  will-change: transform;
}

/* .anim-img-reveal — clip-path wipe. Self-contained: clip-path always clips
   to the element's own box, so this is safe to use directly on an <img>. */
.anim-img-reveal {
  will-change: clip-path, transform;
}

/* .anim-parallax — the moving element. Wrap it (or its natural parent) with
   .anim-parallax-wrap so the vertical drift is clipped and never leaves a
   gap or pushes anything sideways. overflow:hidden works regardless of the
   wrapper's position value, so this deliberately does NOT set `position` —
   many full-bleed background wrappers (like this site's .video-banner-bg)
   are already position:absolute for their own layout reasons, and adding
   position:relative here would fight that at equal CSS specificity. */
.anim-parallax-wrap {
  overflow: hidden;
}
.anim-parallax {
  will-change: transform;
}
/* NOTE: the buffer that keeps a parallax image's drift from revealing an
   edge gap is applied as a GSAP `scale` transform (see animations.js),
   not a CSS height percentage — percentage heights need a definite
   containing-block height to resolve, which isn't reliably true for an
   img inside an absolutely-positioned, inset:0 wrapper, and using it here
   blew up the section's layout instead of just resizing the image. A
   transform never affects box sizing/layout, so it's the safe way to do
   this regardless of how the wrapper is sized. */

/* -------------------- Sections & Cards -------------------- */

/* .anim-stagger-parent / .anim-stagger-item — no structural CSS required;
   items are hidden individually by animations.js right before it animates
   them in, so there's nothing to pre-hide here (avoids any FOUC risk if
   GSAP fails to load — your cards just stay visible instead of stuck at
   opacity:0). */
.anim-stagger-item {
  will-change: transform, opacity;
}

/* .anim-bg-shift — color is scrubbed by GSAP as you scroll through the
   section. The transition below is only a safety fallback for the instant
   before JS attaches; GSAP overrides it once it takes over. */
.anim-bg-shift {
  transition: background-color 0.6s ease;
}

/* -------------------- Reduced motion -------------------- */
/* animations.js also checks this and skips heavy motion (parallax, big
   stagger offsets) entirely when the user has this OS/browser preference
   set — this is just a CSS-level backstop. */
@media (prefers-reduced-motion: reduce) {
  .anim-parallax {
    transform: none !important;
  }
}
