/* ============================================
   WMT — Page Glitch Intro
   The actual page glitches briefly, then clears
   ============================================ */

/* ── Glitch animation on the page itself ── */
body.glitch-intro {
    animation: pageGlitch 450ms steps(6) forwards;
}

@keyframes pageGlitch {
    0% {
        filter: hue-rotate(25deg) saturate(3) contrast(1.6) brightness(1.2);
        transform: translate(4px, 0) skewX(-1deg);
    }

    16% {
        filter: hue-rotate(-15deg) saturate(2) brightness(1.4);
        transform: translate(-5px, 1px) skewX(0.5deg);
    }

    33% {
        filter: hue-rotate(40deg) saturate(4) contrast(2);
        transform: translate(3px, -1px) skewX(-0.8deg);
    }

    50% {
        filter: hue-rotate(-30deg) brightness(1.6) contrast(1.3);
        transform: translate(-2px, 0) skewX(0.3deg);
    }

    66% {
        filter: hue-rotate(10deg) saturate(2.5) brightness(1.1);
        transform: translate(1px, 1px) skewX(-0.4deg);
    }

    83% {
        filter: hue-rotate(-5deg) saturate(1.5) contrast(1.1);
        transform: translate(-1px, 0);
    }

    100% {
        filter: none;
        transform: none;
    }
}

/* ── Scanlines flash during glitch ── */
body.glitch-intro::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            transparent 0px,
            transparent 2px,
            rgba(168, 85, 247, 0.04) 2px,
            rgba(168, 85, 247, 0.04) 4px);
    animation: scanFlash 450ms steps(3) forwards;
}

@keyframes scanFlash {
    0% {
        opacity: 1;
    }

    80% {
        opacity: 0.5;
    }

    100% {
        opacity: 0;
    }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    body.glitch-intro {
        animation: none !important;
    }

    body.glitch-intro::after {
        display: none !important;
    }
}