/* Landing de Cuponcito. Tipografías de /ui.css; los colores son los de la paleta de acá abajo.
   La página es una historia por capítulos (.cap). Cada uno tiene un panel de texto (.txt) y un hueco (.arte).
   Con 3D (html.con3d), una escena three.js fija detrás del contenido para un objeto en cada hueco (landing-3d.js).
   Sin 3D, sin JS o con "reducir movimiento", cada hueco muestra su dibujo en CSS. Todo el contenido se lee igual. */

/* ---------- Paleta: azul sobre blanco, con amarillo de resaltado (elegida el 2026-11-29). --acc: relleno de los botones.
   --acc-txt: el acento usado como texto (contraste 4.5:1 o más sobre el fondo). --toque: resaltado, solo decorativo. ---------- */
html:has(body.landing) { color-scheme: light; }
.landing {
  color-scheme: light;
  --bg: #f4f7fc; --panel: #ffffff; --panel-2: #eaf0fa; --hundido: #e3e9f4; --line: rgba(15, 32, 56, .10); --line-2: rgba(15, 32, 56, .22);
  --fg: #0f2038; --dim: #4a5b74; --acc: #1d5bd8; --acc-hi: #3b78f0; --acc-lo: #1546ad; --acc-ink: #ffffff; --acc-txt: #1a50c2; --toque: #ffd24a;
  --ok: #0b7a43; --warn: #8a5a00; --mal: #b3261e;
  --sombra: 0 1px 2px color-mix(in srgb, var(--fg) 8%, transparent), 0 14px 34px color-mix(in srgb, var(--fg) 9%, transparent);
  --suave: cubic-bezier(.05, .7, .1, 1); --rebote: cubic-bezier(.34, 1.56, .64, 1);
  overflow-x: hidden;
  /* El fondo cambia de color con el capítulo que se está leyendo (landing.js pone --fondo). */
  background: var(--fondo, var(--bg)); transition: background-color .7s ease;
}
body.landing::before { content: none; }
.landing a:not(.btn):not(.marca) { color: var(--acc-txt); }
.landing .rotulo.oro { color: var(--acc-txt); }
.landing button, .landing a.btn {
  position: relative; overflow: hidden; background: var(--acc);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 8px 20px color-mix(in srgb, var(--acc) 28%, transparent);
  transition: transform .16s var(--rebote), background .2s, border-color .2s;
}
.landing button:hover, .landing a.btn:hover { filter: none; background: var(--acc-lo); }
.landing button:active:not([disabled]), .landing a.btn:active { transform: scale(.955); }
.landing button.sec, .landing a.btn.sec { box-shadow: none; background: var(--panel); }
.landing button.sec:hover, .landing a.btn.sec:hover { background: var(--panel-2); }
.landing button:focus-visible, .landing a:focus-visible { outline-color: var(--acc-txt); }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
a.btn.mini { padding: 8px 14px; font-size: .9rem; }
.saltar { position: absolute; left: -999px; top: 8px; z-index: 90; background: var(--acc); color: var(--acc-ink); padding: 8px 12px; border-radius: 8px; }
.saltar:focus { left: 12px; }
/* Onda al tocar un botón (landing.js) */
.onda { position: absolute; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: currentColor; opacity: .32; pointer-events: none; animation: ondaSale .55s var(--suave) forwards; }
@keyframes ondaSale { to { transform: scale(34); opacity: 0; } }

/* La escena: fija, detrás del contenido, sin recibir toques */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s; }
.con3d #gl { opacity: 1; }
.barra, .landing main, .pie { position: relative; z-index: 1; }

/* Barra */
.barra { max-width: 1080px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-left)) 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marca { font: 400 1.55rem/1 var(--f-marca); color: var(--fg); text-decoration: none; letter-spacing: .01em; }
.marca em { font-style: normal; color: var(--acc-txt); }

/* ---------- Capítulos ---------- */
.landing main { max-width: 1080px; margin: 0 auto; padding: 0 max(18px, env(safe-area-inset-left)); }
.cap { min-height: 92svh; display: grid; align-content: center; gap: 18px; padding: 26px 0; }
.arte { order: -1; height: 40svh; min-height: 230px; display: grid; place-items: center; }
.con3d .arte > * { visibility: hidden; }
.arte > * { animation: flota 5s ease-in-out infinite; }
@keyframes flota { 50% { transform: translateY(-10px) rotate(1.5deg); } }
@media (min-width: 860px) {
  .cap { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 44px; align-items: center; min-height: 100svh; }
  .arte { order: 0; height: 70svh; }
  .cap.inv .arte { order: -1; }
}

