/* ==================== 1. CONFIGURACIÓN BASE ==================== */
:root { 
    --cursor-size: 20px; 
    --cursor-hover-size: 80px; 
    
    /* PALETA: ORO Y NEGRO (Adaptado del segundo código) */
    --gold: #fbbf24;          /* Oro Principal */
    --gold-dim: #b45309;      /* Oro Oscuro / Bronce */
    --dark-bg: #050505;       /* Negro Profundo (Fondo) */
    --dark-secondary: #121212;/* Gris muy oscuro */
    --dark-tertiary: #1f1f1f; /* Para detalles sutiles */
    --text-main: #e5e5e5;     /* Blanco roto */
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--dark-bg); 
    color: var(--text-main); 
    cursor: none; 
    overflow-x: hidden; 
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

h1, h2, h3, h4, .font-heading, .heading { 
    font-family: 'Space Grotesk', sans-serif; 
}

::-webkit-scrollbar { width: 0px; background: transparent; }

/* ==================== 2. UTILIDADES DE TEXTO Y EFECTOS ==================== */

/* Text Glow (Convertido a Oro) */
.text-gold-glow { 
    color: var(--gold); 
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.6), 0 0 10px rgba(251, 191, 36, 0.8); 
    display: inline-block; 
    font-weight: 800; 
}

/* Clip Text (Adaptado a Oro/Blanco) */
.clip-text {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    /* Gradiente de Oro a Blanco/Plata sutil */
    background-image: linear-gradient(to right, #ffffff, var(--gold));
}

/* Film Grain */
.grain-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    pointer-events: none; z-index: 9998; opacity: 0.04; 
    background-image: url("https://upload.wikimedia.org/wikipedia/commons/7/76/Noise_overlay_image.png"); 
    mix-blend-mode: overlay; 
}

/* ==================== 3. SCROLL STORY (KEN BURNS & PANELES) ==================== */

#pinContainer { 
    width: 100%; height: 100vh; 
    position: relative; overflow: hidden; 
    background: var(--dark-bg); 
}

.panel { 
    position: absolute; top: 0; left: 0; 
    width: 100%; height: 100%; 
    display: flex; align-items: center; justify-content: center; 
    opacity: 0; z-index: 1; 
}
.panel.first { opacity: 1; z-index: 1; }

