/* ============================================================
   hackenshaw.com - the CRT look: scanlines, flicker, the glitching h1

   ONE copy. Every site page gets it through site.css (@import), and the
   tutorials' hosted game pages (the play/N/ copy of each step) link it on
   its own -
   they want the look, not the page shell. Put class="crt-overlay" on the
   <body>.

   Deliberate copies elsewhere, because they must work offline as single
   files: the reveal.js theme (presentations/theme/hackenshaw.css) and
   qrkeeper's own sheet.
   ============================================================ */

.crt-overlay::before,
.crt-overlay::after {
    content: " ";
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.crt-overlay::before {
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 3px, 3px 100%;
}

.crt-overlay::after {
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.28; }
    15% { opacity: 0.91; }
    25% { opacity: 0.84; }
    40% { opacity: 0.27; }
    50% { opacity: 0.96; }
    60% { opacity: 0.20; }
    75% { opacity: 0.37; }
    90% { opacity: 0.70; }
    100% { opacity: 0.24; }
}

@keyframes textShadow {
    0% { text-shadow: 0.44px 0 1px rgba(0, 30, 255, 0.5), -0.44px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    25% { text-shadow: 1.61px 0 1px rgba(0, 30, 255, 0.5), -1.61px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    50% { text-shadow: 0.08px 0 1px rgba(0, 30, 255, 0.5), -0.08px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    75% { text-shadow: 1.89px 0 1px rgba(0, 30, 255, 0.5), -1.89px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
    100% { text-shadow: 2.62px 0 1px rgba(0, 30, 255, 0.5), -2.62px 0 1px rgba(255, 0, 80, 0.3), 0 0 3px; }
}

h1 {
    animation: textShadow 1.6s infinite;
}

@media (prefers-reduced-motion: reduce) {

    .crt-overlay::after,
    h1 {
        animation: none;
    }
}
