/*
  Güalet · portada
  Neutros de la app (80 %), tinta (15 %) y un solo acento: el rojo del punto del ícono (#FF4B33),
  que aparece como degradado tenue y como luz, nunca como bloque. Las escenas avanzan con
  el scroll (inicio.js); con movimiento reducido o el iPhone de lado todo se muestra quieto
  y completo.
*/

@view-transition { navigation: auto; }

:root {
  --lienzo: #F5F5F7;
  --tarjeta: #FFFFFF;
  --tinta: #1D1D1F;
  --gris: #6E6E73;
  --gris-2: #86868B;
  --linea: rgba(0, 0, 0, 0.08);
  --sombra: 0 4px 12px rgba(0, 0, 0, 0.045);

  /* El acento: el rojo del ícono con su durazno y su ladrillo, solo para degradados y luz. Cada tono
     tiene la misma luz que el naranja retro al que reemplazó. */
  --acento: #FF4B33;
  --acento-rgb: 255, 75, 51;
  --durazno: #FFAC8B;
  --durazno-rgb: 255, 172, 139;
  --ladrillo: #C43210;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --sf: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sf-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --redondo: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  /* Con el iPhone de lado, el margen respeta la isla. */
  --margen: max(clamp(20px, 5vw, 64px), env(safe-area-inset-left), env(safe-area-inset-right));
  --barra: 56px;
  /* Dónde empieza el contenido: la barra más la zona de estado cuando la página va de borde a borde
     (iOS 26 Safari). inicio.js la afina midiendo. */
  --arriba: calc(var(--barra) + env(safe-area-inset-top, 0px));
  /* Lo que tapa abajo la barra flotante de Safari en iOS 26. inicio.js la calcula; sin JS, el inset. */
  --reserva-abajo: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --lienzo: #000000;
    --tarjeta: #161618;
    --tinta: #F5F5F7;
    --gris: #98989D;
    --gris-2: #8E8E93;
    --linea: rgba(255, 255, 255, 0.1);
    --sombra: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--arriba); -webkit-text-size-adjust: 100%; }
body {
  background: var(--lienzo);
  color: var(--tinta);
  font-family: var(--sf);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 3px solid rgba(var(--acento-rgb), 0.85); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--sf-display); text-wrap: balance; }
.lede { text-wrap: pretty; }

.saltar {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--tinta); color: var(--lienzo); padding: 10px 16px; border-radius: 999px;
  transition: top 200ms var(--ease-out);
}
.saltar:focus-visible { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Botones ---------- */
.boton {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 28px; border-radius: 999px;
  background: var(--tinta); color: var(--lienzo);
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  transition: transform 160ms var(--ease-out);
}
/* La luz retro detrás del botón: un degradado tenue que crece al pasar el puntero. */
.boton::before {
  content: ""; position: absolute; inset: -10px -14px; z-index: -1; border-radius: 999px;
  background: radial-gradient(60% 80% at 50% 60%, rgba(var(--acento-rgb), 0.45), rgba(var(--acento-rgb), 0) 70%);
  opacity: 0.55; filter: blur(10px);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out);
}
.boton:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .boton:hover::before { opacity: 1; transform: scale(1.08); }
}
.boton--chico { height: 36px; padding: 0 16px; font-size: 14px; flex: none; }
.boton--chico::before { inset: -6px -8px; opacity: 0.35; }
.boton--grande { height: 60px; padding: 0 36px; font-size: 19px; }
.enlace { font-size: 17px; font-weight: 500; color: var(--tinta); padding: 12px 6px; border-radius: 999px; }
.enlace::after {
  content: ""; display: block; height: 1.5px; margin-top: 2px; border-radius: 1px;
  background: linear-gradient(90deg, var(--durazno), var(--acento));
  transform: scaleX(0.35); transform-origin: 0 50%; opacity: 0.8;
  transition: transform 260ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .enlace:hover::after { transform: scaleX(1); } }

/* ---------- Escenas fijas ---------- */
.escena { position: relative; }
.escena__escenario {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  /* clip, no hidden: un contenedor hidden se puede desplazar por dentro (al enfocar con Tab o
     al llevar algo a la vista) y la escena se queda corrida. clip recorta igual sin desplazarse. */
  overflow: hidden; overflow: clip;
}
.relato { height: 720vh; }
.dicho { height: 250vh; }
.cuentas { height: 400vh; }
/* «Cómo funciona» lleva al momento en que el teléfono ya se alejó. */
.ancla { position: absolute; left: 0; top: 100vh; width: 1px; height: 1px; pointer-events: none; }

