


a {
    color: inherit;
    text-decoration: none;
}

::selection {
    background: rgba(0, 194, 255, 0.3);
    color: white;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--ink);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 194, 255, 0.3);
    border-radius: 3px;
}

/* ── Canvas ── */
#canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Orbs ── */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

.orb-1 {
    width: 700px;
    height: 700px;
    background: rgba(30, 106, 255, 0.07);
    top: -250px;
    right: -200px;
    animation: drift 16s ease-in-out infinite alternate;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(0, 194, 255, 0.06);
    bottom: -150px;
    left: -180px;
    animation: drift 12s ease-in-out infinite alternate-reverse;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: rgba(0, 212, 170, 0.05);
    top: 40%;
    left: 30%;
    animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
    from {
        transform: translate(0, 0)
    }

    to {
        transform: translate(30px, -30px)
    }
}

/* ── Main container ── */
.page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 100px 20px 40px;
    text-align: center;
}

/* ── Glitch 404 ── */
.glitch-wrap {
    position: relative;
    margin-bottom: 12px;
}

.num-404 {
    font-size: clamp(5rem, 13vw, 10rem);
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 1;
    position: relative;
    background: linear-gradient(135deg, rgba(240, 246, 255, 0.12), rgba(240, 246, 255, 0.04));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: flicker 8s ease-in-out infinite;
}

.num-404::before {
    content: '404';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #00c2ff, #00d4aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    clip-path: polygon(0 0, 100% 0, 100% 38%, 0 38%);
    animation: glitch-top 6s ease-in-out infinite;
    filter: blur(0.5px);
}

.num-404::after {
    content: '404';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1e6aff, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    clip-path: polygon(0 62%, 100% 62%, 100% 100%, 0 100%);
    animation: glitch-bot 6s ease-in-out infinite;
    filter: blur(0.5px);
}

@keyframes glitch-top {

    0%,
    90%,
    100% {
        transform: translate(0, 0);
        opacity: 1;
    }

    91% {
        transform: translate(-4px, -2px);
        opacity: 0.9;
    }

    93% {
        transform: translate(4px, 0);
        opacity: 1;
    }

    95% {
        transform: translate(-2px, 1px);
        opacity: 0.85;
    }

    97% {
        transform: translate(0, 0);
        opacity: 1;
    }
}

@keyframes glitch-bot {

    0%,
    90%,
    100% {
        transform: translate(0, 0);
        opacity: 1;
    }

    92% {
        transform: translate(4px, 2px);
        opacity: 0.9;
    }

    94% {
        transform: translate(-4px, 0);
        opacity: 1;
    }

    96% {
        transform: translate(2px, -1px);
        opacity: 0.85;
    }

    98% {
        transform: translate(0, 0);
        opacity: 1;
    }
}

@keyframes flicker {

    0%,
    95%,
    100% {
        opacity: 1;
    }

    96% {
        opacity: 0.85;
    }

    97% {
        opacity: 1;
    }

    98% {
        opacity: 0.9;
    }
}

/* ── Scan line that sweeps over 404 ── */
.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 194, 255, 0.7), transparent);
    animation: scan-sweep 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes scan-sweep {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ── Pill badge ── */
.err-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-2);
    border: 1px solid var(--glass-border-2);
    border-radius: var(--r-full);
    padding: 7px 18px;
    margin-bottom: 22px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cyan);
    backdrop-filter: blur(12px);
    animation: fade-up 0.7s var(--spring) 0.1s both;
}

.err-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan);
    animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.2
    }
}

/* ── Heading ── */
.err-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
    line-height: 1.15;
    animation: fade-up 0.7s var(--spring) 0.18s both;
}

.grad-cyan {
    background: linear-gradient(135deg, #00c2ff, #00d4aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.err-sub {
    max-width: 460px;
    font-size: 1rem;
    color: var(--text-mid);
    line-height: 1.7;
    margin: 0 auto 36px;
    animation: fade-up 0.7s var(--spring) 0.26s both;
}

/* ── Error code strip ── */
.err-code {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(0, 194, 255, 0.6);
    background: rgba(0, 194, 255, 0.05);
    border: 1px solid rgba(0, 194, 255, 0.15);
    border-radius: 8px;
    padding: 8px 16px;
    margin-bottom: 40px;
    animation: fade-up 0.7s var(--spring) 0.32s both;
}

.err-code-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 194, 255, 0.5);
}

/* ── Buttons ── */
.err-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fade-up 0.7s var(--spring) 0.4s both;
    margin-bottom: 56px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 13px 26px;
    border-radius: var(--r-full);
    border: none;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #1e6aff, #0a4dd4);
    color: white;
    box-shadow: var(--glow-blue), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 50px rgba(30, 106, 255, 0.5), 0 0 100px rgba(30, 106, 255, 0.2);
}

