/* 
  NEXUS - Experiencia Digital Inmersiva
  Estilos CSS Personalizados y Glassmorphism (Atmósfera Azul Oscuro Premium)
  --------------------------------------------------
  Inspirado en Apple Vision Pro, DJI Enterprise, Autodesk, Unreal Engine, Bentley Systems.
  Paleta azul profundo con glassmorphism oscuro y luces difusas.
*/

:root {
  /* Paleta Premium Azul Oscuro */
  --bg-base: #07111f;             /* Fondo principal */
  --bg-alt: #0b1728;              /* Fondo alterno */
  --bg-surface: #122033;          /* Superficies / tarjetas */
  --accent-blue: #2563eb;         /* Azul corporativo */
  --accent-cyan: #0ea5e9;         /* Cyan brillante */
  --accent-green: #16a34a;        /* Verde WhatsApp */
  --text-primary: #ffffff;        /* Títulos */
  --text-secondary: #e2e8f0;      /* Texto cuerpo (Aclarado para mejor contraste) */
  --text-muted: #cbd5e1;          /* Texto apagado */
  --glass-bg: rgba(12, 25, 42, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 0, 0, 0.25);
  --font-sans: 'Outfit', 'Inter', sans-serif;
  --cursor-size: 8px;
  --cursor-follower-size: 40px;
}

/* 1. Reset & Base */
html {
  scroll-behavior: smooth;
}

/* Compensar la altura del menú fijo para el scroll nativo */
section[id] {
  scroll-margin-top: 80px;
}

body {
  background-color: var(--bg-base);
  font-family: var(--font-sans);
  color: var(--text-secondary);
  overflow-x: hidden;
  position: relative;
}

/* Scrollbar estilizado */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue);
}

/* Bloqueo de scroll nativo para pre-carga y modales */
.scroll-locked {
  overflow: hidden !important;
}

/* 2. Glassmorphism Oscuro */
.glass-panel {
  background: rgba(16, 28, 48, 0.65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid rgba(255, 255, 255, 0.15); /* Edge lighting */
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 8px 32px 0 var(--glass-shadow);
}

.glass-card {
  position: relative;
  overflow: hidden;
  /* Degradado muy sutil: ligeramente más claro en el top, más profundo abajo */
  background: linear-gradient(
    160deg,
    rgba(22, 38, 66, 0.72) 0%,
    rgba(14, 24, 44, 0.80) 100%
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-top: 1px solid rgba(255, 255, 255, 0.16); /* Edge lighting */
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.65), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
}

/* Glass Shine Reflection Effect */
.glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  transition: none;
  pointer-events: none;
}

/* Se removió el .glass-card:hover duplicado para unificar la transición */

/* ---- Sistema de tipografía interna de tarjetas ---- */

/* Badge de categoría: fondo azul translúcido corporativo */
.card-badge {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  font-family: 'Outfit', monospace;
  color: #93c5fd;                            /* Azul claro/Cyan premium */
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
}

/* Título de tarjeta: blanco puro, peso fuerte */
.card-title {
  color: #ffffff;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Párrafo descriptivo: blanco muy suavizado, interlineado cómodo */
.card-body {
  color: rgba(255, 255, 255, 0.72);          /* ~72% opacidad - legible pero subordinado */
  font-size: 0.8125rem;                       /* 13px — legible sin competir */
  font-weight: 300;
  line-height: 1.7;
}

/* Etiqueta interna de separador */
.card-label {
  font-size: 10px;
  font-family: 'Outfit', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.35);
  display: block;
}

/* Texto de resultado destacado */
.card-result {
  color: #60a5fa;                             /* Azul corporativo aclarado, no el sat. original */
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
}


