/* ══════════════════════════════════════════════════════
   impulsIA — Landing page
   Tokens dark/light + animaciones + carrusel + responsive
   ══════════════════════════════════════════════════════ */

:root {
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-lg: 0 24px 48px -12px rgba(2, 6, 23, 0.35);
  --shadow-md: 0 12px 32px -12px rgba(2, 6, 23, 0.30);
  --shadow-brand: 0 12px 30px -8px rgba(37, 99, 235, 0.45);
  --gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  --font-head: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Dark (default) */
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #16213b;
  --border: rgba(148, 163, 184, 0.14);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --accent: #60a5fa;
  --accent2: #a78bfa;
  --green: #22c55e;
  --on-accent: #0b1020;
  --hero-overlay: rgba(15, 23, 42, 0.35);
  --header-bg: rgba(15, 23, 42, 0.78);
  --scrollbar: #334155;
}

html[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #64748b;
  --accent: #3b82f6;
  --accent2: #8b5cf6;
  --green: #16a34a;
  --on-accent: #ffffff;
  --hero-overlay: rgba(248, 250, 252, 0.30);
  --header-bg: rgba(248, 250, 252, 0.82);
  --shadow-lg: 0 24px 48px -18px rgba(15, 23, 42, 0.22);
  --shadow-md: 0 12px 28px -14px rgba(15, 23, 42, 0.16);
  --shadow-brand: 0 12px 30px -8px rgba(59, 130, 246, 0.4);
  --scrollbar: #cbd5e1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--on-accent); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 8px; }

h1, h2, h3, strong { font-family: var(--font-head); }

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.container { width: min(1160px, 92%); margin-inline: auto; }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  border-radius: 999px;
  padding: 0.85rem 1.8rem;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.25s ease, opacity 0.2s ease, background-color 0.3s ease;
  white-space: nowrap;
}
.btn-lg { padding: 1.05rem 2.2rem; font-size: 1.05rem; }
.btn-nav { padding: 0.6rem 1.3rem; font-size: 0.93rem; }
.btn-primary {
  background: var(--gradient);
  color: var(--on-accent);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -8px rgba(139, 92, 246, 0.5); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ── Header ─────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.nav { display: flex; align-items: center; justify-content: space-between; padding-block: 0.9rem; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-img { height: 38px; width: auto; }
/* imágenes según tema: por defecto (dark) se muestra la dark; light la sobreescribe */
.theme-dark-img { display: block; }
.theme-light-img { display: none; }
html[data-theme="light"] .theme-dark-img { display: none; }
html[data-theme="light"] .theme-light-img { display: block; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.96rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 0.9rem; }

.theme-toggle {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); transform: rotate(15deg); }
.theme-toggle svg { width: 20px; height: 20px; }
.icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

/* ── Eyebrow / section ──────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.section-sub { color: var(--text-muted); max-width: 620px; margin-top: 0.7rem; font-size: 1.05rem; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ══ HERO ══ */
.hero {
  position: relative;
  padding: 150px 0 90px;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 18% 20%, rgba(96, 165, 250, 0.16), transparent 70%),
    radial-gradient(55% 45% at 85% 15%, rgba(167, 139, 250, 0.16), transparent 70%),
    var(--bg);
}
.hero-blobs {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(30% 35% at 75% 60%, rgba(96, 165, 250, 0.12), transparent 70%),
    radial-gradient(26% 30% at 30% 85%, rgba(167, 139, 250, 0.12), transparent 70%);
  filter: blur(20px);
  animation: blobFloat 14s ease-in-out infinite alternate;
}
@keyframes blobFloat { from { transform: translateY(0) scale(1); } to { transform: translateY(-30px) scale(1.06); } }

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--surface);
}
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.hero-title { font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.12; font-weight: 800; letter-spacing: -0.03em; margin: 1.1rem 0 1.2rem; }
.hero-sub { color: var(--text-muted); font-size: 1.12rem; max-width: none; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* Héroe imágenes por tema */
.hero-media { position: relative; }
.hero-picture {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: heroCross 14s infinite;
}
.hero-slide:nth-of-type(2) { animation-delay: 7s; }
@keyframes heroCross {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  46%  { opacity: 1; }
  50%  { opacity: 0; }
  100% { opacity: 0; }
}

.chat-mockup {
  position: absolute;
  bottom: -160px; left: -28px;
  width: min(250px, 64%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.chat-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
}
.chat-head strong { display: block; font-size: 0.8rem; line-height: 1.1; }
.chat-status { font-size: 0.68rem; color: var(--green); }
.chat-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 85%; padding: 6px 10px; border-radius: 12px; font-size: 0.76rem; line-height: 1.35; }
.bubble-in { background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; align-self: flex-start; }
.bubble-out { background: var(--gradient); color: var(--on-accent); border-bottom-right-radius: 4px; align-self: flex-end; }

.stat-card {
  position: absolute;
  top: 16px; right: -18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 12px;
}
.stat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; flex-shrink: 0; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.stat-row strong { display: block; font-size: 0.9rem; }
.stat-row span { font-size: 0.76rem; color: var(--text-muted); }

/* ══ CLIENTES / CARRUSEL ══ */
.clients { padding: 90px 0 60px; text-align: center; }
.clients .container { margin-bottom: 2.2rem; }
.clients .section-sub { margin-inline: auto; }

.carousel { position: relative; max-width: 940px; margin-inline: auto; }
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 1.4rem;
  padding: 1rem 1.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-item { flex: 0 0 auto; scroll-snap-align: center; }
.client-mark { font-size: 1.35rem; }
.client-mark,
.client-logo {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.01em;
  min-width: 180px;
  height: 78px;
  padding-inline: 1.4rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  filter: none;
  transition: transform 0.25s ease, color 0.35s ease, border-color 0.25s;
  user-select: none;
}
.client-logo {
  padding: 10px;
  width: 200px;
  object-fit: contain;
}
.client-mark:hover,
.client-logo:hover { transform: translateY(-4px); border-color: var(--accent); }

.carousel-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 5;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.carousel-btn:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-50%) scale(1.06); }
.carousel-btn.prev { left: -12px; }
.carousel-btn.next { right: -12px; }

