/* ============================================================
   Recepcionista IA — Landing «El hilo»
   Papel cálido, tinta índigo, un acento coral.
   El hero es un scroll-film: una línea de tinta continua que
   se dibuja con el scroll (ver film.js). Mobile-first.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Color — papel crema, tinta índigo, coral quemado */
  --bg: #f7f2e7;
  --bg-alt: #f0e9da;
  --surface: #fdfbf4;
  --surface-2: #f2ecde;
  --border: rgba(35, 42, 84, 0.14);
  --border-strong: rgba(35, 42, 84, 0.28);
  --ink: #232a54;          /* tinta índigo: texto primario / botones sólidos */
  --ink-deep: #161c3e;
  --text-muted: #4c5273;   /* AA sobre papel */
  --text-faint: #666c8a;   /* AA sobre papel — texto secundario */
  --accent: #232a54;       /* CTA primario: tinta */
  --accent-2: #d14e24;     /* coral quemado — el acento de captura */
  --accent-soft: rgba(209, 78, 36, 0.10);
  --accent-text: #b23f1b;  /* enlaces / acento legible sobre papel */
  --aqua: #f3dfc9;         /* bloque CTA final: rubor cálido */
  --success: #206b4e;
  --danger: #b5372b;

  /* Tipografía — Fraunces (pluma editorial) + Instrument Sans */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-h1: clamp(2.25rem, 4.5vw + 1.1rem, 3.875rem);
  --fs-h2: clamp(1.75rem, 2.4vw + 1rem, 2.625rem);
  --fs-h3: 1.125rem;
  --fs-body: 1rem;
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;

  /* Espaciado — múltiplos de 4/8 */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --section-y: clamp(4rem, 9vw, 7rem);

  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 14px 44px rgba(35, 42, 84, 0.10);
  --speed: 0.2s;
  --text: var(--ink);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; /* anclas no quedan bajo el header fijo */ }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body); /* 16px mínimo: evita zoom iOS */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--ink); }
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.14;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

/* Foco visible para teclado */
:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible { outline-offset: 2px; border-radius: 999px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px; /* área táctil mínima */
  font-family: var(--font);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.7rem 1.6rem;
  cursor: pointer;
  color: var(--ink);
  transition: transform var(--speed) ease, box-shadow var(--speed) ease, background var(--speed) ease, border-color var(--speed) ease, color var(--speed) ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 20px rgba(35, 42, 84, 0.22);
}
.btn-primary:hover { background: var(--ink-deep); color: #fff; box-shadow: 0 10px 28px rgba(35, 42, 84, 0.30); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(35, 42, 84, 0.05); color: var(--ink); }
.btn-lg { min-height: 52px; padding: 0.95rem 2.1rem; font-size: 1.0625rem; }
.btn-sm { min-height: 40px; padding: 0.5rem 1.2rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 247, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.site-header.scrolled,
.site-header.nav-open { border-bottom-color: var(--border); background: rgba(251, 250, 247, 0.94); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 64px;
  padding: var(--sp-2) 0;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wordmark:hover { color: var(--ink); }
.wordmark strong { font-weight: 800; }
.wordmark-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  flex-shrink: 0;
}
.main-nav { display: none; }
.main-nav a {
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color var(--speed) ease;
}
.main-nav a:hover { color: var(--ink); }
.nav-cta { display: none; }
.header-cta { display: none; }

/* Botón hamburguesa (solo móvil) */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle-bar {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform var(--speed) ease, opacity var(--speed) ease;
}
.nav-open .nav-toggle-bar:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-open .nav-toggle-bar:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* Panel móvil desplegable */
@media (max-width: 859px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    background: rgba(251, 250, 247, 0.98);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-3) 4% var(--sp-5);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity var(--speed) ease, transform var(--speed) ease;
  }
  .nav-open .main-nav { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 var(--sp-3);
    font-size: 1.0625rem;
    border-radius: 10px;
  }
  .main-nav a:hover { background: var(--surface-2); }
  .nav-cta {
    display: inline-flex;
    margin-top: var(--sp-3);
    background: var(--ink);
    color: #fff !important;
    justify-content: center;
    font-weight: 600;
    border-radius: 999px;
  }
}
@media (min-width: 480px) {
  .header-cta { display: inline-flex; }
}
@media (min-width: 860px) {
  .main-nav { display: flex; gap: 1.75rem; }
  .main-nav a { position: relative; padding: var(--sp-2) 0; }
  .nav-toggle { display: none; }
  .header-cta { display: inline-flex; }
}