/* ---------- Bandas retro ---------- */
.bandas { position: absolute; inset: auto 0 0; height: 58%; pointer-events: none; opacity: 0.42; will-change: transform, opacity; }
.bandas svg { width: 100%; height: 100%; }
.bandas::after {
  /* El lienzo se come la parte alta de las bandas: el texto siempre queda limpio. */
  content: ""; position: absolute; inset: 0 0 auto; height: 62%;
  background: linear-gradient(var(--lienzo) 18%, color-mix(in srgb, var(--lienzo) 0%, transparent));
}
.bandas path { transform-box: fill-box; transform-origin: 50% 100%; }
/* El grano: una textura fija encima de las bandas, recortada a la banda de afuera. Antes era un
   filtro de SVG (feTurbulence) y Safari lo recalculaba entero en cada cambio: congelaba la página. */
.bandas { isolation: isolate; }
.bandas svg { position: absolute; inset: 0; z-index: 0; }
.bandas::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: url(../Assets/grano.png) 0 0 / 80px 80px repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 900' preserveAspectRatio='xMidYMax slice'%3E%3Cpath d='M20 930C20 533.2 302 290 693 290C1030 290 1420 533.2 1420 930Z'/%3E%3C/svg%3E") center bottom / cover no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 900' preserveAspectRatio='xMidYMax slice'%3E%3Cpath d='M20 930C20 533.2 302 290 693 290C1030 290 1420 533.2 1420 930Z'/%3E%3C/svg%3E") center bottom / cover no-repeat;
  opacity: 0; animation: grano 700ms var(--ease-out) 1s forwards;
}
.bandas::after { z-index: 2; }
@keyframes grano { to { opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .bandas::before { animation: none; opacity: 0.6; } }

@media (prefers-color-scheme: dark) {
  .bandas { opacity: 0.5; }
  /* El ícono es negro: en modo oscuro lleva un filo claro para no perderse en el lienzo. */
  .hero__icono, .beta__icono, .menu-icono__app { box-shadow: 0 0 0 1px rgba(255,255,255,0.16), 0 18px 40px rgba(var(--acento-rgb), 0.22); }
}

/* ---------- Inicio ---------- */
.relato .escena__escenario { display: flex; flex-direction: column; align-items: center; }
.hero__texto {
  position: relative; z-index: 2; flex: none;
  padding: calc(var(--arriba) + clamp(24px, 5.4vh, 80px)) var(--margen) 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  will-change: transform, opacity;
}
.hero__icono { width: clamp(68px, 7vw, 96px); height: auto; border-radius: 22.5%; box-shadow: 0 18px 40px rgba(var(--acento-rgb), 0.28), 0 0 0 1px var(--linea); }
.hero h1, .relato h1 {
  margin-top: clamp(14px, 2.2vh, 26px);
  font-size: clamp(76px, 11.5vw, 168px); line-height: 0.95; font-weight: 700; letter-spacing: -0.048em;
}
.hero__lema { margin-top: 10px; font-size: clamp(24px, 3.2vw, 44px); font-weight: 600; letter-spacing: -0.024em; line-height: 1.1; }
/* «But simple.»: el remate del lema, con el degradado retro de la marca. */
.hero__remate {
  display: block; margin-top: 2px;
  background: linear-gradient(95deg, var(--ladrillo), var(--acento) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-color-scheme: dark) {
  .hero__remate { background-image: linear-gradient(95deg, var(--acento), var(--durazno) 70%); }
}
.hero__sub { margin-top: 18px; max-width: 34ch; font-size: clamp(17px, 1.6vw, 21px); color: var(--gris); text-wrap: pretty; }
.hero__acciones { margin-top: 26px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.hero__nota { margin-top: 18px; font-size: 13px; color: var(--gris); }
@media (max-width: 760px), (max-height: 860px) {
  .hero__sub { display: none; }
}

/* ---------- Teléfono ----------
   El bezel oficial del iPhone 17 en blanco (Apple Design Resources, en /bezels) encima de capturas reales de
   1206 × 2622: la pantalla ocupa justo el hueco del bezel, que ya trae la isla. Todo se mide contra --ancho. */
.telefono {
  --ancho: 340px;
  position: relative; flex: none;
  /* Alto explícito y no aspect-ratio: en Safari la pantalla (height: 100%) estiraba el marco. */
  width: var(--ancho); height: calc(var(--ancho) * 2.0444);
}
/* La sombra del teléfono: dos degradados (uno pegado abajo y otro alrededor) en lugar de box-shadow.
   Safari dibuja las sombras grandes por pedazos y en las esquinas se veía una franja clara; un
   degradado se pinta igual en todos lados. */
.telefono::before {
  content: ""; position: absolute; inset: -2% -8% -8%; pointer-events: none;
  background:
    radial-gradient(42% 7% at 50% 91%, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0)),
    radial-gradient(closest-side, rgba(0, 0, 0, 0.11) 80%, rgba(0, 0, 0, 0));
}
.telefono__bisel { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.vidrio {
  position: absolute; left: 5.333%; top: 2.5%; width: 89.333%; height: 95%;
  overflow: hidden; border-radius: calc(var(--ancho) * 0.14); background: #000;
}
.vidrio::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 38%);
}
.cuadro { position: absolute; inset: 0; opacity: 0; transition: opacity 170ms ease; }
.cuadro.visible { opacity: 1; }
/* Las esquinas redondas van en la propia captura: Safari a veces no recorta con overflow mientras el
   teléfono se mueve, y la foto asomaba fuera del bezel. */
.cuadro, .cuadro img { border-radius: inherit; }
.cuadro img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* El velo oscurece la pantalla mientras un pedazo de ella se levanta. */
.velo { position: absolute; inset: 0; z-index: 1; background: #000; opacity: 0; pointer-events: none; }
/* El toque: dónde puso el dedo para pasar a la siguiente pantalla. */
.toque {
  position: absolute; z-index: 4; width: 15%; aspect-ratio: 1; border-radius: 50%;
  translate: -50% -50%; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.35) 60%, rgba(255, 255, 255, 0));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.toque.activo { animation: toque 520ms var(--ease-out); }
@keyframes toque {
  0% { opacity: 0.9; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* ---------- El teléfono del relato ----------
   Se dibuja grande (--ancho-grande) y se aleja con scale(< 1): así la captura nunca se agranda
   más que su tamaño real y se ve nítida en todo el recorrido. */
.movil {
  --ancho-grande: min(480px, 92vw);
  position: relative; z-index: 1; flex: none; margin-top: clamp(22px, 3.6vh, 44px);
  width: var(--ancho-grande); transform-origin: 50% 0; will-change: transform;
}
/* Con el mismo nombre que en la portada: al llegar desde la portada el teléfono y el título se transforman. */
.movil .telefono { --ancho: var(--ancho-grande); view-transition-name: telefono; }
.relato h1 { view-transition-name: titulo-gualet; }
/* Luz de contorno: el teléfono parece iluminado por detrás con el durazno de las bandas. */
.movil__luz {
  /* Un halo difuso, no una sombra con extensión: así no deja una franja de color pegada al marco. */
  position: absolute; inset: -12% -42%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--acento-rgb), 0.3), rgba(var(--durazno-rgb), 0.15) 52%, rgba(var(--durazno-rgb), 0));
  opacity: 0.4; will-change: opacity;
}
@media (prefers-color-scheme: dark) {
  .movil__luz { background: radial-gradient(closest-side, rgba(var(--acento-rgb), 0.44), rgba(var(--acento-rgb), 0.14) 55%, rgba(var(--acento-rgb), 0)); }
}

