:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #1a1f2c;
  --muted: #667085;
  --border: #e2e6ef;
  --accent: #4f6bed;
  --accent2: #8b5cf6;
  --grad: linear-gradient(135deg, #5b7cff, #8b5cf6);
  --err-bg: #fdecec;
  --err: #b42323;
  --ok: #1f9d55;
  --code-bg: #f0f2f8;
  --shadow: 0 24px 60px -20px rgba(45, 55, 110, 0.28), 0 6px 18px -8px rgba(45, 55, 110, 0.18);
  --blob1: rgba(91, 124, 255, 0.35);
  --blob2: rgba(139, 92, 246, 0.28);
  --line: rgba(91, 100, 140, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1116;
    --panel: #181b23;
    --text: #eceef4;
    --muted: #9099ad;
    --border: #2a2f3b;
    --accent: #7590ff;
    --err-bg: #3a1d1f;
    --err: #ff8d8d;
    --code-bg: #12141b;
    --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7), 0 6px 18px -8px rgba(0, 0, 0, 0.5);
    --blob1: rgba(91, 124, 255, 0.28);
    --blob2: rgba(139, 92, 246, 0.24);
    --line: rgba(160, 170, 210, 0.07);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* Fondo */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; width: 620px; height: 620px; border-radius: 50%; filter: blur(80px); }
.b1 { top: -220px; left: -160px; background: radial-gradient(circle, var(--blob1), transparent 70%); animation: float 22s ease-in-out infinite; }
.b2 { top: 120px; right: -220px; background: radial-gradient(circle, var(--blob2), transparent 70%); animation: float 28s ease-in-out infinite reverse; }
.gridlines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(40px, 30px); } }

/* Cabecera */
.nav { max-width: 1180px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.logo img { display: block; border-radius: 9px; }
.nav-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.nav-btn:hover { border-color: var(--accent); transform: translateY(-1px); }

/* Hero */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px rgba(91, 124, 255, 0.18); }

