/* 
  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: #cbd5e1;      /* Texto cuerpo */
  --text-muted: #64748b;          /* 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(17, 119, 252, 0);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 var(--glass-shadow);
}

.glass-card {
  position: relative;
  overflow: hidden;
  background: rgba(12, 25, 42, 0.55);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 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;
}

.glass-card:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 15px 40px 0 rgba(37, 99, 235, 0.1);
  transform: translateY(-8px) scale(1.01);
}

.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.82);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  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(10px);
  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) {
  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;
}

/* 8. Timeline de Proceso Estructural */
.process-line-active {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-cyan));
  transform: translateX(-50%);
  z-index: 1;
  height: 0%;
}

/* 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. Rediseño Agenda Premium (Módulo de Conversión) */
.premium-glass-card {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  background-image: linear-gradient(rgba(18, 32, 51, 0.35), rgba(18, 32, 51, 0.35)),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(37, 99, 235, 0.15), rgba(14, 165, 233, 0.15), rgba(255, 255, 255, 0.04));
  background-size: 100% 100%, 200% 100%;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  animation: borderGradient 8s infinite linear;
  transition: transform 350ms cubic-bezier(0.25, 0.8, 0.25, 1),
              box-shadow 350ms cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, box-shadow;
}

@keyframes borderGradient {
  0% { background-position: 0% 50%, 0% 50%; }
  50% { background-position: 0% 50%, 100% 50%; }
  100% { background-position: 0% 50%, 0% 50%; }
}

.premium-glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    140px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
    rgba(14, 165, 233, 0.12),
    transparent 80%
  );
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 350ms ease;
}

.premium-glass-card:hover::before {
  opacity: 1;
}

.premium-glass-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 36px rgba(14, 165, 233, 0.08);
}

.premium-glass-card .premium-icon-wrapper {
  transition: transform 350ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

.premium-glass-card:hover .premium-icon-wrapper {
  transform: scale(1.08);
}

/* Floating Animation for Icons (2-3px vertical drift) */
@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2.5px); }
}

.float-icon-slow {
  animation: floatIcon 4s ease-in-out infinite;
}

/* WhatsApp CTA Button */
.premium-whatsapp-btn {
  transition: transform 250ms cubic-bezier(0.25, 0.8, 0.25, 1),
              border-color 250ms cubic-bezier(0.25, 0.8, 0.25, 1),
              box-shadow 250ms cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, box-shadow;
}

.premium-whatsapp-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 163, 74, 0.4);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.16);
}

.premium-whatsapp-btn:active {
  transform: translateY(-1px) scale(0.96);
}

.premium-whatsapp-btn .whatsapp-icon {
  transition: transform 250ms cubic-bezier(0.25, 0.8, 0.25, 1);
}

.premium-whatsapp-btn:hover .whatsapp-icon {
  transform: translateX(3px);
}

/* Scroll Animations Initial State */
.agenda-fade-up {
  opacity: 0;
  transform: translateY(24px);
  will-change: opacity, transform;
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.agenda-fade-up.animate-active {
  opacity: 1;
  transform: translateY(0);
}

/* Calendar Card Fade in & Shadow Growth */
.agenda-animate-calendar {
  opacity: 0;
  transform: translateY(20px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
  will-change: opacity, transform, box-shadow;
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.agenda-animate-calendar.animate-active {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.06);
}

/* White Calendar Card: very slow animated gradient border & slight hover elevation */
#calendar-card {
  border: 1px solid transparent;
  background-image: linear-gradient(#ffffff, #ffffff),
                    linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(14, 165, 233, 0.15), rgba(37, 99, 235, 0.1), rgba(14, 165, 233, 0.15));
  background-size: 100% 100%, 300% 300%;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  animation: borderGradientSlow 12s infinite linear;
  transition: transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1),
              box-shadow 400ms cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, box-shadow;
}

@keyframes borderGradientSlow {
  0% { background-position: 0% 0%, 0% 0%; }
  50% { background-position: 0% 0%, 100% 100%; }
  100% { background-position: 0% 0%, 0% 0%; }
}

#calendar-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.08);
}