/* Pedazos de la captura que se levantan y salen del marco. */
/* Encima del hueco de la pantalla, para que cada pedazo quede sobre su lugar en la captura. */
.sobre { position: absolute; left: 5.333%; top: 2.5%; width: 89.333%; height: 95%; z-index: 6; pointer-events: none; }
.recorte { position: absolute; opacity: 0; transform-origin: 50% 50%; will-change: transform, opacity; }
.recorte__sombra {
  position: absolute; inset: 0; border-radius: inherit; opacity: 0;
  box-shadow:
    0 calc(var(--ancho) * 0.07) calc(var(--ancho) * 0.16) rgba(0, 0, 0, 0.3),
    0 calc(var(--ancho) * 0.02) calc(var(--ancho) * 0.05) rgba(0, 0, 0, 0.18),
    0 0 calc(var(--ancho) * 0.12) rgba(var(--acento-rgb), 0.2);
}
.recorte__vista { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.recorte__vista img { position: absolute; max-width: none; height: auto; }

/* Lo que se dice alrededor del teléfono. Escritorio: a los lados, en zigzag. */
.relato__capa { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.rejilla {
  position: absolute; inset: var(--arriba) 0 0; max-width: 1240px; margin: 0 auto;
  padding: 24px var(--margen);
  display: grid; grid-template-columns: minmax(0, 1fr) var(--ancho-final, 340px) minmax(0, 1fr);
  grid-template-rows: repeat(6, minmax(0, 1fr)); column-gap: clamp(40px, 6vw, 110px);
}
.relato__intro h2 {
  grid-column: 1; grid-row: 2 / 6; align-self: center; justify-self: end; max-width: 9.5ch;
  font-size: clamp(40px, 4.6vw, 70px); line-height: 1.02; font-weight: 700; letter-spacing: -0.04em;
}
.relato__intro .lede { grid-column: 3; grid-row: 2 / 6; align-self: center; justify-self: start; max-width: 24ch; margin: 0; }
.relato__intro > * { opacity: 0; will-change: transform, opacity; }

.tiempos { list-style: none; }
.tiempos li { opacity: 0; max-width: 300px; will-change: opacity; }
.tiempos li:nth-child(1) { grid-column: 1; grid-row: 1 / 3; align-self: end; justify-self: end; }
.tiempos li:nth-child(2) { grid-column: 3; grid-row: 3 / 5; align-self: center; justify-self: start; }
.tiempos li:nth-child(3) { grid-column: 1; grid-row: 4 / 7; align-self: start; justify-self: end; }
.tiempos b {
  display: block; font-family: var(--sf-display); font-size: clamp(44px, 5vw, 80px); line-height: 1; font-weight: 700;
  letter-spacing: -0.045em; color: var(--tinta); transition: color 320ms var(--ease-out);
}
.tiempos li.hecho b { color: var(--gris-2); }
.tiempos__linea { display: block; position: relative; width: 56px; height: 2px; margin: 16px 0 14px; border-radius: 1px; background: var(--linea); overflow: hidden; }
.tiempos__linea i { position: absolute; inset: 0; border-radius: 1px; background: linear-gradient(90deg, var(--durazno), var(--acento)); transform-origin: 0 50%; transform: scaleX(0); }
.tiempos span {
  display: block; font-size: 17px; line-height: 1.45; color: var(--gris); max-width: 28ch; text-wrap: pretty;
  opacity: 0; transform: translateY(6px); transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out);
}
.tiempos li.actual span { opacity: 1; transform: none; }
.tiempos__muestra { display: none; --ancho: 300px; }

@media (max-width: 860px) {
  /* Celular: el teléfono arriba y, debajo, un solo tiempo a la vez. */
  .rejilla { inset: var(--capa-arriba, 70%) 0 0; display: block; padding: 0 var(--margen) calc(12px + var(--reserva-abajo)); text-align: center; }
  .relato__intro > *, .tiempos li { position: absolute; left: var(--margen); right: var(--margen); top: 0; margin: 0 auto; }
  .relato__intro h2 { max-width: 14ch; font-size: clamp(30px, 8.4vw, 44px); }
  .relato__intro .lede { top: auto; bottom: calc(14px + var(--reserva-abajo)); max-width: 32ch; font-size: 16px; }
  .tiempos li { max-width: 420px; }
  .tiempos b { font-size: clamp(34px, 9.4vw, 48px); }
  .tiempos__linea { margin: 10px auto 10px; width: 44px; }
  .tiempos span { margin: 0 auto; font-size: 15px; max-width: 32ch; }
}
@media (max-width: 860px) and (max-height: 720px) {
  .relato__intro .lede { display: none; }
}

/* ---------- La idea, en una línea ---------- */
.dicho .escena__escenario { display: grid; place-items: center; padding: var(--arriba) var(--margen) var(--reserva-abajo); }
.dicho__texto {
  max-width: 1100px; text-align: center;
  font-family: var(--sf-display); font-size: clamp(42px, 7.6vw, 116px); line-height: 1.03; font-weight: 700; letter-spacing: -0.045em;
}
.dicho__texto > span { display: block; text-wrap: balance; }
.dicho__texto > span + span { margin-top: 0.12em; }
.dicho__texto i { font-style: normal; opacity: 0.14; }

/* ---------- Cuentas ---------- */
.panel {
  position: absolute; inset: calc(var(--arriba) + 8px) 10px 10px; border-radius: 30px; overflow: hidden;
  background: #1D1D1F; transform-origin: 50% 50%; will-change: transform;
}
/* Luz que cae desde arriba sobre el panel. */
.panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 55% at 50% 0%, rgba(255, 255, 255, 0.1), transparent 70%);
}
.panel__tono {
  position: absolute; inset: 0; opacity: 0; transition: opacity 700ms var(--ease-out);
  background: linear-gradient(170deg, rgba(var(--tono), 1) 0%, rgba(var(--tono), 0.72) 48%, rgba(var(--tono), 0.36) 100%);
}
.panel__tono.actual { opacity: 1; }
@media (prefers-color-scheme: dark) {
  .panel { background: #161618; }
  .panel__tono { background: linear-gradient(170deg, rgba(var(--tono), 0.82) 0%, rgba(var(--tono), 0.5) 48%, rgba(var(--tono), 0.2) 100%); }
}
.cuentas__rejilla {
  position: relative; z-index: 1; height: 100%; max-width: 1320px; margin: 0 auto;
  padding: calc(var(--arriba) + 36px) var(--margen) 36px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: clamp(32px, 4.2vw, 80px);
  color: #fff;
}
.cuentas__texto { justify-self: end; max-width: 430px; will-change: transform, opacity; }
.cuentas__texto h2 { font-size: clamp(36px, 3.6vw, 58px); line-height: 1.02; font-weight: 700; letter-spacing: -0.04em; }
.cuentas__texto .lede { color: rgba(255, 255, 255, 0.72); max-width: 26ch; }
.cuentas__telefono { position: relative; will-change: transform; }
.cuentas__telefono .telefono { --ancho: min(320px, calc((100svh - var(--arriba) - 116px) * 0.46)); }
.leyenda { list-style: none; justify-self: start; display: grid; gap: 10px; will-change: transform, opacity; }
.leyenda li {
  display: flex; align-items: center; gap: 0.34em;
  font-family: var(--sf-display); font-size: clamp(32px, 3.6vw, 54px); line-height: 1.08; font-weight: 700; letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.42); transition: color 320ms var(--ease-out);
}
.leyenda li.actual { color: #fff; }
.leyenda i {
  flex: none; width: 0.62em; height: 0.44em; border-radius: 0.11em;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28);
  transition: transform 320ms var(--ease-out);
}
.leyenda li.actual i { transform: scale(1.08); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85); }

