/**
 * Ridecoop preloader — overlay layout.
 * Animations are driven by GSAP in preloader.js; this file only positions
 * elements and provides the reduced-motion soft fade.
 */

#rc-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    /* Initial state set by GSAP at boot (autoAlpha:1) — keep CSS visible
       so the white overlay paints before JS runs. */
}

#rc-preloader-stage {
    width: min(60vw, 300px);
    height: min(60vw, 300px);
    /* Initial invisible / collapsed state — matches the first frame of the
       master timeline in preloader.js. Prevents a brief full-size flash
       between first paint and the deferred script execution. */
    opacity: 0;
    transform: scale(0);
    will-change: transform, opacity;
}

#preloader-svg {
    width: 100%;
    height: 100%;
}

/* Inline SVG hides speed lines until GSAP starts them. */
.speed-line {
    opacity: 0;
}

/* Lock body scroll while the overlay is active. Toggled by preloader.js. */
body.rc-lock {
    overflow: hidden;
}

/**
 * Reduced motion: skip the choreography entirely. Overlay is removed
 * instantly and nothing animates. Boot script in preloader.js also
 * short-circuits timeline construction when this media query matches.
 */
@media (prefers-reduced-motion: reduce) {
    #rc-preloader {
        display: none !important;
    }
    body.rc-lock {
        overflow: auto !important;
    }
}

/* JS disabled: never lock the user behind a white screen. */
html.no-js #rc-preloader {
    display: none !important;
}