/* ==========================================================================
   1. LOCAL CUSTOM FONTS (@font-face)
   ========================================================================== */
@font-face {
    font-family: 'FestivalMotto';
    src: url('/fonts/inter-v13-latin-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'FestivalTitle';
    src: url('/fonts/cinzel-v23-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'FestivalTech';
    src: url('/fonts/space-mono-v17-latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   2. BASE LAYOUT & BACKDROP
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0a0a0a; 
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 24px; 
}

.background-glow {
    position: absolute;
    width: 90vw;
    height: 90vw;
    max-width: 600px;
    max-height: 600px;
    /* SAFARI & WEBKIT COLOR COMPATIBILITY PATCH */
    background: radial-gradient(circle, rgba(229, 9, 20, 0.25) 0%, rgba(229, 9, 20, 0.06) 45%, rgba(229, 9, 20, 0) 70%);
    top: 50%;
    left: 50%;
    /* FORCE HARDWARE ACCELERATION FOR MAC OS TRAFFIC */
    transform: translate(-50%, -50%) translateZ(0);
    -webkit-transform: translate(-50%, -50%) translateZ(0);
    z-index: 1;
    pointer-events: none;
    animation: glowBreathe 8s infinite ease-in-out both;
}

.container {
    text-align: center;
    z-index: 2;
    width: 100%;
    max-width: 900px;
}

/* ==========================================================================
   3. INDEX PAGE COMPONENTS
   ========================================================================== */
.motto {
    font-family: 'FestivalMotto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: clamp(1.6rem, 4.5vw, 3.5rem); 
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1.25;
    margin-bottom: 3rem;
    color: #f5f5f7;
    word-break: keep-all;
}

.motto span.dot, .error-message span.dot {
    color: #e50914; 
}

.festival-title {
    font-family: 'FestivalTitle', "Times New Roman", Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 3.8vw, 2.8rem);
    text-transform: uppercase;
    letter-spacing: 0.18em; 
    line-height: 1.4;
    margin-bottom: 4rem;
    color: #ffffff;
}

.coming-soon {
    font-family: 'FestivalTech', monospace;
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    text-transform: lowercase;
    letter-spacing: 0.22em;
    color: rgba(255, 255, 255, 0.4); 
    position: relative;
    display: inline-block;
}

.coming-soon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 25%;
    width: 50%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    animation: pulse 3s infinite ease-in-out;
}

/* ==========================================================================
   4. 404 ERROR PAGE COMPONENTS
   ========================================================================== */
.error-code {
    font-family: 'FestivalMotto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: clamp(4rem, 12vw, 8rem); 
    line-height: 1;
    letter-spacing: -0.05em;
    color: #ffffff; 
    margin-bottom: 1rem;
    animation: glitchFade 1.5s ease-out forwards;
}

.error-message {
    font-family: 'FestivalMotto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: clamp(1.2rem, 3vw, 2rem);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
    color: #f5f5f7;
}

.return-link {
    font-family: 'FestivalTech', monospace;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    text-transform: lowercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.return-link:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.03);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   5. SEQUENTIAL ANIMATIONS
   ========================================================================== */
.fade-in-1 { animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.fade-in-2 { animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards; opacity: 0; }
.fade-in-3 { animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards; opacity: 0; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glitchFade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; width: 30%; left: 35%; }
    50% { opacity: 1; width: 60%; left: 20%; }
}

@keyframes glowBreathe {
    0%, 100% {
        transform: translate(-50%, -50%) translateZ(0) scale(0.92);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) translateZ(0) scale(1.08);
        opacity: 1;
    }
}

/* ==========================================================================
   6. CINEMATIC LOCALE SWITCHER (DIRECTORY ROUTING STYLE)
   ========================================================================== */
.locale-switcher {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 100;
}

.locale-trigger {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.locale-trigger:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.03);
}

.locale-menu {
    position: absolute;
    top: 100%;
    margin-top: 8px;
    right: 0;
    background-color: #121212;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* HOVER BRIDGE TO PREVENT COLD DISCONNECTS */
.locale-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
}

.locale-switcher.is-open .locale-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (hover: hover) {
    .locale-switcher:hover .locale-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.locale-option {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 3px;
    text-decoration: none;
}

.locale-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.locale-flag {
    font-size: 1.1rem;
    display: inline-block;
    vertical-align: middle;
    height: 1em;
}

/* ==========================================================================
   7. LOCAL FLAG VECTOR GRAPHICS
   ========================================================================== */
.fib, .fi {
    background-size: contain;
    background-position: 50%;
    background-repeat: no-repeat;
}

.fi {
    position: relative;
    display: inline-block;
    width: 1.333333em;
    line-height: 1em;
}

.fi:before {
    content: "\a0";
}

.fi.fis {
    width: 1em;
}

.fi-cn { background-image: url(/flags/cn4x3.svg); }
.fi-cn.fis { background-image: url(/flags/cn1x1.svg); }

.fi-es { background-image: url(/flags/es4x3.svg); }
.fi-es.fis { background-image: url(/flags/es1x1.svg); }

.fi-fr { background-image: url(/flags/fr4x3.svg); }
.fi-fr.fis { background-image: url(/flags/fr1x1.svg); }

.fi-it { background-image: url(/flags/it4x3.svg); }
.fi-it.fis { background-image: url(/flags/it1x1.svg); }

.fi-gbus { background-image: url(/flags/gbus4x3.svg); }
.fi-gbus.fis { background-image: url(/flags/gbus1x1.svg); }