:root {
    --primary: #F24405;
    --secondary: #8C2703;
    --hover: #e03e00;
    --dark: #0D0D0D;
    --white: #ffffff;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--dark);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* ── GRID BACKGROUND ── */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.page-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.page-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 50% 50%, rgba(242, 68, 5, 0.10) 0%, transparent 65%),
        radial-gradient(ellipse 40% 30% at 20% 80%, rgba(140, 39, 3, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 30% 30% at 80% 20%, rgba(242, 68, 5, 0.06) 0%, transparent 60%);
}

/* ── NAV ── */
nav {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-logo-mark {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 20px;
    color: #fff;
}

.nav-brand {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.nav-brand span {
    color: var(--primary);
}

.nav-home {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-home:hover {
    color: #fff;
    border-color: rgba(242, 68, 5, 0.4);
    background: rgba(242, 68, 5, 0.06);
}

.nav-home svg {
    transition: transform 0.2s;
}

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

/* ── MAIN CONTENT ── */
main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

/* ── GIANT 404 ── */
.error-number-wrap {
    position: relative;
    margin-bottom: 40px;
    user-select: none;
}

.error-number {
    font-family: 'Playfair Display', serif;
    font-size: clamp(140px, 22vw, 280px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -8px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.12) 40%,
            rgba(242, 68, 5, 0.15) 60%,
            rgba(255, 255, 255, 0.04) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    animation: fadeUp 0.8s ease both;
}

.error-number-outline {
    position: absolute;
    inset: 0;
    font-family: 'Playfair Display', serif;
    font-size: clamp(140px, 22vw, 280px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -8px;
    -webkit-text-stroke: 1.5px rgba(242, 68, 5, 0.3);
    color: transparent;
    animation: fadeUp 0.8s 0.08s ease both;
    z-index: 0;
}

/* Floating coal particles */
.particles {
    position: absolute;
    inset: -40px;
    pointer-events: none;
    overflow: visible;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0;
    animation: particleFly var(--dur, 4s) var(--delay, 0s) ease-in-out infinite;
}

.particle:nth-child(2) {
    width: 4px;
    height: 4px;
    background: rgba(242, 68, 5, 0.5);
}

.particle:nth-child(3) {
    width: 8px;
    height: 8px;
    background: rgba(242, 68, 5, 0.3);
    border-radius: 2px;
}

.particle:nth-child(4) {
    width: 3px;
    height: 3px;
}

.particle:nth-child(5) {
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
}

.particle:nth-child(6) {
    width: 7px;
    height: 7px;
    background: rgba(140, 39, 3, 0.6);
}

@keyframes particleFly {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(0deg);
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx, 40px), var(--ty, -80px)) rotate(var(--rot, 180deg));
    }
}

/* Glowing orb behind the 404 */
.error-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(300px, 50vw, 500px);
    height: clamp(200px, 35vw, 350px);
    background: radial-gradient(ellipse, rgba(242, 68, 5, 0.12) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {

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

    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.7;
    }
}

/* ── COAL ICON ── */
.coal-icon-wrap {
    margin-bottom: 28px;
    animation: fadeUp 0.7s 0.2s ease both;
}

.coal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    background: rgba(242, 68, 5, 0.12);
    border: 1px solid rgba(242, 68, 5, 0.25);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    position: relative;
    animation: float 3.5s ease-in-out infinite;
}

.coal-icon::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(242, 68, 5, 0.3), transparent 60%);
    z-index: -1;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ── TEXT ── */
.error-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(242, 68, 5, 0.1);
    border: 1px solid rgba(242, 68, 5, 0.25);
    border-radius: 100px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 24px;
    animation: fadeUp 0.7s 0.3s ease both;
}

.error-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {

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

    50% {
        opacity: 0.4;
        transform: scale(1.4);
    }
}

.error-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 16px;
    animation: fadeUp 0.7s 0.35s ease both;
}

.error-title em {
    font-style: italic;
    color: var(--primary);
}

.error-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
    max-width: 460px;
    margin: 0 auto 40px;
    animation: fadeUp 0.7s 0.4s ease both;
}

/* ── ACTIONS ── */
.error-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    animation: fadeUp 0.7s 0.48s ease both;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 14px 28px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 8px 28px rgba(242, 68, 5, 0.35);
}

.btn-primary:hover {
    background: var(--hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(242, 68, 5, 0.45);
}

.btn-secondary {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    padding: 14px 24px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-secondary:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

/* ── QUICK LINKS ── */
.quick-links {
    margin-top: 64px;
    animation: fadeUp 0.7s 0.55s ease both;
}

.quick-links-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.quick-links-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    padding: 9px 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
}

.quick-link:hover {
    color: var(--primary);
    border-color: rgba(242, 68, 5, 0.3);
    background: rgba(242, 68, 5, 0.05);
    transform: translateY(-2px);
}

.quick-link-icon {
    font-size: 14px;
}

/* ── FOOTER BAR ── */
.page-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.page-footer strong {
    color: rgba(242, 68, 5, 0.7);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    nav {
        padding: 18px 24px;
    }

    .nav-home span {
        display: none;
    }

    .error-number {
        letter-spacing: -4px;
    }

    .error-number-outline {
        letter-spacing: -4px;
    }

    .error-title {
        margin-bottom: 12px;
    }

    .error-desc {
        font-size: 15px;
        margin-bottom: 32px;
    }

    .quick-links {
        margin-top: 48px;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 16px 20px;
    }

    .btn-primary,
    .btn-secondary {
        font-size: 14px;
        padding: 13px 22px;
    }

    .error-actions {
        gap: 10px;
    }

    .quick-link {
        font-size: 12px;
        padding: 8px 14px;
    }
}
