/* ladro.casa · la portada de «Casa», el pre-save en una hoja de iOS y el correo.
 * Hojas, listas agrupadas y toques salen de meclente.com (src/scripts/hojas.ts, styles/maqueta.css).
 * Botones con la regla de la píldora y portada con squircle de iOS (playbook 50). */
/* Archivo servida desde aquí, con las métricas corregidas (playbook 50 §2): ascendente = altura de
 * mayúsculas + d y descendente = d, así el texto queda centrado de verdad en píldoras y botones.
 * Archivo: cap 686, ascent 878, descent 210 (de 1000) → d = 201. */
@font-face {
  font-family: "Archivo";
  src: url("/fuentes/archivo.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
  ascent-override: 88.7%;
  descent-override: 20.1%;
  line-gap-override: 0%;
}
:root {
  --papel: #fceed3;
  --tarjeta: #fff8ea;
  --suave: #f3e4c6;
  --tinta: #493d37;
  --vestido: #c44f4f;
  --linea: rgba(73, 61, 55, 0.16);
  --tenue: rgba(73, 61, 55, 0.6);
  --curva: cubic-bezier(0.32, 0.72, 0, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--papel); }
html, body { margin: 0; }
body {
  color: var(--tinta);
  font-family: "Archivo", system-ui, sans-serif;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
a, button, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; }
::selection { background: #e5c464; color: var(--tinta); }

/* La página va dentro de .app para encogerse detrás de la hoja, como en iOS. */
.app {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--papel) url("/papel.jpg") center / 1400px auto repeat;
  transform-origin: 50% var(--origen, 0px);
  overflow-x: clip;
}
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(clamp(24px, 6svh, 64px), env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 36px max(20px, env(safe-area-inset-left));
}
h1 { margin: 0; }

/* Portada: esquina continua de iOS (figma-squircle, suavizado 0.6), máscara fija porque siempre es cuadrada. */
.portada-caja {
  position: relative;
  width: min(100%, 480px, 54svh);
  min-width: min(100%, 280px);
  aspect-ratio: 1;
  border-radius: 4.5%;
  -webkit-mask: url("/esquina-portada.svg") 0 0 / 100% 100% no-repeat;
  mask: url("/esquina-portada.svg") 0 0 / 100% 100% no-repeat;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--s, 1));
  transition: transform 0.6s var(--curva);
  touch-action: pan-y pinch-zoom; /* el scroll vertical es de la página y se puede hacer zoom con dos dedos */
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.portada-caja.inclina { transition: transform 0.12s ease-out; }
.portada { display: block; width: 100%; height: 100%; -webkit-user-drag: none; pointer-events: none; }
/* brillo tenue que sigue al dedo, como luz sobre papel */
.portada-caja::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 250, 235, 0.22), transparent 55%);
  opacity: var(--brillo, 0);
  transition: opacity 0.4s ease;
  mix-blend-mode: soft-light;
}
.rotulo {
  margin: 20px 0 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-align: center;
}

.acciones {
  width: min(100%, 360px);
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Píldoras: el texto recupera r·(1 − π/4) ≈ 0.2146·r de cada punta. */
.pastilla {
  --py: 14px;
  --r: calc(var(--py) + 0.6em);
  display: block;
  width: 100%;
  padding: var(--py) calc(18px + var(--r) * 0.2146);
  border: 0;
  border-radius: var(--r);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s var(--curva), opacity 0.12s;
}
.pastilla.llena { background: var(--tinta); color: var(--papel); }
.pastilla:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .pastilla.llena:hover { opacity: 0.9; } }

/* Correo: una píldora con el botón adentro, concéntrico a la punta (6 px de aire en los 3 lados). */
.fila {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 20px;
  border: 1px solid rgba(73, 61, 55, 0.35);
  border-radius: 999px;
  background: var(--tarjeta);
  transition: border-color 0.15s;
}
.fila:focus-within { border-color: var(--tinta); }
input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--tinta);
  caret-color: var(--vestido);
}
input[type="email"]::placeholder { color: var(--tenue); }
input[type="email"]:focus { outline: none; }
button[type="submit"] {
  --r: 19px;
  flex: none;
  padding: 10px calc(14px + var(--r) * 0.2146);
  border: 0;
  border-radius: var(--r);
  background: var(--suave);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--tinta);
  cursor: pointer;
  transition: transform 0.12s var(--curva), opacity 0.12s;
}
button[type="submit"]:active { transform: scale(0.95); }
button[type="submit"]:disabled { opacity: 0.5; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--vestido); outline-offset: 3px; }
#mensaje { min-height: 1.3em; margin: 8px 0 0; font-size: 13px; line-height: 1.3; text-align: center; color: var(--vestido); }
/* Cuando sale bien: la misma píldora cambia por dentro (mismo alto, nada de la página se mueve). */
.fila { position: relative; min-height: 52px; }
.hecho-vista {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
}
#aviso.hecho .fila { border-color: transparent; background: var(--tarjeta); }
#aviso.hecho .fila > :not(.hecho-vista) { visibility: hidden; }
#aviso.hecho .hecho-vista { opacity: 1; transition: opacity 0.2s ease; }
#aviso.hecho .hecho-vista span { animation: sube 0.45s 0.15s ease-out both; }
@keyframes sube { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }

