@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg-dark: #1a1a2e;
    --bg-mid: #16213e;
    --accent-gold: #fcc419;
    --accent-orange: #ff922b;
    --accent-fur: #87674a;
    --accent-pink: #f06595;
    --text-light: #e8e8e8;
    --text-muted: #8899aa;
}

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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(252, 196, 25, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(240, 101, 149, 0.06) 0%, transparent 60%);
    font-family: 'Fredoka', sans-serif;
    color: var(--text-light);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* Floating paw prints background */
.paw-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.paw {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0;
    animation: pawFloat 12s infinite ease-in-out;
    color: var(--accent-gold);
    filter: blur(0.5px);
}

@keyframes pawFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) rotate(0deg);
    }
    10% {
        opacity: 0.12;
    }
    90% {
        opacity: 0.12;
    }
    100% {
        opacity: 0;
        transform: translateY(-10vh) rotate(360deg);
    }
}

/* Main container */
.container {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
}

/* Clock */
.clock-wrapper {
    position: fixed;
    bottom: 1.5rem;
    right: 2rem;
    z-index: 10;
}

.clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: var(--accent-gold);
    background: rgba(252, 196, 25, 0.08);
    border: 1px solid rgba(252, 196, 25, 0.2);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    backdrop-filter: blur(8px);
    letter-spacing: 0.05em;
    text-shadow: 0 0 12px rgba(252, 196, 25, 0.4);
}

.clock-label {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.2rem;
    text-align: right;
}

/* 404 glitch number */
.error-code {
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    position: relative;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-orange) 50%, var(--accent-pink) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glitchShift 8s infinite;
    filter: drop-shadow(0 0 30px rgba(252, 196, 25, 0.3));
}

@keyframes glitchShift {
    0%, 92%, 100% {
        transform: none;
    }
    93% {
        transform: translate(-3px, 1px) skewX(-1deg);
    }
    94% {
        transform: translate(3px, -1px) skewX(1deg);
    }
    95% {
        transform: translate(-2px, 0) skewX(0deg);
    }
    96% {
        transform: none;
    }
}

/* SVG mascot */
.mascot-wrapper {
    position: relative;
    display: inline-block;
    margin: 1rem 0;
}