@media (max-width: 860px) {
  .panel { inset: calc(var(--arriba) + 6px) 8px 8px; border-radius: 26px; }
  .cuentas__rejilla {
    grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; text-align: center;
    padding: calc(var(--arriba) + 28px) var(--margen) calc(24px + var(--reserva-abajo)); row-gap: 16px;
  }
  .cuentas__texto { justify-self: center; }
  .cuentas__texto h2 { font-size: clamp(30px, 8.4vw, 44px); }
  .cuentas__texto .lede { display: none; }
  .cuentas__telefono .telefono { --ancho: min(280px, 66vw, calc((100svh - var(--arriba) - var(--reserva-abajo) - 236px) * 0.46)); }
  .leyenda { justify-self: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .leyenda li {
    height: 38px; padding: 0 15px 0 11px; border-radius: 999px; gap: 9px;
    font-family: var(--sf); font-size: 14px; font-weight: 600; letter-spacing: 0;
    background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.72);
    transition: color 260ms var(--ease-out), background-color 260ms var(--ease-out);
  }
  .leyenda li.actual { background: #fff; color: #1D1D1F; }
  .leyenda i { width: 20px; height: 14px; border-radius: 4px; }
  .leyenda li.actual i { transform: none; box-shadow: none; }
}

/* ---------- Secciones ---------- */
.seccion { position: relative; padding: clamp(96px, 14vh, 160px) var(--margen); }
.seccion__encabezado { max-width: 1180px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.seccion h2 { font-size: clamp(40px, 5.4vw, 76px); line-height: 1.02; font-weight: 700; letter-spacing: -0.04em; }
.lede { margin-top: 18px; font-size: clamp(18px, 1.6vw, 22px); color: var(--gris); max-width: 40ch; line-height: 1.45; }

/* Widgets */
.widgets { overflow: hidden; overflow: clip; }
.widgets::before {
  content: ""; position: absolute; left: 50%; top: 34%; width: min(1100px, 140vw); aspect-ratio: 1.6; translate: -50% 0;
  background: radial-gradient(closest-side, rgba(var(--acento-rgb), 0.1), transparent 70%); pointer-events: none;
}
.selector {
  position: relative; margin: 44px auto 0; width: max-content; max-width: 100%;
  display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--tarjeta); box-shadow: 0 0 0 1px var(--linea), var(--sombra);
  overflow-x: auto; scrollbar-width: none;
}
.selector::-webkit-scrollbar { display: none; }
.selector button {
  position: relative; z-index: 1; flex: none; height: 38px; padding: 0 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--gris); white-space: nowrap;
  transition: color 200ms ease;
}
/* La pestaña activa es una copia en tinta del selector, recortada con clip-path:
   el color cambia limpio, sin animar anchos. */
