/* Custom Styles for Principia */

/* Global Transition Optimization */
*, 
*::before, 
*::after {
    transition: 
        transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
        opacity 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
        color 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
        background-color 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
        border-color 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    will-change: auto;
}

/* ===================================================================
   📏 SISTEMA DE ESPACIADO FLUIDO
   Resuelve el problema de saltos bruscos en tamaños intermedios
   usando clamp() para escalado proporcional suave
==================================================================== */

/* Contenedor principal con padding fluido */
.fluid-container {
  /* Escala suavemente desde 16px (móvil) hasta 80px (desktop grande) */
  padding-left: clamp(1rem, 3vw + 0.5rem, 5rem);
  padding-right: clamp(1rem, 3vw + 0.5rem, 5rem);
}

/* Variantes de espaciado fluido para diferentes contextos */
.fluid-spacing-sm {
  padding-left: clamp(1rem, 2vw + 0.5rem, 3rem);
  padding-right: clamp(1rem, 2vw + 0.5rem, 3rem);
}

.fluid-spacing-md {
  padding-left: clamp(1.5rem, 3.5vw + 0.5rem, 6rem);
  padding-right: clamp(1.5rem, 3.5vw + 0.5rem, 6rem);
}

.fluid-spacing-lg {
  padding-left: clamp(2rem, 5vw + 1rem, 8rem);
  padding-right: clamp(2rem, 5vw + 1rem, 8rem);
}

/* Espaciado vertical fluido */
.fluid-py {
  padding-top: clamp(2rem, 5vh + 1rem, 6rem);
  padding-bottom: clamp(2rem, 5vh + 1rem, 6rem);
}

.fluid-py-sm {
  padding-top: clamp(1.5rem, 3vh + 0.5rem, 4rem);
  padding-bottom: clamp(1.5rem, 3vh + 0.5rem, 4rem);
}

.fluid-py-lg {
  padding-top: clamp(3rem, 8vh + 1.5rem, 10rem);
  padding-bottom: clamp(3rem, 8vh + 1.5rem, 10rem);
}

/* ===================================================================
   🎨 SISTEMA DE PARTÍCULAS Y EFECTOS VISUALES
==================================================================== */

/* Stellar Background System - Enhanced for Night Sky */
.stellar-field {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at bottom, #1e293b 0%, #020617 100%);
}

.star {
  position: absolute;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  animation: twinkle 2s infinite alternate;
}

.star.size-1 { width: 1px; height: 1px; }
.star.size-2 { width: 2px; height: 2px; }
.star.size-3 { width: 3px; height: 3px; }

.star.orange { 
  background: radial-gradient(circle, rgba(251, 146, 60, 0.9) 0%, rgba(251, 146, 60, 0) 70%);
  box-shadow: 0 0 6px rgba(251, 146, 60, 0.5);
}
.star.blue { 
  background: radial-gradient(circle, rgba(147, 197, 253, 0.8) 0%, rgba(147, 197, 253, 0) 70%);
  box-shadow: 0 0 4px rgba(147, 197, 253, 0.4);
}
.star.purple { 
  background: radial-gradient(circle, rgba(196, 181, 253, 0.8) 0%, rgba(196, 181, 253, 0) 70%);
  box-shadow: 0 0 4px rgba(196, 181, 253, 0.4);
}

