/*
 * Motion system (GSAP, ScrollTrigger, Lenis).
 * Everything here only applies when html.ea-motion is set, i.e. the visitor did not ask for reduced motion.
 * Elements opt in with data-reveal="words" (titles), "media" (photos) or "rise" (blocks).
 */

/* Lenis smooth scroll. */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

/* Page curtain: covers the page until the script lifts it, and falls back to lifting itself. */
.page-transition { display: none; }
.ea-motion .page-transition { position: fixed; z-index: 2147483647; inset: 0; display: block; pointer-events: none; background: #fcfbf8; transform: translateY(0); transition: transform .62s cubic-bezier(.76, 0, .24, 1); animation: ea-curtain-out .62s cubic-bezier(.76, 0, .24, 1) 2.5s forwards; }
.ea-motion .page-transition__brand { position: absolute; top: 50%; left: 50%; width: clamp(11rem, 22vw, 19rem); transform: translate(-50%, -50%); }
.ea-motion.ea-motion-ready .page-transition { animation: none; }
.ea-motion .page-transition--entered { transform: translateY(-101%); }
@keyframes ea-curtain-out { to { transform: translateY(-101%); } }

/* Word reveal for titles: words start blurred and lowered, GSAP brings them in. */
.ea-motion .reveal-text__word { display: inline-block; opacity: 0; filter: blur(8px); transform: translate3d(0, .28em, 0); }
.ea-motion:not(.ea-motion-ready) [data-reveal="words"] { visibility: hidden; animation: ea-show-text 0s 2.5s forwards; }
@keyframes ea-show-text { to { visibility: visible; } }

/* Blocks rise in; photos are uncovered from the top. */
.ea-motion [data-reveal="rise"] { opacity: 0; }
.ea-motion:not(.ea-motion-ready) [data-reveal="rise"] { animation: ea-show-block 0s 2.5s forwards; }
.ea-motion [data-reveal="media"] { clip-path: inset(0 0 100% 0); }
.ea-motion:not(.ea-motion-ready) [data-reveal="media"] { animation: ea-show-media 0s 2.5s forwards; }
@keyframes ea-show-block { to { opacity: 1; } }
@keyframes ea-show-media { to { clip-path: inset(0 0 0 0); } }