/* Premium reveal animation for Google Calendar (opacity + translateY + blur) */
#calendar-iframe {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(16px);
  will-change: opacity, filter, transform;
  transition: opacity 800ms cubic-bezier(0.22, 1, 0.36, 1),
              filter 1000ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 1000ms cubic-bezier(0.22, 1, 0.36, 1);
}

#calendar-iframe.iframe-loaded {
  filter: blur(0px);
  transform: translateY(0);
}

/* Timeline Animations */
.agenda-timeline-line-h {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1) 900ms;
}

.agenda-timeline-line-v {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 900ms cubic-bezier(0.22, 1, 0.36, 1) 900ms;
}

.animate-active .agenda-timeline-line-h {
  transform: scaleX(1);
}

.animate-active .agenda-timeline-line-v {
  transform: scaleY(1);
}

.agenda-timeline-step {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-active .agenda-timeline-step {
  opacity: 1;
  transform: scale(1);
}

.animate-active .agenda-timeline-step:nth-child(3) { transition-delay: 900ms; }
.animate-active .agenda-timeline-step:nth-child(4) { transition-delay: 1100ms; }
.animate-active .agenda-timeline-step:nth-child(5) { transition-delay: 1300ms; }
.animate-active .agenda-timeline-step:nth-child(6) { transition-delay: 1500ms; }

/* Skeleton Shimmer Loader */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, #f9fafb 25%, #f3f4f6 50%, #f9fafb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .agenda-fade-up {
    transform: none !important;
    transition: opacity 300ms ease-in-out !important;
    transition-delay: 0s !important;
  }
  .agenda-animate-calendar {
    transform: none !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.06) !important;
    transition: opacity 300ms ease-in-out !important;
    transition-delay: 0s !important;
  }
  .agenda-timeline-line-h,
  .agenda-timeline-line-v {
    transform: none !important;
    transition: none !important;
  }
  .agenda-timeline-step {
    transform: none !important;
    transition: opacity 300ms ease-in-out !important;
    transition-delay: 0s !important;
  }
  .premium-glass-card {
    animation: none !important;
    transform: none !important;
    background-image: linear-gradient(rgba(18, 32, 51, 0.35), rgba(18, 32, 51, 0.35)) !important;
  }
  .premium-glass-card::before {
    display: none !important;
  }
  .float-icon-slow {
    animation: none !important;
  }
  #calendar-card {
    animation: none !important;
    background-image: none !important;
    background-color: #ffffff !important;
    transform: none !important;
  }
  #calendar-card:hover {
    transform: none !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.06) !important;
  }
  #calendar-iframe {
    transform: none !important;
    filter: none !important;
  }
  .premium-whatsapp-btn:hover {
    transform: none !important;
  }
  .premium-whatsapp-btn:active {
    transform: none !important;
  }
}

/* ==========================================================================
   20. SECCIÓN CASOS DE ÉXITO (TESTIMONIOS EN VIDEO)
   ========================================================================== */
#casos-exito {
    position: relative;
    z-index: 10;
}

/* Card custom styles */
.video-testimonial-card {
    background: rgba(12, 25, 42, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.2);
    transition: transform 450ms cubic-bezier(0.25, 1, 0.5, 1), 
                box-shadow 450ms cubic-bezier(0.25, 1, 0.5, 1), 
                border-color 450ms cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, box-shadow;
    transform: translate3d(0, 0, 0);
}

.video-testimonial-card:hover {
    transform: translate3d(0, -8px, 0);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15), 0 0 25px rgba(14, 165, 233, 0.1);
}

.video-testimonial-card .thumbnail-container img {
    transition: transform 450ms cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.video-testimonial-card:hover .thumbnail-container img {
    transform: scale(1.05);
}

/* Play button custom styles */
.video-testimonial-card .play-btn {
    transition: transform 450ms cubic-bezier(0.25, 1, 0.5, 1), 
                background-color 450ms, 
                border-color 450ms, 
                box-shadow 450ms;
}

.video-testimonial-card:hover .play-btn {
    transform: scale(1.15);
    background-color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.6);
}

/* Play button pulse */
.video-testimonial-card .play-btn::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(14, 165, 233, 0.4);
    animation: playPulse 2s infinite;
    pointer-events: none;
}