.selector__capa {
  position: absolute; z-index: 2; left: 0; top: 0; height: 100%; pointer-events: none;
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--tinta); color: var(--lienzo);
  transition: clip-path 380ms var(--ease-out);
}
@media (max-width: 600px) {
  .selector {
    width: auto; flex-wrap: wrap; justify-content: center; gap: 8px;
    padding: 0; background: none; box-shadow: none; overflow: visible;
  }
  .selector button { background: var(--tarjeta); box-shadow: 0 0 0 1px var(--linea); transition: color 200ms ease, background-color 200ms ease; }
  .selector button[aria-selected="true"] { background: var(--tinta); color: var(--lienzo); box-shadow: none; }
  .selector__capa { display: none; }
}
.selector__capa span {
  flex: none; height: 38px; padding: 0 16px; border-radius: 999px; display: grid; place-items: center;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}

.widget-marco { position: relative; margin: 36px auto 0; width: min(640px, 100%); }
.widget {
  --u: 1.9px; /* inicio.js lo ajusta: 1/338 del ancho, como un widget mediano de iPhone */
  --w-fondo: var(--tarjeta); --w-tinta: var(--tinta); --w-suave: var(--gris); --w-barra: #C7C7CC; --w-vacio: #E5E5EA; --w-boton: var(--tinta); --w-sobre: var(--lienzo);
  width: 100%; aspect-ratio: 338 / 158; border-radius: calc(var(--u) * 22); padding: calc(var(--u) * 16);
  display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 16);
  background: var(--w-fondo); color: var(--w-tinta);
  box-shadow: 0 0 0 1px var(--linea), 0 30px 70px rgba(0,0,0,0.1);
  transition: background-color 420ms var(--ease-out);
}
@media (prefers-color-scheme: dark) { .widget { --w-barra: #48484A; --w-vacio: #2C2C2E; } }
.widget.de-cuenta { --w-fondo: #1F3A5F; --w-tinta: #fff; --w-suave: rgba(255,255,255,0.7); --w-barra: rgba(255,255,255,0.45); --w-vacio: rgba(255,255,255,0.16); --w-boton: #fff; --w-sobre: #1F3A5F; }
@media (prefers-color-scheme: dark) { .widget.de-cuenta { --w-fondo: #13233A; --w-sobre: #13233A; } }
.widget__izq, .widget__der { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.widget__rotulo { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: calc(var(--u) * 9.6); font-weight: 600; letter-spacing: 0.12em; color: var(--w-suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget__cifra { margin-top: auto; transform-origin: 0 50%; transition: transform 220ms var(--ease-out); font-family: var(--redondo); font-size: calc(var(--u) * 27); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.widget__detalle { font-size: calc(var(--u) * 11.5); font-weight: 500; color: var(--w-suave); line-height: 1.3; }
.widget__barras { margin-top: calc(var(--u) * 8); height: calc(var(--u) * 26); display: flex; align-items: flex-end; gap: calc(var(--u) * 1.5); }
.widget__barras i { flex: 1; height: 100%; border-radius: calc(var(--u) * 3); background: var(--w-barra); transform-origin: 50% 100%; transition: transform 460ms var(--ease-out), background-color 420ms var(--ease-out); }
.widget__barras i.hoy { background: var(--w-tinta); }
.widget__barras i.falta { background: var(--w-vacio); }
.widget__avance { display: none; margin-top: calc(var(--u) * 14); height: calc(var(--u) * 6); border-radius: 999px; background: var(--w-vacio); overflow: hidden; }
.widget__avance i { display: block; height: 100%; border-radius: 999px; background: var(--w-tinta); transform-origin: 0 50%; transition: transform 520ms var(--ease-out); }
.widget.con-avance .widget__avance { display: block; }
.widget.con-avance .widget__barras { display: none; }
.widget__lineas { list-style: none; margin-top: calc(var(--u) * 6); display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 6); }
.widget__lineas li { min-width: 0; display: flex; align-items: center; gap: calc(var(--u) * 6); font-size: calc(var(--u) * 12); font-weight: 500; }
.widget__lineas li svg { width: calc(var(--u) * 12); height: calc(var(--u) * 12); flex: none; opacity: 0.6; }
.widget__lineas li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget__lineas li b { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.widget__boton {
  margin-top: auto; height: calc(var(--u) * 34); border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 5);
  background: var(--w-boton); color: var(--w-sobre); font-size: calc(var(--u) * 14); font-weight: 600;
}
.widget__boton svg { width: calc(var(--u) * 12); height: calc(var(--u) * 12); }
.cambia { transition: opacity 220ms var(--ease-out), filter 220ms var(--ease-out), transform 220ms var(--ease-out); }
.cambia.saliendo { opacity: 0; filter: blur(4px); transform: translateY(4px); }

/* Atajos: tres tarjetas que llegan juntas, como un mazo, y se abren en abanico. */
.atajos { padding-top: clamp(40px, 6vh, 72px); }
.extras { max-width: 1120px; margin: 64px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.extra {
  position: relative; min-width: 0; border-radius: 28px; padding: clamp(20px, 6vw, 28px); background: var(--tarjeta); box-shadow: 0 0 0 1px var(--linea), var(--sombra);
  transform-origin: 50% 85%;
}
.extras[data-abriendo] .extra { will-change: transform; }
.extra:nth-child(2) { z-index: 2; }
.extra__demo {
  position: relative; height: 230px; border-radius: 20px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(var(--acento-rgb), 0.16), rgba(var(--acento-rgb), 0.04) 60%, transparent), var(--lienzo);
}
.extra h3 { margin-top: 24px; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; }
.extra p { margin-top: 8px; color: var(--gris); font-size: 16px; text-wrap: pretty; }
@media (max-width: 980px) { .extras { grid-template-columns: minmax(0, 1fr); max-width: 520px; } }

.menu-icono { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.menu-icono__app { border-radius: 22.5%; box-shadow: 0 12px 24px rgba(0,0,0,0.16); transition: transform 300ms var(--ease-out); }
.menu-icono__menu {
  width: 210px; border-radius: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--tarjeta) 82%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.16), 0 0 0 1px var(--linea);
  transform-origin: 50% 0; opacity: 0; transform: scale(0.92) translateY(-6px);
  transition: opacity 260ms var(--ease-out), transform 360ms var(--ease-out);
}
.menu-icono__menu span { display: flex; align-items: center; justify-content: space-between; flex-direction: row-reverse; padding: 12px 16px; font-size: 15px; font-weight: 500; }
.menu-icono__menu span + span { border-top: 1px solid var(--linea); }
.extra.activo .menu-icono__app { transform: scale(0.94); }
.extra.activo .menu-icono__menu { opacity: 1; transform: none; }

/* Control «Anotar gasto»: el botón se presiona y se enciende, como en el Centro de control. */
.control { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.control__boton {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: var(--tinta);
  background: color-mix(in srgb, var(--tarjeta) 82%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.14), 0 0 0 1px var(--linea);
  transition: transform 220ms var(--ease-out), background-color 260ms var(--ease-out), color 260ms var(--ease-out);
}
.control__nombre { font-size: 15px; font-weight: 600; }
.extra.activo .control__boton { transform: scale(0.92); background-color: var(--acento); color: #fff; }

/* Tope por categoría: lo usado, lo que sumaría este gasto y cuánto quedaría. */
.tope {
  width: min(280px, 90%); min-width: 0; border-radius: 24px; padding: 18px 18px 16px;
  background: var(--tarjeta); box-shadow: 0 16px 40px rgba(0,0,0,0.14), 0 0 0 1px var(--linea);
  display: flex; flex-direction: column; gap: 12px;
}
.tope__fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 600; }
.tope__cat { flex: 1 1 auto; display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.tope__cat svg { flex: none; color: var(--gris); }
.tope__fila b { flex: none; white-space: nowrap; font-family: var(--redondo); font-variant-numeric: tabular-nums; font-size: 17px; }
.tope__barra { position: relative; display: block; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--gris-2) 22%, transparent); overflow: hidden; }
.tope__usado, .tope__nuevo { position: absolute; inset: 0 auto 0 0; border-radius: 999px; transform-origin: 0 50%; }
.tope__usado { width: 35.1%; background: var(--tinta); }
/* Una categoría larga parte en sílabas y se queda en dos líneas; la cifra nunca se recorta. */
.tope__cat span {
  min-width: 0; hyphens: auto; -webkit-hyphens: auto;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
/* El gasto que estás anotando: un tramo con el degradado retro, pegado a lo ya usado. */
.tope__nuevo {
  left: 35.1%; width: 10%; background: linear-gradient(90deg, var(--acento), var(--durazno));
  transform: scaleX(0); transition: transform 520ms var(--ease-out);
}
.tope.sumando .tope__nuevo { transform: none; }
.tope__nota { font-size: 13px; color: var(--gris); font-variant-numeric: tabular-nums; }

/* Privacidad */
.ceros { list-style: none; max-width: 1000px; margin: 64px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ceros li { text-align: center; padding: 34px 20px; border-radius: 28px; background: var(--tarjeta); box-shadow: 0 0 0 1px var(--linea), var(--sombra); }
.cero { display: inline-flex; height: 1em; overflow: hidden; font-family: var(--redondo); font-size: clamp(88px, 11vw, 140px); font-weight: 700; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.cero span { display: flex; flex-direction: column; transition: transform 1400ms var(--ease-out); }
/* Cada dígito lleva su propio degradado: tinta arriba, un poco de rojo abajo. */
.cero span em {
  font-style: normal; height: 1em; display: block;
  background: linear-gradient(180deg, var(--tinta) 35%, color-mix(in srgb, var(--tinta) 50%, var(--acento)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ceros b { display: block; margin-top: 10px; font-size: 18px; font-weight: 600; color: var(--gris); }
@media (max-width: 760px) { .ceros { grid-template-columns: 1fr; } .ceros li { padding: 26px 20px; } }

/* Beta */
.beta { overflow: hidden; overflow: clip; padding-bottom: clamp(170px, 26vh, 300px); }
.bandas--pie { height: 70%; opacity: 0.34; }
.bandas--pie::after { height: 70%; }
.beta__dentro { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.beta__icono { border-radius: 22.5%; box-shadow: 0 18px 40px rgba(var(--acento-rgb), 0.28), 0 0 0 1px var(--linea); margin-bottom: 28px; }
.llegada { list-style: none; margin: 48px 0 44px; width: 100%; max-width: 560px; text-align: left; counter-reset: paso; }
.llegada li { position: relative; counter-increment: paso; padding: 0 0 30px 64px; }
.llegada li::before {
  content: counter(paso); position: absolute; left: 0; top: -4px; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--tinta); color: var(--lienzo); font-weight: 700; font-size: 18px;
  transform: scale(0.85); opacity: 0; transition: transform 420ms var(--ease-out), opacity 260ms var(--ease-out);
}
.llegada li:not(:last-child)::after {
  content: ""; position: absolute; left: 20px; top: 46px; bottom: 6px; width: 2px; border-radius: 1px;
  background: linear-gradient(var(--acento), var(--durazno)); transform: scaleY(0); transform-origin: 50% 0;
  transition: transform 520ms var(--ease-out);
}
.llegada b, .llegada span { display: block; opacity: 0; transform: translateX(-10px); transition: opacity 420ms var(--ease-out), transform 520ms var(--ease-out); }
.llegada b { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.llegada span { margin-top: 4px; color: var(--gris); font-size: 16px; }
.llegada.visible li::before, .llegada.visible b, .llegada.visible span { opacity: 1; transform: none; }
.llegada.visible li:not(:last-child)::after { transform: scaleY(1); }
.llegada li:nth-child(2)::before, .llegada li:nth-child(2) b, .llegada li:nth-child(2) span { transition-delay: 160ms; }
.llegada li:nth-child(3)::before, .llegada li:nth-child(3) b, .llegada li:nth-child(3) span { transition-delay: 320ms; }
.llegada li:nth-child(2)::after { transition-delay: 220ms; }
.beta__nota { margin-top: 22px; font-size: 14px; color: var(--gris); max-width: 46ch; }

/* El pie vive en Assets/pie.css: es el mismo en todas las páginas. */

/* ---------- Pantallas bajas (iPhone de lado) y movimiento reducido: escenas completas y quietas ---------- */
@media (prefers-reduced-motion: reduce), (max-height: 560px) {
  .relato, .dicho, .cuentas { height: auto; }
  .escena__escenario { position: relative; height: auto; overflow: visible; }
  .ancla { top: var(--ancla-quieta, 100vh); }

  .relato .escena__escenario { overflow: hidden; overflow: clip; padding-bottom: 72px; }
  .movil { --ancho-grande: min(300px, 64vw) !important; transform: none !important; }
  .movil__luz { opacity: 0.6 !important; }
  .relato__capa { position: relative; inset: auto; width: 100%; }
  .rejilla { position: relative; inset: auto; display: block; max-width: 520px; padding: 64px var(--margen) 0; text-align: left; }
  .relato__intro > *, .tiempos li { position: static; opacity: 1 !important; transform: none !important; max-width: none; }
  .relato__intro h2 { max-width: none; font-size: clamp(36px, 6vw, 56px); }
  .relato__intro .lede { display: block; margin-top: 14px; max-width: 40ch; font-size: clamp(18px, 1.6vw, 21px); }
  .tiempos.rejilla { margin-top: 40px; padding-top: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 34px; }
  .tiempos li { grid-column: 1 / -1 !important; grid-row: auto !important; justify-self: stretch !important; align-self: auto !important; }
  .tiempos b { font-size: clamp(32px, 5vw, 44px); color: var(--tinta) !important; }
  .tiempos__linea { margin: 12px 0; }
  .tiempos__linea i { transform: none; }
  .tiempos span { opacity: 1; transform: none; margin: 0; font-size: 17px; max-width: 40ch; }
  .tiempos__muestra { display: block; position: relative; margin-top: 18px; width: min(100%, 360px); }
  .tiempos__muestra .recorte { position: relative; opacity: 1; width: 100% !important; left: auto !important; top: auto !important; height: auto !important; aspect-ratio: var(--proporcion); }
  .tiempos__muestra .recorte__sombra { opacity: 1; }

  .dicho .escena__escenario { padding: clamp(80px, 14vh, 140px) var(--margen); }
  .dicho__texto i { opacity: 1 !important; color: inherit !important; }

  .cuentas .escena__escenario { padding: 0; }
  .panel { transform: none !important; }
  .cuentas__rejilla { height: auto; padding-top: calc(var(--arriba) + 64px); padding-bottom: 64px; row-gap: 28px; }
  .cuentas__texto, .leyenda, .cuentas__telefono { opacity: 1 !important; transform: none !important; }
  .cuentas__telefono .telefono { --ancho: min(280px, 60vw); }
  .extra { transform: none !important; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce), (max-width: 860px) and (max-height: 560px) {
  .cuentas__texto .lede { display: block; margin-left: auto; margin-right: auto; }
}

/* ---------- Movimiento reducido: todo quieto y completo ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cambia, .cuadro, .widget, .widget__barras i, .widget__avance i, .selector__capa, .menu-icono__menu, .control__boton, .cero span,
  .llegada li::before, .llegada li::after, .llegada b, .llegada span, .tiempos span, .tiempos b, .leyenda li, .leyenda i,
  .panel__tono, .tope__nuevo, .widget__cifra {
    transition-duration: 1ms !important; transition-delay: 0ms !important;
  }
  .toque { display: none; }
}