.oculto, .trampa { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Hoja de iOS (de meclente) ---- */
.hoja {
  border: 0;
  padding: 0 0 env(safe-area-inset-bottom);
  margin: auto auto 0;
  width: min(100vw, 560px);
  max-width: 100vw;
  max-height: 92vh;
  border-radius: 14px 14px 0 0;
  background: var(--tarjeta);
  color: var(--tinta);
  transform: translateY(100%);
  overflow-y: auto;
  overscroll-behavior: contain;
  will-change: transform;
}
.hoja .agarradera, .hoja .hoja-cabeza { touch-action: none; }
.hoja::backdrop { background: rgb(27 26 23 / calc(var(--p, 0) * 0.3)); }
html.con-hoja { overflow: hidden; }
html.con-hoja .app {
  transform: scale(calc(1 - var(--p, 0) * 0.06));
  border-radius: calc(var(--p, 0) * 18px);
  box-shadow: 0 0 0 1px rgb(27 26 23 / calc(var(--p, 0) * 0.08)), 0 20px 60px rgb(27 26 23 / calc(var(--p, 0) * 0.18));
  overflow: hidden;
}
.borde-safari {
  position: fixed;
  inset: -7px 0 auto 0;
  width: 100%;
  height: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  pointer-events: none;
  background: color-mix(in srgb, rgb(27 26 23) calc(var(--p, 0) * 30%), var(--papel));
}
.borde-safari::backdrop { display: none; }
.agarradera { padding: 8px 0 6px; cursor: grab; }
.agarradera::after { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; margin: 0 auto; background: rgba(27, 26, 23, 0.2); }
.hoja-cuerpo { padding: 12px 20px 26px; display: flex; flex-direction: column; gap: 18px; }
.hoja-cabeza { display: flex; align-items: center; gap: 14px; }
.hoja-cabeza div { display: flex; flex-direction: column; gap: 2px; }
.hoja-cabeza strong { font-size: 19px; font-weight: 600; }
.hoja-cabeza span { font-size: 13px; color: var(--tenue); }
.tapa {
  width: 56px; height: 56px; flex: none; object-fit: cover;
  -webkit-mask: url("/esquina-tapa.svg") 0 0 / 100% 100% no-repeat;
  mask: url("/esquina-tapa.svg") 0 0 / 100% 100% no-repeat;
  border-radius: 11px;
}

/* Lista agrupada de iOS: tarjeta de 18 px, separadores que empiezan en el texto, flechita. */
.grupo { background: var(--papel); border-radius: 18px; border: 1px solid var(--linea); overflow: hidden; }
.renglon {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 12px 18px;
  color: var(--tinta);
  text-decoration: none;
  font-size: 16px;
}
.renglon + .renglon::before { content: ""; position: absolute; top: 0; left: 18px; right: 0; border-top: 1px solid var(--linea); }
.renglon .t { flex: 1; }
.renglon:active { background: var(--suave); }
@media (hover: hover) and (pointer: fine) { .renglon:hover { background: var(--suave); } }
.chevron { flex: none; opacity: 0.45; }

.cerrar-hoja { display: none; }
@media (min-width: 761px) {
  html.con-hoja .app { transform: none; border-radius: 0; box-shadow: none; }
  .hoja { margin: auto; width: min(92vw, 460px); border-radius: 18px; padding-bottom: 0; box-shadow: 0 20px 60px rgba(27, 26, 23, 0.25); }
  .hoja .agarradera { display: none; }
  .hoja .hoja-cuerpo { padding-top: 26px; }
  .cerrar-hoja { display: grid; place-items: center; position: absolute; top: 14px; right: 14px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--suave); color: var(--tinta); cursor: pointer; }
}
@media (prefers-reduced-motion: reduce) { .pastilla, button[type="submit"] { transition: none; } }

/* =====================================================================
 * Marca nueva (30 nov 2026), salió de propuesta.ladro.casa:
 * títulos y logotipo en LADRO Titular Medium (A del juego ss01), LADRO Cuerpo en el
 * texto y la paleta «vestido» con el rojo más vivo.
 * ===================================================================== */
