/* ==========================================================================
   SYNAPTIC PROJECTS — Hoja de Estilos de Vanguardia (v2.0 Clean Tech)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --primary-blue: #2563eb;
  --primary-indigo: #6366f1;
  --primary-purple: #7c3aed;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --dark-slate: #0f172a;
  --soft-slate: #334155;
  --light-slate: #64748b;
  --border-light: #e2e8f0;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
}

html, body {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--dark-slate);
  background-color: transparent !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Tipografía de Titulares — Escala y Tracking Editorial */
.font-display {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;
  letter-spacing: -0.03em;
}

.heading-hero {
  font-size: clamp(2.35rem, 4.2vw + 1rem, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.heading-section {
  font-size: clamp(1.85rem, 2.5vw + 0.75rem, 2.75rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

/* Números tabulares limpios para métricas y calculadora */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Gradientes de Marca inspirados en SYNAPTIC.png */
.text-brand-gradient {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 55%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bg-brand-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
}

.bg-brand-subtle {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.04) 0%, rgba(99, 102, 241, 0.07) 100%);
}

/* Armonización tonal de fotografías para coherencia de dirección de arte */
.img-editorial-grade {
  filter: saturate(0.88) contrast(1.03) brightness(0.99);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.group:hover .img-editorial-grade {
  filter: saturate(0.96) contrast(1.04) brightness(1);
}

/* Efectos de Cristal Translúcido Limpio (Frosted Glass) */
.glass-panel {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-nav {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.65);
}

.glass-pill {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

/* Estado activo en navegación superior */
.nav-link {
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 9999px;
  background: var(--primary-blue);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link.active {
  color: var(--dark-slate);
  font-weight: 600;
}

.nav-link.active::after {
  transform: scaleX(1);
}

/* Estilos refinados para los deslizadores interactivos (Range Inputs) */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 9999px;
  background: #e2e8f0;
  outline: none;
  transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.4);
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.04);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Animaciones sutiles y Revelación al hacer Scroll */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes pulseSubtle {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.85;
  }
}

.animate-pulse-subtle {
  animation: pulseSubtle 3s infinite ease-in-out;
}

@keyframes waveBar {
  0%, 100% {
    height: 8px;
  }
  50% {
    height: 36px;
  }
}

.wave-bar {
  animation: waveBar 1.2s ease-in-out infinite;
}

/* Sombras suaves "Big Tech" */
.shadow-soft-sm {
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04), 0 1px 4px -1px rgba(15, 23, 42, 0.02);
}

.shadow-soft {
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.045), 0 4px 12px -4px rgba(15, 23, 42, 0.025);
}

.shadow-soft-lg {
  box-shadow: 0 22px 40px -10px rgba(15, 23, 42, 0.065), 0 10px 18px -6px rgba(15, 23, 42, 0.03);
}

/* Accesibilidad y foco */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 3px;
}

/* Modales */
.modal-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  transform: scale(0.96) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Canvas de Fondo Fijo: Rayos de Luz Volumétricos & Cáusticas de Agua */
#ambient-fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  display: block;
}

#main-content {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Estilos de la Demo del Agente Telefónico IA (Orbe + Transcripción Fonética)
   ========================================================================== */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.6);
}

#call-scrubber {
  height: 6px;
  background: #1e293b;
  cursor: pointer;
}
#call-scrubber::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  cursor: pointer;
  transition: transform 0.15s ease;
}
#call-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
#call-scrubber::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #38bdf8;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  cursor: pointer;
}

.word-token {
  transition: opacity 0.2s ease, color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

/* ==========================================================================
   Estilos de la Demo del Chatbot Multicanal IA
   ========================================================================== */
@keyframes typingBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes chatBubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-bubble-anim {
  animation: chatBubbleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* WhatsApp Pattern Background */
.wa-chat-bg {
  background-color: #0b141a;
  background-image: radial-gradient(rgba(17, 27, 33, 0.9) 1px, transparent 0);
  background-size: 24px 24px;
}

/* Telegram Pattern Background */
.tg-chat-bg {
  background-color: #0e1621;
  background-image: radial-gradient(rgba(23, 33, 43, 0.8) 1px, transparent 0);
  background-size: 20px 20px;
}

/* Web Widget Pattern Background */
.web-chat-bg {
  background-color: #030712;
  background-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.7), rgba(2, 6, 23, 0.9));
}

#chat-messages-container {
  scroll-behavior: smooth;
}
