/* ZOTS en la web. Fuera de la app, la web va en Papel: crema, tinta, arena y bermellón, los mismos
   colores que el tema Papel (app/src/theme/temas.ts). La letra, la de la app: Crimson Pro y, en lo
   pequeño, IBM Plex Mono, servidas desde aquí (nada de terceros). Las reglas son las de dentro:
   píldoras con borde y una sola rellena, sin sombras, sin grises de fondo, nada rebota. */
@font-face { font-family: 'Crimson Pro'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fuentes/crimson-pro-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Crimson Pro'; font-weight: 400; font-style: italic; font-display: swap; src: url('/fuentes/crimson-pro-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Crimson Pro'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fuentes/crimson-pro-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Crimson Pro'; font-weight: 600; font-style: italic; font-display: swap; src: url('/fuentes/crimson-pro-latin-600-italic.woff2') format('woff2'); }
@font-face { font-family: 'Crimson Pro'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fuentes/crimson-pro-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fuentes/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }

:root {
  --fondo: #f2ede3;
  --tinta: #151413;
  --atenuado: rgba(21, 20, 19, 0.68);
  --linea: rgba(21, 20, 19, 0.13);
  --borde: rgba(21, 20, 19, 0.48);
  --superficie: #ebdaca;
  --acento: #e4502a;
  /* El bermellón para letra pequeña: llevado hacia la tinta hasta leerse (4,5:1), como en la app. */
  --acento-texto: #a63e23;
  --serif: 'Crimson Pro', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  /* La curva de la app para todo lo que entra (theme/movimiento.ts). */
  --posarse: cubic-bezier(0.32, 0.72, 0, 1);
  --margen: clamp(20px, 4vw, 44px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
  color: var(--tinta);
  font: 400 21px/1.34 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--tinta); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

/* Arriba: la mirilla a la izquierda y, a la derecha, muy poco. */
.cima {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: var(--margen) var(--margen) 0;
}
.marca { display: block; width: 46px; height: 46px; flex: none; }
.marca svg { display: block; width: 100%; height: 100%; }
.cima nav { display: flex; gap: 22px; padding-top: 4px; font: 400 12px/1.6 var(--mono); }
.cima nav a { text-decoration: none; }
.cima nav a:hover { text-decoration: underline; }
/* Instagram, arriba a la derecha: solo su icono, en tinta. */
.cima .icono { display: block; flex: none; width: 26px; height: 26px; margin-top: 10px; color: var(--tinta); transition: opacity 220ms var(--posarse); }
.cima .icono svg { display: block; width: 100%; height: 100%; }
.cima .icono:hover { opacity: 0.6; }

/* Abajo: lo legal, pequeño. */
.pie {
  margin-top: auto;
  padding: 56px var(--margen) var(--margen);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font: 400 12px/1.6 var(--mono);
  color: var(--atenuado);
}
.pie a { text-decoration: none; }
.pie a:hover { color: var(--tinta); text-decoration: underline; }

/* Los botones: píldoras con borde; una sola rellena por pantalla. */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1.5px solid var(--borde);
  border-radius: 999px;
  background: none;
  color: var(--tinta);
  font: 600 18px/1 var(--serif);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 220ms var(--posarse), opacity 220ms var(--posarse);
}
.boton:hover { border-color: var(--tinta); }
.boton.lleno { background: var(--acento); border-color: var(--acento); }
.boton.lleno:hover { opacity: 0.88; }
.boton.tinta { background: var(--tinta); border-color: var(--tinta); color: var(--acento); }
.boton.tinta:hover { opacity: 0.88; }
.boton.corto { min-height: 38px; padding: 0 16px; font-size: 16px; }

/* ---------- La portada ---------- */
.portada {
  display: grid;
  gap: 56px;
  /* El texto, cerca de la mirilla: son lo mismo, la marca y su lema. */
  padding: clamp(22px, 2.6vw, 32px) var(--margen) 0;
  font-size: clamp(21px, 1.9vw, 25px);
}
.portada .dicho { max-width: 23em; }
.portada h1 { margin: 0 0 1em; font-size: inherit; line-height: inherit; font-weight: 600; }
.portada p { margin: 0 0 1em; }
/* Descargar: los botones de las tiendas, los de siempre (negros, con su logo y dos líneas), los dos
   del mismo tamaño. Son lo único de la página que no va en la letra ni en los colores de la casa:
   se reconocen porque son así en todas partes. El de tu móvil va el primero. */
