/* ============================================================
   IAmation — Design Tokens
   Sistema de variables CSS centralizadas para toda la web.
   Importar ANTES de cualquier otro CSS custom.
   ============================================================ */

:root {

  /* ── COLORES BASE ─────────────────────────────────────── */
  --color-bg-base:      #020617;  /* slate-950: fondo más profundo */
  --color-bg-surface-1: #0a1628;  /* custom: entre 950 y 900 */
  --color-bg-surface-2: #0f172a;  /* slate-900 */
  --color-bg-surface-3: #1e293b;  /* slate-800: cards */
  --color-bg-surface-4: #293548;  /* slate-750: hover de cards */

  /* ── BRAND — AZUL ─────────────────────────────────────── */
  --color-brand-300:      #93c5fd;
  --color-brand-400:      #60a5fa;
  --color-brand-500:      #3b82f6;   /* primario */
  --color-brand-600:      #2563eb;
  --color-brand-700:      #1d4ed8;
  --color-brand-glow:     rgba(59, 130, 246, 0.40);
  --color-brand-glow-md:  rgba(59, 130, 246, 0.25);
  --color-brand-glow-soft:rgba(59, 130, 246, 0.12);

  /* ── CYAN — ACENTO ────────────────────────────────────── */
  --color-cyan-300:      #67e8f9;
  --color-cyan-400:      #22d3ee;
  --color-cyan-500:      #06b6d4;
  --color-cyan-glow:     rgba(6, 182, 212, 0.35);
  --color-cyan-glow-soft:rgba(6, 182, 212, 0.12);

  /* ── GROWTH — VERDE ───────────────────────────────────── */
  --color-growth-400:      #34d399;
  --color-growth-500:      #10b981;
  --color-growth-glow:     rgba(16, 185, 129, 0.30);
  --color-growth-glow-soft:rgba(16, 185, 129, 0.12);

  /* ── TEXTO ────────────────────────────────────────────── */
  --color-text-primary:   #f1f5f9;  /* slate-100 */
  --color-text-secondary: #94a3b8;  /* slate-400 */
  --color-text-muted:     #475569;  /* slate-600 */
  --color-text-subtle:    #334155;  /* slate-700 */

  /* ── GRADIENTES ───────────────────────────────────────── */
  --gradient-brand:
    linear-gradient(135deg, var(--color-brand-500), var(--color-cyan-500));
  --gradient-brand-hover:
    linear-gradient(135deg, var(--color-brand-400), var(--color-cyan-400));

  --gradient-text-brand:
    linear-gradient(135deg, var(--color-brand-400) 0%, var(--color-cyan-400) 100%);

  /* Fondos radiales hero */
  --gradient-hero-top:
    radial-gradient(
      ellipse 90% 55% at 50% -5%,
      rgba(59, 130, 246, 0.18) 0%,
      rgba(6, 182, 212, 0.08) 45%,
      transparent 70%
    );
  --gradient-hero-right:
    radial-gradient(
      ellipse 55% 80% at 105% 45%,
      rgba(6, 182, 212, 0.12) 0%,
      transparent 60%
    );
  --gradient-hero-left:
    radial-gradient(
      ellipse 40% 60% at -5% 60%,
      rgba(59, 130, 246, 0.08) 0%,
      transparent 60%
    );

  /* ── GLASS / BACKDROP ─────────────────────────────────── */
  --glass-bg:           rgba(10, 22, 40, 0.55);
  --glass-bg-lighter:   rgba(15, 30, 55, 0.45);
  --glass-blur:         blur(16px);
  --glass-blur-sm:      blur(8px);
  --glass-border:       1px solid rgba(255, 255, 255, 0.07);
  --glass-border-brand: 1px solid rgba(59, 130, 246, 0.20);

  /* ── BORDERS ──────────────────────────────────────────── */
  --border-subtle:      1px solid rgba(255, 255, 255, 0.06);
  --border-surface:     1px solid rgba(255, 255, 255, 0.04);
  --border-brand:       1px solid rgba(59, 130, 246, 0.30);
  --border-brand-glow:  1px solid rgba(59, 130, 246, 0.55);
  --border-cyan:        1px solid rgba(6, 182, 212, 0.25);

  /* ── SOMBRAS / GLOWS ──────────────────────────────────── */
  --shadow-card:
    0 4px 24px rgba(0, 0, 0, 0.45),
    0 1px 4px  rgba(0, 0, 0, 0.25);

  --shadow-brand:
    0 0 0 1px rgba(59, 130, 246, 0.20),
    0 0 24px   rgba(59, 130, 246, 0.28),
    0 0 60px   rgba(59, 130, 246, 0.10);

  --shadow-brand-hover:
    0 0 0 1px rgba(59, 130, 246, 0.35),
    0 0 36px   rgba(59, 130, 246, 0.45),
    0 0 80px   rgba(6, 182, 212, 0.15);

  --shadow-cyan:
    0 0 24px rgba(6, 182, 212, 0.25),
    0 0 60px rgba(6, 182, 212, 0.08);

  --shadow-mockup:
    0 0 0 1px  rgba(59, 130, 246, 0.18),
    0 40px 100px rgba(0, 0, 0, 0.65),
    0 0 80px   rgba(59, 130, 246, 0.12),
    0 0 120px  rgba(6, 182, 212, 0.06);

  --shadow-float-card:
    0 8px 32px rgba(0, 0, 0, 0.50),
    0 0 0 1px  rgba(255, 255, 255, 0.06);

  /* ── TIPOGRAFÍA — FLUID TYPE ──────────────────────────── */
  --text-xs:   clamp(0.70rem,  0.65rem + 0.25vw, 0.80rem);
  --text-sm:   clamp(0.85rem,  0.80rem + 0.25vw, 0.95rem);
  --text-base: clamp(1.00rem,  0.95rem + 0.25vw, 1.10rem);
  --text-lg:   clamp(1.10rem,  1.00rem + 0.50vw, 1.25rem);
  --text-xl:   clamp(1.25rem,  1.10rem + 0.75vw, 1.50rem);
  --text-2xl:  clamp(1.50rem,  1.25rem + 1.25vw, 2.00rem);
  --text-3xl:  clamp(1.875rem, 1.50rem + 1.75vw, 2.625rem);
  --text-4xl:  clamp(2.25rem,  1.75rem + 2.50vw, 3.50rem);
  --text-hero: clamp(2.75rem,  2.00rem + 3.75vw, 4.75rem);

  /* ── ESPACIADO ────────────────────────────────────────── */
  --section-y:         clamp(5rem,  10vw, 9rem);
  --container-max:     1200px;
  --container-px:      clamp(1.25rem, 5vw, 2rem);

  /* ── RADIOS ───────────────────────────────────────────── */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  28px;
  --radius-full: 9999px;

  /* ── TRANSICIONES ─────────────────────────────────────── */
  --transition-fast: 150ms ease;
  --transition-base: 280ms ease;
  --transition-slow: 480ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ── ANIMACIONES SCROLL ───────────────────────────────── */
  --reveal-distance: 28px;
  --reveal-duration: 0.65s;
  --reveal-easing:   cubic-bezier(0.22, 1, 0.36, 1);

}


