.error-page {
    position: relative;
    isolation: isolate;
    min-height: calc(100dvh - 156px);
    display: grid;
    place-items: center;
    overflow: hidden;
    padding-block: clamp(48px, 8vw, 104px);
    background:
        radial-gradient(circle at 84% 8%, rgb(152 120 77 / 14%), transparent 32rem),
        radial-gradient(circle at 8% 92%, rgb(27 25 22 / 5%), transparent 26rem),
        var(--color-soft);
}

.error-page__inner {
    position: relative;
    z-index: 1;
    max-width: 40rem;
    display: grid;
    justify-items: center;
    text-align: center;
}

.error-page__eyebrow {
    margin: 0;
    color: var(--color-gold);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
}

.error-page__code {
    margin: 12px 0 0;
    color: var(--color-gold);
    font-size: clamp(4.5rem, 16vw, 8.5rem);
    font-weight: 500;
    line-height: 0.88;
    letter-spacing: -0.06em;
}

.error-page--404 .error-page__code {
    font-size: clamp(6rem, 22vw, 11rem);
}

.error-page__mark {
    width: 9px;
    height: 9px;
    display: block;
    margin-block: 22px 18px;
    border: 1px solid var(--color-gold);
    background: transparent;
    transform: rotate(45deg);
}

.error-page h1 {
    max-width: 16ch;
    margin: 0;
    color: var(--color-ink);
    font-size: var(--text-display);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

.error-page__lead {
    max-width: 38ch;
    margin: 14px 0 0;
    color: var(--color-muted);
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    line-height: 1.9;
}

.error-page__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

.error-page__actions .primary-button {
    min-width: min(100%, 220px);
    min-height: 48px;
    padding-inline: 28px;
    box-shadow: var(--shadow-soft);
    transition: background var(--duration-fast) var(--ease-luxury), transform var(--duration-fast) var(--ease-luxury);
}

.error-page__actions .primary-button:hover {
    background: var(--color-ink);
}

.error-page__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 2px;
    margin-top: 28px;
}

.error-page__links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-inline: 14px;
    color: var(--color-gold-dark);
    font-size: 0.88rem;
    border-bottom: 1px solid transparent;
    transition: color var(--duration-fast) var(--ease-luxury), border-color var(--duration-fast) var(--ease-luxury);
}

.error-page__links a:hover,
.error-page__links a:focus-visible {
    color: var(--color-ink);
    border-bottom-color: currentcolor;
}

@media (max-width: 640px) {
    .error-page__actions,
    .error-page__actions .primary-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .error-page__actions .primary-button,
    .error-page__links a {
        transition: none;
    }

    .error-page__actions .primary-button:hover {
        transform: none;
    }
}

