/* ============================================================ */
/* 1. CONFIGURACIÓN BASE Y VARIABLES (THEME SYSTEM)             */
/* ============================================================ */
:root {
    /* --- TEMA OSCURO (Infinite Void) --- */
    --color-bg-base: #020203;            
    --color-primary: #19b6c2;       /* Cian Eléctrico */
    --color-primary-dim: rgba(25, 182, 194, 0.2);
    --color-secondary: #7000FF;     /* Violeta */
    --color-text: #FFFFFF;
    --color-text-muted: #CBD5E1;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-card-bg: rgba(2, 6, 23, 0.7);
    --color-whatsapp: #25D366;
    
    /* GRADIENTE BASE (OSCURO) - Posición bloqueada al 30% */
    --bg-atmosphere: radial-gradient(circle at 50% 30%, 
        rgba(112, 0, 255, 0.15) 0%,   
        rgba(25, 182, 194, 0.15) 35%, 
        #020203 70%
    );
    --bg-grid-color-1: rgba(0, 240, 255, 0.15);
    --bg-grid-color-2: rgba(112, 0, 255, 0.15);
    
    --glass-bg: rgba(2, 6, 23, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(0, 0, 0, 0.4);
    
    --font-body: 'Inter', sans-serif;
    --font-display: 'Montserrat', sans-serif;
    --nav-height: 90px;
    --border-radius: 16px;
    
    --glow-text: 0 0 40px rgba(25, 182, 194, 0.3);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-card-hover: 0 20px 40px rgba(25, 182, 194, 0.15);
    
    /* Configuración Fondo Oscuro */
    --floor-opacity: 1;
}

/* --- TEMA CLARO (God Mode / Clean Lab) --- */
/* --- TEMA CLARO (Ice White / Porcelana Tecnológica) --- */
body.light-mode {
    --color-bg-base: #FFFFFF;            
    --color-primary: #0052CC;       
    --color-primary-dim: rgba(0, 82, 204, 0.08);
    --color-secondary: #5B21B6;
    --color-text: #0F172A;          
    --color-text-muted: #64748B; /* Un poco más suave para no cansar la vista */
    --color-border: rgba(0, 0, 0, 0.06);
    --color-card-bg: rgba(255, 255, 255, 0.95); /* Tarjetas más sólidas */

    /* GRADIENTE MODO PORCELANA: Mucho más blanco y limpio */
    /* El azul solo es un susurro en los bordes para dar profundidad sin marear */
    --bg-atmosphere: radial-gradient(circle at 50% 30%, 
        #FFFFFF 0%, 
        #FFFFFF 60%,  /* Mantenemos el centro blanco puro */
        #F1F5F9 100%  /* Gris azulado muy pálido en los bordes */
    );

    /* Grilla del suelo: Casi invisible, solo textura subliminal */
    --bg-grid-color-1: rgba(0, 0, 0, 0.03); 
    --bg-grid-color-2: rgba(0, 0, 0, 0.03); 
    
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.05);
    
    --input-bg: #F8FAFC;
    
    --glow-text: none; 
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05); 
    --shadow-card-hover: 0 20px 40px -5px rgba(0, 0, 0, 0.1);

    /* Configuración Fondo Claro */
    --floor-opacity: 0.3;
}

* /* Busca este bloque y agrega la línea nueva */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    
    /* --- ELIMINAR EL FLASH AZUL/ROMBO AL TOCAR EN MÓVIL --- */
    -webkit-tap-highlight-color: transparent;
}
html { scroll-behavior: smooth; }

body {
    background-color: var(--color-bg-base);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    
    /* TRANSICIÓN "LIQUIDA" PROGRESIVA */
    /* El texto tarda más (1.5s) para crear el efecto de degradado gris */
    transition: 
        background-color 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
        color 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar */
body::-webkit-scrollbar { width: 8px; }
body::-webkit-scrollbar-track { background: var(--color-bg-base); }
body::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 4px; }

