/* Cyberpunk error page additions (requires theme.css variables) */

/* scanline overlay */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.035),
            rgba(255, 255, 255, 0.035) 1px,
            rgba(0, 0, 0, 0) 3px,
            rgba(0, 0, 0, 0) 6px);
    mix-blend-mode: overlay;
    opacity: 0.22;
    animation: scanMove 6s linear infinite;
}

@keyframes scanMove {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(24px);
    }
}

/* subtle flicker */
.flicker {
    animation: flicker 4.2s infinite;
}

@keyframes flicker {

    0%,
    100% {
        opacity: 1;
    }

    41% {
        opacity: 0.92;
    }

    42% {
        opacity: 0.78;
    }

    43% {
        opacity: 0.95;
    }

    62% {
        opacity: 0.9;
    }

    63% {
        opacity: 1;
    }
}

/* cyber frame */
.frame {
    position: relative;
    overflow: hidden;
}

.frame::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg,
            rgba(255, 43, 214, 0.45),
            rgba(45, 252, 255, 0.35),
            rgba(138, 91, 255, 0.35),
            rgba(255, 43, 214, 0.45));
    filter: blur(18px);
    opacity: 0.35;
    transform: translateZ(0);
    animation: glow 3.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glow {

    0%,
    100% {
        opacity: 0.28;
    }

    50% {
        opacity: 0.45;
    }
}

/* glitch heading */
.glitch {
    position: relative;
    display: inline-block;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1;
    font-size: 56px;
    color: var(--text);
    text-shadow:
        0 0 18px rgba(255, 43, 214, 0.22),
        0 0 22px rgba(45, 252, 255, 0.18);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
    opacity: 0.9;
}

.glitch::before {
    transform: translate(2px, 0);
    color: var(--neon-cyan);
    text-shadow: 0 0 14px rgba(45, 252, 255, 0.35);
    animation: glitch1 2.4s infinite linear alternate-reverse;
}

.glitch::after {
    transform: translate(-2px, 0);
    color: var(--neon-pink);
    text-shadow: 0 0 14px rgba(255, 43, 214, 0.35);
    animation: glitch2 1.9s infinite linear alternate-reverse;
}

@keyframes glitch1 {
    0% {
        clip-path: inset(0 0 90% 0);
    }

    10% {
        clip-path: inset(10% 0 65% 0);
    }

    20% {
        clip-path: inset(35% 0 45% 0);
    }

    30% {
        clip-path: inset(60% 0 25% 0);
    }

    40% {
        clip-path: inset(20% 0 60% 0);
    }

    50% {
        clip-path: inset(72% 0 10% 0);
    }

    60% {
        clip-path: inset(5% 0 80% 0);
    }

    70% {
        clip-path: inset(45% 0 40% 0);
    }

    80% {
        clip-path: inset(15% 0 70% 0);
    }

    90% {
        clip-path: inset(55% 0 30% 0);
    }

    100% {
        clip-path: inset(0 0 88% 0);
    }
}

@keyframes glitch2 {
    0% {
        clip-path: inset(80% 0 5% 0);
    }

    12% {
        clip-path: inset(55% 0 30% 0);
    }

    24% {
        clip-path: inset(25% 0 55% 0);
    }

    36% {
        clip-path: inset(70% 0 12% 0);
    }

    48% {
        clip-path: inset(12% 0 70% 0);
    }

    60% {
        clip-path: inset(40% 0 42% 0);
    }

    72% {
        clip-path: inset(6% 0 82% 0);
    }

    84% {
        clip-path: inset(62% 0 20% 0);
    }

    100% {
        clip-path: inset(78% 0 6% 0);
    }
}

.code {
    margin-top: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    color: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.20);
    display: inline-block;
}

.actions {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text);
    background: rgba(0, 0, 0, 0.18);
}

.ghost:hover {
    text-decoration: none;
    filter: brightness(1.06);
}

@media (max-width: 520px) {
    .glitch {
        font-size: 44px;
    }
}