/* ══ SERVICIOS ══ */
.services { padding: 80px 0; }
.services .container > .section-title { margin-top: 0; }
.services .section-sub { max-width: none; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-top: 2.6rem; }

.service-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex; flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.25s;
}
.service-group:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.group-head { padding: 0.4rem; }
.group-visual { overflow: hidden; border-radius: 12px; margin-bottom: 1rem; }
.group-visual img { width: 100%; height: 150px; object-fit: cover; transition: transform 0.5s ease; }
.service-group:hover .group-visual img { transform: scale(1.06); }
.group-head h3 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.01em; }
.group-tag { display: inline-block; margin-top: 0.25rem; font-size: 0.82rem; font-weight: 600; color: var(--accent); }

.service-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.8rem; }
.service-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 0.85rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.service-card:hover { border-color: var(--border); }
.service-card .dot {
  width: 12px; height: 12px; border-radius: 4px;
  background: var(--gradient);
  transform: rotate(45deg);
  flex-shrink: 0; margin-top: 5px;
}
.service-card strong { display: block; font-size: 0.95rem; line-height: 1.3; }
.service-card span { display: block; font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

/* ══ SOLUCIONES ══ */
.solutions { padding: 80px 0; background: var(--surface); border-block: 1px solid var(--border); }
.solutions .section-sub { max-width: none; }
.solutions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; margin-top: 2.6rem; }
.solution-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.2rem;
  display: flex; flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.3s, border-color 0.25s;
}
.solution-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.solution-top { flex: 1; }
.solution-img { position: relative; border-radius: 12px; overflow: hidden; margin-bottom: 1rem; }
.solution-img img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.live-badge {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
  color: var(--green);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.solution-body h3 { font-size: 1.15rem; font-weight: 800; line-height: 1.3; min-height: 3em; display: flex; align-items: center; }
.solution-body p { color: var(--text-muted); font-size: 0.94rem; margin-top: 0.35rem; }
.solution-link { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.solution-url { font-family: var(--font-body); font-size: 0.82rem; color: var(--text-muted); }
.solution-link .arrow { color: var(--accent); font-size: 1.2rem; font-weight: 700; transition: transform 0.2s; }
.solution-card:hover .solution-link .arrow { transform: translateX(4px); }

/* ══ CONTACTO ══ */
.contact { padding: 90px 0; }
.contact .section-sub { max-width: none; }
.contact-inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 3rem; align-items: center; }
.contact-media { border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.contact-media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3.4; }
.contact-copy .section-sub { margin-bottom: 1.8rem; }
.socials { display: flex; gap: 0.9rem; margin-top: 1.8rem; }
.socials a {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.socials svg { width: 20px; height: 20px; }

/* ══ FOOTER ══ */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner .brand-img { height: 30px; }
.footer-copy { color: var(--text-faint); font-size: 0.82rem; }
.footer-socials { display: flex; gap: 0.8rem; }
.footer-socials a {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.footer-socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.footer-socials svg { width: 18px; height: 18px; }
.footer-site { color: var(--text-muted); font-size: 0.9rem; font-weight: 600; transition: color 0.2s; }
.footer-site:hover { color: var(--accent); }

/* ══ BOTÓN FLOTANTE WHATSAPP ══ */
.whatsapp-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 70;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px -8px rgba(37, 211, 102, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fabFloat 2.6s ease-in-out infinite;
}
.whatsapp-fab:hover { transform: scale(1.12); box-shadow: 0 18px 38px -8px rgba(37, 211, 102, 0.7); }
.whatsapp-fab svg { width: 32px; height: 32px; }
@keyframes fabFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ══ Scroll reveal ══ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ══ RESPONSIVE ══ */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding: 130px 0 70px; }
  .hero-media { order: -1; }
  .chat-mockup { bottom: 18px; left: 8px; }
  .chat-extra { display: none; }
  .stat-card { right: 8px; }
  .services-grid { grid-template-columns: 1fr; }
  .solutions-grid { grid-template-columns: 1fr; }
  .contact-inner { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .carousel-btn.prev { left: 0; }
  .carousel-btn.next { right: 0; }
}

/* Teléfonos: compactar el chat para que no choque con el stat-card
   (el chat es más alto que la imagen en pantallas pequeñas) */
@media (max-width: 480px) {
  .chat-mockup { bottom: 18px; left: 6px; }
  .chat-head { padding: 8px 10px; }
  .chat-avatar { width: 24px; height: 24px; }
  .chat-body { padding: 8px 10px; gap: 5px; }
  .bubble { padding: 5px 9px; font-size: 0.72rem; line-height: 1.3; }
}

/* Pantallas muy pequeñas: la imagen es tan corta que el chat y el stat-card
   chocan; se encogen ambos para mantenerlos separados. */
@media (max-width: 380px) {
  .stat-card { top: 10px; padding: 8px 12px; }
  .stat-row strong { font-size: 0.8rem; }
  .stat-row span { font-size: 0.68rem; }
  .chat-mockup { bottom: 10px; }
  .chat-body { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-slide { animation: none !important; opacity: 1; }
  .hero-slide:nth-of-type(2) { display: none; }
}