/* ================================================================
   Resayil — Scroll reveal (Phase 24.12 Plan 12)
   ----------------------------------------------------------------
   Staggered fade+slide on scroll-into-view for portal pages.
   Desk is excluded at the JS boot level (no include in
   app_include_* either — this file is portal-only).

   Initial hidden state is encoded here so that when GSAP tweens
   the elements from { opacity:0, y:20 } → { opacity:1, y:0 } the
   CSS baseline matches. If GSAP is missing or prefers-reduced-motion
   is honoured, the fallback rules below make everything visible
   immediately (no animation, no layout shift, no stuck-hidden
   content).
   ================================================================ */

.rs-reveal {
  /* Initial state — until the JS ScrollTrigger trips, these stay hidden.
     If GSAP is missing entirely, the html.no-gsap fallback below sets
     them visible. The `rs-revealed` class is toggled by rs-reveal.js
     onComplete (or immediately in reduced-motion / no-gsap paths). */
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
  transition: opacity 0.5s var(--rs-ease, ease),
              transform 0.5s var(--rs-ease, ease);
}

.rs-reveal.rs-revealed {
  opacity: 1;
  transform: translateY(0);
  /* Once revealed, release will-change so the GPU layer can be
     released by the browser — animation is done. */
  will-change: auto;
}

/* Fallbacks — if GSAP is missing, never hide content.
   rs-reveal.js adds this class when window.gsap is undefined so
   portal pages without the vendor bundle still render readable. */
html.no-gsap .rs-reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  will-change: auto;
}

/* Reduced-motion — hard-respect the user preference. No tween,
   no transition, just show the content. */
@media (prefers-reduced-motion: reduce) {
  .rs-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto;
  }
}

/* Print — always fully visible. Stagger-reveal on paper is useless. */
@media print {
  .rs-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