.glass-card:hover::after {
  left: 150%;
  transition: all 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-input {
  background: rgba(12, 25, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  color: var(--text-primary) !important;
  transition: all 0.3s ease;
}

.glass-input::placeholder {
  color: var(--text-muted);
}

.glass-input:focus {
  border-color: var(--accent-blue);
  background: rgba(18, 32, 51, 0.8);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
}

/* 3. Cabecera Inteligente (Navbar) */
#navbar {
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

#navbar.nav-scrolled {
  background: rgba(7, 17, 31, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* 4. Preloader */
#preloader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-base);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preloader-word {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(20px);
  position: absolute;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.85;
  text-transform: uppercase;
  background: linear-gradient(to right, var(--text-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

@media(min-width: 768px) {
  .preloader-word {
    font-size: 5rem;
  }
}

.preloader-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  width: 0%;
}

/* 5. Cursor Personalizado */
@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  body {
    cursor: none;
  }
  
  a, button, select, input, textarea, iframe, [role="button"], .interactive-element {
    cursor: none;
  }

  .custom-cursor {
    width: 10px;
    height: 10px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.5), 0 0 20px rgba(14, 165, 233, 0.2);
    transition: width 0.2s, height 0.2s, background-color 0.2s, box-shadow 0.2s;
  }

  .custom-cursor-follower {
    width: var(--cursor-follower-size);
    height: var(--cursor-follower-size);
    border: 1.5px solid rgba(14, 165, 233, 0.4);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.06);
    transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
                height 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
                background-color 0.3s, 
                border-color 0.3s,
                border-radius 0.3s,
                transform 0.3s;
  }

  /* Hover sobre Botones / CTAs */
  body.cursor-hover-btn .custom-cursor {
    width: 5px;
    height: 5px;
    background-color: var(--accent-blue);
    box-shadow: 0 0 12px var(--accent-blue);
  }

  body.cursor-hover-btn .custom-cursor-follower {
    width: 55px;
    height: 55px;
    background-color: rgba(37, 99, 235, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.2);
  }

  /* Hover sobre Enlaces */
  body.cursor-hover-link .custom-cursor {
    width: 4px;
    height: 4px;
    background-color: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
  }

  body.cursor-hover-link .custom-cursor-follower {
    width: 45px;
    height: 45px;
    border-radius: 30%;
    border-color: var(--accent-cyan);
    background-color: rgba(14, 165, 233, 0.06);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.1);
    transform: translate(-50%, -50%) rotate(45deg);
  }

  /* Estado de Arrastre */
  body.cursor-drag .custom-cursor {
    background-color: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
  }

  body.cursor-drag .custom-cursor-follower {
    width: 50px;
    height: 50px;
    border-color: var(--accent-blue);
    background-color: rgba(37, 99, 235, 0.06);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.2);
  }
}

/* 6. Indicador de Progreso del Scroll */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
  z-index: 1001;
  width: 0%;
}

/* 7. Componente de Storytelling de Servicios (100vh) */
.story-section {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.story-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.12;
  filter: saturate(0.4) blur(1px);
  transition: opacity 1s ease;
}

.story-section:hover .story-bg-video {
  opacity: 0.18;
}
/* 9. WhatsApp Flotante & Volver Arriba */
#whatsapp-floating {
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#whatsapp-floating:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 30px rgba(22, 163, 74, 0.45);
}

#back-to-top {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 10. Animaciones Helper */
.fade-in-reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(30px);
}

.scale-in-reveal {
  opacity: 0;
  transform: scale(0.9);
}

/* Estilos para el visor 3D/Modal */
.modal-open {
  overflow: hidden;
}

.modal-container {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 11. Ken Burns Effect para la imagen de fondo de Hero */
@keyframes kenBurnsEffect {
  0% { transform: scale(1); }
  50% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

.ken-burns-bg {
  animation: kenBurnsEffect 20s ease-in-out infinite;
}

/* 12. Luces Difusas Ambientales */
.ambient-glow-blue {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-cyan {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* 13. Estilo Premium para Contenedor de Imágenes de Servicios */
.service-image-container div {
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-image-container:hover div {
  opacity: 1 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  /* transform omitido: GSAP gestiona el transform */
}

.service-image-container img {
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
              filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-image-container:hover img {
  filter: brightness(110%);
}

/* 14. Malla Técnica / Wireframe Grid */
#tech-grid-wrapper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0; /* Detrás de todo el contenido */
  overflow: hidden;
  user-select: none;
}

#tech-grid {
  width: 110%;
  height: 110%;
  position: absolute;
  left: -5%;
  top: -5%;
  pointer-events: none;
  transform: translate(0, 0);
  will-change: transform;
}

@keyframes gridLoop {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-40px, -20px);
  }
}

.tech-grid-animated {
  animation: gridLoop 25s linear infinite;
}

@keyframes nodePulseR {
  0%, 100% {
    r: 2;
    opacity: 0.1;
  }
  50% {
    r: 8;
    opacity: 0.8;
  }
}

.grid-node-pulse {
  animation: nodePulseR 4s ease-in-out infinite;
}
#pulse-1 { animation-delay: 0s; }
#pulse-2 { animation-delay: 1.2s; }
#pulse-3 { animation-delay: 2.4s; }
#pulse-4 { animation-delay: 3.6s; }

/* 15. Dron Animado */

#drone-container {
  width: clamp(150px, 20vw, 280px);
  z-index: 5;
  will-change: transform, opacity;
  pointer-events: none;
  margin-top: 10px;
}

#hero-drone {
  width: 100%;
  height: auto;
  transform-origin: center center;
  filter: drop-shadow(0 12px 20px rgba(7, 17, 31, 0.4));
}

/* 16. Premium Text Gradient */
.text-gradient-premium {
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  background-image: linear-gradient(135deg, #ffffff 0%, #ffffff 50%, rgba(255,255,255,0.6) 100%);
}

