/* Biblectures: sistema de diseño (v4).
   Un blog para leer mucho texto: una columna, letra grande, poco adorno.
   Colores de manuscrito: fondo de tinta ferrogálica, texto de pergamino, rojo de
   rúbrica (citas, versículos, capitulares, la acción principal) y oro de iluminación,
   muy medido (números de parte, rombos de serie).
   Cada página lleva una clase en <body>: pg-inicio, pg-libro o pg-leccion.
   La lectura toma el tono de Claude (tarjetas suaves); la portada, la de
   de Evil Rabbit (grilla, datos en mono, ángulos rectos). */

:root {
  color-scheme: dark;

  /* Color (OKLCH) */
  --paper:   oklch(15.5% 0.003 80);   /* negro tibio, sin rojo: el fondo no compite con la rúbrica */
  --paper-2: oklch(19% 0.004 80);     /* tarjetas: texto bíblico, palabra, seguir */
  --paper-3: oklch(22.5% 0.005 80);   /* popover, etiquetas */
  --rule:    oklch(30% 0.006 80);
  --rule-soft: oklch(24% 0.005 80);
  --muted:   oklch(70% 0.014 80);
  --ink-2:   oklch(87% 0.025 82);     /* pergamino: texto de lectura */
  --ink:     oklch(95% 0.022 85);     /* pergamino claro: títulos */
  --crimson-h: 27;                    /* tono de la rúbrica */
  --crimson: oklch(63% 0.195 var(--crimson-h));     /* rúbrica */
  --crimson-deep: oklch(44% 0.16 calc(var(--crimson-h) - 2));
  --crimson-ink: oklch(97% 0.015 85);
  --gold:    oklch(80% 0.095 80);     /* iluminación */

  /* Tipografía: títulos, lectura, Escritura, interfaz, datos */
  --f-head: 'Cormorant Garamond', 'Literata', Georgia, serif;
  --f-text: 'Literata', Georgia, serif;
  --f-scripture: 'Literata', Georgia, serif;
  --f-ui: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --f-heb: 'Noto Serif Hebrew', 'Literata', serif;
  --w-head: 600;
  --track-head: -0.005em;

  --read: 19px;
  --measure: 660px;
  --wide: 1040px;
  --gutter: 24px;
  --radius: 14px;
  --arc-w: 1.6;          /* grosor de los arcos de las profecías */
  --shelf-px: 3;         /* pixelado del estante 3D: cuántos píxeles de pantalla por píxel del render */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink-2);
  font: 400 var(--read)/1.72 var(--f-text);
  font-optical-sizing: auto;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; }
code { font: 0.85em/1.4 var(--f-mono); }
::selection { background: var(--crimson-deep); color: var(--crimson-ink); }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sr:focus { position: fixed; top: 12px; left: 12px; width: auto; height: auto; clip-path: none; padding: 10px 16px; background: var(--paper-3); color: var(--ink); z-index: 1000; font: 500 15px var(--f-ui); }