/* ============================================================
   CLASES DE UTILIDAD GLOBALES
   ============================================================ */

/* Glassmorphism */
.ia-glass {
  background:     var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
}

.ia-glass-lighter {
  background:     var(--glass-bg-lighter);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  border: var(--glass-border);
}

/* Gradient text azul → cyan */
.ia-gradient-text {
  background: var(--gradient-text-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Botón primario */
.ia-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-brand);
  border: none;
  cursor: pointer;
  transition:
    box-shadow var(--transition-base),
    transform   var(--transition-fast),
    background  var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.ia-btn-primary:hover {
  background:  var(--gradient-brand-hover);
  box-shadow:  var(--shadow-brand-hover);
  transform:   translateY(-2px);
}

/* Botón secundario */
.ia-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: rgba(30, 41, 59, 0.50);
  color: var(--color-text-primary);
  font-weight: 600;
  border-radius: var(--radius-full);
  border: var(--border-subtle);
  cursor: pointer;
  transition:
    background var(--transition-base),
    border     var(--transition-base),
    transform  var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: var(--glass-blur-sm);
}

.ia-btn-secondary:hover {
  background: rgba(30, 41, 59, 0.80);
  border: var(--border-brand);
  transform: translateY(-1px);
}

/* Mockup glow wrapper */
.ia-mockup-glow {
  box-shadow: var(--shadow-mockup);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* Animación flotante para stat cards */
@keyframes ia-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.ia-float {
  animation: ia-float 4s ease-in-out infinite;
}

.ia-float-delay {
  animation: ia-float 4s ease-in-out 1.5s infinite;
}

/* Dot pulsante (estado activo) */
@keyframes ia-pulse-ring {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

.ia-dot-pulse {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-growth-400);
  flex-shrink: 0;
}

.ia-dot-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--color-growth-400);
  animation: ia-pulse-ring 2s ease-out infinite;
}