.mascot-svg {
    width: clamp(220px, 50vw, 360px);
    height: auto;
    filter: drop-shadow(0 8px 32px rgba(0, 0, 0, 0.5));
    border-radius: 20px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mascot-svg:hover {
    transform: scale(1.05) rotate(-2deg);
}

/* Ear twitch */
.ear-left {
    transform-origin: 36px 25px;
    animation: earTwitchL 6s infinite ease-in-out;
}

.ear-right {
    transform-origin: 99px 25px;
    animation: earTwitchR 8s infinite ease-in-out;
}

@keyframes earTwitchL {
    0%, 85%, 92%, 100% {
        transform: rotate(0deg);
    }
    87% {
        transform: rotate(-4deg);
    }
    89% {
        transform: rotate(2deg);
    }
    91% {
        transform: rotate(-1deg);
    }
}

@keyframes earTwitchR {
    0%, 78%, 86%, 100% {
        transform: rotate(0deg);
    }
    80% {
        transform: rotate(3deg);
    }
    82% {
        transform: rotate(-2deg);
    }
    84% {
        transform: rotate(1deg);
    }
}

/* Eye blink animation */
.eye-yellow, .eye-pupil, .eye-ring {
    transform-origin: 46.508px 61.358px;
}

.eye-group-right .eye-yellow,
.eye-group-right .eye-pupil,
.eye-group-right .eye-ring {
    /* right eye is mirrored, transform-origin stays in local coords */
    transform-origin: 46.508px 61.358px;
}

@keyframes blink {
    0%, 42%, 48%, 100% {
        transform: scaleY(1);
    }
    45% {
        transform: scaleY(0.05);
    }
}

@keyframes blink2 {
    0%, 72%, 78%, 100% {
        transform: scaleY(1);
    }
    75% {
        transform: scaleY(0.05);
    }
}

.eye-group-left .eye-yellow,
.eye-group-left .eye-pupil,
.eye-group-left .eye-ring {
    animation: blink 4s infinite ease-in-out, blink2 7s infinite ease-in-out;
}

.eye-group-right .eye-yellow,
.eye-group-right .eye-pupil,
.eye-group-right .eye-ring {
    animation: blink 4s infinite ease-in-out, blink2 7s infinite ease-in-out;
}

/* Snout breathing */
.snout-breathe {
    transform-origin: 67.7px 115px;
    animation: snoutBreathe 3.5s infinite ease-in-out;
}

@keyframes snoutBreathe {
    0%, 100% {
        transform: scaleY(1) translateY(0);
    }
    50% {
        transform: scaleY(1.04) translateY(0.8px);
    }
}

/* Snarl animation - all synced on 10s cycle */
.snarl-upper {
    transform-origin: 67.7px 116px;
    animation: snarlUpper 10s infinite ease-in-out;
}
.snarl-lower {
    transform-origin: 67.7px 118px;
    animation: snarlLower 10s infinite ease-in-out;
}
.fang {
    transform-origin: 67.7px 115.5px;
    animation: fangReveal 10s infinite ease-in-out;
}
.mouth-cavity {
    animation: cavityReveal 10s infinite ease-in-out;
    opacity: 0;
}
.snarl-tongue {
    animation: tongueReveal 10s infinite ease-in-out;
    opacity: 0;
}

@keyframes snarlUpper {
    0%, 65%, 85%, 100% { transform: translateY(0); }
    72% { transform: translateY(-2.5px); }
    78% { transform: translateY(-1.8px); }
}
@keyframes snarlLower {
    0%, 65%, 85%, 100% { transform: translateY(0); }
    72% { transform: translateY(3px); }
    78% { transform: translateY(2px); }
}
@keyframes fangReveal {
    0%, 63%, 87%, 100% { opacity: 0; transform: translateY(-2px); }
    68% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
}
@keyframes cavityReveal {
    0%, 63%, 87%, 100% { opacity: 0; }
    70% { opacity: 1; }
    80% { opacity: 1; }
}
@keyframes tongueReveal {
    0%, 65%, 85%, 100% { opacity: 0; transform: translateY(-1px); }
    72% { opacity: 1; transform: translateY(1.5px); }
    78% { opacity: 0.9; transform: translateY(1px); }
}

/* Floating ring around mascot */
.mascot-ring {
    position: absolute;
    inset: -20px;
    border: 2px dashed rgba(252, 196, 25, 0.15);
    border-radius: 50%;
    animation: ringRotate 20s linear infinite;
    pointer-events: none;
}

@keyframes ringRotate {
    to {
        transform: rotate(360deg);
    }
}

/* Title */
.title {
    font-size: clamp(1.3rem, 4vw, 2rem);
    font-weight: 600;
    margin: 1rem 0 0.3rem;
    color: var(--text-light);
}

.subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.15rem);
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.subtitle em {
    color: var(--accent-gold);
    font-style: normal;
    font-weight: 600;
}

/* Pun ticker */
.pun-ticker {
    background: rgba(252, 196, 25, 0.06);
    border: 1px solid rgba(252, 196, 25, 0.12);
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    margin: 1.5rem auto;
    max-width: 500px;
    font-size: 0.95rem;
    color: var(--accent-gold);
    min-height: 3.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s;
}

.pun-ticker .pun-icon {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Button */
.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.8rem 2rem;
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bg-dark);
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-orange) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(252, 196, 25, 0.3);
}

.home-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 30px rgba(252, 196, 25, 0.45);
}

.home-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 1;
    letter-spacing: 0.05em;
}

.footer span {
    color: var(--accent-pink);
}

/* Scanline overlay */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.03) 0px,
            rgba(0, 0, 0, 0.03) 1px,
            transparent 1px,
            transparent 3px
    );
}

/* Responsive */
@media (max-width: 500px) {
    .clock-wrapper {
        position: relative;
        top: 0;
        right: 0;
        margin-top: 2rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    .clock-label {
        text-align: center;
    }

    .footer {
        position: relative;
        margin-top: 2rem;
    }
}
