/* Landing pública (P38) — hereda el sistema visual de la demo (Stitch de Roberto):
   tema claro, violeta eléctrico, Inter + JetBrains Mono + Caveat. Las tres
   pantallas del hero son HTML estático recreado del código real y escalado
   por JS al ancho disponible (app.js). No hereda base.css. */

:root {
  --bg: #f6f5f8;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #5f6b7c;
  --soft: #475569;
  --primary: #7c3aed;
  --primary-deep: #6d28d9;
  --line: #e2e8f0;
  --ok: #22c55e;
  --amber: #ffb200;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --hand: 'Caveat', cursive;
  --pad: clamp(18px, 4.4vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--mono); }
.hand { font-family: var(--hand); color: var(--primary); font-size: 26px; line-height: 1; white-space: nowrap; }
.accent { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: 14px; font-weight: 600; }
.kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  font: inherit; font-weight: 800; font-size: 17px; padding: 16px 26px; border-radius: 13px;
  border: none; cursor: pointer; transition: transform 0.12s ease, background 0.12s ease;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 12px 40px -8px rgba(124, 58, 237, 0.55); }
.btn-primary:hover { background: var(--primary-deep); color: #fff; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn-ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); padding: 15px 22px; }
.btn-ghost:hover { background: rgba(124, 58, 237, 0.08); }
.btn.slim { padding: 10px 18px; font-size: 15px; border-radius: 11px; min-height: 44px; }
.link { font-weight: 800; font-size: 16px; padding: 13px 16px; }

/* Barra */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: 14px var(--pad);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; letter-spacing: -0.02em; color: var(--text); }
.brand svg { color: var(--primary); }
.brand.light { color: #fff; font-size: 18px; }
.nav-links { display: flex; gap: 28px; font-weight: 600; font-size: 15px; }
.nav-links a { color: #334155; }
.nav-links a:hover { color: var(--primary); }

/* Hero */
.hero { position: relative; padding: clamp(40px, 6vw, 72px) var(--pad) 56px; overflow: hidden; }
.glow { position: absolute; border-radius: 999px; pointer-events: none; z-index: 0; }
.glow-a { top: -200px; right: -160px; width: 720px; height: 720px; background: radial-gradient(closest-side, rgba(124,58,237,0.16), rgba(124,58,237,0)); }
.glow-b { top: 420px; left: -220px; width: 560px; height: 560px; background: radial-gradient(closest-side, rgba(255,178,0,0.14), rgba(255,178,0,0)); }
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 22px; align-items: center; text-align: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 8px; font-size: 13px; font-weight: 700; color: var(--soft); }
.pill .dot { width: 10px; height: 10px; border-radius: 999px; background: var(--ok); }
h1 { font-size: clamp(38px, 5.3vw, 68px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 900; max-width: 900px; text-wrap: pretty; }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--soft); max-width: 700px; text-wrap: pretty; }
.cta-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
.trust { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.trust-note { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: -10px; text-align: center; }
.scene-note { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; margin: 18px auto 0; max-width: 640px; }

/* Escena del trío: posiciones calcadas del lienzo a 1168 px de ancho útil; se
   escala proporcionalmente con --k (JS) y en móvil se apila. */
.scene { position: relative; z-index: 1; margin: 24px auto 0; width: min(1168px, 100%); height: calc(650px * var(--k, 1)); }
.dev { position: absolute; }
.dev-tv { left: 0; top: calc(36px * var(--k, 1)); width: calc(556px * var(--k, 1)); z-index: 2; }
.dev-tablet { left: calc(720px * var(--k, 1)); top: calc(190px * var(--k, 1)); width: calc(446px * var(--k, 1)); z-index: 3; }
.dev-phone { left: calc(522px * var(--k, 1)); top: calc(262px * var(--k, 1)); width: calc(184px * var(--k, 1)); z-index: 5; }
.hand-tv { position: absolute; top: -36px; left: 18px; transform: rotate(-3deg); }
.hand-tablet { position: absolute; top: -36px; right: 10px; transform: rotate(2deg); }
.hand-phone { position: absolute; top: calc(100% + 10px); left: -30px; transform: rotate(-2deg); }
.frame { position: relative; }
.frame-tv { background: #0d1017; border-radius: 12px; padding: 8px; box-shadow: 0 30px 60px -18px rgba(40, 25, 5, 0.5); }
.frame-tv .screen { border-radius: 6px; }
.tv-stand { width: 34%; height: 12px; margin: -1px auto 0; background: #2c3342; border-radius: 0 0 10px 10px; }
.frame-tablet { background: #232b3a; border: 1px solid #39435a; border-radius: 20px; padding: 12px; box-shadow: 0 30px 60px -18px rgba(40, 25, 5, 0.45); }
.frame-tablet .cam { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 46px; height: 4px; border-radius: 99px; background: #46516b; }
.frame-tablet .screen { border-radius: 8px; }
.tablet-stand { width: 34%; height: 30px; margin: -4px auto 0; background: linear-gradient(#eceff4, #c9cfda); border-radius: 0 0 14px 14px; box-shadow: 0 14px 24px -10px rgba(40, 25, 5, 0.35); }
.frame-phone { background: #10151f; border: 1px solid #3a4457; border-radius: 38px; padding: 8px; box-shadow: 0 30px 60px -16px rgba(15, 23, 42, 0.55); }
.frame-phone .notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 38%; height: 18px; background: #05070c; border-radius: 0 0 12px 12px; z-index: 5; pointer-events: none; }
.frame-phone .screen { border-radius: 30px; }
.floor { position: absolute; left: 7%; right: 7%; bottom: -15px; height: 26px; background: radial-gradient(closest-side, rgba(70, 45, 15, 0.30), transparent 72%); filter: blur(6px); z-index: -1; }

/* La pantalla real (ancho nativo data-w × data-h) se escala al ancho del marco. */
.screen { position: relative; overflow: hidden; width: 100%; aspect-ratio: var(--ar, 16 / 9); background: #0e1017; }
.screen > div { position: absolute; top: 0; left: 0; transform: scale(var(--s, 1)); transform-origin: 0 0; }

/* Burbuja de voz */
.voice { position: absolute; right: calc(646px * var(--k, 1) + 25px); top: calc(440px * var(--k, 1)); z-index: 6; display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 12px 22px 12px 14px; box-shadow: 0 14px 34px -12px rgba(15, 23, 42, 0.30); font-size: 17px; font-weight: 700; }
.voice-ico { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.voice-btn { position: relative; width: 40px; height: 40px; border-radius: 999px; background: var(--primary); display: flex; align-items: center; justify-content: center; }
.ring { position: absolute; inset: 0; border-radius: 999px; }
.ring::before, .ring::after { content: ""; position: absolute; inset: 0; border-radius: 999px; border: 2px solid var(--primary); animation: pulseRing 2.4s ease-out infinite; }
.ring::after { animation-delay: 1.2s; }
@keyframes pulseRing { 0% { transform: scale(0.8); opacity: 0.8; } 100% { transform: scale(2.2); opacity: 0; } }
.wave { display: flex; gap: 4px; align-items: center; height: 26px; }
.wave span { display: block; width: 4px; height: 26px; border-radius: 2px; background: #a78bfa; transform-origin: center; animation: wave 1.1s ease-in-out infinite; }
.wave span:nth-child(2) { animation-delay: 0.12s; } .wave span:nth-child(3) { animation-delay: 0.24s; }
.wave span:nth-child(4) { animation-delay: 0.36s; } .wave span:nth-child(5) { animation-delay: 0.48s; }
@keyframes wave { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }

/* Entrada escalonada (se activa al entrar en pantalla, app.js) */
.rise { opacity: 0; transform: translateY(18px); transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1); }
.rise.in { opacity: 1; transform: none; }
.rise-2.in { transition-delay: 0.15s; } .rise-3.in { transition-delay: 0.3s; } .rise-4.in { transition-delay: 0.45s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { opacity: 1; transform: none; transition: none; }
  .wave span, .ring::before, .ring::after, .leaver { animation: none; }
  .btn, .lane { transition: none; }
  .btn-primary:hover, .lane:hover { transform: none; }
}

/* Cinta */
.band { margin: 0 var(--pad) 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; }
.band-item { display: flex; flex-direction: column; gap: 4px; padding: 22px 28px; border-right: 1px solid var(--line); }
.band-item:last-child { border-right: none; }
.band-queue { flex-direction: row; align-items: center; gap: 18px; }
.band-text { display: flex; flex-direction: column; gap: 4px; }
.queue-icons { display: flex; gap: 6px; align-items: flex-end; color: var(--text); }
.leaver { animation: leave 5s ease-in infinite; }
@keyframes leave { 0%, 60% { transform: translateX(0); opacity: 1; } 85%, 100% { transform: translateX(-70px); opacity: 0; } }
.big { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.band .small { color: var(--muted); }
.fn { font-size: 11px; font-weight: 800; vertical-align: super; margin-left: 3px; padding: 4px; color: var(--primary); }

/* Carriles */
.lanes-head { padding: 72px var(--pad) 24px; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 900; letter-spacing: -0.03em; line-height: 1.08; }
.lanes-head p, .sec-head p { color: var(--muted); font-size: 17px; font-weight: 500; }
.lanes { padding: 16px var(--pad) 80px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.lane { border-radius: 24px; padding: 40px; display: flex; flex-direction: column; gap: 22px; transition: transform 0.25s ease, box-shadow 0.25s ease; }
.lane:hover { transform: translateY(-4px); box-shadow: 0 30px 60px -24px rgba(15, 23, 42, 0.25); }
.lane-light { background: var(--surface); border: 1px solid var(--line); }
.lane-dark { background: #1a1f2b; color: #fff; box-shadow: 0 30px 60px -30px rgba(15, 23, 42, 0.5); }
.lane-dark .kicker { color: #c4b5fd; }
.lane-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chip { font-size: 13px; color: var(--muted); background: var(--bg); padding: 5px 10px; border-radius: 8px; white-space: nowrap; }
.lane-dark .chip { color: #cbd5e1; background: rgba(255, 255, 255, 0.08); }
.lane h3 { font-size: clamp(24px, 2.3vw, 30px); font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; }
.args { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.5; color: #334155; }
.lane-dark .args { color: #cbd5e1; }
.args li { display: flex; gap: 12px; }
.args svg { flex-shrink: 0; margin-top: 2px; color: var(--primary); }
.lane-dark .args svg { color: #c4b5fd; }
.lane .cta-row { justify-content: flex-start; margin-top: 6px; }
.lane .btn { font-size: 16px; padding: 14px 22px; }
.lane .muted { font-size: 14px; font-weight: 600; }
.lane-dark .muted { color: #94a3b8; }
.express { display: flex; gap: 10px; align-items: center; padding: 14px 16px; background: #fdf4e7; border-radius: 13px; font-size: 14px; color: #7c4a03; font-weight: 600; }
.express svg { flex-shrink: 0; }
.chips3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.chip3 { background: rgba(255, 255, 255, 0.06); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.chip3 .mono { font-size: 18px; font-weight: 700; }
.chip3 span:last-child { font-size: 12px; color: #94a3b8; }

/* Por qué funciona */
.why { padding: 72px var(--pad); background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 36px; }
.sec-head { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; }
.why-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.why-card { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.why-card .big { color: var(--primary); font-size: 34px; }
.why-card h3 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.why-card p { color: var(--soft); font-size: 15px; line-height: 1.5; }
.why-note { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; }

/* Así de fácil */
.how { padding: 80px var(--pad); display: flex; flex-direction: column; gap: 44px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.step { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.step .num { color: var(--primary); font-size: 26px; font-weight: 700; line-height: 1; }
.step div { display: flex; flex-direction: column; gap: 6px; }
.step h3 { font-size: 18px; font-weight: 800; }
.step p { color: var(--muted); font-size: 15px; line-height: 1.45; }
.hw { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 28px; }
.hw div { display: flex; flex-direction: column; gap: 4px; }
.hw strong { font-size: 18px; }
.hw span { color: var(--muted); font-size: 15px; line-height: 1.45; }
.hw .btn { font-size: 15px; padding: 12px 18px; white-space: nowrap; }

/* App */
.app { padding: 80px var(--pad); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: center; background: var(--surface); border-top: 1px solid var(--line); }
.app-copy { display: flex; flex-direction: column; gap: 18px; }
.app-copy p { color: var(--soft); font-size: 17px; line-height: 1.5; }
.badges { display: flex; gap: 12px; }
.badge { height: 46px; width: 150px; border-radius: 10px; background: var(--text); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.app-mock { display: flex; justify-content: center; }
.phone { width: 250px; height: 500px; border-radius: 36px; background: #1a1f2b; padding: 12px; box-shadow: 0 40px 80px -30px rgba(15, 23, 42, 0.6); }
.phone-screen { width: 100%; height: 100%; border-radius: 26px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; padding: 22px 16px; }
.ps-head { font-size: 12px; font-weight: 700; color: var(--muted); }
.ps-card { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); }
.ps-row { flex-direction: row; justify-content: space-between; align-items: center; padding: 14px 16px; }
.ps-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.ps-num { font-size: 44px; font-weight: 700; letter-spacing: -0.02em; }
.ps-ok { font-size: 13px; color: #15803d; font-weight: 700; }
.ps-cur { font-size: 20px; font-weight: 700; color: var(--primary); }
.ps-cta { margin-top: auto; background: var(--primary); color: #fff; border-radius: 13px; padding: 13px; text-align: center; font-weight: 800; font-size: 14px; }

/* Cadenas: formulario */
.chains { padding: 80px var(--pad); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; background: #1a1f2b; color: #fff; }
.chains-copy { display: flex; flex-direction: column; gap: 18px; }
.chains-copy .kicker { color: #c4b5fd; }
.chains-copy p { color: #cbd5e1; font-size: 17px; line-height: 1.5; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: #e2e8f0; font-weight: 600; font-size: 15px; }
.ticks li { padding-left: 26px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 999px; 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%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 90% 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%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 90% no-repeat; }
.chain-form { background: var(--surface); color: var(--text); border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.chain-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: #334155; }
.chain-form .opt { color: var(--muted); font-weight: 600; }
.chain-form input, .chain-form textarea { font: inherit; font-size: 16px; font-weight: 500; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--text); outline: none; transition: border-color 0.12s ease; }
.chain-form input:focus, .chain-form textarea:focus { border-color: var(--primary); background: var(--surface); }
.chain-form input.bad { border-color: #ef4444; }
.chain-form textarea { resize: vertical; }
.f2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 1.4em; font-size: 15px; font-weight: 700; color: var(--primary); }
.form-msg.err { color: #dc2626; }
.chain-form .small { font-size: 13px; }

/* Fuentes */
.sources { padding: 48px var(--pad) 64px; display: flex; flex-direction: column; gap: 14px; }
.sources h2 { font-size: 20px; }
.sources ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--soft); font-size: 14px; line-height: 1.55; max-width: 920px; }
.sources a { font-weight: 700; }

/* Pie */
.foot { background: var(--text); color: #94a3b8; padding: 36px var(--pad); display: flex; justify-content: space-between; align-items: center; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 24px; font-weight: 600; flex-wrap: wrap; }
.foot-links a { color: #cbd5e1; }
.foot-links a:hover { color: #fff; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  /* La escena se apila: visor arriba, tablet + mando debajo. */
  .scene { height: auto; display: flex; flex-direction: column; gap: 28px; align-items: center; padding: 28px 0 8px; }
  .dev { position: relative; inset: auto; }
  .voice { position: static; }
  .dev-tv { width: min(556px, 100%); }
  .scene-row { display: flex; gap: 16px; align-items: flex-end; justify-content: center; width: 100%; }
  .dev-tablet { width: min(446px, calc(100% - 130px)); }
  .dev-phone { width: 110px; }
  .hand-tv, .hand-tablet { display: none; }
  .hand-phone { display: none; }
  .lanes { grid-template-columns: 1fr; }
  .why-grid, .steps { grid-template-columns: 1fr; }
  .app, .chains { grid-template-columns: 1fr; }
  .app-mock { order: -1; }
}
@media (max-width: 900px) {
  .band { grid-template-columns: 1fr; }
  .band-item { border-right: none; border-bottom: 1px solid var(--line); }
  .band-item:last-child { border-bottom: none; }
}
@media (max-width: 640px) {
  .lane { padding: 26px; }
  .chips3 { grid-template-columns: 1fr; }
  .f2 { grid-template-columns: 1fr; }
  .hw { flex-direction: column; align-items: flex-start; }
  .voice { font-size: 14px; padding: 8px 16px 8px 10px; }
  .voice-ico, .voice-btn { width: 32px; height: 32px; }
  .dev-tablet { width: calc(100% - 100px); }
  .dev-phone { width: 84px; }
  .frame-phone { border-radius: 22px; padding: 5px; }
  .frame-phone .screen { border-radius: 17px; }
  .frame-tablet { border-radius: 14px; padding: 8px; }
  .frame-tablet .cam { display: none; }
  .tablet-stand { display: none; }
  .foot { flex-direction: column; align-items: flex-start; }
}