/* LADRO Titular y LADRO Cuerpo (30 nov 2026, de Heal the Web B y A, MPL 2.0), variables 300–700.
 * Mayúsculas 700 de 1000 → ascent 85 %, descent 15 %: texto centrado de verdad (playbook 50 §2) */
@font-face { font-family: "LADRO Titular"; src: url("/fuentes/ladro-titular.woff2?v=1.2") format("woff2"); font-weight: 300 700; font-display: swap; ascent-override: 85%; descent-override: 15%; line-gap-override: 0%; }
/* LADRO Cuerpo: centrado óptico para texto con minúsculas (Roberto, 30 nov). Mayúsculas 700 y x 481 de 1000:
 * el ojo centra entre el centro de las mayúsculas (350) y el de la x (240), ~300 → ascent 80 %, descent 20 %.
 * Para botones solo en mayúsculas (PRE-SAVE) va «LADRO Cuerpo Mayúsculas», centrado en las mayúsculas (85/15). */
@font-face { font-family: "LADRO Cuerpo"; src: url("/fuentes/ladro-cuerpo.woff2?v=1.2") format("woff2"); font-weight: 300 700; font-display: swap; ascent-override: 80%; descent-override: 20%; line-gap-override: 0%; }
@font-face { font-family: "LADRO Cuerpo Mayúsculas"; src: url("/fuentes/ladro-cuerpo.woff2?v=1.2") format("woff2"); font-weight: 300 700; font-display: swap; ascent-override: 85%; descent-override: 15%; line-gap-override: 0%; }
:root {
  --papel: #f8f0e8;
  --gris: #f0e4d9;
  --rojo: #d63b33;          /* el rojo del vestido de Lili, más vivo */
  --sobre-rojo: #fdf1dc;
  --tarjeta: #fffaf4;
  --suave: #ead9cb;
  --tinta: #33231f;
  --oscura: #a8261f;
  --linea: rgba(51, 35, 31, 0.85);
  --tenue: rgba(51, 35, 31, 0.6);
  --vestido: #d63b33;
}
html { background: var(--papel); }
body, button, input { font-family: "LADRO Cuerpo", system-ui, sans-serif; font-synthesis: none; }
.app { background: var(--papel); }
.barra {
  margin: max(12px, env(safe-area-inset-top)) 12px 0;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--gris);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px;
}
.barra a { color: var(--tinta); text-decoration: none; }
/* Logotipo: LADRO Titular Medium con la A del ss01, en trazos (logotipo-tinta.svg); toma el color del texto */
.logo { display: inline-block; height: 0.72em; aspect-ratio: 3208 / 705; background: currentColor; -webkit-mask: url("/logotipo-tinta.svg") center / contain no-repeat; mask: url("/logotipo-tinta.svg") center / contain no-repeat; }

.pastilla.llena { background: var(--oscura); color: #fff; letter-spacing: 0.06em; text-transform: uppercase; font-size: 15px; font-weight: 400; }
button[type="submit"], .hecho-vista, .hoja-cabeza strong { font-weight: 400; }
.fila { background: var(--tarjeta); border-color: rgba(51, 35, 31, 0.2); }
button[type="submit"] { background: var(--suave); }
.hoja { background: var(--tarjeta); }
.grupo { background: var(--gris); }
.hoja-cabeza strong { font-family: "LADRO Titular", sans-serif; font-weight: 500; font-size: 24px; }

/* Landing de espera (antes del 6 dic): disco al centro, barra con el logotipo arriba.
 * El layout de dos columnas queda para la web final: git tag web-final-dos-columnas. */
.barra .logo { font-size: 22px; }
.app { background: var(--papel); }
main { padding-top: clamp(20px, 4svh, 40px); }
.pastilla.llena { background: var(--rojo); }

.rotulo { font-family: "LADRO Cuerpo", sans-serif; font-size: 20px; letter-spacing: 0; }
.rotulo .nombre-disco { font-family: "LADRO Titular", sans-serif; font-weight: 500; font-size: 1.25em; }
/* La barra se queda arriba al hacer scroll (sólida, sin blur: playbook 50 §4) */
.barra { position: sticky; top: max(12px, env(safe-area-inset-top)); z-index: 10; }
.grupo { border-color: rgba(51, 35, 31, 0.14); }
.renglon + .renglon::before { border-top-color: rgba(51, 35, 31, 0.14); }
.hoja:focus { outline: none; }
/* con teclado: el renglón se marca por dentro, sin que lo corte la esquina de la lista */
.renglon:focus-visible { outline: 2px solid var(--vestido); outline-offset: -4px; border-radius: 14px; }
/* Logos de las plataformas en un solo color (Simple Icons, CC0); la línea empieza en el texto, como en iOS */
.renglon .plataforma { flex: none; width: 24px; height: 24px; fill: currentColor; }
.renglon + .renglon::before { left: 56px; }
/* Compartir, en la barra junto al correo */
.barra-der { display: flex; align-items: center; gap: 10px; }
.compartir {
  position: relative; display: grid; place-items: center;
  width: 34px; height: 34px; margin: -6px -10px -6px 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--tinta); cursor: pointer;
  transition: transform 0.12s var(--curva), background-color 0.12s;
}
.compartir:active { transform: scale(0.9); background: var(--suave); }
@media (hover: hover) and (pointer: fine) { .compartir:hover { background: var(--suave); } }
.compartir-aviso {
  position: absolute; top: calc(100% + 10px); right: 0; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px; background: var(--tinta); color: var(--papel); font-size: 13px;
  opacity: 0; translate: 0 -4px; pointer-events: none; transition: opacity 0.2s, translate 0.2s;
}
.compartir.avisando .compartir-aviso { opacity: 1; translate: 0 0; }