/* ============================================================
   EL HILO — scroll-film hero (una línea de tinta continua)
   Por defecto (sin JS o con movimiento reducido) se muestra
   estático y apilado; film.js añade .film-live y lo convierte
   en la toma continua con cámara y pluma.
   ============================================================ */
.film { position: relative; background: var(--bg); }
.film-driver { position: relative; }
.film-live .film-driver { height: 265vh; }
@media (max-width: 699px) { .film-live .film-driver { height: 240vh; } }
.film-stage { position: relative; }
.film-live .film-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

/* El papel: textura de grano muy sutil */
.film-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .film-stage::before { opacity: 0.07; }

/* Fondo de beams (animado por initBeams en main.js) */
.hero-beams {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: blur(26px);
}

/* La línea de tinta */
.film-svg {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: max(100%, 760px);
  height: auto;
  pointer-events: none;
  will-change: transform;
  display: none;
}
.film-live .film-svg { display: block; }
/* Sin vector-effect: el dasharray debe medir en unidades del viewBox
   para que la punta de la pluma (getPointAtLength) y la tinta dibujada
   (stroke-dashoffset) coincidan exactamente. */
.film-svg .thread {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.film-svg .thread-ghost {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.07;
}
@media (max-width: 699px) {
  .film-svg .thread, .film-svg .thread-ghost { stroke-width: 4.5; }
}
.film-svg .pen { fill: var(--accent-2); }
.film-svg .pen-halo { fill: none; stroke: var(--accent-2); stroke-width: 1.5; opacity: 0.5; vector-effect: non-scaling-stroke; }

/* Anillos del timbre (capítulo 01) */
.film-rings circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  animation: ring-pulse 3.4s ease-out infinite;
}
.film-rings circle:nth-child(2) { animation-delay: 1.7s; }
@keyframes ring-pulse {
  0% { transform: scale(0.72); opacity: 0.35; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Beats: el texto sobre el papel */
.beat {
  position: relative;
  text-align: center;
  padding: clamp(3rem, 8vw, 5.5rem) 5%;
}
.film-live .beat {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 5%;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform;
}
.film-live .beat > * { pointer-events: none; }
.film-live .beat a, .film-live .beat .btn { pointer-events: auto; }

/* Composición por beat (solo en modo film) */
.film-live .beat-1 { justify-content: flex-start; padding-top: clamp(6rem, 16vh, 9.5rem); }
.film-live .beat-2 { justify-content: center; align-items: center; text-align: center; }
.film-live .beat-2 .beat-body { max-width: 32em; margin-inline: auto; }
.film-live .beat-3 { justify-content: center; align-items: center; text-align: center; }
.film-live .beat-4 { justify-content: flex-end; padding-bottom: clamp(4.5rem, 12vh, 8rem); }
@media (max-width: 699px) {
  .film-live .beat-2, .film-live .beat-3 {
    align-items: center; text-align: center;
    padding-left: 5%; padding-right: 5%;
  }
  .film-live .beat-2 { justify-content: flex-start; padding-top: 14vh; }
  .film-live .beat-3 { justify-content: flex-start; padding-top: 12vh; }
}

.beat h1 {
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-4);
  max-width: 13em;
}
.beat-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: var(--sp-3);
}
.beat-title {
  font-size: clamp(2rem, 3.6vw + 0.8rem, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}
.beat-body {
  color: var(--text-muted);
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  max-width: 36em;
  margin-inline: auto;
}
/* Halo de papel: mantiene el texto legible cuando la línea lo cruza */
.film-live .beat-eyebrow,
.film-live .beat-title,
.film-live .beat-body,
.film-live .beat h1 {
  text-shadow: 0 0 6px var(--bg), 0 0 14px var(--bg), 0 0 24px var(--bg);
}
/* El halo lava el degradado de los spans itálicos: fuera */
.film-live .beat .text-gradient { text-shadow: none; }

/* Ventanas bajas: cierre más compacto para no rozar el sobre */
@media (max-height: 700px) {
  .film-live .beat-4 { padding-bottom: 2.5rem; }
  .film-live .beat-4 .beat-title { font-size: clamp(1.5rem, 3vw + 0.6rem, 2.2rem); }
  .film-live .beat-4 .beat-body { font-size: 0.9375rem; }
  .film-live .beat-4 .hero-ctas { margin-bottom: 0.5rem; }
}


/* Fichas de datos captados (capítulo 03) */
.beat-chips {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-end;
  margin-top: var(--sp-4);
}
@media (max-width: 699px) { .beat-chips { align-items: center; } }
.beat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-size: var(--fs-sm);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(35, 42, 84, 0.07);
}
.beat-chip .chip-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-text);
}

