/*** Spinner ***/
:root {
    /* CRMM Green & Gold Theme */
    --background: hsl(90, 8%, 96%);
    --foreground: hsl(120, 25%, 18%);
    /* Cards with warm feel */
    --card: hsl(90, 10%, 98%);
    --card-foreground: hsl(120, 25%, 18%);
    /* Popovers */
    --popover: hsl(90, 10%, 98%);
    --popover-foreground: hsl(120, 25%, 18%);
    /* Primary - CRMM Green (torre) */
    --primary: hsl(120, 30%, 35%);
    --primary-foreground: hsl(90, 20%, 98%);
    /* Secondary - Warm cream */
    --secondary: hsl(45, 20%, 92%);
    --secondary-foreground: hsl(120, 25%, 20%);
    /* Muted - Soft gray-green */
    --muted: hsl(90, 8%, 90%);
    --muted-foreground: hsl(120, 10%, 45%);
    /* Accent - CRMM Gold/Orange */
    --accent: hsl(38, 75%, 50%);
    --accent-foreground: hsl(120, 25%, 15%);
    /* Destructive */
    --destructive: hsl(0, 72%, 51%);
    --destructive-foreground: hsl(0, 0%, 100%);
    /* Borders & Inputs */
    --border: hsl(90, 10%, 82%);
    --input: hsl(90, 10%, 85%);
    --ring: hsl(120, 30%, 35%);
    --radius: 0.75rem;
    /* Custom Variables - CRMM Theme */
    --stone: hsl(120, 25%, 22%);
    --stone-light: hsl(90, 10%, 75%);
    --gold: hsl(38, 80%, 55%);
    --gold-dark: hsl(32, 75%, 42%);
    --terracotta: hsl(38, 65%, 48%);
    --cream: hsl(45, 30%, 96%);
    --crmm-green: hsl(120, 30%, 35%);
    --crmm-green-light: hsl(120, 25%, 45%);
    /* Gradients */
    --gradient-hero: linear-gradient(135deg, hsla(120, 25%, 12%, 0.9), hsla(120, 20%, 20%, 0.7));
    --gradient-gold: linear-gradient(135deg, hsl(38, 80%, 55%), hsl(32, 75%, 42%));
    --gradient-green: linear-gradient(135deg, hsl(120, 30%, 35%), hsl(120, 25%, 45%));
    --gradient-stone: linear-gradient(180deg, hsl(90, 8%, 96%), hsl(90, 10%, 92%));
    --gradient-dark: linear-gradient(180deg, hsl(120, 25%, 15%), hsl(120, 30%, 8%));
    /* Shadows */
    --shadow-sm: 0 2px 8px hsla(120, 25%, 15%, 0.08);
    --shadow-md: 0 4px 20px hsla(120, 25%, 15%, 0.12);
    --shadow-lg: 0 8px 40px hsla(120, 25%, 15%, 0.16);
    --shadow-gold: 0 4px 24px hsla(38, 80%, 55%, 0.3);
}

body {
    font-family: 'Inter', sans-serif;
    color: #333333;
    background: var(--gradient-hero);
    overflow: hidden;
    overflow-y: auto;
    font-weight: 400;
    line-height: 1.6;
}

/* ============================================
   PAGE LOADER
   ============================================ */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

    .page-loader.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

.page-loader-logo {
    width: 240px;
    height: auto;
    margin-bottom: 2rem;
    animation: loader-pulse 2s ease-in-out infinite;
}

.page-loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid hsla(38, 80%, 55%, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: loader-spin 1s linear infinite;
}

.page-loader-text {
    margin-top: 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: 0.875rem;
    color: hsla(90, 20%, 95%, 0.7);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes loader-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

.page-404 {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--gradient-dark);
    color: var(--cream);
}

