/* ============================================================
   Wolvex — Error pages
   Friendly, plain-English pages with CSS-only animations in
   brand colours. All motion respects prefers-reduced-motion
   (globally disabled in reset.css).
   ============================================================ */
.error-page .error-hero {
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: var(--space-12) 0 var(--space-16);
    text-align: center;
}

.error-page .error-code {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--fs-sm);
    letter-spacing: 0.2em;
    color: var(--red);
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.error-page .error-hero h1 {
    max-width: 22ch;
    margin-left: auto;
    margin-right: auto;
}

.error-page .error-hero .lead {
    color: var(--ink-soft);
    font-size: var(--fs-lg);
    max-width: 46ch;
    margin: 0 auto var(--space-6);
}

.error-page .error-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-6);
}

.error-page .error-search {
    margin-top: var(--space-6);
}

/* ============ Shared scene canvas ============ */
.error-scene {
    position: relative;
    max-width: 30rem;
    height: 180px;
    margin: 0 auto var(--space-8);
    overflow: hidden;
}

.error-scene .ground {
    position: absolute;
    bottom: 12px;
    left: 8%;
    right: 8%;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--line);
}

/* ============ 404 — wandering wolf ============ */
.wolf {
    position: absolute;
    bottom: 16px;
    left: 0;
    width: 130px;
    height: 84px;
    background: var(--navy);
    clip-path: polygon(
        0% 40%, 8% 52%, 14% 46%, 20% 36%, 30% 32%, 42% 30%,
        55% 26%, 59% 10%, 64% 24%, 70% 8%, 74% 24%, 82% 26%,
        96% 34%, 100% 42%, 88% 46%, 84% 56%, 80% 94%, 74% 94%,
        72% 62%, 60% 60%, 48% 62%, 46% 94%, 40% 94%, 38% 64%,
        30% 64%, 28% 94%, 22% 94%, 20% 60%, 14% 58%, 8% 50%
    );
    animation: wolf-wander 14s ease-in-out infinite;
}

.wolf::after {
    /* red collar detail */
    content: "";
    position: absolute;
    top: 30%;
    right: 16%;
    width: 8%;
    height: 18%;
    background: var(--red);
}

@keyframes wolf-wander {
    0%    { transform: translateX(0) scaleX(1); }
    22%   { transform: translateX(240px) scaleX(1); }
    25%   { transform: translateX(250px) scaleX(1) translateY(-4px); }
    28%   { transform: translateX(260px) scaleX(1); }
    48%   { transform: translateX(310px) scaleX(1); }
    50%   { transform: translateX(310px) scaleX(-1); }
    75%   { transform: translateX(120px) scaleX(-1) translateY(-3px); }
    98%   { transform: translateX(0) scaleX(-1); }
    100%  { transform: translateX(0) scaleX(1); }
}

.moon {
    position: absolute;
    top: 14px;
    right: 18%;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--red);
    opacity: 0.85;
    animation: moon-glow 6s ease-in-out infinite;
}

@keyframes moon-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(193, 32, 37, 0.25); }
    50%      { box-shadow: 0 0 0 16px rgba(193, 32, 37, 0); }
}

/* ============ 410 — shield drifting away ============ */
.shield-gone {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 84px;
    height: 100px;
    margin-left: -42px;
    background: var(--navy);
    border-radius: 42px 42px 50% 50% / 14px 14px 70% 70%;
    animation: drift-away 7s ease-in-out infinite;
}

.shield-gone::before {
    content: "";
    position: absolute;
    inset: 34% 18% 40%;
    background: var(--red);
    border-radius: var(--radius-sm);
}

@keyframes drift-away {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    70%  { transform: translateY(-90px) rotate(8deg); opacity: 0; }
    71%  { transform: translateY(30px) rotate(-4deg); opacity: 0; }
    100% { transform: translateY(0) rotate(0deg); opacity: 1; }
}

/* ============ 419 — hourglass ============ */
.hourglass {
    position: absolute;
    left: 50%;
    bottom: 30px;
    width: 0;
    height: 0;
    margin-left: -34px;
    animation: hourglass-flip 5s cubic-bezier(0.6, 0, 0.4, 1) infinite;
    transform-origin: 34px 52px;
}

.hourglass .top,
.hourglass .bottom {
    position: absolute;
    left: 0;
    width: 0;
    height: 0;
    border-left: 34px solid transparent;
    border-right: 34px solid transparent;
}

.hourglass .top {
    top: 0;
    border-top: 52px solid var(--navy);
}

.hourglass .bottom {
    top: 52px;
    border-bottom: 52px solid var(--red);
}

@keyframes hourglass-flip {
    0%, 55%  { transform: rotate(0deg); }
    70%, 100% { transform: rotate(180deg); }
}

/* ============ 429 — patient queue dots ============ */
.queue-dots {
    position: absolute;
    left: 50%;
    bottom: 60px;
    display: flex;
    gap: var(--space-4);
    transform: translateX(-50%);
}

.queue-dots span {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background: var(--navy);
    animation: queue-bob 1.8s ease-in-out infinite;
}

.queue-dots span:nth-child(2) { animation-delay: 0.2s; background: var(--navy-mid); }
.queue-dots span:nth-child(3) { animation-delay: 0.4s; background: var(--red); }

@keyframes queue-bob {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-22px); }
}

/* ============ 500 — flickering shield with spark ============ */
.shield-fix {
    position: absolute;
    left: 50%;
    bottom: 24px;
    width: 84px;
    height: 100px;
    margin-left: -42px;
    background: var(--navy);
    border-radius: 42px 42px 50% 50% / 14px 14px 70% 70%;
    animation: shield-flicker 4s steps(1, end) infinite;
}

.shield-fix::before {
    content: "";
    position: absolute;
    inset: 34% 18% 40%;
    background: var(--red);
    border-radius: var(--radius-sm);
}

.shield-fix::after {
    /* loose bolt */
    content: "";
    position: absolute;
    right: -26px;
    top: 12px;
    width: 14px;
    height: 14px;
    background: var(--amber);
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    animation: bolt-spin 4s linear infinite;
}

@keyframes shield-flicker {
    0%, 8%, 12%, 100% { opacity: 1; }
    9%, 11%           { opacity: 0.45; }
    52%               { opacity: 1; }
    54%               { opacity: 0.5; }
    56%               { opacity: 1; }
}

@keyframes bolt-spin {
    from { transform: rotate(0deg) translateY(0); }
    50%  { transform: rotate(180deg) translateY(6px); }
    to   { transform: rotate(360deg) translateY(0); }
}

/* ============ 503 — maintenance cone ============ */
.cone {
    position: absolute;
    left: 50%;
    bottom: 16px;
    width: 0;
    height: 0;
    margin-left: -46px;
    border-left: 46px solid transparent;
    border-right: 46px solid transparent;
    border-bottom: 104px solid var(--red);
    animation: cone-bob 3.2s ease-in-out infinite;
}

.cone::before {
    content: "";
    position: absolute;
    top: 38px;
    left: -32px;
    width: 64px;
    height: 18px;
    background: var(--cream);
}

.cone::after {
    content: "";
    position: absolute;
    top: 68px;
    left: -42px;
    width: 84px;
    height: 16px;
    background: var(--navy);
    border-radius: var(--radius-sm);
}

@keyframes cone-bob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-8px) rotate(-2deg); }
}

/* Static fallback when motion is reduced */
@media (prefers-reduced-motion: reduce) {
    .wolf {
        left: 40%;
    }
}