@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* Night Sky Dark Mode Overrides */
.dark .stellar-field {
  background: radial-gradient(ellipse at bottom, #0f172a 0%, #020617 100%);
}

.dark body {
  background: linear-gradient(to bottom, #0f172a, #020617);
}

/* Night Sky Gradients */
.night-sky-bg {
  background: linear-gradient(135deg, #020617 0%, #0f172a 25%, #1e293b 50%, #0f172a 75%, #020617 100%);
}

.night-sky-section {
  background: linear-gradient(to bottom, #0f172a, #1e293b);
  border-top: 1px solid rgba(251, 146, 60, 0.1);
}

/* Dynamic Background Images - Optimized WebP with responsive sizes */
.hero-bg-light {
  /* Móvil por defecto (< 640px) */
  background-image: url('../assets/img/mockups/hero_background_mobile.webp');
}

/* Tablet (≥ 640px) */
@media (min-width: 640px) {
  .hero-bg-light {
    background-image: url('../assets/img/mockups/hero_background_tablet.webp');
  }
}

/* Desktop (≥ 1024px) */
@media (min-width: 1024px) {
  .hero-bg-light {
    background-image: url('../assets/img/mockups/hero_background_desktop.webp');
  }
}

/* Dark Mode - Optimized WebP with responsive sizes */
.dark .hero-bg-light {
  background-image: url('../assets/img/mockups/inspira2_background_mobile.webp');
}

@media (min-width: 640px) {
  .dark .hero-bg-light {
    background-image: url('../assets/img/mockups/inspira2_background_tablet.webp');
  }
}

@media (min-width: 1024px) {
  .dark .hero-bg-light {
    background-image: url('../assets/img/mockups/inspira2_background_desktop.webp');
  }
}

/* Responsive WebP backgrounds for CTA section texture */
.cta-texture-bg {
  background-image: url('../assets/img/mockups/descubre_CTA_index_mobile.webp');
}

@media (min-width: 640px) {
  .cta-texture-bg {
    background-image: url('../assets/img/mockups/descubre_CTA_index_tablet.webp');
  }
}

@media (min-width: 1024px) {
  .cta-texture-bg {
    background-image: url('../assets/img/mockups/descubre_CTA_index_desktop.webp');
  }
}

/* Enhanced Dark Mode Overrides */
.dark .bg-white { 
  background: #0f172a !important; 
}

.dark .bg-gray-50, .dark .bg-gray-100 { 
  background: linear-gradient(135deg, #1e293b, #334155) !important; 
}

/* Selector general para gradientes en modo oscuro - excepciones para contenedores numéricos */
.dark .bg-gradient-to-br:not(.w-16.h-16.rounded-2xl) { 
  background: linear-gradient(135deg, #0f172a, #1e293b, #334155) !important; 
}

/* Estilos específicos para los contenedores numéricos en modo oscuro */
.dark .w-16.h-16.bg-gradient-to-br.rounded-2xl[class*="dark:from-blue"] {
  background: linear-gradient(to bottom right, #60a5fa, #3b82f6) !important;
}

.dark .w-16.h-16.bg-gradient-to-br.rounded-2xl[class*="dark:from-amber"] {
  background: linear-gradient(to bottom right, #f59e0b, #d97706) !important;
}

.dark .w-16.h-16.bg-gradient-to-br.rounded-2xl[class*="dark:from-emerald"] {
  background: linear-gradient(to bottom right, #10b981, #059669) !important;
}

.dark .text-gray-900 { 
  color: #f1f5f9 !important; 
}

.dark .text-gray-600 { 
  color: #cbd5e1 !important; 
}

.dark .border-gray-200 { 
  border-color: rgba(100, 116, 139, 0.3) !important; 
}

/* Dark Mode Card Styles */
.dark .bg-white.rounded-3xl,
.dark .bg-white.rounded-xl,
.dark .bg-white.rounded-2xl {
  background: linear-gradient(135deg, #1e293b, #334155) !important;
  border: 1px solid rgba(100, 116, 139, 0.2) !important;
}

.dark .shadow-xl {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

/* Override all zinc colors for consistency */
.dark .bg-zinc-900 {
  background: linear-gradient(135deg, #1e293b, #334155) !important;
}

.dark .border-zinc-700,
.dark .border-zinc-800 {
  border-color: rgba(100, 116, 139, 0.3) !important;
}

.dark .text-zinc-400 {
  color: #cbd5e1 !important;
}

/* Footer specific overrides */
.dark footer {
  background: linear-gradient(135deg, #020617, #0f172a) !important;
  border-color: rgba(100, 116, 139, 0.2) !important;
}

/* Header Dark Mode */
.dark #header {
  background: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.dark #header.scrolled {
  background: rgba(15, 23, 42, 0.95) !important;
}

/* Smooth Dark Mode Transitions */
* {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease !important;
}

.hero-bg-light {
  transition: background-image 0.8s ease-in-out;
}

/* Floating Elements */
.float-animation {
  animation: float 6s ease-in-out infinite;
}

.float-delayed {
  animation: float 6s ease-in-out infinite;
  animation-delay: -2s;
}

.float-slow {
  animation: float 8s ease-in-out infinite;
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* Gradient Pulse */
.gradient-pulse {
  animation: gradientPulse 4s ease-in-out infinite;
}

@keyframes gradientPulse {
  0%, 100% { background-size: 100% 100%; }
  50% { background-size: 120% 120%; }
}

/* Morphing Backgrounds */
.morphing-bg {
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Hero Content - Visible inmediatamente para mejor LCP */
.hero-title,
.hero-subtitle {
  opacity: 1;
  transform: none;
}

/* Reveal Animations - Solo para contenido no crítico */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Section-specific effects */
.data-flow {
  position: relative;
  overflow: hidden;
}

.data-flow::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(234, 88, 12, 0.1), transparent);
  animation: dataFlow 3s linear infinite;
}

@keyframes dataFlow {
  0% { left: -100%; opacity: 0; }
  50% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Enhanced Loading State */
body:not(.loaded) .reveal-on-scroll {
  opacity: 0;
  transform: translateY(50px);
}

body.loaded .reveal-on-scroll {
  transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Glow Effects */
.glow-orange {
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.3);
  animation: glowPulse 2s ease-in-out infinite alternate;
}

.glow-blue {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  animation: glowPulse 2s ease-in-out infinite alternate;
  animation-delay: 0.5s;
}

.glow-purple {
  box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
  animation: glowPulse 2s ease-in-out infinite alternate;
  animation-delay: 1s;
}

@keyframes glowPulse {
  0% { box-shadow: 0 0 20px rgba(var(--glow-color), 0.3); }
  100% { box-shadow: 0 0 30px rgba(var(--glow-color), 0.6), 0 0 40px rgba(var(--glow-color), 0.3); }
}

/* ===================================================================
   🌪️ SISTEMA DE PARTÍCULAS NATURALES - CONTROLADO VÍA JAVASCRIPT
==================================================================== */

/* Realistic Wind System - NO CSS ANIMATIONS */
.wind-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 10;
  animation: none !important; /* Force disable all CSS animations */
}

.wind-particle.small {
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

.wind-particle.medium {
  width: 4px;
  height: 4px;
  background: rgba(234, 88, 12, 0.8);
  box-shadow: 0 0 8px rgba(234, 88, 12, 0.6);
  border-radius: 50%;
}

.wind-particle.large {
  width: 5px;
  height: 5px;
  background: rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  border-radius: 50%;
}

/* Leaf-like particles */
.wind-particle.leaf {
  width: 5px;
  height: 3px;
  border-radius: 2px;
  background: rgba(34, 197, 94, 0.8);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* Dynamic trail dots */
.dynamic-trail {
  transition: opacity 0.1s ease-out;
  will-change: transform, opacity;
}

/* Pure trail particles - More visible curved lines */
.wind-trail {
  position: absolute;
  width: 30px;
  height: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
  border-radius: 3px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.wind-trail.subtle {
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.8), rgba(234, 88, 12, 0.4), rgba(234, 88, 12, 0));
  box-shadow: 0 0 10px rgba(234, 88, 12, 0.4);
}

.wind-trail.whisper {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.7), rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0));
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.35);
}

/* Multi-layer wind system */
/* Front layer - fast and close */
.wind-layer-front .wind-particle,
.wind-layer-front .wind-trail {
  z-index: 15;
  filter: brightness(1.2) saturate(1.1);
}

/* Middle layer - medium speed */
.wind-layer-middle .wind-particle,
.wind-layer-middle .wind-trail {
  z-index: 10;
  opacity: 0.7;
  filter: brightness(0.9) saturate(0.9);
}

/* Back layer - slow and distant */
.wind-layer-back .wind-particle,
.wind-layer-back .wind-trail {
  z-index: 5;
  opacity: 0.4;
  filter: brightness(0.7) saturate(0.7);
  transform: scale(0.8);
}

/* ===================================================================
   🎨 CONTENEDORES DE PARTÍCULAS
==================================================================== */
.wind-container, 
.natural-wind-container, 
.stellar-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

/* Smooth transitions for all backgrounds and text */
.transition-colors {
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optimized sunset transition for sections */
.sunset-transition {
  transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header Transitions */
.header-transparent {
  background: transparent;
  transition: all 0.5s ease-in-out;
}

.header-solid {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: all 0.5s ease-in-out;
}

.dark .header-solid {
  background: rgba(24, 24, 27, 0.95);
}

/* Navigation Link States - Refined */
.nav-link {
  position: relative;
  transition: all 0.5s ease-in-out;
  font-family: 'Fira Sans', sans-serif;
  font-weight: 400;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 50%;
  background-color: #ea580c;
  transition: all 0.5s ease-in-out;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active-link::after {
  width: 100%;
}

/* Subrayado en modo dark - amarillo dorado como el hero */
html.dark .nav-link::after {
  background-color: #facc15; /* yellow-400 */
}

/* Navbar separators */
.navbar-separator {
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.5s ease-in-out;
}

.header-solid .navbar-separator {
  color: rgba(156, 163, 175, 0.8);
}

.dark .header-solid .navbar-separator {
  color: rgba(156, 163, 175, 0.6);
}

/* Header color transitions for transparent state */
.header-transparent .active-link {
  color: #ea580c;
}

.dark .header-transparent .active-link {
  color: #facc15; /* yellow-400 en modo dark */
}

.header-transparent .inactive-link {
  color: rgba(255, 255, 255, 0.8);
}

.header-transparent .inactive-link:hover {
  color: rgba(255, 255, 255, 1);
}

/* Header color transitions for solid state */
.header-solid .active-link {
  color: #ea580c;
}

.header-solid .inactive-link {
  color: #6b7280;
}

.header-solid .inactive-link:hover {
  color: #374151;
}

.dark .header-solid .active-link {
  color: #facc15; /* yellow-400 en modo dark */
}

.dark .header-solid .inactive-link {
  color: #9ca3af;
}

.dark .header-solid .inactive-link:hover {
  color: #f3f4f6;
}

/* Brand color transitions */
.header-transparent .navbar-brand {
  color: rgba(255, 255, 255, 0.9);
}

.header-solid .navbar-brand {
  color: #6b7280;
}

.dark .header-solid .navbar-brand {
  color: #f3f4f6;
}

/* Theme toggle styles */
.theme-switch {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.theme-switch:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 1);
}

.header-solid .theme-switch {
  background: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.8);
}

.header-solid .theme-switch:hover {
  background: rgba(0, 0, 0, 0.2);
  color: rgba(0, 0, 0, 1);
}

.dark .header-solid .theme-switch {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.dark .header-solid .theme-switch:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 1);
}

/* Enhanced animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-soft {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse-soft {
  animation: pulse-soft 4s ease-in-out infinite;
}

.animation-delay-200 {
  animation-delay: 0.2s;
}

.animation-delay-400 {
  animation-delay: 0.4s;
}

.animation-delay-600 {
  animation-delay: 0.6s;
}

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
  background: #18181b;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #ea580c, #f97316);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #dc2626, #ea580c);
}

/* Hero section enhancements */
.hero-gradient {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.1) 0%, rgba(234, 88, 12, 0.05) 100%);
}

/* Enhanced focus states for accessibility */
.focus-outline:focus,
*:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
  border-radius: 0.375rem;
}

/* Mobile menu toggle */
.mobile-menu-open {
  max-height: 400px;
  opacity: 1;
  transition: all 0.3s ease-in-out;
}

.mobile-menu-closed {
  max-height: 0;
  opacity: 0;
  transition: all 0.3s ease-in-out;
}

/* Navbar Mobile Behavior - Ocultar/Mostrar según scroll */
.mobile-header-auto-hide {
  transition: transform 0.3s ease-in-out;
}

/* Clases para manejar la interacción con el menú móvil */
.mobile-menu-active #header {
  transform: translateY(0) !important;
}

.mobile-menu-active #navbar-menu {
  display: block !important;
  opacity: 1;
}

/* Asegurar que el botón del menú móvil siempre sea visible */
#mobile-menu-btn {
  z-index: 60;
  position: relative;
}

/* Estilos específicos para dispositivos móviles */
@media (max-width: 639px) {
  /* Clases para ocultar/mostrar el navbar en móviles */
  .header-mobile-hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
  }
  
  .header-mobile-visible {
    transform: translateY(0);
    transition: transform 0.3s ease-in-out;
  }
  
  /* Asegurar que el hero section ocupe toda la pantalla sin que el navbar lo cubra */
  #inicio {
    padding-top: 0;
    margin-top: 0;
    min-height: 100vh; /* Mínima altura es toda la pantalla */
    height: auto; /* Permitir que se extienda si es necesario */
    display: flex;
    align-items: center;
    padding-bottom: 3rem; /* Espacio para que el indicador de scroll sea visible */
    position: relative; /* Para posicionamiento absoluto del indicador */
  }
  
  /* Ajustar el contenido del hero para que no quede oculto bajo el navbar */
  .hero-content {
    padding-top: 0;
    margin-top: 0;
  }
  
  /* Ajustes específicos para el título y subtítulo en móvil */
  .hero-title {
    font-size: 2.75rem; /* Ligeramente más grande que text-4xl */
    line-height: 1.1; /* Más compacto */
    letter-spacing: -0.02em; /* Letra ligeramente más junta */
  }
  
  .hero-subtitle {
    font-size: 1.125rem; /* Equivalente a text-lg */
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }
  
  /* Control de posicionamiento del navbar en móviles */
  #header.header-mobile-hidden {
    position: absolute;
  }
  
  #header.header-mobile-visible {
    position: fixed;
  }
  
  /* Ajustes para el header en dispositivos móviles */
  #header {
    z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  /* Fondo oscuro para dark mode en móvil */
  html.dark #header {
    background-color: rgba(17, 24, 39, 0.95) !important; /* gray-900 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  }
  
  /* Ajustes para el logo "Principia" en modo light móvil */
  #navbar-brand {
    color: #4b5563; /* text-gray-600 */
  }
  
  /* Ajustes para el logo "Principia" en modo dark móvil */
  html.dark #navbar-brand {
    color: #ffffff !important; /* white */
  }
  
  /* Ajustes para los enlaces de navegación en modo light móvil */
  .nav-link {
    color: #374151 !important; /* text-gray-700 */
  }
  
  .nav-link:hover {
    color: #ea580c !important; /* principia-orange-600 */
  }
  
  /* Ajustes para los enlaces de navegación en modo dark móvil */
  html.dark .nav-link {
    color: #e5e7eb !important; /* text-gray-200 */
  }
  
  html.dark .nav-link:hover {
    color: #facc15 !important; /* yellow-400 - consistente con el hero */
  }
  
  /* Botón hamburguesa en modo light */
  #mobile-menu-btn {
    border-color: rgba(107, 114, 128, 0.3); /* gray-500 con transparencia */
    background-color: rgba(243, 244, 246, 0.8); /* gray-100 con transparencia */
    color: #374151; /* text-gray-700 */
  }
  
  #mobile-menu-btn:hover {
    background-color: rgba(229, 231, 235, 0.9); /* gray-200 con transparencia */
  }
  
  /* SVG del botón hamburguesa en modo light */
  #mobile-menu-btn svg {
    stroke: #374151; /* gray-700 */
  }
  
  /* Botón hamburguesa en dark mode */
  html.dark #mobile-menu-btn {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
    color: white !important;
  }
  
  html.dark #mobile-menu-btn svg {
    stroke: white !important;
  }
  
  /* Botón de theme toggle en modo light móvil */
  #theme-toggle {
    color: #374151;
  }
  
  /* Ajustes para el menú móvil cuando está abierto */
  #navbar-menu.mobile-menu-open {
    padding: 1rem;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.98);
  }
  
  /* Menú móvil abierto en dark mode */
  html.dark #navbar-menu.mobile-menu-open {
    background-color: rgba(17, 24, 39, 0.98) !important; /* gray-900 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  }
  
  /* Botón CTA en modo dark móvil */
  html.dark .nav-cta-button {
    background-color: #ea580c !important; /* principia-orange-600 */
    color: #ffffff !important;
  }
  
  html.dark .nav-cta-button:hover {
    background-color: #fb923c !important; /* principia-orange-400 */
  }
  
  /* Botón de theme toggle en dark mode móvil */
  html.dark #theme-toggle {
    color: #e5e7eb !important; /* gray-200 */
  }
  
  /* Separadores del navbar en dark mode móvil */
  html.dark .navbar-separator {
    color: rgba(255, 255, 255, 0.3) !important;
  }
}