/* ============================================================ */
/* 2. INDICADORES DE SCROLL Y MOUSE                             */
/* ============================================================ */
.scroll-indicator, .swipe-indicator { /* CORREGIDO: Faltaba el punto */
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s;
}

/* Diseño Mouse (Escritorio) */
.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--color-text);
    border-radius: 20px;
    position: relative;
    transition: border-color 1.5s ease;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--color-primary);
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: mouseScroll 1.5s infinite;
}

@keyframes mouseScroll {
    0% { opacity: 1; top: 6px; }
    100% { opacity: 0; top: 18px; }
}

/* Diseño Mano (Móvil) */
.swipe-indicator {
    display: none; 
    flex-direction: column;
    align-items: center;
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 1.5s ease;
}

.hand-icon {
    width: 30px;
    height: 50px;
    border: 2px solid var(--color-text);
    border-radius: 15px;
    margin-bottom: 5px;
    position: relative;
    background: rgba(255,255,255,0.1);
    transition: border-color 1.5s ease;
}

.finger {
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 70%;
    transform: translateX(-50%);
    animation: swipeAnim 2s cubic-bezier(0.15, 0.41, 0.69, 0.94) infinite;
}

@keyframes swipeAnim {
    0% { opacity: 0; top: 70%; }
    20% { opacity: 1; }
    100% { opacity: 0; top: 20%; }
}

/* Control Visibilidad */
@media (max-width: 768px) {
    .scroll-indicator { display: none; }
    .swipe-indicator { display: flex; }
}

/* ============================================================ */
/* 3. FONDO GLOBAL Y HEXÁGONOS (PARALLAX)                       */
/* ============================================================ */
.fixed-background {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw;
    height: 100dvh; 
    z-index: -1; 
    overflow: hidden; 
    perspective: 1000px;
}

.atmosphere {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-atmosphere);
    transition: background 1.2s ease-in-out;
}

/* Luz Central */
.atmosphere::after {
    content: ''; position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
    width: 60%; height: 60%;
    background: radial-gradient(ellipse, var(--color-primary-dim), transparent 70%);
    filter: blur(90px);
    opacity: 0.6;
    animation: pulseLight 8s ease-in-out infinite alternate;
    transition: background 1.2s ease-in-out, opacity 1.2s ease;
}

/* SUELO CIBERNÉTICO */
.cyber-floor {
    position: absolute; bottom: -50%; left: -50%; width: 200%; height: 100%;
    background-image: 
        linear-gradient(var(--bg-grid-color-1) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid-color-2) 1px, transparent 1px);
    background-size: 60px 60px; 
    transform: rotateX(80deg);
    animation: gridTravel 25s linear infinite;
    -webkit-mask-image: linear-gradient(to top, black 0%, transparent 60%);
    
    transition: background-image 1.2s ease-in-out, opacity 1.2s ease;
    mask-image: linear-gradient(to top, black 0%, transparent 40%); 
    opacity: 0.3; 
}

@keyframes gridTravel {
    0% { background-position: 0 0; }
    100% { background-position: 0 60px; }
}

/* BIO-MESH PARALLAX (DOBLE CAPA DE HEXÁGONOS) */
.particles {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    z-index: 1; 
    pointer-events: none; 
}

.particles::before, .particles::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    background-repeat: repeat;
    transition: opacity 1.5s ease, filter 1.5s ease;
}

/* CAPA 1: FONDO (Lenta) */
.particles::before {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='104' viewBox='0 0 60 104' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l25.98 15v30L30 60 4.02 45V15z' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1'/%3E%3Cpath d='M30 52l25.98 15v30L30 112 4.02 97V67z' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 120px 208px;
    opacity: 0.15;
    animation: meshFlow 120s linear infinite;
}

