/* =====================================================================
   stage.css — pairs with js/stage.js. Load it LAST (after smooth.css / glass.css). Delete its <link> + the stage.js <script> to remove.
   Everything here is transform / opacity only. No blur, no filter animation, no layout animation.
   html.stage-on is set by stage.js only when the device is not "lite" and the person has not asked for reduced motion,
   so on weak devices every rule below simply does not apply.
   ===================================================================== */

/* ---------- 1. One owner for page animation: stage.js (WAAPI). The old CSS keyframes would double-animate and fight it ---------- */
html.stage-on body .view-panel:not(#_) {
    animation: none !important;
    will-change: auto !important;          /* motion.css kept every open panel on its own giant GPU layer; the animation promotes it only while it runs */
    backface-visibility: visible !important;
}
html.stage-on .m-enter > *, html.stage-on .m-reveal.m-in { animation: none !important; will-change: auto !important; }

/* ---------- 2. Route bar: a bright line races across the top of the screen in the direction you are travelling ---------- */
#stage-route {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100003; pointer-events: none; opacity: 0;
    transform: scaleX(0); transform-origin: 0 50%;
    background: linear-gradient(90deg, #22d3ee, #818cf8 45%, #e879f9);
    box-shadow: 0 0 14px rgba(129, 140, 248, .85), 0 0 4px rgba(34, 211, 238, .8);
}

/* ---------- 3. Light sweep: a soft band of light glides across the page area while it changes ---------- */
#stage-shine {
    position: fixed; z-index: 30; pointer-events: none; overflow: hidden; border-radius: 24px; contain: strict;
}
#stage-shine i {
    position: absolute; inset: 0; display: block; opacity: 0; will-change: transform, opacity;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 32%, rgba(199, 210, 254, .16) 50%, rgba(255, 255, 255, 0) 68%);
}
html.light-theme #stage-shine i { background: linear-gradient(100deg, rgba(255, 255, 255, 0) 32%, rgba(109, 94, 252, .13) 50%, rgba(255, 255, 255, 0) 68%); }

/* ---------- 4. Magnetic buttons: they lean toward the mouse (transform handled by the `translate` property in flow.css's spring transition) ---------- */
@media (hover: hover) and (pointer: fine) {
    html.stage-on .stage-mag { will-change: translate; }
}

/* ---------- 5. Little extras (hover / focus only, transform + shadow on ONE element at a time) ---------- */
html.stage-on .fx-card:focus-within, html.stage-on .gl-card:focus-within {
    translate: 0 -2px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .09) inset, 0 26px 50px -24px rgba(99, 102, 241, .5) !important;
}
@media (hover: hover) and (pointer: fine) {
    html.stage-on .gl-row:hover, html.stage-on .sp-item:hover, html.stage-on .ar-item:hover { translate: 5px 0; }
    html.stage-on #admin-students-list > div:hover, html.stage-on #admin-lectures-list > div:hover { translate: 4px 0; }
    html.stage-on .fx-av:hover { scale: 1.08; }
}
html.stage-on .gl-row, html.stage-on .sp-item, html.stage-on .ar-item, html.stage-on #admin-students-list > div, html.stage-on #admin-lectures-list > div, html.stage-on .fx-av {
    transition: translate .45s var(--flow-spring, cubic-bezier(.34, 1.4, .64, 1)), scale .45s var(--flow-spring, cubic-bezier(.34, 1.4, .64, 1)), border-color .2s ease, background-color .2s ease;
}

@media (prefers-reduced-motion: reduce) { #stage-route, #stage-shine { display: none !important; } }
html.perf-lite #stage-route, html.perf-lite #stage-shine { display: none !important; }