.btn-cyan {
    background: linear-gradient(135deg, #00c2ff, #0090cc);
    color: #020817;
    box-shadow: var(--glow-cyan), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-cyan:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(0, 194, 255, 0.6);
}

.btn-glass {
    background: var(--glass-2);
    color: var(--text-bright);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
}

.btn-glass:hover {
    background: var(--glass-3);
    border-color: var(--glass-border-2);
    transform: translateY(-2px);
}

/* ── Quick links ── */
.err-links-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 16px;
    animation: fade-up 0.7s var(--spring) 0.48s both;
}

.err-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fade-up 0.7s var(--spring) 0.54s both;
}

.err-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-mid);
    transition: all 0.22s var(--ease);
    cursor: pointer;
    text-decoration: none;
}

.err-link:hover {
    background: var(--glass-2);
    border-color: var(--glass-border-2);
    color: var(--text-bright);
    transform: translateY(-2px);
}

.err-link-icon {
    font-size: 1rem;
}

/* ── Logo top ── */
.err-logo {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fade-up 0.5s var(--spring) 0s both;
    z-index: 200;
    background: rgba(2, 8, 23, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-full);
    padding: 7px 18px 7px 10px;
    white-space: nowrap;
}

.err-logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #1e6aff, #00c2ff);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-blue);
    position: relative;
    overflow: hidden;
}

.err-logo-mark::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
}

.err-logo-mark svg {
    width: 18px;
    height: 18px;
    fill: white;
    position: relative;
    z-index: 1;
}

.err-logo-text {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.err-logo-text span {
    color: var(--cyan);
}

/* ── Floating particles ── */
.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: float-up linear infinite;
    opacity: 0;
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100vh) scale(0.5);
        opacity: 0;
    }
}

/* ── Grid lines ── */
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 194, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 194, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: grid-fade 4s ease-in-out infinite alternate;
}

@keyframes grid-fade {
    from {
        opacity: 0.6
    }

    to {
        opacity: 1
    }
}

/* ── Corner decorations ── */
.corner {
    position: fixed;
    width: 80px;
    height: 80px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.4;
}

.corner-tl {
    top: 20px;
    left: 20px;
    border-top: 1px solid var(--cyan);
    border-left: 1px solid var(--cyan);
}

.corner-tr {
    top: 20px;
    right: 20px;
    border-top: 1px solid var(--cyan);
    border-right: 1px solid var(--cyan);
}

.corner-bl {
    bottom: 20px;
    left: 20px;
    border-bottom: 1px solid var(--cyan);
    border-left: 1px solid var(--cyan);
}

.corner-br {
    bottom: 20px;
    right: 20px;
    border-bottom: 1px solid var(--cyan);
    border-right: 1px solid var(--cyan);
}

/* ── Animations ── */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Pulse ring under 404 ── */
.pulse-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(0, 194, 255, 0.12);
    animation: ring-pulse 3s ease-out infinite;
    pointer-events: none;
}

.pulse-ring:nth-child(2) {
    animation-delay: 1s;
    border-color: rgba(0, 212, 170, 0.08);
}

.pulse-ring:nth-child(3) {
    animation-delay: 2s;
    border-color: rgba(30, 106, 255, 0.06);
}

@keyframes ring-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

/* ── Responsive ── */
@media(max-width:768px) {
    .err-code {
        font-size: 0.65rem;
        padding: 6px 12px;
        flex-wrap: wrap;
    }
}

@media(max-width:600px) {
    .corner {
        display: none;
    }

    .err-btns {
        flex-direction: column;
        align-items: center;
    }

    .err-btns .btn {
        width: 260px;
        justify-content: center;
    }

    .err-links {
        gap: 8px;
    }

    .err-title {
        font-size: 1.5rem;
    }

    .err-sub {
        font-size: 0.9rem;
    }

    .err-btns {
        margin-bottom: 32px;
    }
}

@media(max-width:420px) {
    .num-404 {
        font-size: 4.5rem;
    }

    .err-logo {
        padding: 5px 14px 5px 8px;
    }
}

@media(max-height:700px) {
    .num-404 {
        font-size: clamp(4rem, 10vh, 7rem);
    }

    .glitch-wrap {
        margin-bottom: 6px;
    }

    .err-pill {
        margin-bottom: 12px;
    }

    .err-title {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }

    .err-sub {
        margin-bottom: 18px;
        font-size: 0.88rem;
    }

    .err-code {
        margin-bottom: 20px;
    }

    .err-btns {
        margin-bottom: 24px;
    }

    .page {
        padding: 90px 20px 24px;
    }
}