/* CAPA 2: FRENTE (Rápida Inversa) */
.particles::after {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='104' viewBox='0 0 60 104' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l25.98 15v30L30 60 4.02 45V15z' fill='none' stroke='rgba(255,255,255,0.2)' stroke-width='1'/%3E%3Cpath d='M30 52l25.98 15v30L30 112 4.02 97V67z' fill='none' stroke='rgba(255,255,255,0.2)' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 60px 104px;
    opacity: 0.2; 
    animation: meshFlow 60s linear infinite reverse;
}

/* AJUSTE HEXÁGONOS MODO CLARO */
/* AJUSTE HEXÁGONOS MODO CLARO (VERSIÓN SUTIL "MARCA DE AGUA") */
body.light-mode .particles::before {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='104' viewBox='0 0 60 104' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l25.98 15v30L30 60 4.02 45V15z' fill='none' stroke='rgba(0, 0, 0, 0.05)' stroke-width='1'/%3E%3Cpath d='M30 52l25.98 15v30L30 112 4.02 97V67z' fill='none' stroke='rgba(0, 0, 0, 0.05)' stroke-width='1'/%3E%3C/svg%3E");
    opacity: 0.2; /* Antes era 0.4 -> Ahora es apenas visible */
}

body.light-mode .particles::after {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='104' viewBox='0 0 60 104' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l25.98 15v30L30 60 4.02 45V15z' fill='none' stroke='rgba(0, 50, 200, 0.06)' stroke-width='1'/%3E%3Cpath d='M30 52l25.98 15v30L30 112 4.02 97V67z' fill='none' stroke='rgba(0, 50, 200, 0.06)' stroke-width='1'/%3E%3C/svg%3E");
    opacity: 0.25; /* Antes era 0.5 -> Mucho más suave */
}

@keyframes meshFlow {
    0% { background-position: 0 0; }
    100% { background-position: 60px 104px; }
}

/* ============================================================ */
/* 4. HEADER & LOGO                                             */
/* ============================================================ */
.header {
    position: fixed; top: 0; width: 100%; height: var(--nav-height);
    background: transparent;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 5%; z-index: 1000;
    pointer-events: none; 
    transition: all 0.5s ease;
}
.logo-container, .theme-toggle { pointer-events: auto; }

@keyframes breatheLogo {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px var(--color-primary-dim)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 15px rgba(25, 182, 194, 0.4)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 5px var(--color-primary-dim)); }
}

.logo { 
    height: 60px; width: auto; 
    animation: breatheLogo 6s infinite ease-in-out; 
    transition: transform 0.3s;
}
.logo:hover { animation-play-state: paused; transform: scale(1.1); }

