@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #080808;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    overflow: hidden;
    color: #fff;
}

/* ── Grid background ── */
.grid-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(245,166,35,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245,166,35,.04) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    animation: gridPan 20s linear infinite;
}

@keyframes gridPan {
    from { background-position: 0 0; }
    to   { background-position: 60px 60px; }
}

/* ── Radial vignette over grid ── */
.grid-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 70% at 50% 50%, transparent 40%, #080808 100%);
}

/* ── Noise scanlines ── */
.noise {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,.08) 0px,
        rgba(0,0,0,.08) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* ── Main card ── */
.card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
    padding: 0 24px;
}

/* ── Logo ── */
.logo {
    margin-bottom: 36px;
    opacity: 0;
    animation: slideDown 0.7s ease-out 0.1s forwards;
}

.logo img {
    width: 90px;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(245,166,35,.35));
}

/* ── Pulse rings behind 404 ── */
.pulse-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(245,166,35,.2);
    animation: ringPulse 3s ease-out infinite;
}

.ring:nth-child(1) { width: 260px; height: 260px; animation-delay: 0s; }
.ring:nth-child(2) { width: 360px; height: 360px; animation-delay: 0.8s; }
.ring:nth-child(3) { width: 460px; height: 460px; animation-delay: 1.6s; }

@keyframes ringPulse {
    0%   { transform: scale(0.6); opacity: 0.6; }
    100% { transform: scale(1.1); opacity: 0; }
}

/* ── 404 Glitch text ── */
.code {
    position: relative;
    font-size: clamp(100px, 20vw, 160px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -6px;
    color: #fff;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.3s forwards;
    z-index: 1;
    -webkit-text-stroke: 1px rgba(245,166,35,.4);
}

.code::before,
.code::after {
    content: '404';
    position: absolute;
    inset: 0;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

.code::before {
    color: #f5a623;
    clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
    transform: translateX(-3px);
    animation: glitch1 4s infinite 1s;
    opacity: 0.7;
}

.code::after {
    color: #4fc3f7;
    clip-path: polygon(0 55%, 100% 55%, 100% 75%, 0 75%);
    transform: translateX(3px);
    animation: glitch2 4s infinite 1.2s;
    opacity: 0.5;
}

@keyframes glitch1 {
    0%, 90%, 100% { transform: translateX(0); opacity: 0; }
    92%            { transform: translateX(-4px); opacity: 0.7; }
    94%            { transform: translateX(4px);  opacity: 0.7; }
    96%            { transform: translateX(-2px); opacity: 0.7; }
    98%            { transform: translateX(0);    opacity: 0.7; }
}

@keyframes glitch2 {
    0%, 90%, 100% { transform: translateX(0); opacity: 0; }
    92%            { transform: translateX(4px);  opacity: 0.5; }
    94%            { transform: translateX(-4px); opacity: 0.5; }
    96%            { transform: translateX(2px);  opacity: 0.5; }
    98%            { transform: translateX(0);    opacity: 0.5; }
}

/* ── Label under 404 ── */
.label {
    margin-top: 8px;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #f5a623;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.6s forwards;
}

/* ── Message ── */
.message {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255,255,255,.45);
    letter-spacing: .5px;
    max-width: 320px;
    line-height: 1.7;
    margin-bottom: 36px;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.75s forwards;
}

/* ── Back button ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 32px;
    background: rgba(245,166,35,.1);
    border: 1px solid rgba(245,166,35,.4);
    border-radius: 6px;
    color: #f5a623;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.9s forwards;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(245,166,35,.08), transparent);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.btn:hover::before { transform: translateX(100%); }

.btn:hover {
    background: rgba(245,166,35,.18);
    border-color: #f5a623;
    color: #fff;
    box-shadow: 0 0 20px rgba(245,166,35,.2);
}

.btn svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.btn:hover svg { transform: translateX(-3px); }

/* ── Shared keyframes ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
