/* ========================================= */
/* 1. VARIABLES GLOBALES Y RESET             */
/* ========================================= */
:root {
    --bg-dark: #0a0a0a;
    --bg-panel: #16161a;
    --cyber-cyan: #00e5ff;
    --cyan-glow: rgba(0, 229, 255, 0.3);
    --industrial-yellow: #ffd600;
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* ========================================= */
/* RESET GLOBAL Y BLOQUEO DE DESBORDAMIENTO  */
/* ========================================= */
html, body {
    overflow-x: hidden !important; /* Aniquila el scroll lateral */
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Obliga a TODOS los elementos a no sumar sus márgenes al ancho total */
*, *::before, *::after {
    box-sizing: inherit;
}

/* ========================================= */
/* CONFIGURACIÓN BASE Y CURSORES TOPOGRÁFICOS*/
/* ========================================= */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    
    /* Escudo de seguridad (Bloqueo de selección de texto) */
    user-select: none; 
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
/* 1. CURSOR MODO NAVEGACIÓN (Mira Cian con punto Amarillo) */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="10" fill="none" stroke="%2300e5ff" stroke-width="1.5" stroke-dasharray="3 3"/><line x1="16" y1="2" x2="16" y2="10" stroke="%2300e5ff" stroke-width="1.5"/><line x1="16" y1="22" x2="16" y2="30" stroke="%2300e5ff" stroke-width="1.5"/><line x1="2" y1="16" x2="10" y2="16" stroke="%2300e5ff" stroke-width="1.5"/><line x1="22" y1="16" x2="30" y2="16" stroke="%2300e5ff" stroke-width="1.5"/><circle cx="16" cy="16" r="2" fill="%23ffd600"/></svg>') 16 16, crosshair;
}

/* 2. CURSOR MODO SELECCIÓN (Mira Amarilla con punto Cian) */
/* Se activa al pasar sobre enlaces, botones y tarjetas */
a, button, .btn-primary, .btn-outline, .card, .whatsapp-widget {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect x="8" y="8" width="16" height="16" fill="none" stroke="%23ffd600" stroke-width="1.5"/><line x1="16" y1="2" x2="16" y2="12" stroke="%23ffd600" stroke-width="1.5"/><line x1="16" y1="20" x2="16" y2="30" stroke="%23ffd600" stroke-width="1.5"/><line x1="2" y1="16" x2="12" y2="16" stroke="%23ffd600" stroke-width="1.5"/><line x1="20" y1="16" x2="30" y2="16" stroke="%23ffd600" stroke-width="1.5"/><circle cx="16" cy="16" r="2" fill="%2300e5ff"/></svg>') 16 16, pointer !important;
}

img {
    /* Mantiene las imágenes adaptables a celulares */
    max-width: 100%; 
    height: auto;
    
    /* Bloquea estrictamente el arrastre de la imagen sin apagar los efectos 3D */
    -webkit-user-drag: none; 
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

h1, h2, h3 {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mono {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: var(--cyber-cyan);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================= */
/* EFECTO UI 1: GLASSMORPHISM (Menú Superior)*/
/* ========================================= */
header {
    background: transparent; /* 1. Ahora inicia 100% invisible para lucir tu foto */
    border-bottom: 1px solid transparent;
    position: fixed;
    width: 100%;
    top: 3px; /* 2. Le dejamos un carril exclusivo a tu barra de progreso */
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all 0.4s ease;
}

header.scrolled {
    background: rgba(10, 10, 10, 0.65); /* 3. Más transparente para que se note el cristal */
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); /* Soporte vital para iPhone/Mac */
    border-bottom: 1px solid rgba(0, 229, 255, 0.3);
    padding: 1rem 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

.logo span {
    color: var(--cyber-cyan);
}

.btn-outline {
    border: 1px solid var(--cyber-cyan);
    color: var(--cyber-cyan);
    padding: 0.5rem 1.5rem;
    text-decoration: none;
    font-family: 'Roboto Mono', monospace;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: var(--cyber-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--cyan-glow);
}

/* ========================================= */
/* EFECTO UI 2: PARALLAX Y RADAR (Hero)      */
/* ========================================= */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(to right, rgba(10,10,10,0.95) 30%, rgba(10,10,10,0.5)), url('img/mavic4pro.jpg') center/cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden; /* Evita que el radar se desborde */
}

/* Malla de telemetría (Grid OSD) */
.hero::before { 
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

/* Línea de Escaneo (Radar) */
.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: rgba(0, 229, 255, 0.7);
    box-shadow: 0 0 15px rgba(0, 229, 255, 1), 0 0 30px rgba(0, 229, 255, 0.5);
    animation: radar-scan 5s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes radar-scan {
    0% { top: -5%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 105%; opacity: 0; }
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.status-badge {
    display: inline-block;
    background: rgba(255, 214, 0, 0.1);
    border: 1px solid var(--industrial-yellow);
    color: var(--industrial-yellow);
    padding: 0.2rem 0.8rem;
    margin-bottom: 1rem;
}

/* ========================================= */
/* EFECTO UI 3: MÁQUINA DE ESCRIBIR          */
/* ========================================= */
.typewriter-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--cyber-cyan);
    animation: typing 2.5s steps(40, end), blink-cursor 0.8s step-end infinite;
    vertical-align: bottom;
    padding-right: 5px;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-cursor {
    from, to { border-color: transparent; }
    50% { border-color: var(--cyber-cyan); }
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #fff;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

.btn-primary {
    background: var(--cyber-cyan);
    color: var(--bg-dark);
    padding: 1rem 2rem;
    text-decoration: none;
    font-family: 'Oswald', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--cyan-glow);
    transform: translateX(5px);
}

/* ========================================= */
/* EFECTO UI 4: PREMIUM SCROLL FADE-IN       */
/* ========================================= */
.fade-element {
    opacity: 0;
    filter: blur(8px); 
    will-change: opacity, transform, filter;
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), 
                filter 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Direcciones de entrada */
.fade-up { transform: translateY(50px) scale(0.95); }
.fade-left { transform: translateX(-50px) scale(0.98); }
.fade-right { transform: translateX(50px) scale(0.98); }

/* Cascada de tiempos */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.5s; }

/* ⚠️ ESTA ES LA CLASE VITAL: Si falta, nada aparece */
.fade-element.visible {
    opacity: 1;
    filter: blur(0);
    transform: translate(0, 0) scale(1);
}

/* ========================================= */
/* ESTRUCTURA: MÓDULOS Y GRID                */
/* ========================================= */
.section {
    padding: 6rem 0;
    border-bottom: 1px solid #1f1f1f;
}

.section-header {
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #fff;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* ========================================= */
/* EFECTO UI 5: GLOW DINÁMICO Y HOVER 3D     */
/* ========================================= */
.card {
    background: var(--bg-panel);
    border-left: 3px solid var(--cyber-cyan);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 229, 255, 0.15), 0 0 15px rgba(0, 229, 255, 0.1);
    border-left: 5px solid var(--cyber-cyan);
}

.card::after {
    content: '+';
    position: absolute;
    top: 10px;
    right: 15px;
    font-family: 'Roboto Mono';
    color: rgba(255,255,255,0.1);
    font-size: 2rem;
    transition: color 0.3s;
}

.card:hover::after {
    color: var(--cyber-cyan);
}

.card h3 {
    font-size: 1.5rem;
    margin: 1rem 0;
    color: #fff;
}

/* ========================================= */
/* ESPECIFICACIONES TÉCNICAS                 */
/* ========================================= */
.tech-spec {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.tech-data {
    background: var(--bg-panel);
    padding: 2rem;
    border: 1px solid #2a2a2a;
}

.tech-data ul {
    list-style: none;
    margin-top: 1rem;
}

.tech-data li {
    padding: 0.8rem 0;
    border-bottom: 1px dashed #2a2a2a;
    display: flex;
    justify-content: space-between;
}

.warning-box {
    border: 1px solid var(--industrial-yellow);
    background: rgba(255, 214, 0, 0.05);
    padding: 1.5rem;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.warning-box:hover {
    box-shadow: 0 0 20px rgba(255, 214, 0, 0.15);
    background: rgba(255, 214, 0, 0.08);
}

/* ========================================= */
/* PIE DE PÁGINA Y RESPONSIVO (CELULARES)    */
/* ========================================= */
footer {
    background: #050505;
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--cyber-cyan);
}

@media (max-width: 768px) {
    /* 1. BLINDAJE ABSOLUTO DEL MENÚ */
    header, header.scrolled {
        position: fixed !important;
        top: 3px !important; /* Mantiene el carril para la barra láser */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 1rem 5% !important;
        /* En móviles, arranca oscuro y nítido para que no se pierda en la foto */
        background: rgba(10, 10, 10, 0.95) !important; 
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        z-index: 9998 !important; 
        border-bottom: 1px solid var(--cyber-cyan) !important;
        box-sizing: border-box !important;
    }

    /* 2. PROTECCIÓN DE LA BARRA DE PROGRESO */
    #progress-bar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 9999 !important;
    }

    /* 3. ALINEACIÓN FORZADA EN UNA LÍNEA */
    .nav-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
    }
    
    /* 4. BLOQUEO DE SALTOS DE TEXTO */
    .logo { 
        font-size: 1.25rem !important; 
        white-space: nowrap !important; 
        flex-shrink: 0 !important; 
        margin: 0 !important;
    }
    
    .btn-outline { 
        padding: 0.4rem 0.8rem !important; 
        font-size: 0.75rem !important; 
        white-space: nowrap !important; 
        flex-shrink: 0 !important; 
        margin-left: 10px !important;
    }

    /* 5. AJUSTES GENERALES */
    .hero h1 { font-size: 2.2rem; }
    .tech-spec { grid-template-columns: 1fr; }
    img { max-width: 100%; height: auto; }
}

/* ========================================= */
/* PIE DE PÁGINA (Footer) Y REDES SOCIALES   */
/* ========================================= */
.footer-section {
    background-color: var(--bg-dark);
    border-top: 1px solid rgba(0, 229, 255, 0.2);
    padding: 4rem 5% 1rem;
    text-align: center;
    position: relative; 
    z-index: 2;
}

.footer-logo { font-size: 1.8rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.footer-logo span { color: var(--cyber-cyan); }
.footer-section p { color: #888; margin-bottom: 2rem; font-size: 0.9rem; }

/* Contenedor Flexbox: Se auto-centra sin importar cuántos botones queden */
.social-links { 
    display: flex; 
    justify-content: center; 
    gap: 1.5rem; 
    margin-bottom: 3rem; 
    flex-wrap: wrap; 
}

.social-links a {
    display: inline-flex; justify-content: center; align-items: center;
    width: 45px; height: 45px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff; background: rgba(10, 10, 10, 0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-links a svg { 
    width: 20px; height: 20px; fill: currentColor; transition: all 0.3s ease; 
}

.social-links a:hover {
    border-color: var(--cyber-cyan); background: rgba(0, 229, 255, 0.1);
    color: var(--cyber-cyan); transform: translateY(-5px) scale(1.1);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
}

.footer-bottom { 
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    padding-top: 1.5rem; 
    color: #555; font-size: 0.75rem; 
}

/* ========================================= */
/* EFECTO UI 6: BARRA DE PROGRESO DE LECTURA */
/* ========================================= */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%; /* Inicia en 0% de progreso */
    height: 3px; /* Grosor de la línea */
    background: var(--cyber-cyan);
    box-shadow: 0 0 12px var(--cyber-cyan); /* Resplandor tecnológico */
    z-index: 9999; /* Máxima prioridad para que se vea por encima del menú */
    transition: width 0.1s ease; /* Transición suave al avanzar */
}

/* ========================================= */
/* EFECTO UI 7: GLITCH FPV (Interferencia)   */
/* ========================================= */
.glitch-hover {
    transition: all 0.1s ease;
}

/* Al pasar el cursor, se detona la animación rápida */
.glitch-hover:hover {
    animation: glitch-fpv 0.3s infinite;
}

/* Keyframes: Aberración cromática (Cian/Amarillo) y saltos de posición */
@keyframes glitch-fpv {
    0% { transform: translate(0); text-shadow: none; }
    20% { transform: translate(-2px, 1px); text-shadow: 2px 0 var(--cyber-cyan), -2px 0 var(--industrial-yellow); }
    40% { transform: translate(2px, -1px); text-shadow: -2px 0 var(--cyber-cyan), 2px 0 rgba(255,0,0,0.7); }
    60% { transform: translate(-1px, -2px); text-shadow: 2px 0 var(--industrial-yellow), -2px 0 var(--cyber-cyan); }
    80% { transform: translate(1px, 2px); text-shadow: -2px 0 var(--cyber-cyan), 2px 0 var(--industrial-yellow); }
    100% { transform: translate(0); text-shadow: none; }
}

/* ========================================= */
/* WIDGET FLOTANTE DE WHATSAPP (Radar Pulse) */
/* ========================================= */
.whatsapp-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25D366; 
    color: #ffffff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.5);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

/* El motor del Pulso de Radar */
.whatsapp-widget::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #25D366;
    z-index: -1;
    animation: radar-pulse 2s infinite;
}

/* Animación de expansión y difuminación (Ondas de radio) */
@keyframes radar-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Comportamiento al pasar el ratón */
.whatsapp-widget:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.8);
    background-color: #1EBE5D;
}

.whatsapp-widget svg {
    width: 35px;
    height: 35px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

/* Pequeño giro del icono al tocar el botón */
.whatsapp-widget:hover svg {
    transform: rotate(-10deg);
}

/* ========================================= */
/* EFECTO UI 9: RED DE NODOS (Fotogrametría) */
/* ========================================= */
#contacto {
    position: relative; /* Clave para anclar el canvas a esta sección */
    overflow: hidden;
}

#nodes-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; 
    pointer-events: none; /* Permite que los clics pasen al formulario */
}

/* Asegura que el formulario flote por encima de la red de nodos */
.contact-container {
    position: relative;
    z-index: 1; 
}

/* Ajuste de posición para celulares para que no estorbe al hacer scroll */
@media (max-width: 768px) {
    .whatsapp-widget {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    .whatsapp-widget svg {
        width: 28px;
        height: 28px;
    }
}