/* --- Variables Maestras --- */
:root {
    --primary: #00b4d8;      /* Cian Scienco */
    --secondary: #0077b6;    /* Azul Profundo */
    --dark-bg: #050914;      /* Fondo Principal */
    --text-light: #f8f9fa;
    --text-muted: #adb5bd;
    --glass-bg: rgba(5, 9, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
}

/* --- Base y Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }
body { background-color: var(--dark-bg); color: var(--text-light); line-height: 1.6; overflow-x: hidden; }

/* --- HEADER --- */
.site-header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    transition: all 0.5s ease; 
    padding: 0; /* 0 relleno global para que la top bar toque el techo absoluto */
    background: transparent;
}

.site-header.scrolled {
    background: var(--glass-bg); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.header-container { 
    width: 90%; max-width: 1200px; margin: 0 auto; 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 25px 0; /* El margen de seguridad del logo ahora vive aquí */
    transition: all 0.5s ease;
}

/* Hacemos que el margen de seguridad se encoja suavemente al bajar por la página */
.site-header.scrolled .header-container {
    padding: 12px 0; 
}

/* --- Efecto Etéreo para los Logos --- */
.logo-img, .footer-logo { 
    height: 45px; width: auto; 
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.footer-logo { height: 65px; } /* El del footer es un poco más grande */

/* El Brillo Institucional al pasar el cursor */
.logo-link:hover .logo-desktop, 
.footer-brand:hover .footer-logo {
    transform: scale(1.03); /* Latido sutil */
    filter: drop-shadow(0 5px 15px rgba(0, 180, 216, 0.6)) brightness(1.1);
}

/* El ícono móvil de la hamburguesa gira y brilla */
.logo-link:hover .logo-mobile {
    transform: rotate(180deg) scale(1.15);
    filter: drop-shadow(0 0 15px rgba(0, 180, 216, 0.8));
}

/* --- NAVEGACIÓN PRINCIPAL --- */
.main-nav .nav-list { display: flex; gap: 30px; list-style: none; }
.nav-item { color: var(--text-light); text-decoration: none; font-size: 0.95rem; position: relative; padding: 5px 0; }
.nav-item::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0%; height: 2px; background: var(--primary); transition: 0.4s; }
.nav-item:hover { color: var(--primary); }
.nav-item:hover::after { width: 100%; }

.btn-academia {
    background: rgba(0, 180, 216, 0.1); color: var(--primary); text-decoration: none;
    padding: 10px 24px; border-radius: 50px; border: 1px solid var(--primary); transition: 0.4s;
}
.btn-academia:hover { background: var(--primary); color: #fff; box-shadow: 0 0 20px rgba(0, 180, 216, 0.4); }

/* --- FOOTER DE LA VIDA --- */
.main-footer {
    background-color: #02040a; 
    color: var(--text-light);
    padding-top: 100px; /* Cambiamos el margen por relleno para mantener el espacio visual */
    margin-top: 0; /* <-- CLAVE: Eliminamos el hueco transparente */
    border-top: 1px solid var(--glass-border);
    position: relative; /* <-- CLAVE: Lo anclamos al flujo de la tarjeta que sube */
    z-index: 10; /* <-- CLAVE: Lo obligamos a pasar por encima de la portada fija */
}
.footer-container { width: 90%; max-width: 1200px; margin: 0 auto; }

.footer-brand { text-align: center; margin-bottom: 60px; }

.social-row {
    display: flex; justify-content: center; gap: 40px; 
    flex-wrap: wrap; margin-bottom: 60px;
}
.social-icon {
    color: var(--text-muted); font-size: 2.2rem; 
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Efecto Base del Hover (Redes) --- */
.social-icon:hover {
    transform: translateY(-8px) scale(1.2);
    color: #ffffff; /* El ícono en sí se vuelve blanco puro */
    text-shadow: none; /* Quitamos la sombra plana vieja */
}

/* --- Efectos Neón 3D Bicolor para cada marca --- */
.social-icon:hover .fa-whatsapp { filter: drop-shadow(2px 2px 5px #25D366) drop-shadow(-2px -2px 5px #075E54); }
.social-icon:hover .fa-telegram { filter: drop-shadow(2px 2px 5px #0088cc) drop-shadow(-2px -2px 5px #38e0ff); }
.social-icon:hover .fa-facebook-f { filter: drop-shadow(2px 2px 5px #1877F2) drop-shadow(-2px -2px 5px #00e6ff); }
.social-icon:hover .fa-youtube { filter: drop-shadow(2px 2px 5px #FF0000) drop-shadow(-2px -2px 5px #ff8c00); }
.social-icon:hover .fa-instagram { filter: drop-shadow(2px 2px 5px #E1306C) drop-shadow(-2px -2px 5px #F56040); }
.social-icon:hover .fa-tiktok { filter: drop-shadow(2px 2px 5px #fe0051) drop-shadow(-2px -2px 5px #00f2fe); }
.social-icon:hover .fa-patreon { filter: drop-shadow(2px 2px 5px #FF424D) drop-shadow(-2px -2px 5px #ffb3b7); }
.social-icon:hover .fa-twitch { filter: drop-shadow(2px 2px 5px #9146FF) drop-shadow(-2px -2px 5px #00e5ff); }
.social-icon:hover .fa-linkedin-in { filter: drop-shadow(2px 2px 5px #0A66C2) drop-shadow(-2px -2px 5px #00e5ff); }
.social-icon:hover .fa-envelope { filter: drop-shadow(2px 2px 5px #ea4335) drop-shadow(-2px -2px 5px #fbbc05); }
.social-icon:hover .fa-graduation-cap { filter: drop-shadow(2px 2px 5px #f39c12) drop-shadow(-2px -2px 5px var(--primary)); }

.footer-links-section { padding-bottom: 60px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; }
.footer-col h4 { color: var(--primary); margin-bottom: 25px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 15px; }
.footer-col a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; transition: 0.3s; }
.footer-col a:hover { color: #fff; padding-left: 5px; }

.footer-bottom { background: #000; padding: 25px 0; text-align: center; border-top: 1px solid var(--glass-border); }
.footer-bottom p { font-size: 0.85rem; color: #555; }

/* --- Control de Logos Desktop/Mobile --- */
.logo-desktop { display: block; }
.logo-mobile { display: none; height: 35px; width: auto; transition: transform 0.3s; }

/* --- Menú Desplegable Móvil --- */
.mobile-toggle { display: none; background: none; border: none; color: var(--text-light); font-size: 1.5rem; cursor: pointer; transition: color 0.3s; }
.mobile-toggle:hover { color: var(--primary); }

.mobile-nav-overlay {
    position: absolute; top: 100%; left: 0; width: 100%; background: var(--dark-bg);
    border-top: 1px solid var(--glass-border); padding: 0; max-height: 0; overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.mobile-nav-overlay.active { max-height: 500px; padding: 20px 0; }
.mobile-nav-list { list-style: none; text-align: center; }
.mobile-nav-list li { margin: 15px 0; opacity: 0; transform: translateY(-10px); transition: all 0.3s ease; }
.mobile-nav-overlay.active li { opacity: 1; transform: translateY(0); }
.mobile-nav-list a { color: var(--text-light); text-decoration: none; font-size: 1.2rem; display: inline-block; }
.mobile-nav-list a:hover { color: var(--primary); }
.btn-academia-mobile { color: var(--primary) !important; font-weight: 600; margin-top: 10px; }

/* --- Barra de Progreso de Lectura --- */
.scroll-progress-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 3px;
    background: transparent; z-index: 1001; /* Por encima del header */
}
.scroll-progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-top-right-radius: 3px; border-bottom-right-radius: 3px;
}

/* --- Estado Activo del Menú --- */
.nav-item.active { color: var(--primary); font-weight: 600; }
.nav-item.active::after { width: 100%; }

/* --- Micro-interacción: Enlaces del Footer con flecha oculta --- */
.footer-col a {
    display: inline-block; position: relative; transition: all 0.3s ease;
}
.footer-col a::before {
    content: '→'; position: absolute; left: -15px; opacity: 0;
    color: var(--primary); transition: all 0.3s ease; font-weight: bold;
}
.footer-col a:hover {
    color: #fff; transform: translateX(15px); /* Se desliza a la derecha */
}
.footer-col a:hover::before { opacity: 1; left: -20px; } /* Aparece la flecha */

/* --- Botón Volver Arriba --- */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: var(--primary); border: 1px solid var(--primary);
    width: 50px; height: 50px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer; z-index: 999;
    opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 15px rgba(0, 180, 216, 0.2);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover {
    background: var(--primary); color: #fff; transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 180, 216, 0.5);
}

/* --- Barra Top de Alertas --- */
.top-bar {
    background: linear-gradient(90deg, #02040a, var(--secondary), #02040a);
    color: white; text-align: center; padding: 8px 15px; font-size: 0.85rem;
    position: relative; overflow: hidden; transition: all 0.4s ease;
}
.top-bar a { color: #fff; text-decoration: underline; font-weight: bold; }
.close-top-bar {
    position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: white; cursor: pointer; font-size: 1rem;
    transition: color 0.3s;
}
.close-top-bar:hover { color: var(--primary); }
/* Ocultamos la barra top suavemente al hacer scroll */
.site-header.scrolled .top-bar { height: 0; padding: 0; opacity: 0; pointer-events: none; }

/* --- Píldora de Captación (Newsletter) --- */
.newsletter-glass-box {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 30px 40px; margin-bottom: 50px;
    display: flex; justify-content: space-between; align-items: center;
    backdrop-filter: blur(10px); flex-wrap: wrap; gap: 20px;
}
.newsletter-text h4 { color: var(--text-light); font-size: 1.3rem; margin-bottom: 5px; }
.newsletter-text p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.newsletter-form { display: flex; gap: 10px; flex-grow: 1; max-width: 450px; }
.newsletter-form input {
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    padding: 12px 20px; border-radius: 50px; color: white; width: 100%;
    outline: none; transition: 0.3s; font-family: 'Outfit', sans-serif;
}
.newsletter-form input:focus { border-color: var(--primary); background: rgba(255,255,255,0.1); }
.newsletter-form button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border: none; padding: 0 25px; border-radius: 50px; 
    cursor: pointer; transition: 0.3s;
}
.newsletter-form button:hover { transform: scale(1.05); box-shadow: 0 0 15px rgba(0, 180, 216, 0.4); }

@media (max-width: 768px) {
    .newsletter-glass-box { justify-content: center; text-align: center; padding: 25px 20px; }
    .newsletter-form { width: 100%; }
}

.hero-espiral {
    height: 220px; /* ¡Lo hicimos casi el doble de grande! */
    width: auto;
    filter: drop-shadow(0 0 40px rgba(0, 180, 216, 0.4));
    will-change: transform;
}
.hero-title { 
    font-size: 4rem; /* Un poco más equilibrado */
    line-height: 1.2; 
    margin-bottom: 20px; color: #fff; 
}

/* Mezclamos un gradiente oscuro con la imagen de tu ciudad */
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: linear-gradient(to bottom, rgba(5,9,20,0.95) 0%, rgba(5,9,20,0.6) 100%), url('assets/fondo-ciudad.jpg') no-repeat center center/cover;
}

.hero-content { z-index: 1; max-width: 900px; }

/* Configuración para el efecto 3D */
.espiral-wrapper { perspective: 1000px; margin-bottom: 30px; }
.hero-espiral {
    height: 140px; width: auto;
    filter: drop-shadow(0 0 30px rgba(0, 180, 216, 0.3)); /* Un aura constante */
    will-change: transform; /* Le dice al navegador que se prepare para animar */
}

.hero-title { 
    font-size: 4.5rem; font-weight: 800; line-height: 1.1; 
    margin-bottom: 25px; color: #fff; letter-spacing: -1px;
}
.text-gradient { 
    background: linear-gradient(90deg, var(--primary), #90e0ef); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
}
.hero-subtitle { 
    font-size: 1.25rem; color: var(--text-muted); 
    max-width: 700px; margin: 0 auto; line-height: 1.6; 
}

/* Responsivo para celulares de la Portada */
@media (max-width: 768px) {
    .hero-title { font-size: 2.8rem; }
    .hero-espiral { height: 100px; }
}

/* --- Responsive Avanzado (Menu Móvil) --- */
@media (max-width: 1100px) {
    .main-nav { display: none; }
    .logo-desktop { display: none; }
    .mobile-toggle { display: block; }
    .logo-mobile { display: block; }
    
    /* Oculta el botón en móviles para que no choque con la hamburguesa */
    .btn-academia { display: none; } 
}

/* --- REPARACIÓN DE LA PORTADA --- */
.hero-section {
    position: relative; 
    min-height: 100vh; 
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 120px 20px 50px; 
    overflow: hidden;
}

.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: linear-gradient(to bottom, rgba(5,9,20,0.95) 0%, rgba(5,9,20,0.6) 100%), url('assets/fondo-ciudad.jpg') no-repeat center center/cover;
}

.hero-content { z-index: 1; max-width: 900px; width: 100%; }

.espiral-wrapper { perspective: 1000px; margin-bottom: 30px; }

.hero-espiral {
    height: 220px; 
    width: auto;
    filter: drop-shadow(0 0 40px rgba(0, 180, 216, 0.4));
    will-change: transform;
    margin: 0 auto;
    display: block;
}

.hero-title { 
    font-size: 4rem; 
    line-height: 1.2; 
    margin-bottom: 20px; color: #fff; 
}

.text-gradient { 
    background: linear-gradient(90deg, var(--primary), #90e0ef); 
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.8rem; }
    .hero-espiral { height: 140px; }
}

/* --- Arreglo Responsive del Inicio --- */
.bento-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px; 
}

/* --- TRANSICIÓN DE PÁGINA (PRELOADER) --- */
.page-transition-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--dark-bg); /* Mismo azul ultra oscuro de tu fondo */
    z-index: 99999; /* Por encima de todo, incluso del header */
    display: flex; justify-content: center; align-items: center;
    opacity: 1; visibility: visible;
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.6s ease;
}

/* Esta clase es la que oculta la cortina */
.page-transition-overlay.hidden {
    opacity: 0; visibility: hidden;
}

/* El logo latiendo en el centro */
.loader-logo {
    width: 60px; height: auto;
    animation: pulse-loader 1.5s infinite ease-in-out;
}

@keyframes pulse-loader {
    0% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 20px var(--primary)); }
    100% { transform: scale(0.9); opacity: 0.5; }
}