/* ---------- Contenedores ---------- */
.col  { max-width: calc(var(--measure) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wide { max-width: calc(var(--wide) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Encabezado ---------- */
.site-head { position: sticky; top: 0; z-index: 100; background: color-mix(in oklch, var(--paper) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule-soft); }
.site-head .wide { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.mark { font: var(--w-head) 28px/1 var(--f-head); color: var(--ink); text-decoration: none; letter-spacing: var(--track-head); display: inline-flex; align-items: center; min-height: 44px; }
.mark .r { color: var(--crimson); }
.mark { gap: 12px; }
.mark .logo { width: 44px; height: 26px; flex: none; overflow: visible; }

/* ---------- Texto ---------- */
h1, h2, h3, h4 { color: var(--ink); font-family: var(--f-head); font-weight: var(--w-head); letter-spacing: var(--track-head); text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(40px, 6vw, 58px); line-height: 1.02; }
h2 { font-size: 34px; line-height: 1.2; }
h3 { font-size: 22px; line-height: 1.3; }
p { text-wrap: pretty; }
.meta { font: 500 14px/1.5 var(--f-ui); color: var(--muted); }
.meta a { color: var(--muted); text-decoration-color: var(--rule); text-underline-offset: 3px; }
.meta a:hover { color: var(--ink); }

/* Etiquetas: pastillas suaves */
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.tag { font: 500 12.5px/1 var(--f-ui); color: var(--ink-2); background: var(--paper-3); border: 1px solid transparent; border-radius: 999px; padding: 6px 11px; white-space: nowrap; }
.tag.coll { color: var(--muted); }
.tag.t-reflexion { background: color-mix(in oklch, var(--crimson-deep) 45%, var(--paper-3)); color: var(--ink); }
.tag.t-introduccion { background: transparent; border-color: color-mix(in oklch, var(--gold) 40%, var(--rule)); color: var(--gold); }

/* ---------- Citas bíblicas en el texto ---------- */
a.ref { color: var(--crimson); text-decoration: underline; text-decoration-style: dotted; text-decoration-color: color-mix(in oklch, var(--crimson) 55%, transparent); text-decoration-thickness: 1px; text-underline-offset: 4px; white-space: nowrap; cursor: help; }
a.ref:hover, a.ref[aria-expanded="true"] { text-decoration-style: solid; }
a.fn { font: 600 0.72em/0 var(--f-ui); color: var(--crimson); text-decoration: none; vertical-align: super; padding: 0 3px; }
a.fn:hover { text-decoration: underline; }

.refpop { position: absolute; z-index: 300; width: min(400px, calc(100vw - 32px)); background: var(--paper-3); border: 1px solid var(--rule); border-radius: 12px; padding: 16px 18px 14px; box-shadow: 0 18px 40px -12px oklch(0% 0 0 / 0.7); opacity: 0; transform: translateY(4px); transition: opacity .16s var(--ease), transform .16s var(--ease); }
.refpop[data-open] { opacity: 1; transform: none; }
.refpop .t { font: 500 12.5px/1.3 var(--f-mono); color: var(--crimson); display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.refpop .t span { color: var(--muted); }
.refpop blockquote, .refpop .body { font: 400 17px/1.6 var(--f-scripture); color: var(--ink); }
.refpop .go { display: inline-block; margin-top: 10px; font: 500 13px/1 var(--f-ui); color: var(--muted); text-underline-offset: 3px; padding: 6px 0; }
.refpop .go:hover { color: var(--ink); }

/* ---------- Texto bíblico citado: un pedazo de papel, siempre en la letra de la Escritura ----------
   La hoja la dibuja site.js (Paper) a la medida de cada cita, en un SVG detrás del texto: borde roto
   a mano, fibra clara en el corte, rajaduras, relieve, manchas y bordes tostados que la
   funden con el fondo. Es un pergamino apagado, para que no encandile en la sala oscura. Sin
   JavaScript queda una hoja lisa del mismo color. */
.scripture {
  --sc-ink: oklch(21% 0.025 50);
  --sc-num: oklch(45% 0.19 27);
  --sc-cap: oklch(30% 0.04 45);
  position: relative; isolation: isolate;
  padding: 30px 34px 24px;
  filter: drop-shadow(0 1px 1px oklch(0% 0 0 / 0.5)) drop-shadow(0 14px 22px oklch(0% 0 0 / 0.55));
}
.scripture > svg.hoja { position: absolute; z-index: -1; pointer-events: none; }
.scripture:not(:has(> svg.hoja))::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 3px;
  background: radial-gradient(130% 150% at 48% 42%, transparent 50%, oklch(35% 0.06 50 / 0.6)), oklch(80% 0.04 82);
}
.scripture p { font: 400 1.08em/1.65 var(--f-scripture); color: var(--sc-ink); }
.scripture sup { font: 600 0.66em/0 var(--f-mono); color: var(--sc-num); padding-right: 4px; }
.scripture figcaption {
  font: 500 12px/1.4 var(--f-mono); color: var(--sc-cap); letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 16px;
}

/* ---------- Botón: rectángulo de pergamino, rúbrica al pasar ---------- */
.btn { display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 22px 0 24px; border-radius: 6px; font: 600 16px/1 var(--f-ui); text-decoration: none; color: var(--paper); background: var(--ink); border: 1px solid var(--ink); transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.btn svg { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover { background: var(--crimson-deep); border-color: var(--crimson-deep); color: var(--crimson-ink); }
.btn:hover svg { transform: translateX(4px); }

/* ---------- Imágenes y video ---------- */
.media img { width: 100%; height: auto; border-radius: var(--radius); background: var(--paper-2); }
.media.wide { width: min(var(--wide), 100vw - var(--gutter) * 2); margin-left: 50%; transform: translateX(-50%); }
.media.wide img { max-height: 82svh; object-fit: cover; object-position: center 30%; }
.media figcaption { position: relative; margin-top: 12px; padding-top: 12px; font: 400 14px/1.5 var(--f-ui); color: var(--muted); }
.media figcaption::before { content: ""; position: absolute; top: 0; left: 0; width: 28px; height: 2px; background: var(--crimson); }
.media figcaption .credit { display: block; margin-top: 4px; }
.media .credit { font: 400 12.5px/1.7 var(--f-mono); color: color-mix(in oklch, var(--muted) 80%, var(--paper)); }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-ph { aspect-ratio: 16 / 9; border: 1px dashed var(--rule); border-radius: var(--radius); display: grid; place-items: center; align-content: center; gap: 14px; padding: 24px; text-align: center; font: 400 15px/1.5 var(--f-ui); color: var(--muted); }
.video-ph svg { width: 44px; height: 44px; color: var(--crimson); }

/* ---------- Pie ---------- */
.site-foot { position: relative; z-index: 1; border-top: 1px solid var(--rule-soft); margin-top: 80px; }
.site-foot .wide { max-width: none; padding-block: 18px 22px; text-align: center; font: 400 12.5px/1.6 var(--f-ui); color: var(--muted); }
.site-foot a { color: var(--muted); text-underline-offset: 3px; }
.site-foot a:hover { color: var(--ink); }

/* Puntos de avance: uno por lección */
.dots { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; justify-content: flex-end; max-width: 220px; }
.dots .dg { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border: 1px solid var(--muted); opacity: .55; }
.dots i.on { background: var(--crimson); border-color: var(--crimson); opacity: 1; }

/* ======================================================================
   Inicio: solo el estante (el título queda para los lectores de pantalla)
   ====================================================================== */
.hero { padding: 0; }
.hero h1 { font-size: clamp(44px, 6.6vw, 82px); line-height: 1; letter-spacing: -0.012em; max-width: 920px; margin-inline: auto; text-align: center; }
.lede { max-width: 620px; margin: 40px auto 0; text-align: center; color: var(--ink-2); }
.lede a { color: var(--ink); text-decoration-color: var(--crimson); text-underline-offset: 4px; }
.lede a:hover { text-decoration-thickness: 2px; }

/* Arcos (en el Prólogo): cada uno une dos capítulos que se citan o se aluden. El gráfico sale
   de la columna de lectura y ocupa el ancho de una foto ancha. */
.prose > .arcos { --aw: min(var(--wide), calc(100vw - 2 * var(--gutter))); width: var(--aw); margin: 48px calc((100% - var(--aw)) / 2) 40px; }
.arcs-plot { position: relative; }
.arcs-plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .4s var(--ease); }
.arcs-all { filter: brightness(1.3) saturate(1.1); }
.arcs-svg { position: relative; width: 100%; height: auto; overflow: visible; }
.ticks line { stroke: var(--muted); stroke-width: 1; opacity: .55; }
.ticks .axis { opacity: .8; }
.ticks .divide { stroke: var(--ink-2); stroke-width: 1.5; opacity: .9; }
.zonas rect { fill: transparent; }
.arcos.focus .arcs-all { opacity: .22; }
/* Debajo del eje: los extremos y, a cada lado de la división, el nombre de cada testamento */
.arcs-axis { position: relative; height: 22px; margin-top: 8px; font: 500 12.5px/1 var(--f-ui); color: var(--muted); }
.arcs-axis span { position: absolute; top: 0; white-space: nowrap; }
.arcs-axis .ax-end:last-child { right: 0; }
.arcs-axis .ax-t { font: 400 12px/1 var(--f-mono); }
.arcs-axis .at { right: calc(100% - var(--nt, 58.9%) + 10px); }
.arcs-axis .nt { left: calc(var(--nt, 58.9%) + 10px); }
/* Al pasar por un libro: su nombre y, como dato, cuántas referencias tiene */
.arcs-live { min-height: 28px; margin-top: 12px; text-align: center; font: 400 15px/1.6 var(--f-ui); color: var(--muted); }
.arcs-live b { font: var(--w-head) 22px/1 var(--f-head); color: var(--ink); margin-right: 10px; }
.arcs-cred { margin-top: 6px; text-align: center; font: 400 13px/1.5 var(--f-ui); color: var(--muted); }
.arcs-cred a { color: inherit; text-underline-offset: 3px; }

/* El estante: la sala en 3D es lo último de la portada */
.estante { margin-top: 36px; position: relative; }
.shelf-stage { position: relative; aspect-ratio: 1040 / 600; background: #0a0d16; border: 1px solid var(--rule-soft); overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.estante:not(.has-shelf) .shelf-stage { display: none; }
.shelf-stage canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: grab; }
.shelf-stage canvas.drag { cursor: grabbing; }
.shelf-stage canvas.point { cursor: pointer; }
.shelf-stage.reading::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 40%, oklch(0% 0 0 / 0.5)); }

/* Papel rasgado: el cartel con el nombre del libro */
.scrap-wrap { filter: drop-shadow(3px 4px 0 oklch(0% 0 0 / 0.6)); }
.paper {
  background:
    radial-gradient(circle at 18% 30%, oklch(70% 0.06 70 / .35) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 64%, oklch(65% 0.06 60 / .3) 0 1.5px, transparent 3px),
    radial-gradient(ellipse at 50% 50%, #efe2c2 40%, #dcc79a 100%);
  color: #2b1d12;
  clip-path: polygon(0% 9%, 7% 1%, 15% 6%, 24% 0%, 33% 5%, 42% 1%, 52% 6%, 61% 0%, 71% 5%, 80% 1%, 89% 6%, 100% 0%, 98% 28%, 100% 52%, 97% 78%, 100% 100%, 90% 95%, 81% 100%, 71% 94%, 60% 100%, 50% 95%, 39% 100%, 29% 94%, 19% 100%, 9% 95%, 0% 100%, 2% 74%, 0% 50%, 3% 26%);
}
/* La única indicación de la portada: sobre la pared de la sala, casi fundida con ella */
.shelf-hint { margin: 0 auto 14px; max-width: 640px; text-align: center; font: italic 400 15px/1.5 var(--f-text); color: oklch(72% 0.025 80 / .7); transition: opacity .4s var(--ease); }
.shelf-hint a { color: oklch(84% 0.06 80 / .9); text-decoration: underline; text-decoration-color: oklch(80% 0.09 75 / .45); text-underline-offset: 3px; }
.shelf-hint a:hover { color: var(--gold); }
.estante:not(.has-shelf) .shelf-hint { display: none; }
/* Sobre la pared de la sala no: tapaba el frontón. Va arriba, sobre el fondo, casi fundida con él */
.shelf-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; }
.shelf-tip .paper { display: block; padding: 10px 16px 11px; font: var(--w-head) 23px/1 var(--f-head); white-space: nowrap; }
.shelf-tip small { display: block; margin-top: 4px; font: italic 400 13px/1.2 var(--f-text); color: oklch(42% 0.04 50); }
.shelf-tip.on small { color: #9b1f1a; }

/* Sin el estante (sin WebGL): la lista de libros en estudio */
.estante.has-shelf .estudio:not(:focus-within) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.estudio { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 64px; }
.estudio a, .estudio .soon { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name dots" "where dots"; align-items: center; gap: 2px 24px; padding: 20px 0; border-bottom: 1px solid var(--rule-soft); text-decoration: none; }
.estudio .name { grid-area: name; font: var(--w-head) 30px/1.2 var(--f-head); letter-spacing: var(--track-head); color: var(--ink); transition: color .15s var(--ease); }
.estudio .where { grid-area: where; font: 400 13px/1.5 var(--f-mono); color: var(--muted); }
.estudio .dots { grid-area: dots; }
.estudio a:hover .name { color: var(--crimson); }
.estudio .soon .name { color: var(--muted); }

/* ======================================================================
   La primera página de cada libro: su introducción y el índice de sus lecturas.
   Es a donde lleva la luz al abrir un libro en el estante.
   ====================================================================== */
.book-head { padding-block: 80px 0; text-align: center; }
.book-head .kick { font: 500 12.5px/1.4 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.book-head .kick span { color: var(--muted); }
.book-head h1 { font-size: clamp(60px, 10vw, 112px); line-height: .92; letter-spacing: -0.015em; margin-top: 20px; }
.book-head .passage { font: italic 400 18px/1.4 var(--f-text); color: var(--muted); margin-top: 16px; }
/* Un rombo de rúbrica entre dos filetes, como en la portada de un códice */
/* Granadas y cadenilla de las columnas del templo (1 Reyes 7:17-20); el SVG lo arma tools/build.mjs */
.book-head .orn { display: flex; justify-content: center; margin-top: 30px; }
.book-head .orn svg { width: 360px; max-width: 100%; height: auto; overflow: visible; }
.book-head .orn .cad { opacity: .8; }
main [tabindex="-1"]:focus { outline: none; }
.pg-libro .prose { padding-top: 40px; }

.lecturas { margin-top: 80px; }
.lecturas h2 { font-size: 40px; }
.toc-state { font: 500 14px/1.5 var(--f-ui); color: var(--muted); margin-top: 6px; }
.toc-empty { margin-top: 18px; font-style: italic; color: var(--muted); }
.toc { margin-top: 28px; }
.toc > * + * { margin-top: 44px; }
.toc h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); font: 600 12.5px/1.4 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--crimson); }
.toc h3 .pas { font: 400 12.5px/1.4 var(--f-mono); letter-spacing: 0; text-transform: none; color: var(--muted); }
.toc ol { list-style: none; padding: 0; }
.toc li a, .toc li .row { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; align-items: baseline; gap: 2px 16px; padding: 17px 0; border-bottom: 1px solid var(--rule-soft); text-decoration: none; }
.toc .n { font: 500 13px/1 var(--f-mono); color: var(--crimson); }
.toc .n:empty::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--gold); rotate: 45deg; translate: 2px -2px; }
.toc .t { font: var(--w-head) 25px/1.25 var(--f-head); letter-spacing: var(--track-head); color: var(--ink); transition: color .15s var(--ease); }
.toc .tp { margin-left: 12px; font: italic 400 15px/1 var(--f-text); color: var(--gold); }
.toc .pas { font: 400 13px/1.4 var(--f-mono); color: var(--muted); white-space: nowrap; }
.toc li a:hover .t, .toc li a:focus-visible .t { color: var(--crimson); }
.toc .off .t { color: color-mix(in oklch, var(--ink-2) 55%, var(--paper)); }
.toc .off .n { opacity: .5; }
.toc .off .soon { grid-column: 2; font: italic 400 14px/1.4 var(--f-text); color: color-mix(in oklch, var(--muted) 75%, var(--paper)); }

/* ======================================================================
   Al abrir un libro, la sala sale de su recuadro y ocupa la pantalla (assets/estante.js);
   la luz sale de las hojas, en 3D. Después se desvanece sobre la página nueva.
   ====================================================================== */
canvas.dive { position: fixed; inset: 0; z-index: 700; display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: progress; }
.nav-busy, .nav-busy body { cursor: progress; }
/* El cargador: cuando la luz del libro llena la pantalla, baja al fondo del sitio y el logo de
   los arcos se dibuja, rápido */
.blind { position: fixed; inset: 0; z-index: 750; display: grid; place-items: center; pointer-events: none; background: var(--paper); opacity: 0; visibility: hidden; transition: opacity .42s var(--ease), visibility 0s .42s; }
.blind.on { opacity: 1; visibility: visible; transition: opacity .42s var(--ease); }
.blind.out { opacity: 0; transition: opacity .45s var(--ease); }
.blind svg { width: 120px; height: 72px; overflow: visible; }
.blind path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.blind.on path { animation: draw .5s var(--ease) forwards; animation-delay: calc(.15s + var(--i, 0) * 55ms); }
:root[data-motion="reduce"] .blind path { stroke-dashoffset: 0; }
main.entering { animation: enter .9s var(--ease) both; }
@keyframes enter { from { opacity: 0; translate: 0 14px; } }
main.leaving { transition: opacity .18s var(--ease); opacity: 0; }

/* ======================================================================
   Pantalla de carga de la portada: el logo de los arcos se dibuja solo
   ====================================================================== */
.loader { display: none; }
.js .loader { position: fixed; inset: 0; z-index: 900; display: grid; place-content: center; justify-items: center; gap: 22px; background: var(--paper); transition: opacity .7s var(--ease), visibility .7s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader svg { width: 132px; height: 80px; overflow: visible; animation: breathe 2.6s 1.3s ease-in-out infinite; }
.loader path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .9s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 110ms); }
.loader p { font: var(--w-head) 32px/1 var(--f-head); letter-spacing: var(--track-head); color: var(--ink); opacity: 0; animation: fade-in .8s .7s var(--ease) forwards; }
.loader p .r { color: var(--crimson); }
.loader small { font: 400 12.5px/1 var(--f-mono); color: var(--muted); opacity: 0; animation: fade-in .8s 1.6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes breathe { 50% { opacity: .6; } }
:root[data-motion="reduce"] .loader path { stroke-dashoffset: 0; }
:root[data-motion="reduce"] .loader p, :root[data-motion="reduce"] .loader small { opacity: 1; }

/* ======================================================================
   Lección: el tono de Claude
   ====================================================================== */
.lesson-head { padding-block: 64px 8px; }
.lesson-head .where { margin-bottom: 20px; }
.lesson-head .passage { font: 500 14px/1.4 var(--f-mono); color: var(--crimson); margin-top: 16px; }
.lesson-head .tags { margin-top: 16px; }

.prose { padding-top: 24px; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { margin-top: 2.1em; }
.prose h2 + * { margin-top: 0.6em; }
.prose em, .prose i { color: var(--ink); }
.prose a:not(.ref):not(.fn) { color: var(--ink); text-decoration-color: var(--crimson); text-underline-offset: 4px; }
.prose > .scripture, .prose > .word, .prose > .media { margin-block: 40px; }

/* Capitular de rúbrica en el primer párrafo, como en los códices */
.prose > p:first-child::first-letter { float: left; font: var(--w-head) 3.6em/0.8 var(--f-head); color: var(--crimson); padding: 0.1em 0.12em 0 0; }
@supports (initial-letter: 3) {
  .prose > p:first-child::first-letter { float: none; font-size: inherit; line-height: inherit; padding: 0; initial-letter: 3; margin-right: 0.14em; }
}

.word { background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 22px 24px 20px; }
.word .w { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 10px; }
.word .orig { font: 400 30px/1.2 var(--f-scripture); color: var(--ink); }
.word .orig[lang="he"] { font-family: var(--f-heb); }
.word .tr { font-style: italic; color: var(--ink); }
.word .sense { font: 500 15px/1.4 var(--f-ui); color: var(--muted); }
.word p:not(.w) { font-size: 18px; line-height: 1.65; }
.word p.strong { font: 400 12.5px/1 var(--f-mono); color: var(--muted); margin-top: 14px; }

.end { margin-top: 72px; padding-top: 8px; border-top: 1px solid var(--rule-soft); }
.end > h2 { font-size: 26px; margin: 44px 0 8px; }
.notes { padding-left: 1.4em; font-size: 17px; line-height: 1.65; }
.notes li { padding: 8px 0; }
.notes li::marker { color: var(--crimson); font: 500 13px var(--f-mono); }
.notes .back { font: 500 13px var(--f-ui); color: var(--muted); margin-left: 6px; text-underline-offset: 3px; }
.notes li:target { background: var(--paper-2); border-radius: 6px; }

.sources { list-style: none; padding: 0; }
.sources li { padding: 20px 0; border-bottom: 1px solid var(--rule-soft); }
.sources .kind { font: 400 12.5px/1 var(--f-mono); color: var(--gold); margin-bottom: 8px; }
.sources .title { font-size: 20px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.sources .meta { margin-top: 4px; }
.sources .why { font-size: 17px; line-height: 1.6; margin-top: 8px; }

/* Seguir leyendo: una tarjeta suave al final, sin anuncio de serie */
.sigue { margin-top: 88px; text-align: center; background: var(--paper-2); border-radius: 20px; padding: 40px 24px 28px; }
.sigue .next { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; padding: 8px 12px; max-width: 100%; }
.sigue .k { font: 500 14px/1.4 var(--f-ui); color: var(--muted); }
.sigue .t { font: var(--w-head) clamp(30px, 4.4vw, 38px)/1.2 var(--f-head); letter-spacing: var(--track-head); color: var(--ink); text-wrap: balance; }
.sigue .pas { font: 400 13px/1.4 var(--f-mono); color: var(--crimson); }
.sigue a.next:hover .t { text-decoration: underline; text-decoration-color: var(--crimson); text-decoration-thickness: 1px; text-underline-offset: 6px; }
.sigue .soon .t { color: var(--ink-2); }
.trail { margin-top: 32px; }
.trail .meta { margin-bottom: 10px; }
.trail ol { list-style: none; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 0; }
.trail li { position: relative; width: 28px; height: 28px; display: grid; place-items: center; }
.trail li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--muted); opacity: .6; }
.trail li.on::before { background: var(--crimson); border-color: var(--crimson); opacity: 1; }
.trail li[aria-current]::before { width: 12px; height: 12px; background: var(--ink); border-color: var(--ink); opacity: 1; }
.trail li a { position: absolute; inset: -8px; border-radius: 50%; }
.trail .prev { display: inline-block; margin-top: 14px; font: 500 14px/1.4 var(--f-ui); color: var(--muted); text-underline-offset: 3px; padding: 10px 0; }
.trail .prev:hover { color: var(--ink); }

/* Dato pendiente de completar */
.fill { border: 1px dashed var(--muted); border-radius: 4px; padding: 0 6px; color: var(--muted); font-style: normal; }
.sample-note { margin-top: 24px; padding: 12px 16px; border: 1px dashed var(--muted); border-radius: 8px; font: 400 14.5px/1.5 var(--f-ui); color: var(--muted); }

/* Lección en pantallas anchas: el texto a la izquierda y un margen a la derecha, como el de
   una Biblia de estudio. Ahí van las notas al pie, al lado del renglón que las cita, y el pie
   de cada imagen o video, al lado de la imagen. El bloque entero mide lo mismo que una foto
   ancha (1040px); el texto queda en unos 75 caracteres por línea. */
.sidenote { display: none; }
@media (min-width: 1100px) {
  .pg-leccion { --read: 20px; --margin-w: 280px; --margin-gap: 56px; }
  .pg-leccion article.col { max-width: calc(var(--wide) + var(--gutter) * 2); padding-right: calc(var(--gutter) + var(--margin-w) + var(--margin-gap)); }
  .pg-leccion .media, .pg-leccion .media.wide { position: relative; width: auto; max-width: none; margin-left: 0; padding-inline: 0; transform: none; }
  .pg-leccion .media.wide img { max-height: 78svh; }
  .pg-leccion .media figcaption { position: absolute; left: calc(100% + var(--margin-gap)); bottom: 0; width: var(--margin-w); margin: 0; padding-top: 14px; font-size: 14.5px; line-height: 1.55; }
  .pg-leccion .sidenote { display: block; float: right; clear: right; position: relative; width: var(--margin-w); margin: 0.3em calc(-1 * (var(--margin-w) + var(--margin-gap))) 1em 0; font: 400 14.5px/1.6 var(--f-ui); color: var(--muted); text-indent: 0; }
  .pg-leccion .sidenote .n { font: 500 12.5px/1 var(--f-mono); color: var(--crimson); margin-right: 8px; }
  .pg-leccion .sidenote.flash { color: var(--ink); }
  .pg-leccion.has-sidenotes .end #notas, .pg-leccion.has-sidenotes .end .notes { display: none; }
}

@media (max-width: 760px) {
  :root { --read: 18px; --gutter: 18px; }
  h2 { font-size: 30px; }
  .prose > .arcos { margin-block: 36px 28px; }
  .lede { margin-top: 28px; }
  .arcs-axis .ax-t { display: none; }
  .estante { margin-top: 28px; }
  .shelf-stage { aspect-ratio: 4 / 5; }
  .estudio { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .estudio .dots { max-width: 120px; }
  .scripture { padding: 30px 22px 22px; }
  .book-head { padding-top: 52px; }
  .toc li a, .toc li .row { grid-template-columns: 1.9em minmax(0, 1fr); }
  .toc .pas { grid-column: 2; }
  .toc h3 { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .refpop { transform: none; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { transition-duration: 0.01ms !important; animation: none !important; }