.descargar { display: grid; grid-template-columns: repeat(2, minmax(0, 172px)); gap: 10px; margin-top: 1.5em; }
.tienda {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 12px;
  border: 1px solid #a6a6a6;
  border-radius: 9px;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', Roboto, Arial, sans-serif;
  text-decoration: none;
  transition: opacity 220ms var(--posarse);
}
.tienda:hover { opacity: 0.85; }
.tienda .logo { flex: none; display: block; width: auto; height: 27px; }
.tienda span { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; }
.tienda small { font-size: 10px; line-height: 1.25; }
.tienda b { font-size: 19px; line-height: 1.12; font-weight: 600; letter-spacing: -0.01em; }
.tienda[data-tienda='android'] small { font-size: 9px; letter-spacing: 0.05em; text-transform: uppercase; }
.descargar .tuya { order: -1; }
/* En un móvil caben los dos en una fila, un poco más prietos; en uno muy estrecho, uno debajo de otro. */
@media (max-width: 420px) {
  .tienda { gap: 8px; padding: 0 10px; }
  .tienda b { font-size: 18px; }
}
@media (max-width: 339px) {
  .descargar { grid-template-columns: minmax(0, 172px); }
}
.nota { margin: 14px 0 0; font: 400 12px/1.6 var(--mono); color: var(--atenuado); }

/* La app, de verdad: tres pantallas. Son objetos (un móvil), no imágenes de una cosa. */
.pantallas { display: flex; gap: 16px; }
.pantallas img {
  flex: none;
  display: block;
  width: min(62vw, 250px);
  height: auto;
  aspect-ratio: 660 / 1434;
  border: 1px solid var(--linea);
  border-radius: 30px;
  background: #0c0c0c;
}
@media (max-width: 999px) {
  .pantallas {
    margin: 0 calc(-1 * var(--margen));
    padding: 0 var(--margen);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .pantallas::-webkit-scrollbar { display: none; }
  .pantallas img { scroll-snap-align: center; }
}
@media (min-width: 1000px) {
  .portada { grid-template-columns: minmax(0, 23em) minmax(0, 1fr); gap: 64px; align-items: start; }
  .pantallas { justify-content: flex-end; }
  .pantallas img { flex: 0 1 240px; width: auto; min-width: 0; }
  .pantallas img:nth-child(2) { margin-top: 44px; }
  .pantallas img:nth-child(3) { margin-top: 88px; }
}
@media (min-width: 1000px) and (max-width: 1239px) {
  .pantallas img:nth-child(3) { display: none; }
}

/* ---------- El perfil de alguien ---------- */
.perfil { width: 100%; max-width: 960px; padding: 28px var(--margen) 0; }
.estado { max-width: 23em; padding: 24px 0; }
.estado h1 { margin: 0 0 0.6em; font-size: inherit; font-weight: 600; }
.estado p { margin: 0 0 1em; }

/* La cabeza: un bloque de bermellón, igual para todos, escrito en tinta. */
.cabeza { max-width: 560px; margin-bottom: 26px; padding: 18px; border-radius: 24px; background: var(--acento); }
.cabeza .fila { display: flex; align-items: center; gap: 16px; }
.cabeza .nombre { flex: 1; min-width: 0; }
.cabeza h1 { margin: 0; font-size: clamp(26px, 7.4vw, 36px); line-height: 1.08; font-weight: 700; overflow-wrap: anywhere; }
.cabeza p { margin: 3px 0 0; font-size: 17px; color: rgba(21, 20, 19, 0.96); }
.cabeza .boton { width: 100%; margin-top: 16px; }

/* Una persona es un círculo. Sin foto, la inicial de su @. */
.cara { flex: none; display: block; width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--tinta); }
.cara.inicial { display: flex; align-items: center; justify-content: center; color: var(--acento); font: 600 34px/1 var(--serif); text-transform: uppercase; }
.cara.menor { width: 36px; height: 36px; }
.cara.menor.inicial { color: var(--fondo); font-size: 17px; }

.bloque { margin-bottom: 26px; }
.bloque h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.2; font-weight: 700; }