/* Fondos de Fase (Adaptados a Escala de Grises oscuros y toques dorados) */
.bg-fase1 { background: radial-gradient(circle at center, #1c1917, var(--dark-bg)); } /* Cálido muy oscuro */
.bg-fase2 { background: radial-gradient(circle at center, #27272a, var(--dark-bg)); } /* Gris zinc */
.bg-fase3 { background: radial-gradient(circle at center, #3f3f46, var(--dark-bg)); } /* Gris medio */
.bg-fase4 { background: radial-gradient(circle at center, #451a03, var(--dark-bg)); } /* Sutil tono bronce */

.overlay { background: rgba(5, 5, 5, 0.7); position: absolute; inset: 0; }

.story-bg { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    object-fit: cover; z-index: -1; 
    transform: scale(1); transition: transform 10s ease; 
    /* Filtro ajustado al estilo del segundo código (menos azul, más contraste oscuro) */
    filter: brightness(0.4) contrast(1.1); 
    will-change: transform;
}
.panel.active .story-bg { transform: scale(1.1); }

/* ==================== 4. TARJETAS (SPOTLIGHT & FLIP) ==================== */

/* Spotlight Effect */
.spotlight-card { 
    position: relative; overflow: hidden; 
    --mouse-x: 0px; --mouse-y: 0px; 
}
.spotlight-card::before { 
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    opacity: 0; transition: opacity 0.5s; 
    /* Brillo blanco sutil como en el código 2 */
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.08), transparent 40%); 
    pointer-events: none; z-index: 10; will-change: opacity;
}
.spotlight-card:hover::before { opacity: 1; }

/* ESTILOS FLIP CARD */
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    height: 400px;
    width: 100%;
    cursor: pointer;
}

.flip-inner {
    position: relative; width: 100%; height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-inner {
    transform: rotateY(180deg);
}

.flip-front, .flip-back {
    position: absolute; width: 100%; height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.flip-front {
    background-color: var(--dark-secondary);
}
.flip-front img {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(0.7) contrast(1.1) grayscale(0.2);
}

.flip-back {
    /* Gradiente oscuro en lugar de azul */
    background: linear-gradient(to bottom, var(--dark-secondary), #000000);
    color: var(--text-main);
    transform: rotateY(180deg);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    padding: 2rem;
    /* Borde Oro */
    border: 1px solid var(--gold); 
}

/* ==================== 5. LIGHTBOX ==================== */

.lightbox-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

#lightbox-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95); /* Fondo más oscuro */
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none; 
    transition-property: opacity;
    transition-duration: 300ms;
    transition-timing-function: ease-in-out;
}

#lightbox-modal.lightbox-open {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== 6. UI: CURSOR, PRELOADER, FAB ==================== */

#custom-cursor { 
    position: fixed; top: 0; left: 0; 
    width: var(--cursor-size); height: var(--cursor-size); 
    border: 1px solid rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.1); 
    border-radius: 50%; pointer-events: none; z-index: 9999; 
    transform: translate(-50%, -50%); 
    transition: width 0.3s cubic-bezier(0.19, 1, 0.22, 1), 
                height 0.3s cubic-bezier(0.19, 1, 0.22, 1), 
                background 0.3s; 
    backdrop-filter: blur(2px); 
    will-change: width, height, transform, top, left;
}
#custom-cursor.hovered { 
    width: var(--cursor-hover-size); height: var(--cursor-hover-size); 
    /* Fondo dorado al hacer hover */
    background: rgba(234, 179, 8, 0.1); 
    border-color: rgba(234, 179, 8, 0.4); 
    mix-blend-mode: screen; 
}

/* Ticker */
.ticker-wrap { 
    width: 100%; overflow: hidden; 
    background-color: #000; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    white-space: nowrap; 
}
.ticker { display: inline-block; padding-left: 100%; animation: ticker 35s linear infinite; }
@keyframes ticker { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

/* Cards hover */
.card-split { transition: flex 0.5s ease; }
.card-split:hover { flex: 2; }

/* Preloader */
#preloader { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: var(--dark-bg); z-index: 10000; 
    display: flex; justify-content: center; align-items: center; flex-direction: column; 
}
.loader-bar { width: 200px; height: 2px; background: #333; margin-top: 20px; position: relative; overflow: hidden; }
/* Progreso en Oro */
.loader-progress { position: absolute; top: 0; left: 0; height: 100%; width: 0%; background: var(--gold); transition: width 0.2s; }

/* Progress Bar */
#reading-progress { 
    position: fixed; top: 0; left: 0; height: 3px; 
    background: var(--gold); 
    z-index: 9999; width: 0%; transition: width 0.1s; 
    box-shadow: 0 0 10px var(--gold); 
}

/* FAB */
.fab { 
    position: fixed; bottom: 30px; right: 30px; z-index: 50; 
    width: 60px; height: 60px; 
    /* Fondo Dorado */
    background: var(--gold); 
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4); 
    transition: transform 0.3s, background 0.3s; 
    color: #000; /* Icono negro para contraste con oro */
    cursor: none; 
}

.fab:hover { 
    transform: scale(1.1); 
    background: #ffffff; 
}



/* Animación para que las luces se muevan suavemente "flotando" */
 @keyframes float-slow {
        0%, 100% { transform: translate(0, 0) scale(1); }
        33% { transform: translate(30px, -50px) scale(1.1); }
        66% { transform: translate(-20px, 20px) scale(0.9); }
    }
    @keyframes pulse-slow {
        0%, 100% { opacity: 0.5; transform: scale(1); }
        50% { opacity: 0.8; transform: scale(1.1); }
    }
    @keyframes spin-slow {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }
    .animate-float-slow { animation: float-slow 15s ease-in-out infinite; }
    .animate-pulse-slow { animation: pulse-slow 8s ease-in-out infinite; }
    .animate-spin-slow { animation: spin-slow 40s linear infinite; }