@keyframes playPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

/* Pagination Dots */
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-dot.active {
    background-color: var(--accent-cyan);
    box-shadow: 0 0 12px var(--accent-cyan);
    width: 24px;
    border-radius: 4px;
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .video-testimonial-card,
    .video-testimonial-card .thumbnail-container img,
    .video-testimonial-card .play-btn,
    .play-btn::after,
    #carousel-track {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .video-testimonial-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    .video-testimonial-card:hover .thumbnail-container img {
        transform: none !important;
    }

    .video-testimonial-card:hover .play-btn {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* ==========================================================================
   21. DIRECCIÓN DE ARTE PREMIUM — REFINAMIENTO CINEMATOGRÁFICO
   Capa de mejora visual añadida sobre el sistema existente. No sustituye
   ningún componente: solo lo refina (profundidad, luz, microinteracción).
   ========================================================================== */

/* 21.1 Tipografía: jerarquía y lectura */
h1, h2, h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}

/* 21.2 Etiquetas "eyebrow" de sección (// SHOWROOM DIGITAL, 01 / ...) */
.eyebrow-label {
  position: relative;
  padding-left: 30px;
  letter-spacing: 0.16em;
}

.eyebrow-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-cyan), transparent);
  transform: translateY(-50%);
}

/* 21.3 Navbar: subrayado animado en enlaces de escritorio */
#navbar .hidden.lg\:flex a {
  position: relative;
  padding-bottom: 2px;
}

#navbar .hidden.lg\:flex a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  transition: right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#navbar .hidden.lg\:flex a:hover::after {
  right: 0;
}

/* 21.4 Botones/CTA: barrido de luz sutil + feedback de presión.
   Se ancla a cualquier elemento cuya clase contenga shadow-neon-blue/cyan
   (incluye variantes hover:shadow-neon-*), sin tocar el marcado existente. */
a[class*="shadow-neon-blue"],
button[class*="shadow-neon-blue"],
a[class*="shadow-neon-cyan"],
button[class*="shadow-neon-cyan"] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

a[class*="shadow-neon-blue"]::before,
button[class*="shadow-neon-blue"]::before,
a[class*="shadow-neon-cyan"]::before,
button[class*="shadow-neon-cyan"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 35%;
  height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 1;
}

a[class*="shadow-neon-blue"]:hover::before,
button[class*="shadow-neon-blue"]:hover::before,
a[class*="shadow-neon-cyan"]:hover::before,
button[class*="shadow-neon-cyan"]:hover::before {
  left: 130%;
}

a[class*="shadow-neon-blue"]:active,
button[class*="shadow-neon-blue"]:active,
a[class*="shadow-neon-cyan"]:active,
button[class*="shadow-neon-cyan"]:active {
  transform: scale(0.97);
}

/* 21.5 Accesibilidad: foco visible elegante y consistente */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 21.6 Hero: profundidad cinematográfica (viñeta + fundido inferior + glow) */
#hero {
  isolation: isolate;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 18%, transparent 42%, rgba(7, 17, 31, 0.55) 100%);
  z-index: 12;
  pointer-events: none;
}

#hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: linear-gradient(to bottom, transparent, var(--bg-alt) 92%);
  z-index: 13;
  pointer-events: none;
}

.hero-title-line.text-transparent {
  filter: drop-shadow(0 0 26px rgba(14, 165, 233, 0.28));
}

/* 21.7 Grano fílmico sutil (solo escritorio/tablet, coste mínimo, estático) */
@media (min-width: 768px) {
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
    opacity: 0.025;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
  }
}

/* 21.8 Servicios: marcas de encuadre tipo HUD en las imágenes */
.service-image-container {
  position: relative;
}

.service-image-container::before,
.service-image-container::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(14, 165, 233, 0.5);
  border-style: solid;
  border-width: 0;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.5s ease, border-color 0.5s ease;
  opacity: 0.5;
}

.service-image-container::before {
  top: -10px;
  left: -10px;
  border-top-width: 2px;
  border-left-width: 2px;
}