/* Badge de estadística (beat 1) */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  margin-bottom: var(--sp-5);
  max-width: 92%;
  text-align: left;
  box-shadow: 0 2px 10px rgba(35, 42, 84, 0.06);
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(181, 55, 43, 0.14);
  flex-shrink: 0;
}
.text-gradient {
  background: linear-gradient(120deg, var(--accent-2), #7a4dbf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}
html[data-theme="dark"] .text-gradient {
  background-image: linear-gradient(120deg, #f28a5c, #a98ae8);
  -webkit-background-clip: text;
  background-clip: text;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
@media (max-width: 479px) {
  .hero-ctas { flex-direction: column; align-items: stretch; width: min(340px, 100%); margin-inline: auto; }
}
.hero-footnote { color: var(--text-faint); font-size: var(--fs-xs); }
.br-desktop { display: none; }
@media (min-width: 700px) { .br-desktop { display: block; } }

/* Lector de capítulo + barra de progreso del film */
.film-progress {
  position: absolute;
  left: clamp(1rem, 4vw, 2.5rem);
  bottom: clamp(1rem, 4vh, 2rem);
  display: none;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.film-live .film-progress { display: flex; }
.film-bar {
  display: inline-block;
  width: 72px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.film-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent-2);
  border-radius: 2px;
}

/* Pista de scroll */
.film-cue {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(1rem, 4vh, 2rem);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.film-live .film-cue { display: flex; }
.film-cue i {
  width: 1.5px;
  height: 26px;
  background: var(--accent-2);
  border-radius: 2px;
  animation: cue-drop 1.8s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue-drop {
  0% { transform: scaleY(0); opacity: 0; }
  35% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(10px); opacity: 0; }
}

/* El hilo continúa: hebra vertical sobre cada encabezado de sección */
.section-head::before {
  content: "";
  display: block;
  width: 1.5px;
  height: 30px;
  margin: 0 auto var(--sp-4);
  background: linear-gradient(180deg, transparent, var(--accent-2));
  border-radius: 2px;
}

/* Lenis toma el control del scroll suave */
html.lenis { scroll-behavior: auto; }

/* ---------- Secciones ---------- */
.section { padding: var(--section-y) 0; position: relative; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(2.5rem, 6vw, 4rem); }
.section-head h2 { font-size: var(--fs-h2); }
.section-sub { color: var(--text-muted); font-size: 1.0625rem; max-width: 42em; margin-inline: auto; }
.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: var(--sp-3);
}

/* ---------- Demo ---------- */
.demo-grid { display: grid; gap: var(--sp-5); align-items: stretch; }
@media (min-width: 900px) { .demo-grid { grid-template-columns: 1fr 1.15fr; } }

.demo-single { max-width: 580px; margin-inline: auto; }
.demo-cta-line { text-align: center; margin: var(--sp-5) 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.demo-cta-line a {
  color: var(--accent-text);
  font-weight: 600;
  display: inline-block;
  padding: var(--sp-2) 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color var(--speed) ease;
}
.demo-cta-line a:hover { color: var(--ink); }

.demo-call-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.call-visual {
  position: relative;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.4rem;
  color: var(--accent-2);
}
.mic-icon { width: 38px; height: 38px; }
.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-2);
  opacity: 0;
}
.call-active .pulse-ring { animation: pulse 1.6s ease-out infinite; }
.call-active .call-visual { background: rgba(32, 107, 78, 0.10); color: var(--success); }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0; }
}
.demo-call-card h3 { font-size: 1.35rem; }
.demo-note { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.4rem; min-height: 2.6em; }
.btn-call { min-width: 240px; }
.btn-call[data-state="active"] { background: var(--danger); color: #fff; box-shadow: 0 6px 20px rgba(181, 55, 43, 0.30); }
.demo-disclaimer { margin-top: 1.3rem; color: var(--text-faint); font-size: var(--fs-xs); max-width: 340px; }

.demo-chat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  height: 460px; /* altura fija: el chat scrollea dentro, no empuja la página */
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--surface-2);
}
.chat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(32, 107, 78, 0.12); flex-shrink: 0; }
.chat-body {
  flex: 1;
  min-height: 0; /* permite que el área scrollee dentro del flex */
  padding: var(--sp-5) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  overflow-y: auto;
  overflow-x: hidden;
  justify-content: flex-end;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* el scroll del chat no arrastra la página */
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.chat-msg {
  max-width: 84%;
  padding: 0.65rem 1rem;
  border-radius: 16px;
  font-size: 0.9375rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  animation: msg-in 0.35s ease forwards;
}
@keyframes msg-in { to { opacity: 1; transform: translateY(0); } }
.chat-msg.caller {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg.ai {
  align-self: flex-end;
  background: var(--ink);
  color: #f5f8fa;
  border: 1px solid var(--ink);
  border-bottom-right-radius: 4px;
}
.chat-msg .who {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.15rem;
}
.chat-msg.ai .who { color: #b9b4d6; }
.chat-typing {
  align-self: flex-end;
  display: inline-flex;
  gap: 4px;
  padding: 0.7rem 1rem;
}
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
  animation: blink 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 70%, 100% { opacity: 0.25; } 35% { opacity: 1; } }

.chat-lead-card {
  margin: 0 var(--sp-4) var(--sp-4);
  border: 1px solid rgba(32, 107, 78, 0.30);
  background: rgba(32, 107, 78, 0.06);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  animation: msg-in 0.4s ease forwards;
}
.lead-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--success); margin-bottom: var(--sp-1); }
.lead-body { font-size: 0.9375rem; color: var(--text); }

