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

body {
    width: 100%;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #001324;
    color: #ffffff;
    overflow-x: hidden; /* Solo en body para evitar bugs de scroll wheel en Chrome/Windows */
    transition: background-color 1.5s ease, color 1.5s ease;
}

/* --- LIGHT MODE (MODO VIVO) --- */
body.light-mode {
    background-color: #ffffff;
    color: #0B2A4A;
}

body.light-mode .nav-item {
    color: #0B2A4A;
    text-shadow: none;
}

body.light-mode .contact-link {
    border-color: #0B2A4A;
}
body.light-mode .contact-link:hover {
    color: #0B2A4A;
}

body.light-mode .subtitle,
body.light-mode .text-block p,
body.light-mode .contact-panel p {
    color: #1A3A5A;
    font-weight: 600;
}

/* El efecto de aura fue reemplazado por un bloque sólido directo en el HTML para evitar óvalos y parches */

body.light-mode .cursor {
    background-color: #0B2A4A;
    box-shadow: 0 0 150px 100px rgba(255, 214, 0, 0.25);
}

/* --- LOGOS Y EFECTOS DE RESPLANDOR --- */
.hero-logo {
    filter: drop-shadow(0 0 30px rgba(240, 223, 0, 0.4)) drop-shadow(0 10px 20px rgba(0,0,0,0.6));
    animation: pulse-glow 4s infinite alternate ease-in-out;
}

@keyframes pulse-glow {
    0% { filter: drop-shadow(0 0 20px rgba(255, 214, 0, 0.2)) drop-shadow(0 10px 20px rgba(0,0,0,0.6)); }
    100% { filter: drop-shadow(0 0 50px rgba(255, 214, 0, 0.5)) drop-shadow(0 10px 20px rgba(0,0,0,0.8)); }
}

body.light-mode .hero-logo,
body.light-mode .nav-logo {
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.3)); /* Sombra súper elegante y nítida en blanco */
    animation: none; /* Quitamos el resplandor amarillo porque en fondo blanco no se ve bien, dejamos solo la sombra 3D */
}

/* Estilos del Botón Magnético en Modo Claro */
body.light-mode .magnetic-btn {
    border-color: #0B2A4A;
    color: #0B2A4A;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
body.light-mode .magnetic-btn:hover {
    color: #001324;
    border-color: #F0DF00;
}

/* Custom Cursor (Reflector) */
.cursor {
    position: fixed;
    top: 0; left: 0;
    width: 8px; height: 8px;
    background-color: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 150px 100px rgba(240, 223, 0, 0.15); /* Efecto de luz cálida de reflector */
    transition: width 0.2s, height 0.2s;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #000a12; 
}
::-webkit-scrollbar-thumb {
    background: #1D252C; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #F0DF00; 
}

/* --- WebGL Canvas --- */
#webgl-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none; /* Asegura que no bloquee el scroll del usuario */
    outline: none;
}

