/* ════════════════════════════════════════════════════════════
   css/base.css — Variables, reset, tipografía y keyframes
   Coexsis v17 — base para todos los demás archivos CSS
   ════════════════════════════════════════════════════════════ */

/* ========================================
   1. VARIABLES
   ======================================== */
:root {
  /* Sistema --hue dinámico */
  --hue: 260;

  /* Colores primarios dinámicos */
  --p1: hsl(var(--hue), 90%, 60%);
  --p2: hsl(calc(var(--hue) + 40), 95%, 65%);

  /* Colores fijos de marca */
  --pink:   #ec4899;
  --indigo: #6366f1;
  --green:  #4ade80;
  --blue:   #60a5fa;
  --yellow: #fbbf24;
  --purple: #a5b4fc;

  /* Fondos */
  --bg:  #050510;
  --bgA: #0f1020;

  /* Texto */
  --ink:   #eaf2ff;
  --muted: rgba(234, 242, 255, 0.65);
  --text-main: #f8fafc;
  --text-mut:  #94a3b8;

  /* Semánticos */
  --success: #4ade80;
  --warning: #fbbf24;
  --danger:  #ef4444;

  /* Glassmorphism */
  --glass-bg:     rgba(13, 18, 40, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shine:  rgba(255, 255, 255, 0.05);

  /* Layout */
  --maxw: 1240px;
  --pad:  clamp(20px, 5vw, 60px);

  /* Tipografía */
  --font-family: 'Exo 2', sans-serif;

  /* Transiciones */
  --ease:      cubic-bezier(0.23, 1, 0.32, 1);
  --ease-soft: cubic-bezier(0.25, 1, 0.5, 1);

  /* Sombras */
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
  --glow:      0 0 40px rgba(99, 102, 241, 0.2);
}

/* ========================================
   2. RESET
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  
  /* ✅ FIX: Elimina el scroll lateral negro */
  overflow-x: hidden !important; 
  width: 100%;
  max-width: 100vw;
}

ul { list-style: none; }
a  { text-decoration: none; color: inherit; }
img, picture, svg { max-width: 100%; display: block; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

::selection {
  background: #ec4899;
  color: #fff;
}

/* ========================================
   3. SCROLLBAR
   ======================================== */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--p1); }

/* ========================================
   4. BARRA DE PROGRESO
   ======================================== */
.progress {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 3px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 9999;
  pointer-events: none;
}
#progressBar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ec4899, #6366f1);
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.6);
}

/* ========================================
   5. TIPOGRAFÍA
   ======================================== */
h1, h2, h3, h4,
.h1, .h2,
.btn, .kicker { font-family: var(--font-family); }

h1, h2, h3 {
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.h1 {
  font-size: clamp(1.9rem, 3.8vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #fff 30%, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(236, 72, 153, 0.3));
}

.h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  font-size: clamp(1rem, 1.5vw, 1.05rem);
  line-height: 1.7;
  color: #94a3b8;
  max-width: 560px;
  margin-bottom: 1.5rem;
}

.kicker {
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: hsl(var(--hue), 80%, 65%);
  margin-bottom: 1rem;
  display: inline-block;
  position: relative;
  padding-left: 20px;
}
.kicker::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  animation: pulse 2s infinite;
}

.text-dynamic {
  background: linear-gradient(90deg, #fff, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: shimmer 3s infinite;
}

.feature-list {
  list-style: none;
  margin: 0 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-list li {
  font-size: 0.95rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========================================
   6. REVEAL — ANIMACIONES DE ENTRADA
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity  0.8s var(--ease),
    transform 0.8s var(--ease);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.3s; }
.d4 { transition-delay: 0.45s; }

/* ========================================
   7. KEYFRAMES
   ======================================== */
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px currentColor; }
  50%      { opacity: 0.4; box-shadow: 0 0 14px currentColor; }
}
@keyframes blink {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 0.2; }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.95) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}
@keyframes shineText {
  to { background-position: 200% center; }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes floatBlob {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -30px) scale(1.08); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}
@keyframes float-particle {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-100px) scale(1.5); opacity: 0; }
}
@keyframes floatChip {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes railScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(calc(-100% / 3)); }
}
@keyframes shineSweep {
  0%   { left: -100%; }
  40%  { left: 150%; }
  100% { left: 150%; }
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%            { transform: translateY(-6px); opacity: 1; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========================================
   8. AJUSTES DEL WIDGET EXTERNO DE IA
   ======================================== */
/* Ocultar el botón original del widget */
button.cx-fab, 
.cx-fab {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Mover la ventana del chat para no tapar al robot */
.cx-widget, 
.cx-chat-window, 
div[id^="cx-chat-"], 
#cx-chat-window {
  /* Separación inferior para librar al robot flotante */
  bottom: 120px !important; 
  /* Separación derecha */
  right: 20px !important; 
  z-index: 99999 !important;
}

/* Ajuste responsivo para móviles */
@media (max-width: 768px) {
  .cx-widget, 
  .cx-chat-window, 
  div[id^="cx-chat-"], 
  #cx-chat-window {
    bottom: 100px !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
  }
}