/* The missing page uses the Roz navy and gold identity; other error codes keep the quiet layout above. */
.error-page--404 {
    min-height: max(620px, calc(100dvh - 156px));
    padding-block: clamp(36px, 5vw, 76px);
    color: #f8f5ef;
    background:
        radial-gradient(circle at 77% 44%, rgb(40 94 143 / 28%), transparent 34%),
        radial-gradient(circle at 12% 80%, rgb(213 175 107 / 10%), transparent 30%),
        linear-gradient(125deg, #05284e 0%, #061e3b 55%, #04172e 100%);
}

.error-page--404::before {
    position: absolute;
    inset: 18px;
    z-index: -1;
    border: 1px solid rgb(210 172 103 / 14%);
    content: '';
    pointer-events: none;
}

.error-404 {
    width: min(1320px, calc(100% - clamp(48px, 8vw, 120px)));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
    align-items: center;
    gap: clamp(30px, 6vw, 100px);
}

.error-404__copy { position: relative; z-index: 2; max-width: 620px; }
.error-404__eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 42px;
    color: #d2ac67;
    font-size: .84rem;
    font-weight: 600;
    letter-spacing: .01em;
    animation: error-404-reveal .8s .06s both;
}
.error-404__eyebrow span { width: 10px; height: 10px; border: 1px solid currentcolor; transform: rotate(45deg); }
.error-404__index {
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(100%, 420px);
    margin: 0 0 20px;
    color: #d2ac67;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    animation: error-404-reveal .8s .12s both;
}
.error-404__index > span:nth-child(2) { height: 1px; flex: 1; background: rgb(210 172 103 / 40%); }
.error-404__index [dir='ltr'] { font-family: Georgia, serif; letter-spacing: .14em; }
.error-404 h1 {
    max-width: 12ch;
    margin: 0;
    color: #fffaf1;
    font-size: clamp(2.5rem, 4.1vw, 4.4rem);
    font-weight: 500;
    line-height: 1.28;
    letter-spacing: -.035em;
    animation: error-404-reveal .8s .18s both;
}
.error-404__lead {
    max-width: 43ch;
    margin: 24px 0 0;
    color: #bac9d8;
    font-size: clamp(.92rem, 1.15vw, 1.05rem);
    line-height: 2;
    animation: error-404-reveal .8s .27s both;
}
.error-404__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
    animation: error-404-reveal .8s .36s both;
}
.error-404__button {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 11px 25px;
    border: 1px solid #d2ac67;
    font-size: .9rem;
    font-weight: 700;
    transition: background .25s ease, color .25s ease, border-color .25s ease, transform .25s var(--ease-luxury);
}
.error-404__button svg { width: 19px; height: 19px; fill: none; stroke: currentcolor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.error-404__button--primary { color: #082745; background: #d2ac67; }
.error-404__button--secondary { color: #f8f5ef; background: transparent; }
.error-404__button:hover { transform: translateY(-3px); }
.error-404__button--primary:hover { background: #eed29a; border-color: #eed29a; }
.error-404__button--secondary:hover { color: #082745; background: #d2ac67; }
.error-404__button:focus-visible,
.error-404__links a:focus-visible { outline: 2px solid #f8e2b5; outline-offset: 4px; }
.error-404__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 22px;
    margin-top: 45px;
    padding-top: 20px;
    border-top: 1px solid rgb(210 172 103 / 26%);
    animation: error-404-reveal .8s .45s both;
}
.error-404__links > span { width: 100%; color: #90a9bd; font-size: .76rem; }
.error-404__links a { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; color: #e1c48a; font-size: .82rem; transition: color .2s ease; }
.error-404__links a:hover { color: #fff; }
.error-404__links a span { font-family: Arial, sans-serif; font-size: .9rem; }

.error-404__visual {
    min-width: 0;
    animation: error-404-appear 1.1s .12s both;
}
.error-404__stage {
    position: relative;
    height: clamp(390px, 40vw, 550px);
    display: grid;
    place-items: center;
    isolation: isolate;
}
.error-404__stage::before {
    position: absolute;
    inset: 14% 8%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(210 172 103 / 12%), transparent 65%);
    content: '';
}
.error-404__number {
    position: relative;
    z-index: 1;
    color: transparent;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(12rem, 23vw, 22rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -.11em;
    -webkit-text-stroke: 1px rgb(219 184 121 / 64%);
    text-shadow: 0 20px 65px rgb(0 0 0 / 11%);
}
.error-404__orbit {
    position: absolute;
    inset: 50% auto auto 50%;
    display: block;
    border-radius: 50%;
    pointer-events: none;
}
.error-404__orbit--outer {
    width: 87%;
    height: 75%;
    border: 1px solid rgb(210 172 103 / 27%);
    border-inline-start-color: rgb(210 172 103 / 72%);
    animation: error-404-orbit 24s linear infinite;
}
.error-404__orbit--inner {
    width: 62%;
    height: 61%;
    border: 1px solid rgb(210 172 103 / 14%);
    border-block-start-color: rgb(210 172 103 / 42%);
    animation: error-404-orbit-reverse 30s linear infinite;
}
.error-404__gem {
    position: absolute;
    z-index: 2;
    inset: 50% auto auto 50%;
    width: clamp(100px, 12vw, 165px);
    height: auto;
    color: #e4bf78;
    stroke: currentcolor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 12px 18px rgb(210 172 103 / 25%));
    animation: error-404-float 5.5s ease-in-out infinite;
}
.error-404__gem path:first-child { fill: rgb(210 172 103 / 9%); }
.error-404__spark {
    position: absolute;
    z-index: 3;
    width: 9px;
    height: 9px;
    border: 1px solid #e4bf78;
    transform: rotate(45deg);
    animation: error-404-sparkle 3.5s ease-in-out infinite;
}
.error-404__spark--one { inset: 13% 20% auto auto; }
.error-404__spark--two { inset: auto auto 21% 17%; width: 6px; height: 6px; animation-delay: 1s; }
.error-404__spark--three { inset: 38% auto auto 8%; width: 5px; height: 5px; animation-delay: 2.1s; }
.error-404__visual-caption {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-top: 13px;
    border-top: 1px solid rgb(210 172 103 / 28%);
    color: #9bb0c0;
    direction: ltr;
    font-family: Georgia, serif;
    font-size: .67rem;
    letter-spacing: .17em;
}

@keyframes error-404-reveal { from { opacity: 0; transform: translateY(17px); } to { opacity: 1; transform: translateY(0); } }
@keyframes error-404-appear { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes error-404-orbit { from { transform: translate(-50%, -50%) rotate(-28deg); } to { transform: translate(-50%, -50%) rotate(332deg); } }
@keyframes error-404-orbit-reverse { from { transform: translate(-50%, -50%) rotate(25deg); } to { transform: translate(-50%, -50%) rotate(-335deg); } }
@keyframes error-404-float { 0%, 100% { transform: translate(-50%, -50%) translateY(4px); } 50% { transform: translate(-50%, -50%) translateY(-12px); } }
@keyframes error-404-sparkle { 0%, 100% { opacity: .35; scale: .75; } 50% { opacity: 1; scale: 1.15; } }

@media (max-width: 980px) {
    .error-page--404 { padding-block: 30px 60px; }
    .error-404 { max-width: 720px; grid-template-columns: 1fr; gap: 0; }
    .error-404__visual { order: -1; }
    .error-404__stage { height: 300px; }
    .error-404__number { font-size: clamp(12rem, 43vw, 19rem); }
    .error-404__gem { width: clamp(100px, 17vw, 140px); }
    .error-404__visual-caption { display: none; }
    .error-404__copy { max-width: 600px; margin-inline: auto; text-align: center; }
    .error-404__eyebrow, .error-404__index, .error-404__actions, .error-404__links { justify-content: center; }
    .error-404__eyebrow { margin-bottom: 24px; }
    .error-404__index { margin-inline: auto; }
    .error-404 h1, .error-404__lead { margin-inline: auto; }
}

@media (max-width: 640px) {
    .error-page--404 { min-height: calc(100dvh - 85px); padding-block: 18px 100px; }
    .error-page--404::before { inset: 9px; }
    .error-404 { width: calc(100% - 42px); }
    .error-404__stage { height: 225px; }
    .error-404__number { font-size: clamp(10rem, 49vw, 14rem); }
    .error-404__gem { width: clamp(85px, 25vw, 108px); }
    .error-404__eyebrow { margin-bottom: 18px; font-size: .76rem; }
    .error-404__index { margin-bottom: 14px; }
    .error-404 h1 { max-width: 15ch; font-size: clamp(1.9rem, 7vw, 2.5rem); }
    .error-404__lead { margin-top: 16px; font-size: .88rem; line-height: 1.9; }
    .error-404__actions { gap: 10px; margin-top: 24px; }
    .error-404__button { width: 100%; min-height: 49px; }
    .error-404__links { margin-top: 30px; padding-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .error-page--404 *, .error-page--404 *::before, .error-page--404 *::after {
        animation: none !important;
        transition: none !important;
    }
    .error-404__orbit--outer { transform: translate(-50%, -50%) rotate(-28deg); }
    .error-404__orbit--inner { transform: translate(-50%, -50%) rotate(25deg); }
    .error-404__gem { transform: translate(-50%, -50%); }
    .error-404__button:hover { transform: none; }
}
