/* ============================================================
   RMFC MOTION // load + scroll effects (see assets/motion.js)
   Modelled on endurosat.com/space-service: page fade-in on load,
   masked word reveals, scrubbed hero exit, letter fade-in, Lenis.
   ============================================================ */

/* ---- Lenis (from lenis@1.3.26/dist/lenis.css) ---- */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent],
.lenis [data-lenis-prevent-wheel],
.lenis [data-lenis-prevent-touch],
.lenis [data-lenis-prevent-vertical],
.lenis [data-lenis-prevent-horizontal] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
.lenis.lenis-autoToggle { transition-property: overflow; transition-duration: 1ms; transition-behavior: allow-discrete; }
/* Lenis drives scrolling; native smooth scroll would fight it */
html.lenis { scroll-behavior: auto; }

/* ---- Load: page held black, then fades in over 1s ---- */
html.motion-loading body { opacity: 0; }
html.motion body { transition: opacity 1s linear; }

/* The homepage's CSS-only hero rise is replaced by the motion script */
html.motion .reveal { opacity: 1; transform: none; animation: none; }

/* ---- Split text masks ---- */
/* Each word slides inside its own clip box. clip-path (not overflow) leaves
   the layout untouched and room for descenders on tight display line-heights */
.m-mask { display: inline-block; clip-path: inset(-0.35em -0.3em -0.35em -0.3em); }
.m-word { display: inline-block; will-change: transform; }