/* Pie (30 nov): tarjeta como la barra, con fichas de acceso (pre-save, press kit, correo, Instagram) y créditos */

/* Barra centrada según el playbook 50 §1: alto = 2·py + 1 línea de 20 px; el ícono de compartir queda
 * concéntrico a la punta (a py de la orilla en sus tres lados) y el logotipo recupera r·(1 − π/4).
 * El logotipo es una caja exacta (máscara SVG de la letra), así que va como bloque, fuera del renglón. */
.barra { --py: 11px; --px: 16px; --pill: calc(var(--py) + 10px); padding: var(--py) var(--px); border-radius: var(--pill); }
.barra .marca { display: flex; margin-inline-start: calc(var(--pill) * (1 - 3.14159 / 4)); }
.barra .logo { display: block; }
.barra-der { margin-inline-end: calc(var(--py) - var(--px)); }
.compartir { margin: -7px; }

/* Pie descubierto (30 nov, idea de Roberto): el pie, en marrón, se queda fijo detrás del sitio; el contenido
 * lo tapa y termina con dos esquinas squircle (.capa-fin). Al llegar abajo, el contenido se va y el pie aparece.
 * El pie sube 64 px bajo .capa-fin para que en las esquinas siempre se vea marrón. */
.capa { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  background: linear-gradient(var(--papel), var(--papel)) no-repeat top / 100% calc(100% - 64px); }
.capa-fin { flex: none; height: 64px; margin-top: auto; background: var(--papel); border-radius: 0 0 32px 32px; }

/* Sin huérfanas: pretty en texto, balance en títulos, y &nbsp; entre las dos últimas palabras en el HTML */

h1, h2, h3, .rotulo { text-wrap: balance; }

/* Después de dejar el correo: la píldora se vuelve el botón «Compártelo con alguien» (sin casita, 30 nov).
 * Va en marrón para no competir con Pre-save; el aviso de abajo confirma que ya quedó en la lista. */
.hecho-vista { border: 0; margin: 0; padding: 0 20px; border-radius: inherit; background: transparent; color: inherit; font: inherit; font-size: 16px; font-weight: 400; cursor: pointer; }
.hecho-vista svg { width: 20px; height: 20px; flex: none; }
#aviso.hecho .fila { background: var(--tinta); border-color: var(--tinta); }
#aviso.hecho .hecho-vista { color: var(--papel); pointer-events: auto; }
#aviso.hecho .hecho-vista:active { transform: scale(0.98); }
#aviso.hecho .hecho-vista:focus-visible { outline: 2px solid var(--vestido); outline-offset: 3px; }
#aviso.hecho #mensaje { color: var(--tinta); font-size: 14px; }

.pastilla.llena { font-family: "LADRO Cuerpo Mayúsculas", "LADRO Cuerpo", system-ui, sans-serif; }

/* Cuenta regresiva (30 nov): pequeña, debajo del rótulo. Números tabulares para que nada baile al cambiar. */
.cuenta { display: flex; justify-content: center; gap: 18px; margin: 14px 0 0; }
.cuenta .celda { display: flex; flex-direction: column; align-items: center; min-width: 2.4em; }
.cuenta b { font-family: "LADRO Titular", sans-serif; font-weight: 500; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.cuenta small { margin-top: 5px; font-size: 11px; line-height: 1; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tenue); }
.cuenta.salio { font-size: 15px; color: var(--tinta); }

/* Nada se sale de lado (30 nov): la capa del contenido recorta en x por si algo rebasa (la portada inclinada,
 * un aviso). clip no crea un contenedor de scroll, así que la barra sigue fija. */
.capa { overflow-x: clip; }