.theme-toggle {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
    width: 45px; height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    color: var(--color-text);
    transition: all 0.4s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.theme-toggle:hover { transform: rotate(15deg) scale(1.1); border-color: var(--color-primary); }

.toggle-icon { display: none; }
body:not(.light-mode) .toggle-icon.sun { display: block; }
body.light-mode .toggle-icon.moon { display: block; }

/* ============================================================ */
/* 5. HERO SECTION                                              */
/* ============================================================ */
.hero-section {
    position: relative; min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 120px 20px 100px; text-align: center;
}

.hero-content { position: relative; z-index: 2; width: 100%; max-width: 850px; }

.brand-eyebrow {
    display: flex; align-items: center; justify-content: center; gap: 15px;
    margin-bottom: 25px; opacity: 0; transform: translateY(-20px);
    animation: fadeReveal 1s ease forwards 0.3s;
}
.brand-text {
    font-family: var(--font-display); font-size: 0.8rem; font-weight: 700;
    color: var(--color-primary); letter-spacing: 0.3em;
    transition: color 0.6s ease;
}
.energy-line { 
    height: 1px; width: 40px; background: var(--color-primary); opacity: 0.5; 
    transition: background 0.6s ease;
}

@keyframes fadeReveal { to { opacity: 1; transform: translateY(0); } }

.title-wrapper { min-height: 110px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 30px; }

.hero-content h1 {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(2.2rem, 4.5vw, 4rem); line-height: 1.1;
    color: var(--color-text); 
    text-shadow: var(--glow-text);
    transition: color 0.6s ease, text-shadow 0.6s ease;
}

/* --- CURSOR CSS PRO --- */
.hero-content h1::after {
    content: ''; 
    display: inline-block;
    width: 4px;  
    height: 0.9em; 
    background: var(--color-primary); 
    margin-left: 8px; 
    animation: blink 1.2s infinite steps(2, start); 
    vertical-align: baseline; 
    position: relative;
    top: 0.05em; 
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-content p {
    font-size: 1.15rem; color: var(--color-text-muted);
    max-width: 700px; margin: 0 auto 40px;
    font-weight: 400;
    transition: color 0.6s ease;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 16px 40px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    text-decoration: none; border-radius: 50px; 
    font-size: 0.9rem; transition: all 0.3s ease;
}

.btn-primary {
    background: var(--color-primary); color: #fff;
    box-shadow: 0 0 20px var(--color-primary-dim); 
    border: 1px solid transparent;
}
.btn-primary:hover {
    transform: translateY(-3px); box-shadow: 0 0 40px var(--color-primary-dim);
    filter: brightness(1.1);
}

/* ============================================================ */
/* 6. SERVICIOS Y CONTACTO                                      */
/* ============================================================ */
.services-section, .contact-section {
    padding: 100px 5%; position: relative; z-index: 2;
}

.section-header { text-align: center; margin-bottom: 70px; }
.section-header h2 { 
    font-family: var(--font-display); font-size: 2.2rem; 
    color: var(--color-text); margin-bottom: 15px;
    transition: color 0.6s ease;
}
.underline { 
    width: 60px; height: 4px; background: var(--color-primary); margin: 0 auto; border-radius: 2px;
    transition: background 0.6s ease;
}

.services-grid { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 30px; max-width: 1200px; margin: 0 auto; 
}

/* TARJETA */
.service-card {
    background: var(--color-card-bg);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    padding: 50px 35px;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    transition: background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease, transform 0.3s;
    display: flex; flex-direction: column; align-items: flex-start; 
    position: relative;
    box-shadow: var(--shadow-card);
}

.service-card:hover { 
    transform: translateY(-10px); 
    border-color: var(--color-primary);
    box-shadow: var(--shadow-card-hover);
}

.service-card--pro { 
    border-color: var(--color-primary-dim); 
    background: linear-gradient(160deg, var(--color-primary-dim) 0%, var(--color-card-bg) 100%);
}

.card-badge {
    position: absolute; top: 20px; right: 20px; 
    background: var(--color-primary); color: #fff;
    font-size: 0.7rem; font-weight: 700; padding: 6px 12px; 
    border-radius: 20px; letter-spacing: 0.5px;
    transition: background 0.6s ease;
}

/* Iconos SVG */
.icon-box {
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    background: var(--color-primary-dim);
    border-radius: 12px;
    color: var(--color-primary);
    margin-bottom: 25px;
    transition: all 0.5s ease;
}
.service-card:hover .icon-box {
    background: var(--color-primary); color: #fff;
    transform: rotate(-5deg);
}

.icon-box svg { width: 32px; height: 32px; }

.service-card h3 { 
    font-size: 1.4rem; margin-bottom: 15px; color: var(--color-text); font-weight: 700; 
    transition: color 0.6s ease;
}
.service-card p { 
    color: var(--color-text-muted); font-size: 0.95rem; line-height: 1.6;
    flex-grow: 1; margin-bottom: 30px; 
    transition: color 0.6s ease;
}

.btn-card {
    background: transparent; 
    border: 2px solid var(--color-border);
    color: var(--color-text); 
    padding: 12px 0; width: 100%;
    font-weight: 700; font-size: 0.85rem; border-radius: 8px;
    cursor: pointer; transition: 0.3s; text-transform: uppercase; letter-spacing: 1px;
}
.btn-card:hover { 
    background: var(--color-text); color: var(--color-bg-base); 
    border-color: var(--color-text);
}

.btn-card--glow { 
    border-color: var(--color-primary); color: var(--color-primary); 
}
.btn-card--glow:hover { 
    background: var(--color-primary); color: #fff; 
    box-shadow: 0 5px 15px var(--color-primary-dim);
}

/* CONTACT FORM */
.contact-form {
    max-width: 650px; margin: 0 auto;
    background: var(--color-card-bg); 
    backdrop-filter: blur(15px);
    padding: 50px; border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
    transition: background 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

.form-group { margin-bottom: 25px; }
.form-group label { 
    display: block; margin-bottom: 10px; font-size: 0.85rem; 
    color: var(--color-primary); font-weight: 700; text-transform: uppercase; 
    transition: color 0.6s ease;
}
.form-group input, .form-group textarea {
    width: 100%; padding: 15px; background: var(--input-bg);
    border: 1px solid var(--color-border); color: var(--color-text);
    border-radius: 8px; font-family: var(--font-body); font-size: 1rem;
    transition: background 0.5s, border 0.5s, color 0.5s;
}
.form-group input:focus, .form-group textarea:focus { 
    outline: none; border-color: var(--color-primary); 
    box-shadow: 0 0 0 3px var(--color-primary-dim);
}

.btn-secondary {
    width: 100%; padding: 16px; background: transparent;
    border: 2px solid var(--color-primary); color: var(--color-primary);
    font-weight: 700; cursor: pointer; border-radius: 8px; transition: 0.3s; 
    text-transform: uppercase; letter-spacing: 1px;
}
.btn-secondary:hover { background: var(--color-primary); color: #fff; transform: translateY(-2px); }
.form-message { margin-top: 20px; text-align: center; }

.footer {
    padding: 40px; text-align: center; border-top: 1px solid var(--color-border);
    color: var(--color-text-muted); font-size: 0.9rem; position: relative; z-index: 2;
    transition: border-color 0.6s ease, color 0.6s ease;
}
.footer a { color: var(--color-primary); text-decoration: none; font-weight: 600; }

/* ============================================================ */
/* 7. BOTÓN FLOTANTE WHATSAPP                                   */
/* ============================================================ */
.whatsapp-float {
    position: fixed;
    width: 60px; height: 60px;
    bottom: 30px; 
    left: 30px; 
    background-color: var(--color-whatsapp);
    color: #FFF;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 2000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(10deg);
    background-color: #20BA56;
}

/* ============================================================ */
/* 8. RESPONSIVE (CORREGIDO FINAL V3 - MÓVIL PERFECTO)          */
/* ============================================================ */
@media (max-width: 768px) {
    .header { padding: 0 15px; }
    
    /* 1. TEXTO MÁS ELEGANTE EN MÓVIL (No tan gigante) */
    .hero-content h1 { 
        font-size: 1.8rem; /* Antes era 2.2rem, muy grande */
        line-height: 1.2;
        padding: 0 10px; /* Margen lateral para que no toque los bordes */
    }
    
    /* Ajuste del cursor para que no se vea deforme en móvil */
    .hero-content h1::after {
        height: 0.8em; 
        width: 3px;
    }

    .hero-content p { 
        font-size: 0.95rem; 
        margin-bottom: 30px; 
        padding: 0 10px;
    }
    
    /* 2. SWIPE MÁS ARRIBA (Para librar la barra de Android/iPhone) */
    .swipe-indicator {
        display: flex !important;
        bottom: 70px !important; /* Subido de 20px a 70px por seguridad */
        z-index: 20; 
    }

    /* Ocultamos el mouse de PC */
    .scroll-indicator { display: none !important; }
    
    /* 3. WHATSAPP EN SU LUGAR */
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        left: auto;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}
/* 9. TRANSICIÓN GLOBAL DE TEXTOS (Anti-salto) */
h1, h2, h3, p, span, a, .brand-text {
    transition: color 1.5s cubic-bezier(0.4, 0, 0.2, 1), text-shadow 1.5s ease;
}