:root {
  --bg: #fffdf7;
  --surface: #ffffff;
  --soft: #fff4cc;
  --ink: #15171c;
  --muted: #5a606b;
  --line: #ece6d6;
  --yellow: #f5b700;
  --yellow-ink: #15171c;
  --accent: #b9471a;
  --chat-bg: #efe7dc;
  --bubble-in: #ffffff;
  --bubble-out: #d9fdd3;
  --radius: 18px;
  --max: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121318;
    --surface: #1b1d24;
    --soft: #2a2412;
    --ink: #f1efe9;
    --muted: #a4a8b2;
    --line: #2c2f38;
    --accent: #f08a5d;
    --chat-bg: #0f1a17;
    --bubble-in: #202c33;
    --bubble-out: #005c4b;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.6 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: 'Archivo', 'Inter', sans-serif; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px; font-weight: 700; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--yellow); color: var(--yellow-ink); box-shadow: 0 6px 0 #c99600; }
.btn-primary:hover { box-shadow: 0 8px 0 #c99600; }
.btn-ghost { border: 2px solid var(--ink); }
.btn svg { width: 22px; height: 22px; flex: none; }

/* Encabezado */
header.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.35rem; text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--yellow); display: grid; place-items: center; }
.logo-mark svg { width: 22px; height: 22px; }
nav.links { display: flex; gap: 22px; align-items: center; font-size: 0.95rem; }
nav.links a { text-decoration: none; color: var(--muted); }
nav.links a:hover { color: var(--ink); }
@media (max-width: 760px) { nav.links .hide-sm { display: none; } }

/* Portada */
.hero { padding: 56px 0 72px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: auto -10% -40% 40%; height: 120%;
  background: radial-gradient(closest-side, var(--soft), transparent); z-index: -1;
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }
.eyebrow { display: inline-block; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--yellow) 62%); }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 34ch; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 18px; }
.trust { display: flex; flex-wrap: wrap; gap: 18px; font-size: 0.92rem; color: var(--muted); padding: 0; margin: 0; list-style: none; }
.trust li::before { content: '✓ '; color: var(--accent); font-weight: 700; }

