/* ========================================
   CRT Terminal Screen Effect - High Visibility
   ======================================== */

/* Scanlines effect - strong terminal-style horizontal lines */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 8000;
    animation: scanlines 0.2s linear infinite;
}

/* CRT screen flicker overlay - phosphor glow effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.1);
    pointer-events: none;
    z-index: 7999;
    animation: flicker 0.15s infinite;
}

/* Scanlines animation - creates moving line effect */
@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(2px); }
}

/* Screen flicker animation */
@keyframes flicker {
    0% { opacity: 0.27861; }
    5% { opacity: 0.34769; }
    10% { opacity: 0.23604; }
    15% { opacity: 0.90626; }
    20% { opacity: 0.18128; }
    25% { opacity: 0.83891; }
    30% { opacity: 0.65583; }
    35% { opacity: 0.67807; }
    40% { opacity: 0.26559; }
    45% { opacity: 0.84693; }
    50% { opacity: 0.96019; }
    55% { opacity: 0.08594; }
    60% { opacity: 0.20313; }
    65% { opacity: 0.71988; }
    70% { opacity: 0.53455; }
    75% { opacity: 0.37288; }
    80% { opacity: 0.71428; }
    85% { opacity: 0.70419; }
    90% { opacity: 0.7003; }
    95% { opacity: 0.36108; }
    100% { opacity: 0.24387; }
}

/* CRT Terminal color grading */
body {
    background: #000;
}

/* RGB Glitch overlay - highly visible chromatic aberration */
html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(
            90deg,
            rgba(255, 0, 0, 0.1) 0%,
            transparent 10%,
            transparent 90%,
            rgba(0, 255, 255, 0.1) 100%
        );
    pointer-events: none;
    z-index: 8001;
    opacity: 0;
    animation: glitch-flicker 3s infinite;
    mix-blend-mode: screen;
}

/* Glitch animation - very visible terminal distortion */
@keyframes glitch-flicker {
    0%, 90% { 
        opacity: 0; 
        transform: translate(0, 0) scale(1, 1);
    }
    91% { 
        opacity: 1; 
        transform: translate(5px, 2px) scale(1.01, 0.99);
    }
    92% { 
        opacity: 0.8; 
        transform: translate(-5px, -2px) scale(0.99, 1.01);
    }
    93% { 
        opacity: 1; 
        transform: translate(3px, -3px) scale(1.02, 0.98);
    }
    94% { 
        opacity: 0.7; 
        transform: translate(-3px, 3px) scale(0.98, 1.02);
    }
    95% { 
        opacity: 0.9; 
        transform: translate(2px, 1px) scale(1, 1);
    }
    96%, 100% { 
        opacity: 0;
        transform: translate(0, 0) scale(1, 1);
    }
}

/* Screen curvature lines (horizontal) */
html::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 4px,
            rgba(0, 0, 0, 0.05) 4px,
            rgba(0, 0, 0, 0.05) 5px
        );
    pointer-events: none;
    z-index: 8002;
}