.service-image-container::after {
  bottom: -10px;
  right: -10px;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

.service-image-container:hover::before,
.service-image-container:hover::after {
  opacity: 1;
  border-color: var(--accent-cyan);
}

/* 21.9 Refinamiento de elevación en tarjetas (menos exagerado, más premium) */
.glass-card:hover {
  transform: translateY(-6px) scale(1.008);
}

.video-testimonial-card:hover {
  transform: translate3d(0, -6px, 0);
}

.metric-card {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
}

.metric-card:hover .stat-number {
  text-shadow: 0 0 18px rgba(14, 165, 233, 0.35);
}

/* 21.10 Móvil: rendimiento y detalles diseñados a propósito */
@media (max-width: 767px) {
  .glass-panel,
  .glass-card,
  .video-testimonial-card,
  .premium-glass-card,
  #calendar-card {
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
  }

  .ambient-glow-blue,
  .ambient-glow-cyan {
    width: 320px;
    height: 320px;
  }

  #whatsapp-floating {
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
    right: calc(1.25rem + env(safe-area-inset-right));
  }

  #back-to-top {
    bottom: calc(6.5rem + env(safe-area-inset-bottom));
    right: calc(1.25rem + env(safe-area-inset-right));
  }

  .service-image-container::before,
  .service-image-container::after {
    width: 16px;
    height: 16px;
  }
}

/* 21.11 Respeto a prefers-reduced-motion para los nuevos elementos */
@media (prefers-reduced-motion: reduce) {
  body::after {
    display: none !important;
  }
  #navbar .hidden.lg\:flex a::after {
    transition: none !important;
  }
  a[class*="shadow-neon-blue"]::before,
  button[class*="shadow-neon-blue"]::before,
  a[class*="shadow-neon-cyan"]::before,
  button[class*="shadow-neon-cyan"]::before {
    display: none !important;
  }
  .glass-card:hover,
  .video-testimonial-card:hover,
  .metric-card:hover {
    transform: none !important;
  }
}

/* ==========================================================================
   22. FASE 2 — REFINAMIENTO CINEMATOGRÁFICO AVANZADO
   Segunda pasada de dirección de arte: transiciones entre secciones,
   navbar compacto, numeración editorial en servicios, portafolio y
   menú móvil con transición real.
   ========================================================================== */

/* 22.1 Costuras suaves entre secciones (evita cortes bruscos) */
main > section {
  position: relative;
}

main > section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to bottom, rgba(4, 9, 18, 0.4), transparent);
  pointer-events: none;
  z-index: 1;
}

/* 22.2 Navbar: se compacta ligeramente al hacer scroll (sensación premium) */
#navbar > div:first-child {
  transition: padding 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

#navbar.nav-scrolled > div:first-child {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

#navbar.nav-scrolled a[aria-label="NEXUS Digital Inicio"] img {
  height: 2.35rem;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

a[aria-label="NEXUS Digital Inicio"] img {
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 22.3 Tipografía: tracking editorial en títulos de sección */
main h2 {
  letter-spacing: -0.01em;
}

/* 22.4 Servicios: numeración editorial gigante de fondo (marca de agua) */
.story-section {
  isolation: isolate;
}

.story-section::before {
  content: attr(data-step);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: clamp(9rem, 24vw, 22rem);
  line-height: 1;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.045);
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

/* 22.5 Portafolio: anillo de luz cyan en el hover de cada proyecto */
#proyectos .glass-card {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#proyectos .glass-card:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35),
              inset 0 0 0 1px rgba(14, 165, 233, 0.35),
              0 0 40px rgba(14, 165, 233, 0.08);
}

/* 22.6 Casos de éxito: acento superior animado en tarjetas de métricas */
#casos-exito .metric-card {
  position: relative;
  overflow: hidden;
}

#casos-exito .metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#casos-exito .metric-card:hover::before {
  transform: scaleX(1);
}

/* 22.7 Menú móvil: transición real de apertura/cierre (no un simple hidden/visible) */
#mobile-menu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.35s ease,
              transform 0.35s ease;
}

#mobile-menu.mobile-menu-open {
  max-height: 32rem;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  main > section::before {
    display: none !important;
  }
  .story-section::before {
    display: none !important;
  }
  #mobile-menu {
    transition: opacity 0.25s ease !important;
  }
}