/* ---------- Beneficios ---------- */
.benefits-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .benefits-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-5); } }
@media (min-width: 1024px) { .benefits-grid { grid-template-columns: repeat(4, 1fr); } }
.benefit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5);
  box-shadow: 0 4px 18px rgba(35, 42, 84, 0.05);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.benefit-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow); }
.benefit-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
}
.benefit-icon svg { width: 22px; height: 22px; }
/* Icono inline en títulos de tarjeta */
.trust-card h3, .case-card h3 { display: flex; align-items: flex-start; gap: 0.6rem; }
.title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-top: -0.2em;
  flex-shrink: 0;
}
.title-icon svg { width: 17px; height: 17px; }
.lead-title .title-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(32, 107, 78, 0.12);
  color: var(--success);
  vertical-align: -0.45em;
  margin-top: 0;
  margin-right: 0.45rem;
}
.lead-title .title-icon svg { width: 13px; height: 13px; }
.success-icon { background: rgba(32, 107, 78, 0.12); color: var(--success); vertical-align: -0.55em; margin-right: 0.6rem; }
.benefit-card h3 { font-size: var(--fs-h3); margin-bottom: var(--sp-2); }
.benefit-card p { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }

/* ---------- Pasos ---------- */
.steps-grid { display: grid; gap: var(--sp-4); counter-reset: step; }
@media (min-width: 640px) { .steps-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-5); } }
@media (min-width: 1024px) { .steps-grid { grid-template-columns: repeat(4, 1fr); } }
.step-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  box-shadow: 0 4px 18px rgba(35, 42, 84, 0.05);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: #fff;
  background: var(--ink);
  margin-bottom: var(--sp-4);
}
.step-card h3 { font-size: 1.0625rem; margin-bottom: var(--sp-2); }
.step-card p { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }

/* ---------- Casos de uso ---------- */
.cases-grid { display: grid; gap: var(--sp-4); }
/* Móvil: carrusel con swipe — nunca tarjetas comprimidas */
@media (max-width: 639px) {
  .cases-grid {
    display: flex;
    gap: var(--sp-3);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: -4vw;
    padding: var(--sp-1) 4vw var(--sp-4);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cases-grid::-webkit-scrollbar { display: none; }
  .cases-grid .case-card {
    flex: 0 0 min(84%, 320px);
    scroll-snap-align: center;
  }
}
@media (min-width: 640px) { .cases-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-5); } }
@media (min-width: 1024px) { .cases-grid { grid-template-columns: repeat(3, 1fr); } }
.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: 0 4px 18px rgba(35, 42, 84, 0.05);
  transition: border-color 0.25s ease;
}
.case-card:hover { border-color: var(--border-strong); }
.case-card h3 { font-size: 1.0625rem; margin-bottom: var(--sp-3); }
.case-lead {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: 10px;
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.case-lead strong { color: var(--text); }
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid rgba(209, 78, 36, 0.28);
}
.tag-urgent { background: rgba(181, 55, 43, 0.08); color: #a63a34; border-color: rgba(181, 55, 43, 0.28); }
.case-card-cta { display: flex; flex-direction: column; justify-content: center; text-align: center; align-items: center; gap: var(--sp-2); }
.case-card-cta p { color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- Confianza ---------- */
.trust-grid { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-7); }
@media (min-width: 860px) { .trust-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); } }
.trust-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5);
  box-shadow: 0 4px 18px rgba(35, 42, 84, 0.05);
}
.trust-card h3 { font-size: var(--fs-h3); margin-bottom: var(--sp-2); }
.trust-card p { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }

