/* ===== 404 PAGE ===== */
.page-404 {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0 80px;
    position: relative;
    overflow: hidden;
}

/* Background effects */
.e404-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.e404-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 100%);
}
.e404-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
}
.e404-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: 10%;
    left: 10%;
    animation: e404float 8s ease-in-out infinite;
}
.e404-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent2);
    bottom: 10%;
    right: 15%;
    animation: e404float 10s ease-in-out infinite reverse;
}
.e404-orb-3 {
    width: 200px;
    height: 200px;
    background: var(--accent);
    top: 60%;
    left: 55%;
    animation: e404float 12s ease-in-out infinite 2s;
}
@keyframes e404float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(25px, -35px) scale(1.05); }
    66% { transform: translate(-15px, 20px) scale(0.95); }
}

/* Layout */
.e404-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 960px;
    margin: 0 auto;
}

/* Left: visual with number */
.e404-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.e404-number {
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}
.e404-digit {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(80px, 14vw, 140px);
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    text-shadow: 0 4px 30px var(--glow);
    animation: e404digitBounce 3s ease-in-out infinite;
}
.e404-d1 { animation-delay: 0s; }
.e404-d2 { animation-delay: 0.4s; }
@keyframes e404digitBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Circle face (the 0) */
.e404-circle {
    width: clamp(80px, 14vw, 140px);
    height: clamp(80px, 14vw, 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: e404digitBounce 3s ease-in-out infinite 0.2s;
}
.e404-circle svg {
    width: 100%;
    height: 100%;
}
.e404-ring {
    animation: e404spin 6s linear infinite;
    transform-origin: 60px 60px;
}
@keyframes e404spin {
    to { transform: rotate(360deg); }
}
.e404-eye {
    animation: e404blink 4s ease-in-out infinite;
}
@keyframes e404blink {
    0%, 42%, 50%, 100% { r: 5; }
    45% { r: 1; }
}

/* Floating particles */
.e404-particles {
    position: absolute;
    inset: -30px;
    pointer-events: none;
}
.e404-particles i {
    position: absolute;
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.25;
    animation: e404particle 5s ease-in-out infinite;
}
.e404-particles i:nth-child(1) { top: 10%; left: 5%;  animation-delay: 0s;   width: 8px; height: 8px; }
.e404-particles i:nth-child(2) { top: 75%; left: 10%; animation-delay: 0.8s; width: 5px; height: 5px; }
.e404-particles i:nth-child(3) { top: 20%; right: 5%; animation-delay: 1.6s; width: 7px; height: 7px; }
.e404-particles i:nth-child(4) { top: 80%; right: 8%; animation-delay: 2.4s; width: 4px; height: 4px; }
.e404-particles i:nth-child(5) { top: 45%; left: -2%; animation-delay: 3.2s; width: 6px; height: 6px; }
.e404-particles i:nth-child(6) { top: 5%;  left: 50%; animation-delay: 1.2s; width: 5px; height: 5px; }
.e404-particles i:nth-child(7) { top: 90%; left: 50%; animation-delay: 2.0s; width: 7px; height: 7px; }
.e404-particles i:nth-child(8) { top: 50%; right: 0;  animation-delay: 0.4s; width: 4px; height: 4px; }
@keyframes e404particle {
    0%, 100% { transform: translate(0, 0) scale(1);   opacity: 0.2; }
    50%      { transform: translate(12px, -18px) scale(1.5); opacity: 0.5; }
}

/* Right: text content */
.e404-content {
    text-align: left;
}
.e404-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accentbg2);
    border: 1px solid var(--border2);
    border-radius: 100px;
    padding: 5px 14px;
    margin-bottom: 20px;
}
.e404-content h1 {
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
}
.e404-desc {
    font-size: 16px;
    color: var(--text2);
    line-height: 1.7;
    max-width: 400px;
    margin-bottom: 32px;
}
.e404-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Mobile */
@media (max-width: 768px) {
    .e404-layout {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .e404-content {
        text-align: center;
    }
    .e404-desc {
        margin-left: auto;
        margin-right: auto;
    }
    .e404-actions {
        justify-content: center;
    }
    .page-404 {
        padding: 100px 0 60px;
    }
}