/* Cuadre (modo expresivo). Diales ENERGY 3 / RHYTHM 3 / MOTION 3.
   Decisiones (una línea por recurso):
   - Fondo papel bond frío y hoja blanca: la escena de uso es el mostrador de día con el celular en la mano, no una oficina oscura.
   - Acento amarillo resaltador: solo marca el dato que importa (el total, el renglón que se valida, la mora de más de 30 días). Los botones van en tinta.
   - Una familia (Schibsted Grotesk): grotesca de periódico con cifras claras, sirve para la factura y para el titular.
   - El objeto vivo es la factura de ejemplo (ledger.js); cada estado es un paso real del producto. Sin otro motivo.
   - Hairlines solo en la factura, las filas del comparativo y el FAQ: separan contenido real.
   - Sombra dura desplazada solo bajo el papel (hoja y papelitos): es papel sobre el mostrador; el resto de la UI no tiene sombras.
   - El mockup de WhatsApp es UI del producto con datos verosímiles; las etiquetas nombran piezas que se ven. */
:root {
  --bg: #edf0f3; --paper: #ffffff; --surface: #e3e8ed;
  --ink: #13202f; --ink-2: #3c4a59; --ink-3: #56636f;
  --line: rgba(19, 32, 47, .14); --line-solid: #cfd6dd; --shadow: #c9d1d9;
  --accent: #f5d90a; --accent-ink: #13202f;
  --wa: #dff3d6;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --container: 1240px; --gutter: clamp(20px, 4vw, 40px);
  --t-hero: clamp(42px, 5.6vw, 84px); --t-h2: clamp(32px, 3.8vw, 56px); --t-h3: clamp(24px, 2.2vw, 34px);
  --t-lead: clamp(18px, 1.3vw, 20px); --t-body: 17px; --t-small: 14px;
  --r-s: 4px; --r-m: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { background: var(--bg); color: var(--ink); overflow-x: clip; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { font: 400 var(--t-body)/1.6 var(--sans); background: var(--bg); }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
input[type="range"] { accent-color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.num { font-variant-numeric: lining-nums; } /* Schibsted ensancha la puntuación con tnum: cifras proporcionales */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 50; }
.skip:focus { top: 12px; }

h1 { font-size: var(--t-hero); font-weight: 700; line-height: 1; letter-spacing: -.035em; text-wrap: balance; }
h2 { font-size: var(--t-h2); font-weight: 700; line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
h3 { font-size: var(--t-h3); font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
p { color: var(--ink-2); text-wrap: pretty; }
.lead { font-size: var(--t-lead); line-height: 1.55; max-width: 31em; }
h1 + .lead, h2 + .lead { margin-top: 24px; }
.kicker { font-size: var(--t-small); font-weight: 500; color: var(--ink-3); margin-bottom: 20px; max-width: 30em; }
.link { font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.link:hover { text-decoration-thickness: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: var(--r-s); font-weight: 600; white-space: nowrap; border: 0; cursor: pointer; transition: transform .15s var(--ease), background .2s, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn--ink { background: var(--ink); color: var(--paper); box-shadow: 4px 4px 0 var(--accent); }
.btn--ink:hover { box-shadow: 6px 6px 0 var(--accent); }
.btn--ghost { border: 1px solid var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--lg { min-height: 54px; padding: 0 26px; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: none; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent; transition: background .3s, border-color .3s; }
.nav.is-scrolled { background: rgba(237, 240, 243, .88); backdrop-filter: blur(12px); border-color: var(--line); }
.nav__in { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; letter-spacing: -.04em; margin-right: auto; }
.brand__mark { width: 18px; height: 18px; background: linear-gradient(var(--ink) 0 22%, transparent 22% 39%, var(--accent) 39% 61%, transparent 61% 78%, var(--ink) 78%); }
.nav__links { display: flex; gap: 28px; font-size: var(--t-small); font-weight: 500; color: var(--ink-2); }
.nav__links a:hover { color: var(--ink); }
.nav__toggle { display: none; min-height: 44px; padding: 0 16px; border: 1px solid var(--ink); border-radius: var(--r-s); background: none; cursor: pointer; }

/* Objeto vivo */
.stage { position: relative; margin: 0; }
.stage canvas { display: block; width: 100%; height: 100%; }
figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: var(--t-small); color: var(--ink-3); }
.pause { min-height: 44px; padding: 0 14px; background: none; border: 1px solid var(--line); border-radius: var(--r-s); cursor: pointer; color: var(--ink-2); }
.pause:hover { border-color: var(--ink); }

/* 1 · Hero */
.hero { min-height: min(calc(100dvh - 68px), 980px); display: flex; align-items: center; padding: 24px 0 56px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 72px); align-items: center; width: 100%; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; margin: 36px 0 44px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.facts > div { padding: 14px 14px 0 0; }
.facts dt { font-size: var(--t-small); color: var(--ink-3); }
.facts dd { font-weight: 600; margin-top: 2px; }
.stage--hero { height: min(76vh, 720px); }
.stage--hero canvas { height: calc(100% - 58px); }

/* 2 · Proceso: el objeto a la izquierda, el texto a la derecha */
.process { position: relative; background: var(--surface); }
.process__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 72px); min-height: min(100vh, 1000px); align-items: center; }
.rail { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; font-size: var(--t-small); font-weight: 600; color: var(--ink-2); }
.rail__bar { position: relative; width: 140px; height: 3px; background: var(--line-solid); }
.rail__bar i { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(var(--p, 0)); }
.steps { list-style: none; padding: 0; position: relative; min-height: 240px; }
.step h3 { font-size: var(--t-h2); font-weight: 700; line-height: 1.04; letter-spacing: -.03em; margin-bottom: 18px; }
.step p { font-size: var(--t-lead); max-width: 26em; }
.stage--process { height: min(80vh, 820px); }
.js-pin .step { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js-pin .step.is-on { opacity: 1; transform: none; }

/* 3 · WhatsApp */
.wa { padding: clamp(96px, 12vw, 180px) 0; overflow: clip; }
.wa__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.phone { position: relative; margin: 0; width: min(100%, 400px); }
.phone__screen { width: 100%; min-height: 560px; background: #efeae2; border: 10px solid var(--ink); border-radius: 36px; padding: 0 14px 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 10px 12px 0 var(--shadow); }
.chat__head { margin: 0 -14px 6px; padding: 18px 18px 14px; background: #f7f7f5; border-radius: 26px 26px 0 0; display: flex; flex-direction: column; color: var(--ink); line-height: 1.3; }
.chat__head span { font-size: 13px; color: var(--ink-3); }
.msg { position: relative; max-width: 82%; padding: 10px 12px 22px; border-radius: 10px; background: var(--paper); font-size: 15px; line-height: 1.45; }
.msg p { color: var(--ink); }
.msg--out { align-self: flex-end; background: var(--wa); }
.msg .time { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: var(--ink-3); }
.msg--doc { padding: 14px 14px 26px; min-width: 76%; }
.doc__name { font-weight: 600; }
.doc__meta { font-size: 13px; color: var(--ink-3) !important; }
.doc__total { font-size: 24px; font-weight: 700; margin: 8px 0 10px; background: var(--accent); display: inline-block; padding: 0 6px; }
.doc__pay { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--line); margin: 4px -14px 0; font-weight: 600; font-size: 14px; color: #1a5fb4; }
.msg--ok p { font-weight: 600; }
.tag { position: absolute; left: calc(100% + var(--reach, 0px)); top: 50%; transform: translateY(-50%); width: max-content; font-size: var(--t-small); font-weight: 500; line-height: 1.3; padding: 7px 10px; background: var(--ink); color: var(--paper); border-radius: var(--r-s); max-width: 230px; }
.tag::before { content: ""; position: absolute; right: 100%; top: 50%; width: calc(var(--reach, 0px) - 8px); border-top: 1.5px solid var(--ink); }
.doc__name, .doc__total { position: relative; }

/* 4 · Planes */
.plans { padding: clamp(96px, 12vw, 180px) 0; background: var(--paper); }
.plans h2 { max-width: 15em; margin-bottom: 56px; }
.table-scroll { overflow-x: auto; }
.compare { width: 100%; min-width: 640px; border-collapse: collapse; font-size: var(--t-body); }
.compare th, .compare td { text-align: left; padding: 18px 20px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-size: var(--t-h3); font-weight: 700; letter-spacing: -.02em; border-bottom: 2px solid var(--ink); }
.compare thead th:first-child { font-size: var(--t-small); font-weight: 500; color: var(--ink-3); vertical-align: bottom; }
.compare tbody th { font-weight: 500; color: var(--ink-2); width: 32%; }
.compare tbody tr:first-child td { font-size: var(--t-h3); font-weight: 700; letter-spacing: -.02em; }
.compare td + td, .compare th + td, .compare th + th { border-left: 1px solid var(--line); }
.compare .is-rec { background: #fbf6cf; }
.note { max-width: 70ch; margin-top: 24px; font-size: var(--t-small); color: var(--ink-3); }

/* 5 · Calculadora */
.book { padding: clamp(96px, 10vw, 160px) 0; }
.book__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.form .lead { margin-bottom: 40px; }
fieldset { border: 0; padding: 0; margin: 0 0 28px; }
legend { font-size: var(--t-small); font-weight: 500; color: var(--ink-2); margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: var(--r-s); border: 1px solid var(--line-solid); background: var(--paper); cursor: pointer; font-weight: 500; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.field-row { display: grid; gap: 10px; font-size: var(--t-small); font-weight: 500; color: var(--ink-2); margin-bottom: 28px; }
.field-row output { font-size: var(--t-h3); font-weight: 700; color: var(--ink); }
.field-row input:not([type="range"]) { min-height: 50px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--line-solid); background: var(--paper); font-size: var(--t-body); color: var(--ink); caret-color: var(--ink); }
.field-row input::placeholder { color: var(--ink-3); opacity: 1; }
.field-row input[type="range"] { width: 100%; min-height: 44px; }
.err { color: #9c2c12; min-height: 1.6em; font-size: var(--t-small); font-weight: 500; }
.ticket { position: sticky; top: 96px; padding: 32px; background: var(--paper); box-shadow: 8px 10px 0 var(--shadow); }
.ticket__h { font-size: var(--t-small); color: var(--ink-3); }
.ticket__plan { font-size: var(--t-h2); font-weight: 700; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; margin-top: 6px; }
.ticket__price { font-size: var(--t-h3); font-weight: 600; color: var(--ink); margin: 6px 0 14px; }
.ticket__why { margin-bottom: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.ticket .btn { width: 100%; white-space: normal; text-align: center; }
.ticket__fine { margin-top: 14px; font-size: var(--t-small); color: var(--ink-3); }

/* FAQ y pie */
.faq { padding: clamp(96px, 10vw, 160px) 0; background: var(--surface); }
.faq__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); }
details { border-top: 1px solid var(--line); padding: 20px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-size: var(--t-lead); font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; min-height: 44px; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-weight: 400; color: var(--ink-3); }
details[open] summary::after { content: "−"; }
details p { margin-top: 10px; max-width: 40em; }
.foot { background: var(--ink); color: var(--paper); padding: 72px 0 40px; }
.foot p { color: #c7d0d9; }
.foot__in { display: grid; gap: 28px; }
.foot__mark { font-size: clamp(72px, 15vw, 210px); font-weight: 700; letter-spacing: -.06em; line-height: .85; color: var(--paper) !important; }
.foot__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; font-size: var(--t-small); }

@media (max-width: 960px) {
  .hero__grid, .process__grid, .book__grid, .wa__grid, .faq__grid { grid-template-columns: minmax(0, 1fr); }
  .hero { min-height: auto; padding-top: 32px; }
  .stage--hero { height: min(60vh, 600px); }
  .process__grid { min-height: auto; padding: 96px var(--gutter); gap: 0; }
  .stage--process { height: min(46vh, 460px); position: sticky; top: 68px; background: var(--surface); z-index: 1; padding-bottom: 8px; }
  .steps { min-height: 0; }
  .step { padding: 60px 0 220px; }
  .step:last-child { padding-bottom: 100px; }
  .phone { padding-right: 0; }
  .phone__screen { margin: 0 auto; }
  .tag { display: none; }
  .ticket { position: static; }
  .foot__cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .nav__links { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; }
  .nav__links.is-open { display: flex; }
  .nav__links a { min-height: 48px; display: flex; align-items: center; }
  .nav__toggle { display: inline-flex; align-items: center; }
  .nav__cta { display: none; }
  .hero__copy { display: contents; }
  .hero__grid { row-gap: 0; }
  .stage--hero { order: 1; height: min(52vh, 460px); margin-top: 4px; }
  .facts { order: 2; margin-top: 24px; grid-template-columns: minmax(0, 1fr); }
  .facts > div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 12px 0; }
  .actions { margin: 28px 0 16px; }
  .phone__screen { min-height: 560px; }
}
