/* Tu Historia — dirección «La sobremesa»: de noche, en la mesa, bajo una lámpara.
   Plan y porqué: proyectos/libro-historia-de-vida/DIAGNOSTICO-y-viaje.md §3 (dirección 1).
   Letra: Alegreya (Juan Pablo del Peral, Argentina), hecha para literatura. */

:root {
  --nogal: #17110D;          /* la mesa */
  --nogal-2: #241A13;
  --luz: #E8C88A;            /* la lámpara: solo como luz, nunca como relleno grande */
  --luz-rgb: 232, 200, 138;
  --papel: #F1EADB;          /* donde se lee */
  --papel-2: #E6DCC6;
  --tinta: #1D1B22;
  --tinta-2: #4A4339;
  --claro: #EFE6D4;          /* texto sobre la mesa */
  --claro-2: #BDB09A;
  --lapiz: #B23A2B;          /* solo notas y marcas del editor */
  --lapiz-claro: #E58A72;    /* el mismo lápiz, legible sobre la mesa oscura */
  --oro: #C9A961;
  --f: 'Alegreya', Georgia, 'Times New Roman', serif;
  --fsc: 'Alegreya SC', 'Alegreya', Georgia, serif;
  --sale: cubic-bezier(.23, 1, .32, 1);
  --base: 19px;
  color-scheme: dark;
}
body.ud { --base: 21px; }   /* «La mía»: de usted y con letra más grande */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; overflow: hidden; color: var(--claro); background-color: var(--nogal);
  font: 400 var(--base)/1.55 var(--f); font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
p { margin: 0 0 .9em; }
a { color: var(--luz); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--luz); outline-offset: 3px; }
::selection { background: rgba(var(--luz-rgb), .35); }