/* Testimonios — bloque tinta oscura, como cita editorial */
.testimonials-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 760px) { .testimonials-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-5); } }
.testimonial-card {
  margin: 0;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5);
}
.testimonial-card blockquote {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.55;
  color: #f5f1e6;
  font-style: italic;
}
.testimonial-card figcaption { font-size: 0.875rem; color: #b9b4d6; font-weight: 600; }
.testimonial-card.placeholder { opacity: 0.85; border-style: dashed; border-color: rgba(255, 255, 255, 0.35); }

/* ---------- Precios ---------- */
.pricing-grid { display: grid; gap: var(--sp-5); align-items: stretch; }
@media (min-width: 900px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); } }
/* Móvil apilado: el plan destacado va primero */
@media (max-width: 899px) {
  .price-card-featured { order: -1; }
}
.price-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 18px rgba(35, 42, 84, 0.05);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.price-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.price-card h3 { font-size: 1.25rem; margin-bottom: var(--sp-1); }
.price { margin-bottom: var(--sp-2); }
.price .amount { font-family: var(--font-display); font-size: 2.75rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.price .per { color: var(--text-faint); font-size: var(--fs-sm); }
.price-desc { color: var(--text-muted); font-size: var(--fs-sm); }
@media (min-width: 900px) { .price-desc { min-height: 2.6em; } }
.price-features { flex: 1; margin: 0 0 var(--sp-5); display: flex; flex-direction: column; gap: 0.625rem; }
.price-features li {
  position: relative;
  padding-left: 1.5rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
}
.price-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.price-setup { font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: var(--sp-4); }
.price-card-featured {
  border-color: var(--ink);
  background: linear-gradient(180deg, rgba(205, 238, 242, 0.35), var(--surface) 45%);
  box-shadow: 0 18px 48px rgba(35, 42, 84, 0.16);
}
@media (min-width: 900px) {
  .price-card-featured { transform: translateY(-10px); }
  .price-card-featured:hover { transform: translateY(-13px); }
}
.featured-tag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 1rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.pricing-fineprint {
  max-width: 42em;
  margin: var(--sp-7) auto 0;
  text-align: center;
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s ease;
}
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  list-style: none;
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: var(--sp-3) var(--sp-8) var(--sp-3) var(--sp-5);
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  user-select: none;
  color: var(--ink);
  transition: color var(--speed) ease;
}
.faq-item summary:hover { color: var(--accent-text); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: var(--sp-5);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--accent-text);
  transition: transform var(--speed) ease;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p {
  padding: 0 var(--sp-5) var(--sp-4);
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  max-width: 65ch;
}

/* ---------- CTA final + Formulario — bloque aqua pálido ---------- */
.cta-final {
  position: relative;
  overflow: hidden;
  padding-bottom: calc(var(--section-y) + 2rem);
  background: linear-gradient(180deg, var(--aqua), #f5e8d8 70%, var(--bg));
}
.cta-glow {
  position: absolute;
  inset: auto -20% -50%;
  height: 600px;
  background: radial-gradient(560px 320px at 50% 60%, rgba(255, 255, 255, 0.55), transparent 70%);
  pointer-events: none;
}
.cta-final .section-head h2 { color: var(--ink-deep); }
.contact-form {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5);
  box-shadow: var(--shadow);
}
@media (min-width: 700px) { .contact-form { padding: var(--sp-7) var(--sp-7) var(--sp-6); } }
.form-row { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-4); }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.form-field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--sp-2);
  color: var(--text-muted);
}
.form-field input {
  width: 100%;
  min-height: 48px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem; /* 16px: evita zoom iOS */
  padding: 0.75rem 1rem;
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
}
.form-field input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(209, 78, 36, 0.18);
}
.form-field input::placeholder { color: var(--text-faint); }
.form-field-full { margin-bottom: var(--sp-4); }
.form-field select {
  width: 100%;
  min-height: 48px;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 0.75rem 2.6rem 0.75rem 1rem;
  cursor: pointer;
  transition: border-color var(--speed) ease, box-shadow var(--speed) ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666c8a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}
.form-field select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(209, 78, 36, 0.18);
}
.form-note { text-align: center; color: var(--text-faint); font-size: var(--fs-xs); margin: var(--sp-3) 0 0; }
.hidden-field { position: absolute; left: -9999px; }
.form-success { text-align: center; padding: var(--sp-5) var(--sp-4) var(--sp-2); }
.form-success h3 { color: var(--success); }
.form-success p { color: var(--text-muted); }