/* Sus tops, en una fila: cada uno un montón, la primera cosa delante y las demás asomando. */
.tira {
  display: flex;
  gap: 14px;
  margin: 0 calc(-1 * var(--margen));
  padding: 0 var(--margen);
  overflow-x: auto;
  scrollbar-width: none;
}
.tira::-webkit-scrollbar { display: none; }
.monton { position: relative; flex: none; height: 148px; padding: 0; border: 0; background: none; cursor: pointer; }
/* Cada cosa lleva un filo del color del fondo, que la separa de la de debajo sin sombras. */
.monton .capa {
  position: absolute;
  left: 0;
  top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 132px;
  overflow: hidden;
  border: 2px solid var(--fondo);
  border-radius: 6px;
  background: var(--superficie);
  transform: translateX(calc(var(--i, 0) * 11px)) rotate(calc(var(--i, 0) * 4deg));
  transition: opacity 220ms var(--posarse);
}
.monton .capa.redonda { border-radius: 50%; }
.monton .capa img { display: block; width: 100%; height: 100%; object-fit: cover; }
.monton .sin-imagen { padding: 8px; font: 600 13px/1.2 var(--serif); text-align: center; }
.monton:hover .capa { opacity: 0.9; }

/* El título de la rejilla es su filtro: «Todo 39», con un ángulo que dice que se abre. */
.filtro { position: relative; display: inline-block; margin-bottom: 12px; }
.filtro summary {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  font-size: 22px;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}
.filtro summary::-webkit-details-marker { display: none; }
.filtro summary strong { font-weight: 700; }
.filtro .cuenta { font: 400 12px/1 var(--mono); color: var(--atenuado); }
.filtro .angulo {
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 1.5px solid var(--atenuado);
  border-bottom: 1.5px solid var(--atenuado);
  transform: translateY(-4px) rotate(45deg);
}
.filtro .opciones {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  padding: 4px 18px;
  border: 1px solid var(--borde);
  border-radius: 18px;
  background: var(--fondo);
}
.filtro .opciones button {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--linea);
  border-radius: 0;
  background: none;
  color: inherit;
  font: 400 19px/1.2 var(--serif);
  text-align: left;
  cursor: pointer;
}
.filtro .opciones button:last-child { border-bottom: 0; }
.filtro .opciones button[aria-pressed='true'] { color: var(--acento-texto); font-weight: 700; }