/* Animated musical notes floating */
.floating-notes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.note {
    position: absolute;
    font-size: 2rem;
    opacity: 0.08;
    color: var(--gold);
    animation: floatNote 12s ease-in-out infinite;
}

    .note:nth-child(1) {
        left: 5%;
        top: 20%;
        animation-delay: 0s;
        font-size: 3rem;
    }

    .note:nth-child(2) {
        left: 15%;
        top: 60%;
        animation-delay: 2s;
        font-size: 1.5rem;
    }

    .note:nth-child(3) {
        left: 30%;
        top: 35%;
        animation-delay: 4s;
        font-size: 2.5rem;
    }

    .note:nth-child(4) {
        left: 50%;
        top: 75%;
        animation-delay: 1s;
        font-size: 2rem;
    }

    .note:nth-child(5) {
        left: 65%;
        top: 15%;
        animation-delay: 3s;
        font-size: 3.5rem;
    }

    .note:nth-child(6) {
        left: 80%;
        top: 50%;
        animation-delay: 5s;
        font-size: 1.8rem;
    }

    .note:nth-child(7) {
        left: 90%;
        top: 30%;
        animation-delay: 2.5s;
        font-size: 2.2rem;
    }

    .note:nth-child(8) {
        left: 40%;
        top: 85%;
        animation-delay: 6s;
        font-size: 1.6rem;
    }

@keyframes floatNote {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.06;
    }

    25% {
        transform: translateY(-30px) rotate(10deg);
        opacity: 0.12;
    }

    50% {
        transform: translateY(-15px) rotate(-5deg);
        opacity: 0.08;
    }

    75% {
        transform: translateY(-40px) rotate(8deg);
        opacity: 0.1;
    }
}

/* Tower silhouette watermark */
.tower-404 {
    position: absolute;
    bottom: -20px;
    right: 5%;
    width: 180px;
    height: 320px;
    opacity: 0.04;
    color: var(--gold);
}

.tower-404-left {
    position: absolute;
    bottom: -20px;
    left: 5%;
    width: 140px;
    height: 260px;
    opacity: 0.03;
    color: var(--gold);
    transform: scaleX(-1);
}

/* Content */
.content-404 {
    position: relative;
    z-index: 10;
    text-align: center;    
    padding: 2rem;
}

.logo-404 {
    width: auto;
    max-height: 140px;
    max-width: 90%;
    height: auto;
    margin: 0 auto 2rem;
    opacity: 0.9;
    animation: pulse404 3s ease-in-out infinite;
}

@keyframes pulse404 {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.error-code {
    font-family: 'Cinzel', serif;
    font-size: 8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, hsl(38, 80%, 55%), hsl(32, 75%, 42%), hsl(38, 80%, 55%));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer404 3s linear infinite;
}

@keyframes shimmer404 {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.subtitle-404 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: hsl(45, 30%, 90%);
    margin-bottom: 1rem;
}

.description-404 {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    color: hsl(90, 10%, 60%);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

/* Decorative divider */
.divider-404 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.divider-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.divider-icon {
    color: var(--gold);
    font-size: 1.2rem;
}

/* Buttons */
.buttons-404 {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.btn-404-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, hsl(38, 80%, 55%), hsl(32, 75%, 42%));
    color: hsl(90, 20%, 98%);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 24px hsl(38, 80%, 55%, 0.3);
}

    .btn-404-primary:hover {
        color: #2a472a;
        transform: translateY(-2px);
        box-shadow: 0 8px 32px hsl(38, 80%, 55%, 0.4);
    }

.btn-404-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: transparent;
    color: hsl(38, 80%, 55%);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid hsl(38, 80%, 55%, 0.4);
    border-radius: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

    .btn-404-outline:hover {
        color: #7b917b;
        background: hsl(38, 80%, 55%, 0.1);
        border-color: hsl(38, 80%, 55%);
        transform: translateY(-2px);
    }

/* Quick links */
.quick-links-404 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
}

.quick-link {
    font-family: 'Lora', serif;
    color: hsl(90, 10%, 55%);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    position: relative;
}

    .quick-link:hover {
        color: var(--gold);
    }

    .quick-link::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 0;
        height: 1px;
        background: var(--gold);
        transition: width 0.3s ease;
    }

    .quick-link:hover::after {
        width: 100%;
    }

/* Responsive */
@media (max-width: 640px) {
    .error-code {
        font-size: 5rem;
    }

    .subtitle-404 {
        font-size: 1.2rem;
    }

    .description-404 {
        font-size: 1rem;
    }

    .tower-404 {
        width: 120px;
        height: 220px;
    }

    .tower-404-left {
        display: none;
    }
}