/* ---------- CTA fijo móvil ---------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: var(--sp-3) 4% calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
  background: rgba(251, 250, 247, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  transform: translateY(110%);
  transition: transform 0.25s ease;
}
.sticky-cta.visible { transform: translateY(0); }
.sticky-cta .btn { box-shadow: 0 6px 20px rgba(35, 42, 84, 0.25); }
@media (min-width: 860px) { .sticky-cta { display: none; } }

/* ---------- Footer — degradado aurora suave ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background:
    linear-gradient(120deg, rgba(209, 78, 36, 0.08), rgba(122, 77, 191, 0.06) 45%, rgba(226, 168, 92, 0.13)),
    var(--bg);
  padding: var(--sp-7) 0 var(--sp-6);
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 760px) { .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; } }
.footer-brand p { color: var(--text-faint); font-size: 0.875rem; margin: var(--sp-3) 0 0; }
.footer-links { display: flex; flex-direction: column; gap: var(--sp-1); }
@media (min-width: 760px) { .footer-links { text-align: right; align-items: flex-end; } }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--speed) ease;
}
.footer-links a:hover { color: var(--ink); }
.footer-legal { padding-top: var(--sp-5); color: var(--text-faint); font-size: var(--fs-xs); }
.footer-legal .footnote { font-size: 0.72rem; margin-top: var(--sp-1); }

/* ---------- Animaciones de scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  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.visible { opacity: 1; transform: translateY(0) scale(1); }
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .chat-msg, .chat-lead-card { animation: none; opacity: 1; transform: none; }
  .call-active .pulse-ring { animation: none; }
  .sticky-cta { transition: none; }
  .btn, .benefit-card, .price-card { transition: none; }
}

/* ---------- Toggle de tema ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color var(--speed) ease, background var(--speed) ease, color var(--speed) ease;
}
.theme-toggle:hover { border-color: var(--ink); background: var(--accent-soft); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Extras de precios (minutos, ROI, garantía) ---------- */
.li-note { color: var(--text-faint); font-weight: 400; }
.pricing-roi {
  max-width: 46em;
  margin: var(--sp-6) auto 0;
  text-align: center;
  font-size: 1.0625rem;
  color: var(--text-muted);
}
.pricing-roi strong { color: var(--ink); }
.guarantee-banner {
  max-width: 720px;
  margin: var(--sp-5) auto 0;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: rgba(32, 107, 78, 0.07);
  border: 1px solid rgba(32, 107, 78, 0.30);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
}
.guarantee-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 107, 78, 0.12);
  color: var(--success);
}
.guarantee-icon svg { width: 24px; height: 24px; }
.guarantee-banner strong { color: var(--ink); }
.guarantee-banner div { font-size: var(--fs-sm); color: var(--text-muted); }

/* ============================================================
   MODO OSCURO
   ============================================================ */