/* Reveal / scroll animations */
.ia-reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity   var(--reveal-duration) var(--reveal-easing),
    transform var(--reveal-duration) var(--reveal-easing);
}

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

.ia-reveal-delay-1 { transition-delay: 0.08s; }
.ia-reveal-delay-2 { transition-delay: 0.18s; }
.ia-reveal-delay-3 { transition-delay: 0.28s; }
.ia-reveal-delay-4 { transition-delay: 0.38s; }
.ia-reveal-delay-5 { transition-delay: 0.48s; }
.ia-reveal-delay-6 { transition-delay: 0.58s; }


/* ============================================================
   NOISE / GRAIN TEXTURE
   Añade tacto premium al dark theme — ref: Linear, Vercel
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
  opacity: 0.038;
  pointer-events: none;
  z-index: 9998;
  mix-blend-mode: overlay;
}


/* ============================================================
   ANIMATED MESH GRADIENT (Hero background)
   Gradientes radiales que se mueven — efecto "vivo"
   ============================================================ */
@keyframes ia-mesh-drift-1 {
  0%, 100% { opacity: 0.18; transform: scale(1)    translate(0%,  0%);  }
  33%       { opacity: 0.26; transform: scale(1.12) translate(-4%, 6%);  }
  66%       { opacity: 0.14; transform: scale(0.94) translate( 5%, -4%); }
}

@keyframes ia-mesh-drift-2 {
  0%, 100% { opacity: 0.12; transform: scale(1)    translate( 0%,  0%); }
  40%       { opacity: 0.20; transform: scale(1.10) translate( 6%,  4%); }
  80%       { opacity: 0.08; transform: scale(0.92) translate(-5%,  6%); }
}

@keyframes ia-mesh-drift-3 {
  0%, 100% { opacity: 0.08; transform: scale(1)    translate(0%, 0%);  }
  50%       { opacity: 0.14; transform: scale(1.15) translate(8%, -6%); }
}

.ia-mesh-1 { animation: ia-mesh-drift-1 18s ease-in-out infinite; }
.ia-mesh-2 { animation: ia-mesh-drift-2 22s ease-in-out infinite; }
.ia-mesh-3 { animation: ia-mesh-drift-3 14s ease-in-out infinite; }


/* ============================================================
   ANIMATED GRADIENT BORDER (conic-gradient spin)
   Uso: añadir clase ia-card-border-glow a la card.
   La card debe tener position:relative e isolation:isolate.
   ============================================================ */
@keyframes ia-border-spin {
  to { transform: rotate(360deg); }
}

.ia-card-border-glow {
  position: relative;
  isolation: isolate;
}

.ia-card-border-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--_angle, 0deg),
    var(--color-brand-500) 0%,
    var(--color-cyan-400)  25%,
    var(--color-growth-400) 50%,
    var(--color-cyan-400)  75%,
    var(--color-brand-500) 100%
  );
  animation: ia-border-spin 5s linear infinite;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ia-card-border-glow:hover::before,