/* ═════════ La mesa: luz, veta, objetos fuera de foco ═════════ */
.mesa { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.mesa__veta { position: absolute; inset: -10%; opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='v'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0025 .06' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .14 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23v)'/%3E%3C/svg%3E");
  background-size: 600px 600px; }
.mesa__luz { position: absolute; inset: 0; transition: opacity 1.2s ease;
  background:
    radial-gradient(60% 46% at 50% 18%, rgba(var(--luz-rgb), .30), rgba(var(--luz-rgb), .10) 45%, transparent 72%),
    radial-gradient(120% 80% at 50% 120%, rgba(0,0,0,.55), transparent 60%); }
.mesa__vineta { position: absolute; inset: 0; background: radial-gradient(130% 95% at 50% 30%, transparent 48%, rgba(0,0,0,.62)); }
#polvo { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; }

/* objetos de la mesa: papeles, fotos, una taza. Se juntan conforme avanza el viaje (data-etapa en <body>). */
.obj { position: absolute; transition: transform 1.6s var(--sale), opacity 1.2s ease, filter 1.2s ease; filter: blur(1.8px) brightness(.48); will-change: transform; }
.obj--papel { width: 150px; height: 196px; background: linear-gradient(170deg, #EDE3CF, #D9CBB0); box-shadow: 0 18px 30px rgba(0,0,0,.5); }
.obj--papel::after { content: ""; position: absolute; inset: 22px 18px; background: repeating-linear-gradient(180deg, rgba(40,30,20,.18) 0 1px, transparent 1px 11px); }
.obj--foto { width: 118px; height: 92px; background: #EFE7D6; padding: 7px; box-shadow: 0 14px 24px rgba(0,0,0,.55); }
.obj--foto::before { content: ""; display: block; width: 100%; height: 100%; background: radial-gradient(circle at 40% 45%, #9C8E78, #5E5346 70%, #3E362D); filter: sepia(.4); }
.obj--taza { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #2A1A10 0 38%, #6E5A48 39% 44%, #C9B9A0 45% 60%, #8C7864 61% 64%, transparent 65%); box-shadow: 0 12px 26px rgba(0,0,0,.5); }
.o1 { left: -38px; top: 12%; transform: rotate(-14deg); }
.o2 { right: -46px; top: 30%; transform: rotate(11deg); }
.o3 { left: -24px; bottom: 9%; transform: rotate(8deg); }
.o4 { right: -18px; bottom: 16%; transform: rotate(-9deg); }
.o5 { right: 12%; top: -40px; transform: rotate(4deg); }
.o6 { left: 8%; top: -50px; }
/* etapa 2: los papeles se van juntando hacia el centro, abajo */
body[data-etapa="2"] .o1 { transform: translate(40px, 60px) rotate(-6deg); }
body[data-etapa="2"] .o2 { transform: translate(-50px, 30px) rotate(5deg); }
body[data-etapa="2"] .o3 { transform: translate(40px, -20px) rotate(3deg); }
/* etapa 3 en adelante: un montón ordenado, casi fuera de vista; la luz se centra */
body[data-etapa="3"] .obj, body[data-etapa="4"] .obj { opacity: .35; }
body[data-etapa="3"] .o1, body[data-etapa="4"] .o1 { transform: translate(calc(50vw - 40px), calc(100vh - 160px)) rotate(-2deg); }
body[data-etapa="3"] .o2, body[data-etapa="4"] .o2 { transform: translate(calc(-50vw + 110px), calc(70vh - 180px)) rotate(1deg); }
body[data-etapa="3"] .o3, body[data-etapa="4"] .o3 { transform: translate(calc(50vw - 30px), 40px) rotate(2deg); }
body[data-etapa="4"] .mesa__luz { opacity: .8; }

/* ═════════ Barra de arriba ═════════ */
.barra { position: fixed; top: 0; left: 0; right: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between;
  padding: calc(6px + env(safe-area-inset-top)) 10px 6px; }
.barra button { background: none; border: 0; padding: 12px 10px; font-size: 16px; color: var(--claro-2); cursor: pointer; min-height: 44px; }
.barra button:hover { color: var(--claro); }
#atras { visibility: hidden; }
.avance { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 7; background: linear-gradient(90deg, rgba(var(--luz-rgb), .2), var(--luz)); transition: width .5s var(--sale); }
.marca { display: none; position: absolute; left: 50%; transform: translateX(-50%); font: 500 15px/1 var(--fsc); letter-spacing: .02em; color: var(--claro-2); white-space: nowrap; }

/* ═════════ Pantallas ═════════ */
.pantalla { position: fixed; inset: 0; z-index: 2; display: flex; flex-direction: column;
  padding-top: calc(56px + env(safe-area-inset-top));
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .5s var(--sale), transform .5s var(--sale), visibility .5s; }
.pantalla.on { opacity: 1; visibility: visible; transform: none; }
.cuerpo { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 8px 22px 28px; width: 100%; max-width: 600px; margin: 0 auto; scrollbar-width: none; }
.cuerpo::-webkit-scrollbar { display: none; }
.pie { width: 100%; max-width: 600px; margin: 0 auto; padding: 12px 22px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(23,17,13,.92) 36%); display: grid; gap: 6px; }
.pie:empty { display: none; }

h1, h2, h3 { font-weight: 500; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-size: clamp(27px, 7.6vw, 44px); line-height: 1.1; }
h2 { font-size: clamp(27px, 7.4vw, 38px); line-height: 1.12; margin-bottom: .55em; }
h3 { font-size: 1.15em; line-height: 1.25; margin-bottom: .4em; }
.lead { font-size: 1.08em; color: var(--claro); }
.suave { color: var(--claro-2); font-size: .9em; }
.chico { font-size: .82em; color: var(--claro-2); }
b, strong { font-weight: 700; color: #FFF6E6; }

/* Botones: uno principal (luz) y uno de texto */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 14px 20px;
  background: var(--luz); color: var(--tinta); border: 0; border-radius: 3px; cursor: pointer; text-decoration: none;
  font: 700 1.02em/1.2 var(--f); letter-spacing: .005em; touch-action: manipulation;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 10px 26px -10px rgba(var(--luz-rgb), .7);
  transition: transform .16s var(--sale), filter .2s; }
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn--texto { background: none; color: var(--claro); box-shadow: none; min-height: 48px; font-weight: 500; text-decoration: underline; text-decoration-color: rgba(var(--luz-rgb), .5); text-underline-offset: .2em; }
.btn--papel { background: var(--papel); }

/* ═════════ Portada (pantalla 1) ═════════ */
.portada-p .cuerpo { display: flex; flex-direction: column; }
.portada-p .cuerpo > :first-child { margin-top: auto; }
.portada-p .cuerpo > :last-child { margin-bottom: auto; }
.sello { font: 500 16px/1.2 var(--fsc); color: var(--luz); margin-bottom: 18px; letter-spacing: .02em; }
.portada-p h1 { margin-bottom: .45em; }
.portada-p .sub { font-size: 1.05em; color: var(--claro); margin-bottom: 1.4em; }
.pregunta { font-size: 1.12em; font-weight: 500; margin: 0 0 .6em; color: #FFF6E6; }
.aval { margin-top: 1.4em; font-size: .82em; color: var(--claro-2); line-height: 1.45; }

/* ═════════ Opciones: tiras de papel sobre la mesa ═════════ */
.ops { display: grid; gap: 10px; margin: 14px 0 6px; }
.ops--dos { grid-template-columns: 1fr 1fr; }
.op { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 13px 16px; text-align: left;
  background: var(--papel); color: var(--tinta); border: 0; border-radius: 2px; cursor: pointer; line-height: 1.3; font-size: .95em;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 18px -8px rgba(0,0,0,.7);
  transition: transform .25s var(--sale), background-color .2s; touch-action: manipulation; }
.ops .op:nth-child(3n+1) { transform: rotate(-.35deg); }
.ops .op:nth-child(3n+2) { transform: rotate(.3deg); }
.op:active { transform: scale(.985); }
/* lo elegido queda encerrado en lápiz rojo, como lo marca un editor */
.op svg.circulo { position: absolute; inset: -5px -10px; width: calc(100% + 20px); height: calc(100% + 10px); pointer-events: none; overflow: visible; }
.op svg.circulo path { fill: none; stroke: var(--lapiz); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .45s var(--sale); }
.op svg.circulo path { opacity: 0; }
.op[aria-pressed="true"] svg.circulo path { stroke-dashoffset: 0; opacity: 1; }
.op[aria-pressed="true"] { background: #FBF6EA; }
.op--grande { min-height: 64px; font-size: 1.02em; font-weight: 500; }

/* Nota del editor, en lápiz rojo (letra provisional: itálica; luego, la letra de César escaneada) */
.nota { position: relative; margin: 14px 0 4px 4px; padding-left: 26px; color: var(--lapiz-claro); font-style: italic; font-size: 1.02em; line-height: 1.35;
  opacity: 0; transform: translateY(6px) rotate(-.6deg); transition: opacity .5s ease, transform .5s var(--sale); }
.nota.on { opacity: 1; transform: rotate(-.6deg); }
.nota::before { content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 14'%3E%3Cpath d='M1 8c3-1 6-1 9 0M8 3l6 5-6 5' fill='none' stroke='%23E58A72' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat; }
.respuesta { margin-top: 12px; padding: 14px 16px; border-left: 2px solid rgba(var(--luz-rgb), .55); color: var(--claro); font-size: .98em;
  opacity: 0; transition: opacity .6s ease; }
.respuesta.on { opacity: 1; }

/* ═════════ Campos ═════════ */
.campo { display: grid; gap: 6px; margin: 0 0 16px; transition: opacity .4s ease, transform .4s var(--sale); }
.campo.oculto { display: none; }
.campo label, .etq { font-size: .92em; color: var(--claro); font-weight: 500; }
.campo .ayuda { font-size: .8em; color: var(--claro-2); margin: -2px 0 2px; }
.entrada { width: 100%; min-height: 54px; padding: 12px 14px; background: var(--papel); color: var(--tinta); border: 0; border-radius: 2px;
  font-size: max(16px, .98em); box-shadow: inset 0 -2px 0 rgba(29,27,34,.55); }
.entrada:focus { outline: 3px solid var(--luz); outline-offset: 1px; }
textarea.entrada { min-height: 84px; resize: vertical; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 9px 14px; border-radius: 999px; background: rgba(241,234,219,.1); color: var(--claro); border: 1px solid rgba(241,234,219,.28);
  cursor: pointer; font-size: .88em; transition: background-color .2s, color .2s, border-color .2s; }
.chip[aria-pressed="true"] { background: var(--papel); color: var(--tinta); border-color: var(--papel); }
.casilla { display: flex; gap: 12px; align-items: flex-start; font-size: .85em; color: var(--claro); cursor: pointer; margin: 6px 0 12px; }
.casilla input { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 2px; accent-color: var(--lapiz); }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.aviso { color: var(--lapiz-claro); font-size: .86em; min-height: 1.2em; }
.anios { font-size: 1.3em; font-weight: 500; color: #FFF6E6; margin: 6px 0 14px; min-height: 1.4em; }
.anios b { color: var(--luz); font-weight: 700; }

/* pasos dentro de la pantalla 5 */
.paso { display: none; }
.paso.on { display: block; animation: entra .45s var(--sale); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }
.contador { font: 500 15px/1 var(--fsc); color: var(--luz); margin-bottom: 10px; }

/* ═════════ El libro en 3D ═════════ */
.escena { display: grid; place-items: center; padding: 18px 0 26px; perspective: 1500px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.libro { --h: 300px; --ar: .647; --e: calc(var(--h) * .09); position: relative; width: calc(var(--h) * var(--ar)); height: var(--h);
  transform-style: preserve-3d; transform: rotateX(6deg) rotateY(var(--gira, -24deg)); transition: transform .7s var(--sale); cursor: grab; }
.escena.arrastrando .libro { transition: none; cursor: grabbing; }
.libro > * { position: absolute; }
.libro__tapa { inset: 0; transform: translateZ(calc(var(--e) / 2)); transform-origin: left center; transition: transform 1.1s var(--sale); transform-style: preserve-3d; }
.libro__tapa .portada { position: absolute; inset: 0; backface-visibility: hidden; }
.libro__guarda { position: absolute; inset: 0; transform: rotateY(180deg); backface-visibility: hidden; background: #2C2B44;
  background-image: radial-gradient(circle at 20% 30%, rgba(201,169,97,.35) 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, rgba(229,138,114,.25) 0 2px, transparent 3px);
  background-size: 22px 26px, 30px 24px; }
.libro__hoja { inset: 2px 3px 2px 0; transform: translateZ(calc(var(--e) / 2 - 1px)); background: #F4EEE1; display: grid; place-items: center; text-align: center; color: var(--tinta); padding: 14%; font-size: calc(var(--h) * .05); line-height: 1.25; }
.libro__lomo { top: 0; bottom: 0; left: calc(var(--e) / -2); width: var(--e); transform: rotateY(-90deg); background: var(--tela); display: grid; place-items: center; overflow: hidden; }
.libro__lomo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.5), rgba(255,255,255,.06) 45%, rgba(0,0,0,.4)); }
.libro__lomo span { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--oro); font: 500 calc(var(--e) * .34)/1 var(--f); white-space: nowrap; max-height: 86%; overflow: hidden; text-overflow: ellipsis; }
.libro__paginas { top: 4px; bottom: 4px; right: calc(var(--e) / -2); width: calc(var(--e) - 4px); transform: rotateY(90deg);
  background: repeating-linear-gradient(90deg, #F3EDDF 0 1px, #CFC5B0 1px 2px); }
.libro__paginas::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.28), transparent 50%, rgba(0,0,0,.18)); }
.libro__atras { inset: 0; transform: translateZ(calc(var(--e) / -2)) rotateY(180deg); background: var(--tela); }
.libro__piso { position: absolute; left: -16%; right: -16%; bottom: calc(var(--h) * -.07); height: calc(var(--h) * .12); transform: translateZ(-60px) rotateX(90deg);
  background: radial-gradient(closest-side, rgba(0,0,0,.75), transparent); pointer-events: none; }
.libro.abierto .libro__tapa { transform: translateZ(calc(var(--e) / 2)) rotateY(-162deg); }
@media (prefers-reduced-motion: no-preference) {
  .libro.llega { animation: llega 1.3s var(--sale) both; }
  @keyframes llega { from { transform: rotateX(14deg) rotateY(-70deg) translateY(30px); opacity: 0; } 40% { opacity: 1; } }
}

/* ═════════ Portadas (4 estilos) ═════════ */
.portada { --tela: #2F4A3A; container-type: inline-size; overflow: hidden; color: var(--oro); background-color: var(--tela);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='t'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .35' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23t)'/%3E%3C/svg%3E"),
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.10), rgba(0,0,0,.25));
  font-family: var(--f); }
.portada::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.32) 0, transparent 3%, rgba(255,255,255,.1) 4%, transparent 6.5%), linear-gradient(118deg, rgba(255,255,255,.14), transparent 38%, rgba(0,0,0,.2)); }
.portada[data-estilo="sereno"] { --tela: #2F4A3A; }
.portada[data-estilo="andariego"] { --tela: #23304D; }
.portada[data-estilo="oficio"] { --tela: #5A3A26; }
.portada[data-estilo="familia"] { --tela: #6B2430; }
.portada .arte { position: absolute; left: 0; right: 0; top: 8%; height: 46%; width: 100%; opacity: .75; }
.portada .arte * { fill: none; stroke: currentColor; stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.portada .arte .lleno { fill: currentColor; stroke: none; opacity: .5; }
.portada .textos { position: absolute; left: 10%; right: 10%; bottom: 12%; text-align: center; }
.portada .titulo { font-weight: 700; line-height: 1.05; font-size: min(12.5cqw, calc(270cqw / var(--n, 10))); text-wrap: balance; overflow-wrap: anywhere;
  background: linear-gradient(180deg, #F3E2A8 10%, #D2B36C 55%, #A98A49); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.35)); }
.portada .regla { width: 22cqw; height: .5cqw; margin: 5cqw auto 4cqw; background: currentColor; opacity: .6; }
.portada .autor { font-size: 6.2cqw; letter-spacing: .02em; opacity: .9; }
.portada .sellito { position: absolute; left: 0; right: 0; bottom: 4.5cqw; text-align: center; font: 500 3.4cqw/1 var(--fsc); opacity: .65; }

/* elegir estilo */
.estilos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.estilo { position: relative; display: grid; gap: 8px; padding: 8px; background: rgba(241,234,219,.06); border: 1px solid rgba(241,234,219,.16); border-radius: 3px; cursor: pointer; text-align: left; color: var(--claro); }
.estilo .portada { position: relative; aspect-ratio: .647; width: 100%; }
.estilo b { font-size: .95em; }
.estilo span.d { font-size: .76em; color: var(--claro-2); line-height: 1.3; }
.estilo[aria-pressed="true"] { border-color: var(--luz); box-shadow: 0 0 0 1px var(--luz), 0 10px 30px -12px rgba(var(--luz-rgb), .6); }
.titulos .op { font-weight: 500; }
.cargando { color: var(--claro-2); font-style: italic; }

/* ═════════ Armando el libro ═════════ */
.armando { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; text-align: center; padding: 24px; background: rgba(23,17,13,.86);
  opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
.armando.on { opacity: 1; visibility: visible; }
.armando p { font-size: 1.15em; color: #FFF6E6; min-height: 1.6em; }
.armando .hilo { width: 160px; height: 2px; margin: 18px auto 0; background: rgba(var(--luz-rgb), .2); overflow: hidden; }
.armando .hilo i { display: block; height: 100%; width: 40%; background: var(--luz); animation: hilo 1.4s ease-in-out infinite; }
@keyframes hilo { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ═════════ Las páginas del libro de muestra ═════════ */
.hojas { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 22px 18px; margin: 0 -22px; scrollbar-width: none; overscroll-behavior-x: contain; }
.hojas::-webkit-scrollbar { display: none; }
.hoja { flex: 0 0 min(78vw, 330px); aspect-ratio: .647; scroll-snap-align: center; background: #F4EEE1; color: var(--tinta);
  padding: 11% 10% 9%; position: relative; box-shadow: 0 20px 40px -18px rgba(0,0,0,.85), inset -14px 0 22px -18px rgba(0,0,0,.35);
  font-size: clamp(12.5px, 3.55vw, 15px); line-height: 1.5; display: flex; flex-direction: column; }
body.ud .hoja { font-size: clamp(13.5px, 3.8vw, 16px); }
.hoja p { margin: 0 0 .7em; text-indent: 1.2em; hyphens: auto; -webkit-hyphens: auto; }
.hoja p.sin { text-indent: 0; }
.hoja .folio { position: absolute; bottom: 4.5%; left: 0; right: 0; text-align: center; font-size: .8em; color: #7A6F5E; }
.hoja h4 { font: 500 1.35em/1.15 var(--f); margin: 18% 0 1.1em; text-align: center; }
.hoja .cap { font: 500 .85em/1 var(--fsc); text-align: center; color: #7A6F5E; margin-top: 10%; }
.hoja.centro { justify-content: center; text-align: center; }
.hoja.centro p { text-indent: 0; }
.hoja .indice { list-style: none; margin: 0; padding: 0; }
.hoja .indice li { display: flex; gap: 6px; align-items: baseline; margin-bottom: .55em; }
.hoja .indice li span:nth-child(2) { flex: 1; border-bottom: 1px dotted #A89C88; transform: translateY(-.25em); }
.hoja .qr { width: 46%; margin: 8% auto 6%; }
.hoja .qr rect { fill: var(--tinta); }
.pasa { display: flex; justify-content: space-between; align-items: center; color: var(--claro-2); font-size: .82em; margin: -4px 2px 10px; }
.puntos { display: flex; gap: 5px; }
.puntos i { width: 6px; height: 6px; border-radius: 50%; background: rgba(241,234,219,.25); transition: background-color .3s; }
.puntos i.on { background: var(--luz); }

/* ═════════ Pasos, listas y desplegables (pantallas 9–12) ═════════ */
.pasos { list-style: none; padding: 0; margin: 10px 0 18px; counter-reset: p; display: grid; gap: 16px; }
.pasos li { counter-increment: p; display: grid; grid-template-columns: 34px 1fr; gap: 4px 10px; }
.pasos li::before { content: counter(p); font: 500 1.5em/1 var(--f); color: var(--luz); grid-row: span 2; padding-top: 2px; }
.pasos b { display: block; margin-bottom: 2px; }
.incluye { list-style: none; padding: 0; margin: 8px 0 16px; display: grid; gap: 8px; }
.incluye li { position: relative; padding-left: 24px; }
.incluye li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 11px; height: 6px; border-left: 2px solid var(--luz); border-bottom: 2px solid var(--luz); transform: rotate(-45deg); }
details { border-top: 1px solid rgba(241,234,219,.18); }
details:last-of-type { border-bottom: 1px solid rgba(241,234,219,.18); }
summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 2px; cursor: pointer; font-weight: 500; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.4em; line-height: 1; color: var(--luz); transition: transform .3s var(--sale); }
details[open] summary::after { transform: rotate(45deg); }
details > div { padding: 0 2px 16px; font-size: .95em; }
details ol, details ul { padding-left: 1.2em; margin: 0; display: grid; gap: 8px; }
details p:last-child { margin-bottom: 0; }

/* inversión */
.escalera { margin: 12px 0 18px; display: grid; gap: 0; }
.escalon { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid rgba(241,234,219,.14); }
.escalon span { font-size: .88em; color: var(--claro-2); }
.escalon s { color: var(--claro-2); text-decoration-color: var(--lapiz-claro); text-decoration-thickness: 2px; white-space: nowrap; }
.escalon.hoy { border-bottom: 0; padding-top: 16px; }
.escalon.hoy span { color: var(--claro); font-weight: 500; }
.escalon.hoy strong { font-size: 1.9em; color: var(--luz); white-space: nowrap; }
.pagos { background: var(--papel); color: var(--tinta); padding: 16px 18px; border-radius: 2px; margin: 6px 0 18px; box-shadow: 0 14px 30px -16px rgba(0,0,0,.8); }
.pagos p { margin: 0 0 .5em; }
.pagos b { color: var(--tinta); }
.pagos .suave { color: var(--tinta-2); }
.fecha { border-left: 2px solid var(--lapiz-claro); padding: 4px 0 4px 14px; margin: 10px 0 18px; }

/* quién está detrás */
.quien-p { background: #0E0A08; }
.quien-p .foto { position: absolute; inset: 0; background: url(../img/cesar.jpg) 50% 18% / cover no-repeat; filter: grayscale(1) sepia(.18) brightness(.7); }
.quien-p .foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,10,8,.1) 0, rgba(14,10,8,.35) 34%, rgba(14,10,8,.94) 58%); }
.quien-p .cuerpo { position: relative; }
.quien-p .espacio { height: 38vh; }
.libros { display: flex; gap: 14px; overflow-x: auto; padding: 8px 2px 14px; scrollbar-width: none; }
.libros::-webkit-scrollbar { display: none; }
.libros figure { flex: 0 0 96px; margin: 0; }
.libros img { width: 96px; height: 140px; object-fit: cover; box-shadow: 0 12px 22px -10px rgba(0,0,0,.9), inset 0 0 0 1px rgba(255,255,255,.05); }
.libros figcaption { font-size: .7em; color: var(--claro-2); margin-top: 6px; line-height: 1.25; }

/* cierre */
.tarjeta { margin: 8px auto 14px; width: min(100%, 360px); }
.tarjeta canvas { width: 100%; height: auto; display: block; box-shadow: 0 24px 46px -18px rgba(0,0,0,.9); }
.fila-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.fila-btns .btn { font-size: .9em; min-height: 50px; }
.preg { margin: 14px 0 8px; font-weight: 500; }

/* ═════════ Modo «prefiero leer» ═════════ */
body.leyendo { overflow: auto; }
body.leyendo .pantalla { position: relative; inset: auto; opacity: 1; visibility: visible; transform: none; padding-top: 0; display: none; min-height: 0; }
body.leyendo .pantalla[data-leer] { display: flex; }
body.leyendo .pantalla[data-leer]:first-of-type { padding-top: calc(60px + env(safe-area-inset-top)); }
body.leyendo .cuerpo { overflow: visible; flex: none; }
body.leyendo .pie { background: none; }
body.leyendo .quien-p { min-height: 100vh; }
body.leyendo .avance, body.leyendo #atras { visibility: hidden; }
body.leyendo .barra { background: linear-gradient(rgba(23,17,13,.95), rgba(23,17,13,.6) 70%, transparent); }

@media (min-width: 760px) {
  .marca { display: block; }
  .libro { --h: 360px; }
  .obj--papel { width: 210px; height: 270px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #polvo { display: none; }
}
@media print {
  body { overflow: visible; background: #fff; }
  .mesa, .barra, .avance, .pie, .pantalla:not(.imprime) { display: none !important; }
  .pantalla.imprime { position: static; opacity: 1; visibility: visible; transform: none; padding: 0; }
  .pantalla.imprime .cuerpo > :not(.hojas) { display: none; }
  .hojas { display: block; overflow: visible; margin: 0; padding: 0; }
  .hoja { width: 13.97cm; height: 21.59cm; margin: 0 auto; page-break-after: always; box-shadow: none; font-size: 12pt; }
}
.nota:empty { display: none; }
.pie .nota { margin: 0 0 6px 4px; }
.pie { position: relative; z-index: 1; }
[hidden] { display: none !important; }
