:root {
    --bg-1: #08131a;
    --bg-2: #14303b;
    --bg-3: #1f4d5d;
    --text: #dffcf5;
    --accent: #52f2c1;
    --panel: rgba(5, 15, 20, 0.72);
    --panel-border: rgba(82, 242, 193, 0.22);
    --shadow: rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--text);
    font-family: "Courier New", Courier, monospace;
    background:
        radial-gradient(circle at top, rgba(82, 242, 193, 0.18), transparent 32%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2) 48%, var(--bg-3));
    background-size: 100% 100%, 200% 200%;
    animation: bg-shift 14s ease infinite;
}

a {
    color: inherit;
}

.hero {
    width: min(100%, 720px);
}

.panel {
    padding: 32px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 24px 60px var(--shadow);
    backdrop-filter: blur(14px);
}

.error-body {
    background:
        radial-gradient(circle at top, rgba(255, 109, 77, 0.18), transparent 30%),
        linear-gradient(135deg, #120d11, #2f1b1f 48%, #44242b);
}

.error-panel {
    border-color: rgba(255, 109, 77, 0.24);
}

.eyebrow {
    margin: 0 0 16px;
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.error-body .eyebrow {
    color: #ff8b70;
}

.line {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid var(--accent);
    width: 0;
    animation: typing 2s steps(30) forwards, blink 1s step-end infinite;
}

.line + .line {
    margin-top: 12px;
}

.line-title {
    min-height: 2.6rem;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.error-title {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 4.8rem);
    line-height: 0.95;
}

.error-copy {
    margin: 16px 0 0;
    max-width: 34rem;
    color: #f7dfd9;
    line-height: 1.6;
}

.error-action {
    margin: 28px 0 0;
}

.error-action a {
    display: inline-block;
    padding: 12px 16px;
    border: 1px solid rgba(255, 139, 112, 0.35);
    border-radius: 999px;
    color: #fff2ed;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.error-action a:hover,
.error-action a:focus-visible {
    background: rgba(255, 139, 112, 0.12);
    border-color: rgba(255, 139, 112, 0.6);
    transform: translateY(-1px);
}

.line-delay-1 {
    animation-delay: 2.1s;
}

.line-delay-2 {
    animation-delay: 4.2s;
}

@keyframes typing {
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

@keyframes bg-shift {
    0% {
        background-position: 0 0, 0 50%;
    }

    50% {
        background-position: 0 0, 100% 50%;
    }

    100% {
        background-position: 0 0, 0 50%;
    }
}

@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .panel {
        padding: 24px 20px;
    }

    .line {
        white-space: normal;
        width: 100%;
        border-right: 0;
        animation: fade-up 0.7s ease forwards;
        opacity: 0;
        transform: translateY(8px);
    }

    .line-delay-1 {
        animation-delay: 0.18s;
    }

    .line-delay-2 {
        animation-delay: 0.36s;
    }
}

@keyframes fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