.ia-card-border-glow.is-active::before {
  opacity: 1;
}

/* Variante siempre visible (para card destacada en pricing) */
.ia-card-border-glow--always::before {
  opacity: 0.7;
}


/* ============================================================
   MARQUEE / TICKER HORIZONTAL
   ============================================================ */
@keyframes ia-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ia-marquee-wrap {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  mask-image:         linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.ia-marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: ia-marquee 28s linear infinite;
}

.ia-marquee-wrap:hover .ia-marquee-track {
  animation-play-state: paused;
}

.ia-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 2rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.ia-marquee-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-subtle);
  flex-shrink: 0;
}


/* ============================================================
   TYPEWRITER / CYCLING TEXT
   ============================================================ */
@keyframes ia-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.ia-cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--color-brand-400);
  margin-left: 1px;
  vertical-align: middle;
  border-radius: 1px;
  animation: ia-blink 1s step-end infinite;
}


/* ============================================================
   TERMINAL / CÓDIGO ESTÉTICO
   ============================================================ */
.ia-terminal {
  background: #0a0f1a;
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-xl);
  overflow: hidden;
  font-family: 'Fira Code', 'Courier New', monospace;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 60px rgba(0,0,0,0.6),
    0 0 40px rgba(59,130,246,0.06);
}

.ia-terminal-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ia-terminal-body {
  padding: 1.25rem 1.5rem;
  font-size: var(--text-sm);
  line-height: 1.8;
}

.ia-terminal-line {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ia-terminal-line.show {
  opacity: 1;
  transform: translateX(0);
}

.t-prompt { color: #64748b; }
.t-cmd    { color: #60a5fa; }
.t-ok     { color: #34d399; }
.t-value  { color: #f1f5f9; }
.t-time   { color: #f59e0b; }
.t-result { color: #22d3ee; font-weight: 700; }
.t-dim    { color: #334155; }


/* ============================================================
   SVG FLOW DIAGRAM
   ============================================================ */
.ia-flow-path {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ia-flow-path.draw {
  stroke-dashoffset: 0;
}

.ia-flow-node {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ia-flow-node.show {
  opacity: 1;
  transform: scale(1);
}


/* ============================================================
   TILT 3D EN CARDS
   ============================================================ */
.ia-tilt {
  will-change: transform;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
  transform-style: preserve-3d;
}

.ia-tilt:hover {
  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(59,130,246,0.15);
}


/* ============================================================
   COUNTER ANIMATION
   ============================================================ */
[data-counter] {
  display: inline-block;
}


/* ============================================================
   BENTO GRID (servicios)
   ============================================================ */
.ia-bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto auto;
  gap: 1rem;
}

@media (max-width: 1023px) {
  .ia-bento {
    grid-template-columns: 1fr 1fr;
  }
  .ia-bento-span3 {
    grid-column: span 2 !important;
  }
}

@media (max-width: 639px) {
  .ia-bento { grid-template-columns: 1fr; }
  .ia-bento-span2, .ia-bento-span3 {
    grid-column: span 1 !important;
  }
}

.ia-bento-span2 { grid-column: span 2; }
.ia-bento-span3 { grid-column: span 3; }

.ia-bento-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  transition:
    border-color var(--transition-base),
    background   var(--transition-base),
    transform    var(--transition-base);
}

.ia-bento-card:hover {
  border-color: rgba(59,130,246,0.25);
  background: rgba(15, 23, 42, 0.85);
  transform: translateY(-2px);
}

.ia-bento-card--accent {
  background: rgba(10, 22, 40, 0.8);
  border-color: rgba(59,130,246,0.18);
}

.ia-bento-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

/* Parallax helper */
.ia-parallax { will-change: transform; }

/* ─── Shared page classes (used across all pages) ─── */
.glass-dark {
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.card-dark {
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.2s, background 0.2s;
}
.card-dark:hover {
    border-color: rgba(59,130,246,0.3);
    background: rgba(30,41,59,0.65);
}
.gradient-text {
    background: linear-gradient(135deg, #60a5fa, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