/* Teléfono con el chat */
.phone {
  width: min(340px, 100%); margin: 0 auto; border-radius: 40px; padding: 12px;
  background: #15171c; box-shadow: 0 30px 60px -20px rgba(0,0,0,.35);
}
.screen { border-radius: 30px; overflow: hidden; background: var(--chat-bg); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #075e54; color: #fff; }
.chat-head .av { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; }
.chat-head .av svg { width: 20px; height: 20px; }
.chat-head b { display: block; font-size: 0.95rem; }
.chat-head small { opacity: .8; font-size: 0.75rem; }
.chat { padding: 14px 12px 18px; display: flex; flex-direction: column; gap: 8px; font-size: 0.86rem; line-height: 1.4; min-height: 430px; }
.b { max-width: 82%; padding: 8px 11px; border-radius: 12px; box-shadow: 0 1px 0 rgba(0,0,0,.08); opacity: 0; transform: translateY(6px); animation: pop .4s ease forwards; }
.b.in { background: var(--bubble-in); align-self: flex-start; border-top-left-radius: 4px; }
.b.out { background: var(--bubble-out); align-self: flex-end; border-top-right-radius: 4px; }
.b .chip { display: block; margin-top: 7px; padding: 6px; text-align: center; border-top: 1px solid var(--line); color: #128c7e; font-weight: 600; }
.b:nth-child(1) { animation-delay: .2s } .b:nth-child(2) { animation-delay: .9s } .b:nth-child(3) { animation-delay: 1.6s }
.b:nth-child(4) { animation-delay: 2.3s } .b:nth-child(5) { animation-delay: 3s } .b:nth-child(6) { animation-delay: 3.7s }
@keyframes pop { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .b { animation: none; opacity: 1; transform: none; } }

/* Secciones */
section { padding: 80px 0; }
section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; padding: 0; margin: 0; list-style: none; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.steps li { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--yellow); color: var(--yellow-ink); font-weight: 800; margin-bottom: 14px;
}
.steps p { color: var(--muted); margin: 0; font-size: 0.97rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Ejemplo de ofertas */
.offers { display: flex; flex-direction: column; gap: 12px; }
.offer { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.offer .who { flex: 1; }
.offer .who b { display: block; }
.offer .who small { color: var(--muted); }
.offer .price { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 1.25rem; }
.offer.best { border-color: var(--yellow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--yellow) 35%, transparent); }
.yours { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--soft); font-weight: 600; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; margin-bottom: 14px; color: var(--accent); }
.feature .ic svg { width: 24px; height: 24px; }
.feature p { color: var(--muted); margin: 0; }

/* Conductores */
.drivers { background: #15171c; color: #f1efe9; border-radius: 28px; padding: 48px; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .drivers { grid-template-columns: 1fr; padding: 32px 22px; } }
.drivers .muted { color: #b7bac2; }
.drivers ul { padding: 0; margin: 0 0 24px; list-style: none; display: grid; gap: 10px; }
.drivers li::before { content: '→ '; color: var(--yellow); font-weight: 800; }
.plan { background: #1f2229; border: 1px solid #343843; border-radius: var(--radius); padding: 28px; text-align: center; }
.plan .amount { font-family: 'Archivo', sans-serif; font-size: 3.4rem; font-weight: 800; color: var(--yellow); line-height: 1; }
.plan .per { color: #b7bac2; margin-bottom: 18px; }
.plan .note { font-size: 0.9rem; color: #b7bac2; margin: 14px 0 0; }

/* Preguntas */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: '+'; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--muted); margin: 12px 0 0; }

.cta-final { text-align: center; }
.cta-final p { max-width: 520px; margin: 0 auto 26px; }

footer { padding: 36px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* Páginas legales */
.legal { max-width: 760px; padding: 48px 20px 80px; margin: 0 auto; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.legal h2 { font-size: 1.35rem; margin-top: 2em; }
.legal li { margin-bottom: 0.4em; }

/* ---------- Scroll: barra de progreso con taxi ---------- */
header.top { position: sticky; }
.road { position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: transparent; pointer-events: none; }
.road-fill { height: 100%; width: calc(var(--p, 0) * 100%); background: var(--yellow); }
.road-car { position: absolute; bottom: -9px; left: calc(var(--p, 0) * (100% - 22px)); width: 22px; height: 22px; color: var(--yellow); filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }

/* ---------- Aparecer al bajar ---------- */
.js .reveal, .js .reveal-item { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in, .js .reveal-item.in { opacity: 1; transform: none; }
.js .features .reveal:nth-child(2) { transition-delay: .12s; }
.js .features .reveal:nth-child(3) { transition-delay: .24s; }
.js .offers .reveal-item:nth-child(2) { transition-delay: .15s; }
.js .offers .reveal-item:nth-child(3) { transition-delay: .3s; }
.js .offers .reveal-item:nth-child(4) { transition-delay: .45s; }

/* Portada con leve paralaje */
.hero .phone { transform: translateY(calc(var(--hero, 0) * -40px)) rotate(calc(var(--hero, 0) * -3deg)); transition: transform .1s linear; }

/* ---------- Historia con teléfono fijo ---------- */
.story { display: grid; grid-template-columns: 1fr 380px; gap: 56px; align-items: start; }
.story-steps { display: flex; flex-direction: column; }
.story-step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; opacity: .3; transition: opacity .4s ease; }
.story-step.active { opacity: 1; }
.story-step h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.story-step p { color: var(--muted); font-size: 1.1rem; max-width: 40ch; }
.step-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); color: var(--yellow-ink); font-weight: 800; margin-bottom: 18px; }
.story-phone { position: sticky; top: calc(50vh - 290px); }
.screens { position: relative; min-height: 470px; }
.screen-step { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
.screen-step .b { animation: none; opacity: 1; transform: none; }
.screen-step.active { opacity: 1; }
.screen-step.active .b { animation: pop .4s ease both; }
.screen-step.active .b:nth-child(1) { animation-delay: .05s } .screen-step.active .b:nth-child(2) { animation-delay: .35s }
.screen-step.active .b:nth-child(3) { animation-delay: .65s } .screen-step.active .b:nth-child(4) { animation-delay: .95s }
.story-dots { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.story-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: width .3s ease, background .3s ease; }
.story-dots i.on { width: 26px; border-radius: 4px; background: var(--yellow); }
.mini-chat { display: none; }

@media (max-width: 900px) {
  .story { grid-template-columns: 1fr; }
  .story-phone { display: none; }
  .story-step { min-height: 0; opacity: 1; padding: 22px 0 34px; border-bottom: 1px solid var(--line); }
  .mini-chat { display: flex; flex-direction: column; gap: 8px; background: var(--chat-bg); border-radius: var(--radius); padding: 14px 12px; font-size: 0.88rem; line-height: 1.4; margin-top: 8px; }
  .mini-chat .b { opacity: 1; transform: none; animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal-item { opacity: 1; transform: none; transition: none; }
  .hero .phone { transform: none; }
  .screen-step.active .b { animation: none; }
}