/* Form focus states */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 2px #ea580c;
  border-color: transparent;
}

/* Enhanced button styles with sunset transitions */
.btn-primary {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  transition: all 0.5s ease-in-out;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.4);
}

/* Section decorations */
.section-decoration {
  position: relative;
}

.section-decoration::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ea580c, transparent);
}

/* Card hover effects with sunset transitions */
.card-hover {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Text gradient utilities */
.text-gradient {
  background: linear-gradient(135deg, #ea580c, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-blue {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Dark mode specific adjustments */
.dark {
  color-scheme: dark;
}

/* Sunset/Sunrise Effect - Enhanced for all sections */
.sunset-transition {
  transition: background-color 0.8s ease-in-out, 
              border-color 0.8s ease-in-out, 
              color 0.8s ease-in-out,
              box-shadow 0.6s ease-in-out,
              backdrop-filter 0.8s ease-in-out;
}

/* Section backgrounds with sunset effect */
section {
  transition: background-color 0.8s ease-in-out, 
              border-color 0.8s ease-in-out;
}

/* Enhanced transitions for cards and containers - Optimized */
.rounded-2xl, .rounded-3xl, .rounded-xl {
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Text elements smooth transitions - Optimized */
h1, h2, h3, h4, h5, h6, p, span, div {
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero background image smooth transitions - Optimized */
/* Note: Las imágenes de fondo están definidas en la parte superior del archivo con media queries responsive y formato WebP */

.parallax-bg {
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
              filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              background-image 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced hover effects for all interactive elements */
.hover-lift {
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-lift:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  will-change: transform;
}

.hover-lift:hover .service-icon {
  animation: gentleRotate 0.8s ease-out, iconPulse 2.5s ease-in-out infinite;
}

.dark .hover-lift:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* Enhanced button hover effects - Optimized */
button, .btn {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Solo aplicar efectos de hover a botones específicos con clases de acción */
button.bg-principia-orange-600:hover, 
button.bg-green-600:hover,
.btn:hover,
a.inline-flex:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.2);
  will-change: transform;
}

/* Enlaces de texto simples - hover sutil */
a[href]:hover {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

/* Efecto específico para iconos SVG en botones de acción */
button.bg-principia-orange-600:hover svg, 
button.bg-green-600:hover svg,
.btn:hover svg,
a.inline-flex:hover svg {
  animation: gentleRotate 0.6s ease-out;
}

/* Estilo base para iconos de servicios y tecnología */
.service-icon, .tech-icon {
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  z-index: 2;
}

/* Efecto de glow suave para iconos en modo oscuro */
.dark .service-icon:hover, .dark .tech-icon:hover {
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Card hover improvements - Optimized */
.group {
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.group:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
  will-change: transform;
}

.dark .group:hover {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .nav-link::after {
    height: 2px;
  }
  
  .header-solid {
    background: rgba(255, 255, 255, 1);
  }
  
  .dark .header-solid {
    background: rgba(0, 0, 0, 1);
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .header-transparent,
  .header-solid {
    background: white !important;
    color: black !important;
    position: static !important;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
  
  .btn-primary:hover {
    transform: none;
  }
  
  .card-hover:hover {
    transform: none;
  }
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ===================================================================
   📐 GUÍA: SISTEMA DE ESPACIADO FLUIDO
   
   PROBLEMA RESUELTO:
   - Evita márgenes muy pequeños en pantallas intermedias (ej: 1290px)
   - Elimina los "saltos" bruscos entre breakpoints (sm:, md:, lg:)
   - Mantiene coherencia visual en todos los tamaños de pantalla
   
   CLASES DISPONIBLES:
   
   .fluid-container
   └─ Uso general para secciones principales
   └─ Escala: 16px → 80px según viewport
   └─ Fórmula: clamp(1rem, 3vw + 0.5rem, 5rem)
   
   .fluid-spacing-sm
   └─ Para navbar y elementos compactos
   └─ Escala: 16px → 48px
   └─ Fórmula: clamp(1rem, 2vw + 0.5rem, 3rem)
   
   .fluid-spacing-md
   └─ Alternativa con más amplitud
   └─ Escala: 24px → 96px
   └─ Fórmula: clamp(1.5rem, 3.5vw + 0.5rem, 6rem)
   
   .fluid-spacing-lg
   └─ Para secciones destacadas
   └─ Escala: 32px → 128px
   └─ Fórmula: clamp(2rem, 5vw + 1rem, 8rem)
   
   .fluid-py, .fluid-py-sm, .fluid-py-lg
   └─ Versiones verticales (padding-top/bottom)
   
   CÓMO FUNCIONAN:
   clamp(min, preferred, max)
   - min: valor mínimo en móviles
   - preferred: escala proporcional con viewport (vw/vh)
   - max: valor máximo en desktop grande
   
   EJEMPLOS DE USO:
   
   <!-- Hero Section -->
   <div class="container mx-auto fluid-container">
   
   <!-- Navbar -->
   <nav class="mx-auto fluid-spacing-sm">
   
   <!-- Sección destacada -->
   <section class="fluid-container fluid-py-lg">
   
   NOTA: Estas clases reemplazan:
   px-4 sm:px-6 lg:px-8  →  fluid-container
   px-4                  →  fluid-spacing-sm
   
==================================================================== */

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ea580c;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Nuevas animaciones dinámicas para iconos */
@keyframes gentleRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(6deg); }
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes subtleGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.1); }
  50% { box-shadow: 0 0 15px rgba(255, 255, 255, 0.3), 0 0 25px rgba(255, 255, 255, 0.1); }
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-2px); }
}


