:root {
  color-scheme: light;
  --bg: #F6FAFC;
  --tinta: #0F1B2D;
  --marino: #1F2A44;
  --amarillo: #FFC933;
  --amarillo-suave: #FFF1C2;
  --esmeralda: #0A7F58;
  --esmeralda-suave: #DDF5EA;
  --rojo: #B42318;
  --rojo-suave: #FDE7E4;
  --borde: #D5E0E9;
  --suave: #475569;
  --blanco: #FFFFFF;
  --ancho: 1680px;
  --titulo: "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;
  --texto: "Plus Jakarta Sans", system-ui, "Segoe UI", Roboto, sans-serif;
  --mano: "Caveat", "Segoe Print", cursive;
  --alto-barra: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tinta); font-family: var(--texto); font-size: 1.0625rem; line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--marino); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - clamp(2rem, 5vw, 6rem), var(--ancho)); margin-inline: auto; }
.saltar { position: absolute; left: -999px; top: 0; background: var(--marino); color: #fff; padding: .6rem 1rem; z-index: 20; }
.saltar:focus { left: 1rem; top: 1rem; }

/* ---- Barra ---- */
.barra { background: var(--bg); border-bottom: 1px solid var(--borde); }
.barra__fila { display: flex; align-items: center; gap: 1.5rem; min-height: 72px; }
.marca { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.marca__icono { border-radius: 11px; }
.marca__nombre { font-family: var(--titulo); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }
.barra__marca { margin-left: auto; text-decoration: none; font-weight: 600; color: var(--suave); }
.barra__marca:hover { color: var(--tinta); text-decoration: underline; text-underline-offset: 6px; }

/* ---- Botones ---- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: .7rem 1.6rem;
  border-radius: 14px; border: 2px solid transparent; font-family: var(--texto); font-weight: 700; font-size: 1.0625rem;
  text-decoration: none; line-height: 1.2; white-space: nowrap; transition: transform .12s ease, background-color .12s ease;
}
.boton:hover { transform: translateY(-2px); }
.boton--amarillo { background: var(--amarillo); color: var(--marino); }
.boton--amarillo:hover { background: #FFD65C; }
.boton--oscuro { background: var(--marino); color: #fff; }
.boton--oscuro:hover { background: #2B3A5E; }
.boton--borde { border-color: var(--marino); color: var(--marino); background: transparent; }
.boton--borde:hover { background: rgba(31, 42, 68, .07); }
.boton--borde-oscuro { border-color: var(--marino); color: var(--marino); background: transparent; }
.boton--borde-oscuro:hover { background: rgba(31, 42, 68, .1); }
.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1rem; }

/* ---- Tipografía de títulos ---- */
h1, h2 { font-family: var(--titulo); font-weight: 800; letter-spacing: -.035em; line-height: 1.04; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.2vw, 5rem); }
h2 { font-size: clamp(1.9rem, 4.2vw, 3.6rem); }
h3 { font-family: var(--titulo); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.bajada { font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.55; color: var(--suave); max-width: 40em; }
.pista { font-size: .98rem; color: var(--suave); font-weight: 600; }

/* =====================================================
   Historia: pantallas 1 y 2 (caos que se ordena)
   Sin JS o con "reducir movimiento": queda quieta y apilada.
   ===================================================== */
.historia__fijo { display: grid; gap: 2rem; padding-block: 2.5rem 3rem; width: min(100% - clamp(2rem, 5vw, 6rem), var(--ancho)); margin-inline: auto; }
.historia__texto { display: grid; gap: 2.25rem; align-content: center; }
.texto { display: grid; gap: 1.5rem; align-content: start; }

.escenario {
  position: relative; overflow: hidden; isolation: isolate; container-type: size;
  background: var(--amarillo); border-radius: 32px; height: 620px;
  display: grid; place-items: center;
}
.escenario__ruta { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }

/* Teléfono: todo su contenido escala con su ancho (unidades cqw). */
.telefono {
  --tw: min(44cqh, 82cqw);
  width: var(--tw); height: 90cqh; container-type: inline-size;
  background: var(--tinta); border-radius: calc(var(--tw) * .12); padding: calc(var(--tw) * .03);
  box-shadow: 0 30px 60px -22px rgba(15, 27, 45, .55);
}
.tel { position: relative; height: 100%; background: var(--bg); border-radius: 9.5cqw; overflow: hidden; font-size: 5.1cqw; line-height: 1.3; }
.capa { position: absolute; inset: 0; padding: 7cqw 6cqw 5cqw; display: grid; gap: 3.4cqw; align-content: start; opacity: 0; transition: opacity .35s ease; }
.tel__titulo { font-family: var(--titulo); font-weight: 800; font-size: 1.45em; letter-spacing: -.02em; line-height: 1.1; }
.tel__sub { color: var(--suave); font-weight: 600; font-size: .9em; }
.tel__fila-titulo { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; }

[data-capa="vacio"] .capa--vacio,
[data-capa="ficha"] .capa--ficha,
[data-capa="ruta"] .capa--ruta { opacity: 1; }

.esqueleto { height: 11cqw; border-radius: 3.5cqw; background: var(--borde); opacity: .65; }

.campos { display: grid; gap: 2.4cqw; }
.campo { background: var(--blanco); border: 1px solid var(--borde); border-radius: 3.5cqw; padding: 2.4cqw 3.4cqw; display: grid; gap: .1em; }
.campo dt { font-size: .74em; color: var(--suave); font-weight: 600; }
.campo dd { font-weight: 700; }
.guardada { justify-self: start; background: var(--esmeralda-suave); color: var(--esmeralda); font-weight: 700; padding: 1.6cqw 4cqw; border-radius: 999px; font-size: .9em; }

.paradas { display: grid; gap: 2.6cqw; }
.paradas li { display: grid; grid-template-columns: 4.2em 1fr; gap: 2.5cqw; align-items: center; background: var(--blanco); border: 1px solid var(--borde); border-radius: 3.6cqw; padding: 3cqw 3.4cqw; font-weight: 700; }
.hora { font-family: var(--titulo); font-weight: 700; color: var(--marino); }
.lista { background: var(--esmeralda-suave); color: var(--esmeralda); font-weight: 700; font-size: .8em; padding: .8cqw 3.4cqw; border-radius: 999px; }

/* Elementos que aparecen por etapas al bajar */
[data-desde] { opacity: 0; transform: translateY(1.6cqw); transition: opacity .3s ease, transform .3s ease; }
[data-desde].visible { opacity: 1; transform: none; }

/* Lo que hoy usan (se pierden dentro del celular al bajar) */
.pieza { position: absolute; z-index: 2; will-change: transform, opacity; display: none; }
.manuscrito { font-family: var(--mano); font-weight: 700; font-size: clamp(1rem, 3.1cqw, 1.7rem); line-height: 1.15; color: #26324d; }
.tachado { text-decoration: line-through; opacity: .6; }

.pieza--cuaderno {
  left: 3%; top: 5%; width: clamp(130px, 33cqw, 290px); padding: 1.2em 1em 1em 1.8em; background: #FFFEF6; border-radius: 6px 14px 14px 6px;
  box-shadow: 0 10px 24px -10px rgba(15, 27, 45, .45); border-left: 8px solid #C8503C;
  background-image: repeating-linear-gradient(transparent 0, transparent 1.3em, #BBD3EA 1.3em, #BBD3EA calc(1.3em + 1px));
  background-position: 0 .6em;
}
.pieza--chat { left: 4%; bottom: 5%; width: clamp(140px, 36cqw, 300px); background: #E7DED2; border-radius: 16px; padding: .7em; display: grid; gap: .4em; box-shadow: 0 10px 24px -10px rgba(15, 27, 45, .45); font-size: clamp(.72rem, 2.1cqw, 1rem); }
.chat__cab { font-weight: 700; font-size: .9em; color: #3B4A3F; }
.burbuja-chat { background: var(--blanco); border-radius: 10px 10px 10px 2px; padding: .35em .6em; max-width: 90%; line-height: 1.25; }
.burbuja-chat--yo { background: #D6F5C8; justify-self: end; border-radius: 10px 10px 2px 10px; }
.pieza--papel { right: 3%; top: 7%; width: clamp(130px, 31cqw, 270px); padding: .9em 1em; background: #FFFFFF; transform-origin: center; box-shadow: 0 10px 24px -10px rgba(15, 27, 45, .45); clip-path: polygon(0 3%, 6% 0, 14% 3%, 24% 0, 36% 3%, 50% 0, 62% 3%, 76% 0, 88% 3%, 100% 0, 100% 100%, 0 100%); }
.pieza--nota { right: 5%; top: 52%; width: clamp(96px, 22cqw, 190px); padding: 1em; background: #FFE066; box-shadow: 0 10px 24px -10px rgba(15, 27, 45, .5); }
.pieza--duda { left: 46%; bottom: 3%; max-width: 40cqw; background: var(--blanco); border-radius: 999px; padding: .6em 1.2em; font-family: var(--titulo); font-weight: 700; font-size: clamp(.8rem, 2.4cqw, 1.2rem); line-height: 1.2; box-shadow: 0 10px 24px -10px rgba(15, 27, 45, .45); text-align: center; }

/* Modo quieto (sin JS o con "reducir movimiento"): ruta ya armada, sin papeles */
.historia:not(.historia--viva) .capa--ruta { opacity: 1; }
.historia:not(.historia--viva) [data-desde] { opacity: 1; transform: none; }

/* Modo vivo: la escena se queda fija mientras se baja */
.historia--viva { height: 380vh; position: relative; }
.historia--viva .historia__fijo {
  position: sticky; top: 0; height: 100svh; padding-top: 1.25rem; padding-bottom: calc(1.25rem + var(--alto-barra)); align-items: center; grid-template-rows: minmax(0, 1fr);
}
.historia--viva .escenario { height: min(100%, 800px); }
.historia--viva .pieza { display: block; }
.historia--viva .historia__texto { display: grid; }
.historia--viva .texto { grid-area: 1 / 1; transition: opacity .4s ease, transform .4s ease; }
.historia--viva[data-fase="1"] .texto-2,
.historia--viva[data-fase="2"] .texto-1 { opacity: 0; visibility: hidden; transform: translateY(14px); }

/* =====================================================
   Pantalla 3: tres respuestas
   ===================================================== */
.respuestas { padding-block: clamp(3rem, 7vw, 6rem); }
.respuestas__cabeza { display: grid; gap: .7rem; margin-bottom: clamp(1.75rem, 3vw, 2.75rem); }
.respuestas__cabeza p { color: var(--suave); font-size: 1.2rem; }
.respuestas__rejilla { display: grid; gap: 1.1rem; }
.respuesta { border-radius: 28px; padding: clamp(1.4rem, 2.4vw, 2.2rem); display: grid; gap: 1rem; align-content: start; }
.respuesta__texto { max-width: 36em; opacity: .9; }
.respuesta--hoy { background: var(--amarillo-suave); }
.respuesta--pagos { background: var(--blanco); border: 1px solid var(--borde); }
.respuesta--ganas { background: var(--esmeralda-suave); }

.mini { position: relative; background: var(--bg); border: 1px solid var(--borde); border-radius: 20px; padding: 1.1rem 1.2rem; display: grid; gap: .8rem; font-size: 1rem; min-height: 290px; align-content: start; }
.mini__titulo { display: flex; justify-content: space-between; align-items: center; font-family: var(--titulo); font-weight: 800; font-size: 1.2rem; }
.mini__ejemplo { font-family: var(--texto); font-size: .76rem; font-weight: 600; background: var(--amarillo-suave); padding: .15rem .6rem; border-radius: 999px; }
.mini__lista { display: grid; gap: .5rem; }
.mini__lista li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; background: var(--blanco); border: 1px solid var(--borde); border-radius: 12px; padding: .65rem .85rem; font-weight: 600; transition: background-color .3s ease, border-color .3s ease; }
.mini__lista li > .mini__nombre { font-weight: 700; }
.mini__estado { font-size: .85rem; font-weight: 700; padding: .2rem .7rem; border-radius: 999px; background: var(--borde); color: var(--suave); transition: background-color .3s ease, color .3s ease; }
.mini__total { font-weight: 700; min-height: 1.6em; }

/* Escena 1: ruta de hoy */
.mini__lista li.ahora { border-color: var(--marino); background: var(--amarillo-suave); }
.mini__lista li.ahora .mini__estado { background: var(--amarillo); color: var(--marino); }
.mini__lista li.hecho .mini__estado { background: var(--esmeralda-suave); color: var(--esmeralda); }
.wa { background: var(--esmeralda-suave); border: 1px solid #A9DFC6; border-radius: 14px 14px 14px 3px; padding: .65rem .85rem; font-size: .95rem; min-height: 3.4rem; opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; }
.wa.on { opacity: 1; transform: none; }

/* Escena 2: pagos */
.respuesta--pagos .mini__lista li { grid-template-columns: 1fr auto; }
.mini__lista li[data-estado="pago"] .mini__estado { background: var(--esmeralda-suave); color: var(--esmeralda); }
.mini__lista li[data-estado="debe"] { border-color: #F2B8B2; }
.mini__lista li[data-estado="debe"] .mini__estado { background: var(--rojo-suave); color: var(--rojo); }
.dedo { position: absolute; left: 70%; top: 70%; width: 30px; height: 30px; border-radius: 50%; background: rgba(31, 42, 68, .85); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); transition: top .6s ease, left .6s ease, opacity .3s ease; opacity: 0; pointer-events: none; z-index: 3; }
.dedo.ver { opacity: 1; }
.dedo.toque { animation: toque .45s ease; }
@keyframes toque { 50% { transform: scale(.7); box-shadow: 0 0 0 14px rgba(31, 42, 68, .18); } }

/* Escena 3: ganancias */
.cifras { display: grid; gap: .55rem; }
.cifras div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--borde); }
.cifras dt { color: var(--suave); font-weight: 600; }
.cifras dd { font-family: var(--titulo); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }
.cifras__util { border-bottom: 0 !important; }
.cifras__util dt { color: var(--tinta); font-weight: 700; }
.cifras__util dd { color: var(--esmeralda); font-size: 2.1rem; }
.barra-util { height: 12px; border-radius: 999px; background: var(--borde); overflow: hidden; }
.barra-util span { display: block; height: 100%; width: 0; background: var(--esmeralda); border-radius: 999px; transition: width 1.2s ease; }

/* =====================================================
   Pantalla 4: cierre
   ===================================================== */
.cierre { background: var(--amarillo); padding-block: clamp(3rem, 7vw, 6rem); }
.cierre__rejilla { display: grid; gap: 2.25rem; align-items: center; }
.cierre__texto { display: grid; gap: 1.25rem; }
.cierre__bajada { font-size: 1.3rem; font-weight: 600; }
.cierre__precio { font-size: 1.25rem; font-weight: 600; }
.cierre__precio strong { font-family: var(--titulo); font-size: 2rem; letter-spacing: -.02em; }
.cierre__correo { font-weight: 700; color: var(--marino); }
.cierre__lista { display: grid; gap: 1rem; }
.cierre__lista li { background: rgba(255, 255, 255, .62); border-radius: 22px; padding: clamp(1.3rem, 2.2vw, 2rem) clamp(1.35rem, 2.3vw, 2.1rem); font-size: clamp(1.05rem, 1.35vw, 1.3rem); line-height: 1.5; display: grid; align-content: center; }
.cierre__lista strong { display: block; font-family: var(--titulo); font-size: 1.2em; letter-spacing: -.01em; margin-bottom: .3em; }

/* ---- Pie ---- */
.pie { padding-block: 1.75rem; }
.pie__fila { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.pie p { color: var(--suave); font-size: .95rem; }

/* =====================================================
   Pantallas anchas
   ===================================================== */
@media (min-width: 960px) {
  .historia__fijo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 4vw, 5rem); }
  .escenario { height: clamp(560px, 78vh, 800px); }
  .respuestas__rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cierre__rejilla { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(2rem, 4vw, 5rem); }
  .cierre__lista { grid-template-columns: 1fr 1fr; }
}

/* =====================================================
   Celular: texto arriba, escena abajo, una columna
   ===================================================== */
@media (max-width: 959px) {
  .historia--viva .historia__fijo { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: .9rem; padding-top: .9rem; padding-bottom: calc(.9rem + var(--alto-barra)); }
  .historia--viva .escenario { height: 100%; border-radius: 24px; }
  .historia--viva h1 { font-size: clamp(1.7rem, 7.4vw, 2.4rem); }
  .historia--viva h2 { font-size: clamp(1.5rem, 6.6vw, 2.2rem); }
  .historia--viva .texto { gap: .8rem; }
  .historia--viva .bajada { font-size: 1rem; line-height: 1.4; }
  .historia--viva .texto-1 .bajada { display: none; }
  .historia--viva .acciones { gap: .6rem; }
  .historia--viva .acciones .boton { min-height: 46px; padding-inline: 1.1rem; font-size: 1rem; }
  .historia--viva .pista { font-size: .88rem; }
}
@media (max-width: 640px) {
  :root { --alto-barra: 64px; }
  .barra__fila { min-height: 64px; gap: 1rem; }
  .barra__fila > .boton { min-height: 44px; padding-inline: 1rem; font-size: .95rem; }
  .barra__marca { display: none; }
  .barra__fila > .boton { margin-left: auto; }
  .acciones .boton { flex: 1 1 100%; }
  .historia--viva .acciones .boton { flex: 1 1 auto; }
  .mini { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boton, .barra-util span, .capa, [data-desde], .wa, .dedo { transition: none; }
  .boton:hover { transform: none; }
}


/* =====================================================
   Mapa de la ruta: se conecta con Google Maps (pantalla 2)
   ===================================================== */
.mapa { margin: .6rem 0 0; display: grid; gap: .9rem; max-width: 34rem; }
.mapa__svg { display: block; width: 100%; height: auto; max-height: 31svh; border-radius: 20px; box-shadow: 0 18px 40px -22px rgba(15, 27, 45, .55), 0 0 0 1px var(--borde); }
.mapa__pie { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; }
.mapa__boton { display: inline-flex; align-items: center; gap: .45rem; background: var(--marino); color: #fff; font-weight: 700; padding: .55rem 1.1rem; border-radius: 12px; white-space: nowrap; }
.mapa__texto { color: var(--suave); font-size: 1rem; line-height: 1.4; max-width: 24rem; }
/* Las partes del mapa aparecen con el scroll, sin desplazarse (el ancho del celular no aplica aquí). */
.mapa [data-desde], .mapa[data-desde] { transform: none; }
.mapa__ruta path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s ease; }
.mapa__ruta.visible path { stroke-dashoffset: 0; }
.historia:not(.historia--viva) .mapa__ruta path { stroke-dashoffset: 0; }

/* Botón de Google Maps dentro de la pantalla de ruta del celular */
.tel__maps { display: flex; align-items: center; justify-content: center; gap: 2cqw; justify-self: stretch; margin-top: 1cqw; padding: 2.6cqw 3cqw; border-radius: 3.4cqw; background: var(--marino); color: #fff; font-weight: 800; font-size: .92em; }
.tel__maps svg { width: 1.2em; height: 1.2em; flex: none; }

/* Cada texto se centra por su cuenta: el segundo es más alto por el mapa. */
.historia--viva .texto { align-self: center; }
/* En celular y en pantallas bajas no hay espacio para el mapa de la izquierda: queda el botón dentro del celular. */
@media (max-width: 959px), (max-height: 660px) {
  .historia--viva .mapa { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mapa__ruta path { transition: none; }
}
