body.error404 {
    background: var(--navy);
}

body.error404 #header,
body.error404 #footer,
body.error404 .site-header,
body.error404 .site-footer,
body.error404 header.site-header,
body.error404 footer.site-footer,
body.error404 .entry-header,
body.error404 .entry-footer,
body.error404 .nav,
body.error404 .navigation {
    display: none;
}

body.error404 #wrapper,
body.error404 #container,
body.error404 #content,
body.error404 main,
body.error404 .site-main {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.nf-page {
    position: relative;
    min-height: 100vh;
    background: var(--navy);
    color: var(--white);
    font-family: var(--font-body);
    display: grid;
    grid-template-rows: 1fr auto;
    overflow: hidden;
}

.nf-page * {
    box-sizing: border-box;
}

.nf-page .bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 72px 72px;
    pointer-events: none;
    z-index: 0;
}

.nf-page .bg-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 900px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(200, 164, 90, 0.07) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.nf-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 32px 60px;
    text-align: center;
}

.not-found-num {
    font-family: var(--font-head);
    font-size: clamp(140px, 22vw, 280px);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -12px;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
    user-select: none;
    pointer-events: none;
    position: relative;
    margin-bottom: -20px;
}

.not-found-num::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--gold) 40%, var(--gold) 60%, transparent 100%);
    opacity: 0.5;
    animation: nf-scan 3.5s ease-in-out infinite;
}

@keyframes nf-scan {
    0% {
        top: 0%;
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

.nf-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(200, 164, 90, 0.1);
    border: 1px solid rgba(200, 164, 90, 0.25);
    color: var(--gold);
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 7px 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    border-radius: var(--radius-sm);
}

.nf-headline {
    font-family: var(--font-head);
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin-bottom: 16px;
    max-width: 560px;
}

.nf-headline em {
    font-style: normal;
    color: var(--gold);
}

.nf-sub {
    font-size: 16px;
    color: #6b8ab5;
    line-height: 1.75;
    max-width: 420px;
    margin: 0 auto 44px;
}

.nf-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 64px;
}

.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 28px;
    text-decoration: none;
    font-family: var(--font-head);
    font-size: 14px;
    transition: background 0.2s, transform 0.15s, color 0.2s, border-color 0.2s;
    border-radius: var(--radius-md);
}

.btn-primary {
    background: var(--gold);
    color: var(--navy);
    font-weight: 800;
    letter-spacing: 0.2px;
}

.btn-primary:hover {
    background: #d4b36a;
    transform: translateY(-2px);
}

.btn-primary svg {
    transition: transform 0.2s;
}

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

.btn-ghost {
    background: transparent;
    color: #6b8ab5;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-ghost:hover {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.2);
}

.nf-links-label,
.nf-search-label {
    font-family: var(--font-head);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #3d5a80;
}

.nf-links-label {
    margin-bottom: 18px;
}

.nf-links {
    display: flex;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    flex-wrap: wrap;
    justify-content: center;
    max-width: 680px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.nf-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    text-decoration: none;
    color: #6b8ab5;
    font-size: 13px;
    font-family: var(--font-head);
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.nf-link:last-child {
    border-right: none;
}

.nf-link:hover {
    color: var(--gold);
    background: rgba(200, 164, 90, 0.04);
}

.nf-link svg {
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.nf-link:hover svg {
    opacity: 1;
}

.nf-search-wrap {
    margin-top: 48px;
    width: 100%;
    max-width: 480px;
}

.nf-search-label {
    margin-bottom: 12px;
    display: block;
}

.nf-search-inner {
    position: relative;
}

.nf-search {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 15px;
    padding: 14px 52px 14px 18px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    border-radius: var(--radius-md);
}

.nf-search::placeholder {
    color: #3d5a80;
}

.nf-search:focus {
    border-color: rgba(200, 164, 90, 0.35);
}

.nf-search-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 50px;
    height: 100%;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    color: #3d5a80;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.nf-search-btn:hover {
    color: var(--gold);
    background: rgba(200, 164, 90, 0.06);
}

.nf-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-brand {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    color: #3d5a80;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.footer-brand span {
    color: var(--gold);
}

.footer-note {
    font-size: 12px;
    color: #2a3d52;
}

.fade-in {
    opacity: 0;
    transform: translateY(16px);
    animation: nf-fade-in 0.6s ease forwards;
}

.fade-in:nth-child(2) {
    animation-delay: 0.1s;
}

.fade-in:nth-child(3) {
    animation-delay: 0.2s;
}

.fade-in:nth-child(4) {
    animation-delay: 0.3s;
}

.fade-in:nth-child(5) {
    animation-delay: 0.4s;
}

.fade-in:nth-child(6) {
    animation-delay: 0.5s;
}

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

@media (max-width: 600px) {
    .nf-main {
        padding: 64px 20px 48px;
    }

    .not-found-num {
        letter-spacing: -8px;
    }

    .nf-links {
        flex-direction: column;
    }

    .nf-link {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        justify-content: center;
    }

    .nf-link:last-child {
        border-bottom: none;
    }

    .nf-footer {
        justify-content: center;
        text-align: center;
    }
}
