/* =========================================
   Effects CSS - Glitch & Animations
   ========================================= */

.glitch {
    position: relative;
    color: var(--color-white);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(30px, 9999px, 36px, 0);
    }

    20% {
        clip: rect(18px, 9999px, 88px, 0);
    }

    40% {
        clip: rect(8px, 9999px, 83px, 0);
    }

    60% {
        clip: rect(35px, 9999px, 14px, 0);
    }

    80% {
        clip: rect(2px, 9999px, 98px, 0);
    }

    100% {
        clip: rect(54px, 9999px, 13px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(10px, 9999px, 92px, 0);
    }

    20% {
        clip: rect(78px, 9999px, 4px, 0);
    }

    40% {
        clip: rect(93px, 9999px, 59px, 0);
    }

    60% {
        clip: rect(2px, 9999px, 18px, 0);
    }

    80% {
        clip: rect(56px, 9999px, 33px, 0);
    }

    100% {
        clip: rect(15px, 9999px, 63px, 0);
    }
}

/* =========================================
   Hero Image - Scanline Reveal
   ========================================= */

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    /* Align left */
    width: 100%;
    /* Full Width */
    height: 100%;
    z-index: 0;
    overflow: hidden;
    border: none;
    /* No borders for background mode */
    transition: all 0.5s ease;
}

/* Base Image State - Hidden/Grayscale */
.hero-img-scanline {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%) brightness(0.4) contrast(1.5);
    transition: all 0.5s ease;
    opacity: 0.7;
}

/* Scanline Overlay */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(to bottom,
            rgba(0, 0, 0, 0.8) 0px,
            rgba(0, 0, 0, 0.8) 2px,
            rgba(0, 255, 0, 0.1) 3px,
            rgba(0, 255, 0, 0.1) 4px);
    z-index: 2;
    pointer-events: none;
    /* Let clicks pass through */
    transition: all 0.5s ease;
    clip-path: inset(0 0 0 0);
}

/* Hover State - Reveal */
.hero-image-container:hover {
    border: none;
    box-shadow: none;
    transform: none;
}

.hero-image-container:hover .hero-img-scanline {
    filter: grayscale(0%) brightness(1) contrast(1);
    opacity: 1;
}

.hero-image-container:hover .scanlines {
    /* "Open" the scanlines or make them disappear */
    clip-path: inset(50% 0 50% 0);
    /* Collapse vertically to center then vanish */
    opacity: 0;
}

@media (max-width: 900px) {
    .hero-image-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        /* Keep full height on mobile too? Or maybe auto? Let's keep full background */
        max-width: none;
        margin: 0;
        display: block;
        z-index: 0;
    }
}