/* La rejilla: casillas iguales, cada cosa entera en la suya, y su nota como sello. */
.rejilla { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
/* En una pantalla ancha las celdas crecen, y con ellas la frase y el sello. */
@media (min-width: 640px) {
  .rejilla { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .rejilla .hueco.frase { padding: 14px; }
  .rejilla .hueco.frase span { font-size: 18px; }
  .rejilla .hueco .sin-imagen { font-size: 17px; }
  .rejilla .sello { right: 8px; bottom: 8px; width: 34px; height: 34px; font-size: 18px; line-height: 34px; }
}
.celda { position: relative; aspect-ratio: 0.72; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.celda:hover .hueco { opacity: 0.88; }
.hueco {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 4px;
  background: var(--superficie);
  transition: opacity 220ms var(--posarse);
}
.hueco img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hueco.llena img { object-fit: cover; }
.hueco.redonda img { width: 80%; height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
/* Lo que no llena su casilla va sobre su propia imagen, ampliada y difuminada, con un velo: el
   hueco se llena con los colores de la cosa y no con uno del tema (como dentro de la app). */
.hueco img.detras {
  position: absolute;
  z-index: -2;
  inset: -14%;
  width: 128%;
  height: 128%;
  aspect-ratio: auto;
  border-radius: 0;
  object-fit: cover;
  filter: blur(16px);
}
.hueco.difuminada::before { content: ''; position: absolute; z-index: -1; inset: 0; background: rgba(0, 0, 0, 0.22); }
.hueco.frase { align-items: center; padding: 10px; }
/* Una cosa sin imagen (no la tiene, o no ha cargado): su título, para que la celda no quede vacía. */
.hueco .sin-imagen {
  display: -webkit-box;
  padding: 10px;
  overflow: hidden;
  font: 600 14px/1.25 var(--serif);
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}
.hueco.frase span {
  display: -webkit-box;
  overflow: hidden;
  font: italic 600 14px/1.25 var(--serif);
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}
.sello {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--acento);
  color: var(--tinta);
  font: 700 15px/28px var(--serif);
  text-align: center;
}

/* Un zot abierto: su tarjeta, sobre un velo de papel. */
.abierto {
  width: 100%;
  max-width: 560px;
  max-height: 100dvh;
  margin: auto;
  padding: 20px;
  border: 0;
  background: none;
  color: inherit;
  overflow-y: auto;
}
.abierto::backdrop { background: rgba(242, 237, 227, 0.94); }
.abierto[open] { animation: posarse 300ms var(--posarse); }
@keyframes posarse {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .abierto[open] { animation: none; }
  .boton, .hueco, .tienda, .cima .icono { transition: none; }
}
.tarjeta { padding: 18px; border-radius: 24px; background: var(--superficie); }
.tarjeta .quien { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.tarjeta .quien b { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.tarjeta .cuerpo { display: flex; align-items: flex-start; gap: 18px; }
.tarjeta .cuerpo.arriba { flex-direction: column; align-items: stretch; }
.tarjeta .imagen { position: relative; flex: none; width: min(168px, 42%); }
.tarjeta .arriba .imagen { width: 100%; }
.tarjeta .imagen img { display: block; width: 100%; height: auto; border-radius: 4px; object-fit: cover; }
.tarjeta .imagen.redonda img { aspect-ratio: 1; border-radius: 50%; }
.tarjeta .imagen .sello { right: -10px; bottom: -10px; width: 38px; height: 38px; font-size: 20px; line-height: 38px; }
.tarjeta .sello.suelto { position: static; flex: none; width: 38px; height: 38px; font-size: 20px; line-height: 38px; }
.tarjeta .dice { flex: 1; min-width: 0; }
.tarjeta .dice small { display: block; font-size: 15px; line-height: 1.3; color: var(--atenuado); }
.tarjeta .dice h2 { margin: 2px 0 10px; font-size: 27px; line-height: 1.08; font-weight: 700; overflow-wrap: anywhere; }
.tarjeta .dice p { margin: 0; font-size: 20px; line-height: 1.3; font-style: italic; overflow-wrap: anywhere; white-space: pre-line; }
.tarjeta .dice p.sola { font-size: 26px; line-height: 1.2; font-weight: 600; }
.tarjeta ol { margin: 4px 0 0; padding: 0; list-style: none; }
.tarjeta ol li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--linea); }
.tarjeta ol li > b { flex: none; width: 22px; color: var(--acento); font-size: 30px; line-height: 1; font-weight: 700; text-align: center; }
/* Con diez puestos, el número es de dos cifras y su columna, más ancha. */
.tarjeta ol.diez li > b { width: 34px; }
.tarjeta ol .hueco { flex: none; width: 56px; height: 56px; background: none; }
.tarjeta ol .nombre { min-width: 0; }
.tarjeta ol .nombre strong { display: block; font-size: 19px; line-height: 1.2; font-weight: 600; }
.tarjeta ol .nombre small { display: block; font-size: 15px; color: var(--atenuado); }
.abierto .acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.abierto .acciones .boton { flex: 1; }

/* ---------- Las páginas legales ---------- */
.legal { width: 100%; max-width: calc(700px + 2 * var(--margen)); padding: clamp(32px, 6vw, 60px) var(--margen) 0; font-size: 19px; line-height: 1.5; }
.legal h1 { margin: 0 0 8px; font-size: clamp(30px, 5vw, 38px); line-height: 1.1; font-weight: 700; }
.legal h2 { margin: 1.9em 0 0.4em; font-size: 24px; line-height: 1.2; font-weight: 700; }
.legal h3 { margin: 1.5em 0 0.3em; font-size: 19px; line-height: 1.3; font-weight: 600; }
.legal p { margin: 0 0 0.9em; }
.legal ul, .legal ol { margin: 0 0 0.9em; padding-left: 1.2em; }
.legal li { margin-bottom: 0.3em; }
.legal .fecha { margin-bottom: 2.2em; font: 400 12px/1.6 var(--mono); color: var(--atenuado); }
.legal table { width: 100%; margin: 0.6em 0 1.2em; border-collapse: collapse; font-size: 16px; line-height: 1.4; }
.legal th, .legal td { padding: 10px 14px 10px 0; border-top: 1px solid var(--linea); text-align: left; vertical-align: top; }
.legal th { font: 400 11px/1.5 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--atenuado); }
.legal .indice { padding: 0; list-style: none; }
.legal .indice li { margin: 0; padding: 10px 0; border-top: 1px solid var(--linea); }
/* Lo que solo Pablo puede rellenar: [PABLO: …]. La lista está en web/README.md. */
.pendiente { padding: 1px 5px; border-radius: 4px; background: rgba(228, 80, 42, 0.16); font: 400 0.68em/1.4 var(--mono); }
/* En el móvil, las tablas de tres columnas se leen fila a fila: cada celda en su línea. */
@media (max-width: 560px) {
  .apilada, .apilada tbody, .apilada tr, .apilada td { display: block; width: 100%; }
  .apilada thead { display: none; }
  .apilada tr { padding: 10px 0; border-top: 1px solid var(--linea); }
  .apilada td { padding: 0 0 4px; border: 0; }
  .apilada td:first-child { font-weight: 600; }
  .apilada td[data-t]::before { content: attr(data-t) ': '; color: var(--atenuado); }
}