/* El panel de texto: blanco, con una sombra de color corrida (cada capítulo, la suya) */
.txt { background: var(--panel); border-radius: 28px; padding: clamp(22px, 5vw, 38px); display: grid; gap: 14px; justify-items: start; align-content: start; box-shadow: 10px 10px 0 var(--tinte, var(--toque)), var(--sombra); }
.txt.sin-panel { background: none; box-shadow: none; padding: 0; border-radius: 0; }
.txt h2 { font: 400 clamp(1.9rem, 7vw, 3rem)/1.02 var(--f-marca); letter-spacing: .005em; text-wrap: balance; }
.txt > p { color: var(--dim); font-size: clamp(1.06rem, 3.6vw, 1.2rem); line-height: 1.45; max-width: 32em; }
.cap:nth-of-type(2) { --tinte: #f2b01e; } .cap:nth-of-type(3) { --tinte: #1d5bd8; } .cap:nth-of-type(4) { --tinte: #24a6e0; }
.cap:nth-of-type(5) { --tinte: #8259ff; } .cap:nth-of-type(6) { --tinte: #2f9e62; } .cap:nth-of-type(7) { --tinte: #ffd24a; }
.cap:nth-of-type(8) { --tinte: #e0892a; } .cap:nth-of-type(9) { --tinte: #ffd24a; }
.txt > p.chapa { font: 700 .82rem/1 var(--f-rotulo); letter-spacing: .14em; text-transform: uppercase; color: #fff; background: var(--c); padding: 9px 13px 8px; border-radius: 99px; }
.nota { color: var(--dim); font-size: .88rem; }
.tildes { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 1.06rem; }
.tildes li { padding-left: 30px; position: relative; line-height: 1.4; }
.tildes li::before { content: ""; position: absolute; left: 2px; top: .3em; width: 15px; height: 8px; border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok); transform: rotate(-45deg); }
.pasos { list-style: none; padding: 0; margin: 0; counter-reset: paso; display: grid; gap: 12px; font-size: 1.08rem; }
.pasos li { counter-increment: paso; padding-left: 46px; position: relative; min-height: 34px; display: flex; align-items: center; line-height: 1.35; }
.pasos li::before { content: counter(paso); position: absolute; left: 0; top: 50%; translate: 0 -50%; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--toque); color: var(--fg); font: 400 1.1rem/1 var(--f-marca); }

/* Portada */
.portada { min-height: 0; padding-top: clamp(10px, 4vw, 30px); }
@media (min-width: 860px) { .portada { min-height: 88svh; } }
.portada h1 { font-size: clamp(2.6rem, 10.4vw, 4.6rem); line-height: .98; margin: 4px 0; }
/* El resaltador se dibuja al cargar */
.portada h1 em { font-style: normal; background: linear-gradient(var(--toque), var(--toque)) no-repeat 0 86% / 100% 34%; padding: 0 .06em; margin: 0 -.06em; }
.bajada { font-size: clamp(1.1rem, 3.8vw, 1.3rem) !important; }
.botones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.baja { font: 700 .8rem/1 var(--f-rotulo) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.baja::after { content: ""; width: 9px; height: 9px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); animation: baja 1.4s ease-in-out infinite; }
@keyframes baja { 50% { translate: 0 6px; } }

/* El sobre de prueba, dentro del paso 2 */
.probar { display: grid; gap: 12px; justify-items: start; width: 100%; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.probar-tit { font-weight: 700; font-size: 1.04rem; }
.rubros { display: flex; gap: 8px; flex-wrap: wrap; }
.landing .rubro { background: var(--rubro); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--rubro) 34%, transparent); padding: 10px 18px; min-height: 46px; border-radius: 99px; }
.landing .rubro:hover { background: color-mix(in srgb, var(--rubro) 86%, #000); }
.landing .rubro[disabled] { opacity: .6; }
.resultado { display: grid; gap: 10px; justify-items: start; padding: 16px; border-radius: 16px; border: 2px solid var(--acc); background: var(--panel-2); outline: none; width: 100%; }
.resultado-txt { font: 400 1.4rem/1.15 var(--f-marca); }
.resultado p:not(.resultado-txt) { color: var(--dim); line-height: 1.45; }
/* Papelitos al cerrar el sobre de prueba (landing.js) */
.papelito { position: absolute; left: 50%; top: 40%; width: 9px; height: 14px; border-radius: 2px; background: var(--c); pointer-events: none; z-index: 3; animation: papelito var(--t, 1s) cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes papelito { to { transform: translate(var(--dx), var(--dy)) rotate(var(--giro)); opacity: 0; } }

/* Cierre */
.cierre .txt { box-shadow: 10px 10px 0 var(--toque), 0 24px 50px rgba(0, 0, 0, .25); }
.cierre .arte { height: 30svh; min-height: 190px; }
@media (min-width: 860px) { .cierre .arte { height: 60svh; } }
.piloto a.btn[aria-disabled="true"], .cierre a.btn[aria-disabled="true"] { opacity: .7; border-style: dashed; cursor: default; }
.faq { width: 100%; }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq details:first-of-type { border-top: 1px solid var(--line-2); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 34px 14px 0; font-weight: 600; font-size: 1.04rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; translate: 0 -50%; font: 400 1.6rem/1 var(--f-texto); color: var(--acc-txt); transition: rotate .3s var(--rebote); }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { color: var(--dim); padding: 0 0 14px; line-height: 1.5; }
.casos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); width: 100%; }
.caso { background: var(--panel-2); border-radius: 16px; padding: 14px; display: grid; gap: 6px; }
.caso blockquote { margin: 0; line-height: 1.45; }
.caso .dato { font: 700 1.4rem/1 var(--f-rotulo); color: var(--acc-txt); }
.pie { background: var(--panel); padding: 26px 18px max(30px, env(safe-area-inset-bottom)); display: grid; gap: 10px; justify-items: center; text-align: center; color: var(--dim); font-size: .92rem; }
@media (max-width: 859px) { .landing .pie { padding-bottom: 96px; } }

/* Pedido de piloto siempre a mano en celular (landing.js lo muestra entre la portada y el cierre) */
.landing a.btn.fijo { position: fixed; left: 14px; right: 14px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 40; min-height: 50px; box-shadow: 0 10px 28px color-mix(in srgb, var(--fg) 30%, transparent); transition: transform .35s var(--suave), opacity .25s, background .2s; }
.landing a.btn.fijo.fuera { transform: translateY(140%); opacity: 0; pointer-events: none; }
@media (min-width: 860px) { .landing a.btn.fijo { display: none; } }

/* ---------- Dibujos en CSS: lo que se ve en cada hueco cuando no hay 3D ---------- */
.d-sobre { position: relative; width: 150px; aspect-ratio: 3 / 4; border-radius: 12px; background: linear-gradient(160deg, #3b78f0, #1546ad); color: #fff; display: grid; align-content: center; justify-items: center; gap: 10px; box-shadow: 0 20px 36px rgba(21, 70, 173, .35); }
.d-sobre b { width: 64px; height: 64px; border-radius: 50%; background: var(--toque); color: var(--fg); display: grid; place-items: center; font: 400 2.4rem/1 var(--f-marca); }
.d-sobre > span:last-child { font: 700 .66rem/1 var(--f-rotulo); letter-spacing: .14em; text-transform: uppercase; }
.d-tira { position: absolute; left: 0; right: 0; top: 0; height: 15%; background: var(--toque); border-radius: 12px 12px 0 0; border-bottom: 2px dashed rgba(15, 32, 56, .4); }
.d-sobre.abierto .d-tira { transform: translateX(46%) rotate(14deg); }
.d-sellos { width: min(84vw, 300px); background: #f6ecd6; border: 1px dashed #b9a680; border-radius: 14px; padding: 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; box-shadow: var(--sombra); }
.d-sellos i { aspect-ratio: 1; border-radius: 50%; border: 3px solid #b3261e; opacity: .85; }
.d-sellos i:nth-child(n+7) { border: 1.5px dashed #b9a680; opacity: 1; }
.d-tel { width: 118px; aspect-ratio: 9 / 16; border-radius: 22px; background: #0b0908; padding: 7px; display: grid; box-shadow: 0 20px 36px rgba(15, 32, 56, .3); }
.d-tel span { align-self: center; margin: 0 6px; background: #d6aa4e; color: #1c1405; font-weight: 700; font-size: .78rem; text-align: center; padding: 10px 4px; border-radius: 10px; }
.d-carta { width: 150px; aspect-ratio: 5 / 7; border-radius: 14px; background: #fffaf0; border: 5px solid var(--toque); color: var(--fg); padding: 12px; display: grid; align-content: space-between; box-shadow: 0 20px 36px rgba(15, 32, 56, .25); }
.d-carta span { font: 700 .66rem/1 var(--f-rotulo); letter-spacing: .14em; text-transform: uppercase; }
.d-carta b { font: 400 1.6rem/1 var(--f-marca); }
.d-carta i { font-style: normal; font-size: .8rem; color: var(--dim); }
.d-carta.blindada { outline: 3px solid var(--toque); outline-offset: 12px; }
.d-carta.blindada b { font: 600 1.1rem ui-monospace, Consolas, monospace; }
/* El llavero real: cupón de 50 x 30 mm, mostaza con el dibujo en carbón, muescas en el corte y el agujero en el talón. */
.d-llavero { position: relative; width: 170px; aspect-ratio: 5 / 3; border-radius: 12px; display: grid; place-items: center; padding-left: 42px; color: #3d3d3d; background: #dca336;
  -webkit-mask: radial-gradient(circle at 11.6% 23.7%, #0000 7.5px, #000 8px), radial-gradient(circle at 24.5% 0, #0000 7px, #000 7.5px), radial-gradient(circle at 24.5% 100%, #0000 7px, #000 7.5px);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
.d-llavero::after { content: ""; position: absolute; left: 24.5%; top: 14%; height: 72%; border-left: 3px dashed #3d3d3d; margin-left: -1.5px; }
.d-llavero b { font: 400 1.5rem/1 Impact, "Barlow Condensed", "Arial Narrow", sans-serif; letter-spacing: .01em; }
.d-trio { display: flex; align-items: center; gap: 14px; }
.d-trio > * { scale: .7; }
.d-cartel { width: 104px; aspect-ratio: 3 / 4; border-radius: 12px; background: #fff; border: 4px solid var(--acc); display: grid; place-items: center; font: 700 1.6rem var(--f-rotulo); color: var(--fg); }

/* ---------- Movimiento ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Los paneles entran una vez, al llegar a la pantalla (landing.js agrega .visto). */
  .js .ver { opacity: 0; transform: translateY(34px) rotate(-1.2deg) scale(.96); transition: opacity .5s var(--suave), transform .8s var(--rebote); }
  .js .ver.visto { opacity: 1; transform: none; }
  .js .ver > * { opacity: 0; transform: translateY(14px); transition: opacity .45s var(--suave), transform .55s var(--suave); }
  .js .ver.visto > * { opacity: 1; transform: none; }
  .js .ver.visto > :nth-child(1) { transition-delay: .12s; } .js .ver.visto > :nth-child(2) { transition-delay: .2s; }
  .js .ver.visto > :nth-child(3) { transition-delay: .28s; } .js .ver.visto > :nth-child(n+4) { transition-delay: .36s; }
  .resultado:not([hidden]) { animation: entraResultado .5s var(--rebote) both; }
  @keyframes entraResultado { from { opacity: 0; transform: scale(.94); } }
  .portada h1 em { animation: resalta .7s var(--suave) .35s both; }
  @keyframes resalta { from { background-size: 0% 34%; } }
  .portada .txt > * { animation: sube .6s var(--suave) both; }
  .portada .txt > :nth-child(2) { animation-delay: .06s; } .portada .txt > :nth-child(3) { animation-delay: .12s; }
  .portada .txt > :nth-child(4) { animation-delay: .18s; } .portada .txt > :nth-child(5) { animation-delay: .3s; }
  @keyframes sube { from { opacity: 0; transform: translateY(18px); } }
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  .arte > *, .baja::after, .onda, .papelito { animation: none !important; }
  .landing, .landing a.btn.fijo { transition: none !important; }
  .onda, .papelito { display: none; }
}
html { scroll-padding-top: 12px; }
/* En celular, la portada muestra primero el texto y después su hueco. */
@media (max-width: 859px) { .portada .arte { order: 0; height: 34svh; } }