/* --- Header Minimalista --- */
.minimal-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5vw;
    z-index: 1001; /* Debe estar por encima del overlay móvil (999) */
}
.minimal-header .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1001;
}
.nav-logo {
    height: 60px; /* Tamaño decente */
    width: auto;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
    transition: transform 0.3s ease;
}
.nav-logo:hover {
    transform: scale(1.05);
}
@keyframes nav-pulse {
    0% { filter: drop-shadow(0 0 10px rgba(255, 214, 0, 0.2)) drop-shadow(0 5px 10px rgba(0,0,0,0.5)); transform: scale(1); }
    100% { filter: drop-shadow(0 0 25px rgba(255, 214, 0, 0.6)) drop-shadow(0 5px 10px rgba(0,0,0,0.5)); transform: scale(1.05); }
}
.nav-links {
    display: flex; gap: 2.5rem; align-items: center;
}
.nav-item {
    color: white; text-decoration: none; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
    transition: all 0.3s;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.nav-item:hover { color: #F0DF00; }
.contact-link { 
    border: 2px solid white; padding: 0.8rem 2rem; border-radius: 30px; 
}
.contact-link:hover { 
    background: #F0DF00; color: #002B49; border-color: #F0DF00; text-shadow: none;
}

/* --- Layout --- */
.scroll-container {
    position: relative;
    z-index: 10; /* POR ENCIMA DEL CANVAS 3D */
}

.panel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 10vw 0 10vw; /* Padding superior para evitar choque con el header fijo */
}

/* --- Typography --- */
.reveal-text {
    opacity: 0; /* Animado por GSAP */
    transform: translateY(30px);
}

.title-main {
    font-size: clamp(4rem, 15vw, 12rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 0.9;
    margin-bottom: 1rem;
    text-align: center;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 400;
    letter-spacing: 0.3em;
    text-align: center;
    text-transform: uppercase;
    color: #C8D6EB;
}

.text-block { max-width: 800px; }
.text-block.left { align-self: flex-start; }
.text-block.right { align-self: flex-end; text-align: right; }

.text-block h2 {
    font-size: clamp(1.3rem, 6vw, 4.5rem);
    font-weight: 200;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    word-break: keep-all; 
    overflow-wrap: normal;
}

.text-block p {
    font-size: 1.2rem;
    font-weight: 400;
    color: #C8D6EB;
    line-height: 1.6;
}

/* --- Scroll Indicator --- */
.scroll-down {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.8;
}
.scroll-down .arrow { display: block; margin-top: 10px; animation: bounce 2s infinite; font-size: 1.5rem; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

/* --- Magnetic Button & Contact Panel --- */
.contact-panel {
    align-items: center;
    text-align: center;
    background-color: #001324; /* Fondo sólido para máxima elegancia y legibilidad */
    border-top: 1px solid rgba(240, 223, 0, 0.2); /* Línea sutil amarilla */
    box-shadow: 0 -20px 50px rgba(0,0,0,0.5); /* Sombra hacia arriba para dar profundidad sobre el 3D */
    z-index: 100;
    position: relative;
    padding: 6rem 2rem; /* Más espacio para respirar */
}
.contact-panel h2 { 
    font-size: clamp(2.5rem, 6vw, 5rem); 
    font-weight: 700; /* Regresamos a 700 para mantener la identidad clásica de Montserrat */
    letter-spacing: -0.03em;
    margin-bottom: 1rem; 
    text-transform: capitalize;
}
.contact-panel p { 
    font-size: 1.3rem; 
    color: #C8D6EB; 
    margin-bottom: 4rem; 
}

/* --- Footer (Dirección) --- */
.site-footer {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
    font-size: 1.1rem; /* Más grande y legible */
    color: #C8D6EB;
    letter-spacing: 0.05em;
    font-weight: 400;
    z-index: 10;
    opacity: 0.9;
}
body.light-mode .site-footer {
    color: #1A3A5A;
    font-weight: 600;
}

/* --- WhatsApp Floating Button --- */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0px 6px 20px rgba(37, 211, 102, 0.4);
    background-color: #20b858;
}

/* Icono SVG dentro del botón */
.whatsapp-float svg {
    width: 35px;
    height: 35px;
    fill: currentColor;
}
.magnetic-wrap {
    display: inline-block;
    padding: 2rem;
}

.magnetic-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 220px; height: 220px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
    transition: background 0.3s, color 0.3s;
    cursor: none;
}

.magnetic-btn::before {
    content: ''; position: absolute;
    top: 100%; left: 0; width: 100%; height: 100%;
    background-color: #F0DF00;
    border-radius: 50%;
    transition: top 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
    z-index: -1;
}

.magnetic-btn:hover { border-color: #F0DF00; color: #002B49; }
.magnetic-btn:hover::before { top: 0; border-radius: 0; }

@media (max-width: 768px) {
    .nav-links { display: none; }
    .text-block.right, .text-block.left { align-self: center; text-align: center; }
}

/* --- Internal Pages (Proyectos, Nosotros, Cotizar) --- */
.internal-page {
    background-color: #001324;
    overflow-y: auto;
}
.page-content {
    padding: 150px 10vw 50px 10vw;
    min-height: 100vh;
}
.page-title {
    font-size: clamp(3rem, 6vw, 6rem);
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: #F0DF00;
}
.page-subtitle {
    font-size: 1.2rem;
    color: #C8D6EB;
    margin-bottom: 4rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.content-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}
.content-box h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 200;
}
.content-box p {
    color: #9ba5b5;
    line-height: 1.8;
}

/* --- Rediseño Minimalista Premium (Contacto) --- */
.glass-card {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 50;
    /* Fondo limpio, sin gradientes que ensucien */
    background: transparent;
}

/* Destello eliminado */
.glass-card::before {
    display: none;
}

.glass-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 200;
    margin-bottom: 1rem;
    color: #ffffff;
    line-height: 1.2;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.glass-title strong {
    font-weight: 900;
    color: #F0DF00;
}

.glass-subtitle {
    font-size: 1.2rem;
    color: #C8D6EB;
    margin-bottom: 3rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

/* --- Botón Premium --- */
.btn-neon {
    display: inline-block;
    padding: 1.2rem 3.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #001324; /* Letra oscura */
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 50px;
    background: #F0DF00; /* Fondo amarillo sólido corporativo */
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 10px 20px rgba(240, 223, 0, 0.3);
}

.btn-neon:hover {
    background: #ffffff;
    color: #001324;
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
}

.btn-neon:active {
    transform: translateY(1px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

/* --- MOBILE MENU (Hamburger & Overlay) --- */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000;
    padding: 10px;
}
.mobile-menu-btn span {
    display: block;
    width: 30px;
    height: 3px;
    background: white;
    margin: 6px 0;
    transition: 0.4s;
    border-radius: 3px;
}
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -7px);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 19, 36, 0.98);
    backdrop-filter: blur(15px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.mobile-nav-overlay a {
    color: white;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s;
}
.mobile-nav-overlay a:hover {
    color: #F0DF00;
}
.mobile-nav-overlay .contact-link {
    border: 2px solid #F0DF00;
    color: #F0DF00;
    padding: 1rem 3rem;
    border-radius: 50px;
    margin-top: 1rem;
}

/* Reglas extremas para móviles y tablets pequeños */
@media (max-width: 768px) {
    .nav-links { display: none !important; }
    .mobile-menu-btn { display: block; }
    .minimal-header { padding: 1rem 5vw; }
    .page-content { padding-top: 120px; }
    .page-title {
        font-size: 3rem;
    }
    
    .panel {
        min-height: auto !important;
        padding: 60px 5vw 40px 5vw !important; /* Mucho menos espacio muerto */
        justify-content: flex-start !important;
    }
    
    .hero-panel {
        min-height: auto !important;
        padding-top: 140px !important; /* Separar del header */
        padding-bottom: 20px !important; /* Pegarlo más a la foto */
    }

    .hero-logo {
        transform: none !important;
        margin-bottom: 2rem;
    }
    
    /* Regla absoluta e inquebrantable para celulares (evita que INFRAESTRUCTURA se rompa) */
    .text-block h2 {
        font-size: 24px !important;
        word-break: keep-all !important;
        hyphens: none !important;
        overflow-wrap: normal !important;
    }
}

/* Ocultar cursor en dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .cursor { display: none !important; }
}