html[data-theme="dark"] {
  --bg: #12152b;
  --bg-alt: #171b34;
  --surface: #1c2140;
  --surface-2: #232950;
  --border: rgba(240, 235, 220, 0.12);
  --border-strong: rgba(240, 235, 220, 0.25);
  --ink: #efeadb;
  --ink-deep: #fffdf4;
  --text-muted: #b7b5c6;
  --text-faint: #908fa8;
  --accent: #f07c4f;
  --accent-2: #f07c4f;
  --accent-soft: rgba(240, 124, 79, 0.14);
  --accent-text: #f49067;
  --aqua: #241f3f;
  --success: #3dd68c;
  --danger: #f0786e;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  --text: var(--ink);
  color-scheme: dark;
}
/* Rellenos que en claro usaban tinta oscura y en oscuro necesitan acento */
html[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #e4693c, #f08a57);
  color: #1a1330;
  box-shadow: 0 6px 22px rgba(228, 105, 60, 0.35);
}
html[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #ef7648, #f79a67);
  color: #1a1330;
  box-shadow: 0 10px 30px rgba(228, 105, 60, 0.45);
}
html[data-theme="dark"] .btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .wordmark-icon,
html[data-theme="dark"] .step-num,
html[data-theme="dark"] .featured-tag {
  background: linear-gradient(135deg, #e4693c, #f08a57);
  color: #1a1330;
}
html[data-theme="dark"] .nav-cta {
  background: linear-gradient(135deg, #e4693c, #f08a57) !important;
  color: #1a1330 !important;
}
html[data-theme="dark"] .chat-msg.ai {
  background: linear-gradient(135deg, #34305e, #443e76);
  border-color: rgba(240, 124, 79, 0.35);
  color: #f3efe4;
}
html[data-theme="dark"] .chat-msg.ai .who { color: #c0b8e0; }
html[data-theme="dark"] .testimonial-card {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
html[data-theme="dark"] .testimonial-card blockquote { color: #e7eff5; }
html[data-theme="dark"] .testimonial-card figcaption { color: var(--text-faint); }
html[data-theme="dark"] .testimonial-card.placeholder { border-style: dashed; border-color: rgba(255, 255, 255, 0.28); }
html[data-theme="dark"] .price-card-featured {
  border-color: var(--accent-text);
  background: linear-gradient(180deg, rgba(240, 124, 79, 0.10), var(--surface) 45%);
}
html[data-theme="dark"] .cta-final {
  background: linear-gradient(180deg, #241f3f, #1b1834 70%, var(--bg));
}
html[data-theme="dark"] .cta-glow {
  background: radial-gradient(560px 320px at 50% 60%, rgba(240, 124, 79, 0.16), transparent 70%);
}
html[data-theme="dark"] .site-header { background: rgba(14, 21, 29, 0.72); }
html[data-theme="dark"] .site-header.scrolled,
html[data-theme="dark"] .site-header.nav-open { background: rgba(14, 21, 29, 0.92); }
@media (max-width: 859px) {
  html[data-theme="dark"] .main-nav { background: rgba(14, 21, 29, 0.98); }
}
html[data-theme="dark"] .sticky-cta { background: rgba(14, 21, 29, 0.90); }
html[data-theme="dark"] .site-footer {
  background:
    linear-gradient(120deg, rgba(240, 124, 79, 0.10), rgba(124, 150, 230, 0.08) 50%, rgba(230, 180, 180, 0.06)),
    var(--bg-alt);
}
html[data-theme="dark"] .guarantee-banner { background: rgba(61, 214, 140, 0.08); border-color: rgba(61, 214, 140, 0.28); }
html[data-theme="dark"] .guarantee-icon { background: rgba(61, 214, 140, 0.14); }
html[data-theme="dark"] .chat-lead-card { background: rgba(61, 214, 140, 0.08); border-color: rgba(61, 214, 140, 0.28); }
html[data-theme="dark"] .tag-urgent { background: rgba(240, 122, 110, 0.12); color: #fca5a5; border-color: rgba(240, 122, 110, 0.30); }

/* ---------- Borde animado (luz que recorre el botón) ---------- */
.btn-glow { position: relative; isolation: isolate; }
.btn-glow .mb-border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: -1; /* sobre el fondo del botón, debajo del texto */
}
.btn-glow .mb-border svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.btn-glow .mb-dot {
  position: absolute;
  top: 0; left: 0;
  width: 72px; height: 15px; /* estela alargada; se orienta al borde vía rotación en JS */
  border-radius: 999px;
  background: radial-gradient(ellipse at center, #fffdf4 0%, hsla(18, 88%, 72%, 0.92) 26%, hsla(262, 60%, 66%, 0.4) 56%, transparent 80%);
}

/* ============================================================
   FILM — línea de tinta retirada por diseño (menos saturación)
   Se conserva el scroll, la cámara y la aparición de capítulos;
   solo se oculta la ilustración del hilo (hilo, pluma y anillos).
   `visibility: hidden` mantiene el layout y no rompe film.js.
   ============================================================ */
.film-svg { visibility: hidden; }

/* ============================================================
   POLISH PASS — microinteracciones y refinamiento
   (transiciones 150–250ms, easing premium, jerarquía)
   ============================================================ */

/* ---------- Selección de texto con color de marca ---------- */
::selection { background: var(--accent-2); color: #fff; }
html[data-theme="dark"] ::selection { background: #f07c4f; color: #1a1330; }

/* ---------- Header ---------- */
.site-header.scrolled { box-shadow: 0 8px 28px rgba(35, 42, 84, 0.07); }
html[data-theme="dark"] .site-header.scrolled { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); }

/* Wordmark: el ícono saluda al pasar el cursor */
.wordmark-icon { transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.wordmark:hover .wordmark-icon { transform: rotate(-8deg) scale(1.06); }

/* Nav: subrayado que se desliza (solo escritorio) */
@media (min-width: 860px) {
  .main-nav a { position: relative; }
  .main-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 100%; bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-text);
    transition: right 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .main-nav a:hover::after { right: 0; }
}

/* Toggle de tema: giro sutil al presionar */
.theme-toggle svg { transition: transform 0.2s ease; }
.theme-toggle:active svg { transform: rotate(40deg) scale(0.88); }

/* ---------- Botones ---------- */
.btn { position: relative; overflow: hidden; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
/* Destello que cruza el botón primario al pasar el cursor */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -80%;
  width: 55%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
  pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }
.btn-ghost:hover { transform: translateY(-1px); }

/* ---------- Hero ---------- */
/* Brillo que respira lentamente sobre el degradado del titular */
.text-gradient {
  background-size: 200% 100%;
  animation: gradient-drift 9s ease-in-out infinite alternate;
}
@keyframes gradient-drift {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}
/* El punto rojo de la estadística late suavemente */
.badge-dot { animation: badge-pulse 2.4s ease-in-out infinite; }
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(181, 55, 43, 0.14); }
  50% { box-shadow: 0 0 0 7px rgba(181, 55, 43, 0.06); }
}
html[data-theme="dark"] .badge-dot { animation-name: badge-pulse-dark; }
@keyframes badge-pulse-dark {
  0%, 100% { box-shadow: 0 0 0 4px rgba(240, 122, 110, 0.16); }
  50% { box-shadow: 0 0 0 7px rgba(240, 122, 110, 0.06); }
}

/* ---------- Chat de ejemplo ---------- */
.chat-dot { animation: chat-pulse 2s ease-in-out infinite; }
@keyframes chat-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(32, 107, 78, 0.12); }
  50% { box-shadow: 0 0 0 7px rgba(32, 107, 78, 0.05); }
}

/* ---------- Tarjetas: elevación y acentos coherentes ---------- */
.benefit-card, .step-card, .case-card, .trust-card, .testimonial-card {
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.22s ease,
              box-shadow 0.22s ease;
}
.step-card:hover, .case-card:hover, .trust-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.benefit-card:hover { transform: translateY(-4px); }
.testimonial-card:hover { transform: translateY(-3px); }

/* Los íconos reaccionan con su tarjeta */
.benefit-icon, .title-icon, .step-num {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.2s ease, color 0.2s ease;
}
.benefit-card:hover .benefit-icon { transform: translateY(-2px) scale(1.07); }
.trust-card:hover .title-icon, .case-card:hover .title-icon { transform: scale(1.08) rotate(-4deg); }
.step-card:hover .step-num { transform: scale(1.1); }

/* La cita del caso se ilumina con la tarjeta */
.case-lead { transition: border-color 0.22s ease, background 0.22s ease; }
.case-card:hover .case-lead { border-left-color: var(--accent-text); }

/* ---------- Precios ---------- */
.price-card .btn { transition-duration: 0.2s; }
.price-card:hover .amount { color: var(--accent-text); }
.price .amount { transition: color 0.22s ease; }
html[data-theme="dark"] .price-card:hover .amount { color: var(--accent-text); }
.guarantee-banner { transition: transform 0.22s ease, box-shadow 0.22s ease; }
.guarantee-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(32, 107, 78, 0.12); }

/* ---------- FAQ: apertura suave + ícono que gira ---------- */
.faq-item summary::after {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}
.faq-item[open] summary::after {
  content: "+";
  transform: translateY(-50%) rotate(45deg);
}
.faq-item[open] p { animation: faq-in 0.26s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes faq-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
.faq-item { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.faq-item:hover { border-color: var(--border-strong); }
.faq-item[open] { box-shadow: 0 6px 24px rgba(35, 42, 84, 0.06); }
html[data-theme="dark"] .faq-item[open] { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3); }

/* ---------- Formulario ---------- */
.form-field label { transition: color 0.18s ease; }
.form-field:focus-within label { color: var(--accent-text); }
.footer-links a { transition: color 0.18s ease, transform 0.18s ease; }
.footer-links a:hover { transform: translateX(-2px); }

/* ---------- Jerarquía tipográfica afinada ---------- */
.section-head h2 { letter-spacing: -0.022em; margin-bottom: 0.55em; }
.section-head .eyebrow { margin-bottom: var(--sp-4); }
.beat h1 { letter-spacing: -0.025em; }
.price .amount { letter-spacing: -0.03em; }

/* ---------- Movimiento reducido: apagar el pulido ---------- */
@media (prefers-reduced-motion: reduce) {
  .text-gradient, .badge-dot, .chat-dot { animation: none; }
  .btn-primary::after { display: none; }
  .faq-item[open] p { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .benefit-card, .step-card, .case-card, .trust-card, .testimonial-card,
  .benefit-icon, .title-icon, .step-num, .wordmark-icon, .guarantee-banner { transition: none; }
  .btn:hover, .step-card:hover, .case-card:hover, .trust-card:hover,
  .benefit-card:hover, .testimonial-card:hover, .guarantee-banner:hover { transform: none; }
}