h1 {
  margin: 20px 0 18px;
  font-size: clamp(40px, 5.4vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.lead { margin: 0; max-width: 520px; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); }

.cta { margin-top: 30px; max-width: 400px; }
.alert { background: var(--err-bg); color: var(--err); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

.providers { display: flex; flex-direction: column; gap: 10px; }
.provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px -12px rgba(45, 55, 110, 0.35);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.provider:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 14px 30px -12px rgba(79, 107, 237, 0.45); }
.provider svg { flex: none; }

.or { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.dev { display: flex; flex-direction: column; gap: 8px; }
.dev label { font-size: 13px; color: var(--muted); }
.dev .row { display: flex; gap: 8px; }
.dev input { flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; }
.dev input:focus { outline: none; border-color: var(--accent); }
.dev button { font: inherit; font-weight: 600; border: none; border-radius: 12px; padding: 11px 20px; background: var(--grad); color: #fff; cursor: pointer; }
.note { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.checks { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 14.5px; }
.checks li { display: inline-flex; align-items: center; gap: 7px; }
.checks svg { color: var(--ok); flex: none; }

/* Demo del producto */
.hero-copy, .hero-demo { min-width: 0; }
.hero-demo { position: relative; padding-bottom: 236px; }
.win { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.win-bar { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--border); background: linear-gradient(var(--panel), var(--code-bg)); }
.wdots { display: inline-flex; gap: 6px; }
.wdots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.win-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.url { display: inline-flex; align-items: center; gap: 6px; flex: 1; max-width: 240px; margin: 0 auto; padding: 4px 12px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12.5px; }

.chat-body { padding: 18px 18px 8px; min-height: 356px; display: flex; flex-direction: column; gap: 12px; }
.d-user { align-self: flex-end; max-width: 82%; padding: 9px 14px; border-radius: 16px 16px 4px 16px; background: var(--grad); color: #fff; font-size: 14.5px; }
.d-agent { display: flex; gap: 10px; font-size: 14.5px; }
.d-agent img { flex: none; border-radius: 7px; margin-top: 1px; }
.d-agent p { margin: 0; }
.d-tools { display: flex; flex-direction: column; gap: 6px; padding-left: 34px; }
.d-chip { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 12.5px; }
.d-chip svg { flex: none; }
.d-chip b { font-weight: 500; flex: none; }
.d-chip code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.d-chip .st { flex: none; width: 14px; height: 14px; display: inline-block; }
.d-chip.run .st { border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.d-chip.ok .st { background: var(--ok); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat; }

.d-user, .d-agent, .d-chip { opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s; }
.d-user.show, .d-agent.show, .d-chip.show { opacity: 1; transform: none; }

.d-input { display: flex; align-items: center; gap: 8px; margin: 8px 14px 14px; padding: 10px 10px 10px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); font-size: 14px; min-height: 46px; }
.d-input #d-typed { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.d-input .caret { width: 2px; height: 18px; background: var(--accent); animation: blink 1s steps(2) infinite; flex: none; }
.d-input em { margin-left: auto; flex: none; font-style: normal; font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 10px; background: var(--grad); color: #fff; opacity: 0.6; }

.preview-win { position: absolute; right: -14px; bottom: 0; width: 62%; z-index: 2; opacity: 0; transform: translateY(24px) scale(0.96); transition: opacity 0.6s, transform 0.6s; }
.preview-win.show { opacity: 1; transform: none; }
.pv-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.pv-head strong { font-size: 15px; }
.pv-search { padding: 4px 10px; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 12px; }
.pv-note { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 13px; }
.pv-note b { font-weight: 600; }
.pv-note span { grid-column: 1; color: var(--muted); font-size: 12px; }
.pv-note .tag { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.t1 { background: rgba(91, 124, 255, 0.16); color: var(--accent); }
.t2 { background: rgba(31, 157, 85, 0.16); color: var(--ok); }
.t3 { background: rgba(245, 158, 11, 0.18); color: #b7791f; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }

/* Secciones */
.section { max-width: 1080px; margin: 0 auto; padding: 24px 24px 84px; text-align: center; }
.section h2, .final h2 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
.sub { margin: 10px auto 40px; max-width: 520px; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: left; }
.steps li { position: relative; padding: 24px 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); transition: transform 0.2s, box-shadow 0.2s; }
.steps li:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #fff; font-weight: 700; }
.steps h3, .feat h3 { margin: 16px 0 6px; font-size: 18px; letter-spacing: -0.01em; }
.steps p, .feat p { margin: 0; color: var(--muted); font-size: 15px; }

.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: left; }
.feat { padding: 24px 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.feat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.fico { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(91, 124, 255, 0.13); color: var(--accent); }
.feat h3 { margin-top: 14px; }

.final {
  max-width: 1080px;
  margin: 0 auto 72px;
  padding: 56px 24px;
  border-radius: 28px;
  background: var(--grad);
  color: #fff;
  text-align: center;
  box-shadow: 0 30px 70px -28px rgba(91, 100, 240, 0.7);
  width: calc(100% - 48px);
}
.final p { margin: 12px auto 26px; max-width: 460px; color: rgba(255, 255, 255, 0.88); }
.final-cta { display: flex; flex-direction: column; gap: 10px; max-width: 340px; margin: 0 auto; }
.final .provider { background: #fff; color: #1a1f2c; border-color: transparent; }

.foot { padding: 0 24px 40px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* Adaptación */
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 44px; padding-bottom: 72px; }
  .cta { max-width: 460px; }
  .steps, .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .nav { padding: 14px 18px; }
  .hero { padding: 20px 18px 56px; }
  .hero-demo { padding-bottom: 0; }
  .chat-body { min-height: 0; padding: 14px 14px 6px; }
  .preview-win { position: relative; right: auto; bottom: auto; width: 100%; margin-top: 14px; }
  .steps, .fgrid { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 12px 18px 60px; }
  .final { width: calc(100% - 36px); padding: 44px 20px; border-radius: 22px; margin-bottom: 48px; }
  .d-chip code { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
