/* ─────────────────────────────────────────────────────────────
   idegest.com · hoja de estilos
   Escrita a mano. Todo se sirve en local: cero peticiones a terceros.

   La idea: «las llaves». Cada capítulo de la historia es una llave numerada, con su
   color y su dibujo; un marcador de cinco llaves dice dónde estás, de dónde vienes y a
   dónde vas; y el acceso de clientes no sale nunca de pantalla.
   ───────────────────────────────────────────────────────────── */

/* ── Tokens de color ──
   La paleta es de imprenta fina: crema y tinta de base, cuatro tonos profundos y apagados que
   respiran (bosque, marino, salvia y ocre) y el magenta de idegest como TOQUE ESPECIAL: el
   botón, la palabra «llaves», el marcador y una llave magenta en cada ilustración. El bosque es
   el complementario del magenta. Los cocientes de contraste son WCAG, calculados sobre estos
   valores exactos.

   Texto normal (AA = 4,5:1)
     tinta         sobre crema 16,5 · papel 17,5 · arena 14,9 · salvia 11,8 · ocre 10,2
     tinta-suave   sobre crema 10,0 · arena 9,1 · salvia 7,2 · ocre 6,2
     tinta-tenue   sobre crema 6,2 · papel 6,6 · arena 5,7
     magenta-texto sobre crema 5,3 · papel 5,6 · arena 4,8   (enlaces y botones)
     magenta-hondo sobre crema 7,3 · arena 6,6 · salvia 5,2     (enlaces sobre salvia)
     crema         sobre bosque 11,4 · marino 12,7 · tinta 16,5
     crema-tenue   sobre bosque 6,5 · marino 7,2 · tinta 9,3
     ocre          sobre bosque 7,1 · marino 7,9         (enlaces sobre oscuro)
     blanco        sobre magenta-texto 5,9
     magenta-luminoso sobre tinta 5,6                        (enlaces en el pie)

   El magenta puro (#E6007E) NO llega a 4,5:1 como texto: úsalo en gráficos y en texto grande
   (≥ 24 px). Sobre bosque y marino contrasta poco en luminosidad (2,8 y 3,2), pero sí en
   tono; por eso las llaves llevan contorno negro. La línea (#D9D3C3) es decorativa. */

:root {
  /* Superficies */
  --crema: #F5F2EA;          /* fondo de la página */
  --papel: #FBF9F4;          /* superficie más clara */
  --arena: #ECE7DA;          /* superficie más oscura */
  --linea: #D9D3C3;
  --blanco: #FFFFFF;

  /* Tinta */
  --tinta: #151412;
  --tinta-suave: #3D3B37;
  --tinta-tenue: #5C5953;
  --crema-tenue: #BDB8AA;    /* texto secundario sobre fondo oscuro */

  /* Los tonos que respiran */
  --bosque: #17382F;
  --marino: #1B2A49;
  --salvia: #C5D3C2;
  --ocre: #E3BC68;

  /* El magenta de idegest: el toque especial */
  --magenta: #E6007E;
  --magenta-texto: #C4006B;
  --magenta-hondo: #9E0055;
  --magenta-luminoso: #FF3DA0;

  /* Usos */
  --fondo: var(--crema);
  --texto: var(--tinta);
  --texto-suave: var(--tinta-suave);
  --texto-tenue: var(--tinta-tenue);
  --acento: var(--magenta);
  --enlace: var(--magenta-texto);
  --enlace-hover: var(--magenta-hondo);
  --foco: var(--magenta-texto);

  /* Los botones: los cambia cada tema si hace falta */
  --b-fondo: var(--magenta-texto);
  --b-texto: var(--blanco);
  --b-borde: var(--tinta);
  --b-sombra: var(--tinta);
}

/* ── Tipografías ──
   Alojadas en local (/fuentes), recortadas a latín y castellano; las licencias
   van en /fuentes/LICENCIAS.txt. Ambas son variables en peso (100–900).

   Urbanist: títulos y texto. El wordmark del logo es el peso 850.
   Fraunces: solo cursiva, como acento (una palabra del titular, los numerales).
   Es el corte de texto (tamaño óptico 14), recio, que acompaña bien a Urbanist
   en negra. Como solo existe la cursiva, úsala siempre con font-style: italic.

   Sin € ni ™ en Urbanist: si algún día salen en un texto, el navegador los
   toma de la fuente del sistema. */

@font-face {
  font-family: 'Urbanist';
  src: url('/fuentes/urbanist.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('/fuentes/fraunces-cursiva.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --letra: 'Urbanist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --letra-acento: 'Fraunces', Georgia, 'Times New Roman', serif;

  /* Formas para máscaras (flecha, llave) y el subrayado del titular, como datos del propio
     CSS: ni una petición más, y se tiñen con el color del texto */
  --flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Cpath d='M0 8h21M14.5 1.5 21 8l-6.5 6.5' fill='none' stroke='%23000' stroke-width='2.4'/%3E%3C/svg%3E");
  --llave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='7' cy='17' r='4.2' fill='none' stroke='%23000' stroke-width='2.6'/%3E%3Cpath d='M10 14 20.5 3.5M16.5 7.5l3 3M13.5 10.5l2.5 2.5' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --subraya: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M2 7C14 1 24 11 36 6S58 2 70 7 94 11 118 5' fill='none' stroke='%23151412' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ── Los temas: el color de cada capítulo ──
   Una portada, una banda de la portada y el panel «siguiente capítulo» eligen uno.
   La historia respira así: salvia, marino, arena, bosque, ocre. */

.tema--salvia {
  --fondo-c: var(--salvia);
  --texto-c: var(--tinta);
  --suave-c: var(--tinta-suave);
  --enlace-c: var(--magenta-hondo);
  --acento-c: var(--magenta);
  --foco: var(--tinta);
}

.tema--marino {
  --fondo-c: var(--marino);
  --texto-c: var(--crema);
  --suave-c: var(--crema-tenue);
  --enlace-c: var(--ocre);
  --acento-c: var(--ocre);
  --foco: var(--ocre);
}

.tema--arena {
  --fondo-c: var(--arena);
  --texto-c: var(--tinta);
  --suave-c: var(--tinta-suave);
  --enlace-c: var(--magenta-texto);
  --acento-c: var(--magenta);
}

.tema--bosque {
  --fondo-c: var(--bosque);
  --texto-c: var(--crema);
  --suave-c: var(--crema-tenue);
  --enlace-c: var(--ocre);
  --acento-c: var(--ocre);
  --foco: var(--ocre);
}

.tema--ocre {
  --fondo-c: var(--ocre);
  --texto-c: var(--tinta);
  --suave-c: var(--tinta-suave);
  --enlace-c: var(--tinta);
  --acento-c: var(--magenta);
  --foco: var(--tinta);
}

/* ── Base ── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--letra);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* el sitio que deja la barra de capítulos, fija abajo en pantallas pequeñas */
  padding-bottom: calc(3.75rem + env(safe-area-inset-bottom));
}

@media (min-width: 52rem) {
  body { padding-bottom: 0; }
}

main { flex: 1 0 auto; }

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--enlace); }
a:hover { color: var(--enlace-hover); }

:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--magenta-texto);
  color: var(--blanco);
}

/* El texto que solo oyen los lectores de pantalla (también lo usa
   enlacesExternos en sitio.yml) */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.saltar {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--tinta);
  color: var(--crema);
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
}

.saltar:focus { top: 16px; }

.contenedor {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 48px);
}

/* La flecha, dibujada con una máscara porque Urbanist no tiene «→» */
.flecha {
  display: inline-block;
  flex: none;
  width: 1.15em;
  height: 0.8em;
  background: currentColor;
  -webkit-mask: var(--flecha) center / contain no-repeat;
  mask: var(--flecha) center / contain no-repeat;
  transition: transform 0.2s;
}

.flecha--izq { transform: scaleX(-1); }

/* ── Ilustraciones ──
   Los SVG van incrustados y llevan colores fijos de la paleta: cada escena vive sobre el fondo
   de su capítulo. El magenta solo aparece en la llave, la firma de la marca en cada dibujo.
   Trazo grueso, formas planas y sombra dura. */

.ilu {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ilu .t {
  stroke: var(--tinta);
  stroke-width: 6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ilu .s { fill: var(--tinta); stroke: none; }
.ilu .mag { fill: var(--magenta); }
.ilu .ocre { fill: var(--ocre); }
.ilu .marino { fill: var(--marino); }
.ilu .bosque { fill: var(--bosque); }
.ilu .salvia { fill: var(--salvia); }
.ilu .papel { fill: var(--papel); }
.ilu .tinta { fill: var(--tinta); }
.ilu .arena { fill: var(--arena); }
.ilu .l { fill: var(--tinta); opacity: 0.85; }
.ilu .chk { fill: none; stroke: var(--papel); stroke-width: 11; }
.ilu .pt { fill: none; stroke: var(--tinta); stroke-width: 6; stroke-dasharray: 1 15; stroke-linecap: round; }
.ilu .pt--claro { stroke: var(--papel); }
.ilu .chispa { stroke: var(--tinta); stroke-width: 7; stroke-linecap: round; }

.ilu .n,
.ilu .m {
  fill: var(--papel);
  stroke: none;
}

.ilu .n {
  font-family: var(--letra-acento);
  font-size: 76px;
  font-style: italic;
  font-weight: 400;
}

.ilu .n2 { font-size: 60px; }

.ilu .m {
  font-family: var(--letra);
  font-size: 92px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

/* Los tubos: el arco del candado y los eslabones de la cadena */
.ilu .tubo0,
.ilu .tubo,
.ilu .tubos {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ilu .tubo0,
.ilu .tubos { stroke: var(--tinta); stroke-width: 42; }

.ilu .tubo { stroke-width: 28; }
.ilu .tubo--ocre { stroke: var(--ocre); }
.ilu .tubo--marino { stroke: var(--marino); }
.ilu .tubo--bosque { stroke: var(--bosque); }
.ilu .tubo--salvia { stroke: var(--salvia); }
.ilu .tubo--papel { stroke: var(--papel); }
.ilu .roto { stroke-dasharray: 300 54; stroke-dashoffset: 218; }

/* ── Botones ── */

.boton {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.7em 1.3em;
  border: 2px solid var(--b-borde);
  border-radius: 999px;
  background: var(--b-fondo);
  color: var(--b-texto);
  box-shadow: 4px 4px 0 var(--b-sombra);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.boton:hover {
  color: var(--b-texto);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--b-sombra);
}

.boton:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--b-sombra);
}

.boton:hover .flecha { transform: translateX(0.25em); }

.boton--contorno {
  --b-fondo: var(--papel);
  --b-texto: var(--tinta);
}

.boton--grande {
  padding: 0.85em 1.6em;
  font-size: 1.125rem;
}

/* ── Cabecera: el logo, el marcador de capítulos y el acceso de clientes ── */

.cabecera {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--crema);
  border-bottom: 1px solid var(--linea);
}

.cabecera__barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 4rem;
  padding-block: 8px;
}

.cabecera__logo { display: block; flex: none; line-height: 0; }
.cabecera__logo img { width: clamp(92px, 11vw, 116px); }

/* El acceso de clientes: el botón de la casa, siempre a la vista */
.acceso {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 1.05em 0.5em 0.85em;
  border: 2px solid var(--tinta);
  border-radius: 999px;
  background: var(--magenta-texto);
  color: var(--blanco);
  box-shadow: 3px 3px 0 var(--tinta);
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.acceso:hover {
  color: var(--blanco);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--tinta);
}

.acceso:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--tinta);
}

.acceso__llave {
  width: 1.3em;
  height: 1.3em;
  background: currentColor;
  -webkit-mask: var(--llave) center / contain no-repeat;
  mask: var(--llave) center / contain no-repeat;
}

/* El marcador: cinco llaves. Las que quedan atrás, llenas; la actual, con su nombre;
   las que faltan, vacías. En pantallas pequeñas es una barra fija abajo. */

.rail {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--papel);
  border-top: 2px solid var(--tinta);
}

.rail__lista {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail__item { display: flex; align-items: center; }

.rail__item + .rail__item::before {
  content: "";
  flex: none;
  width: 10px;
  height: 3px;
  background: var(--linea);
}

.rail__item--hecho + .rail__item::before { background: var(--tinta); }

.rail__enlace {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 999px;
  color: var(--tinta);
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.rail__num {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 2px solid var(--tinta);
  border-radius: 50%;
  background: var(--papel);
  font-size: 0.75rem;
  font-weight: 800;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s, color 0.15s;
}

.rail__texto {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.rail__item--hecho .rail__num {
  background: var(--tinta);
  color: var(--crema);
}

.rail__enlace:hover .rail__num {
  background: var(--ocre);
  color: var(--tinta);
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 var(--tinta);
}

.rail__item--actual .rail__enlace {
  padding-right: 0.95rem;
  border: 2px solid var(--tinta);
  background: var(--magenta-texto);
  color: var(--blanco);
  box-shadow: 3px 3px 0 var(--tinta);
}

.rail__item--actual .rail__num {
  width: 28px;
  height: 28px;
  margin: 2px;
  border: 0;
  background: var(--blanco);
  color: var(--magenta-texto);
}

.rail__item--actual .rail__enlace:hover .rail__num { transform: none; box-shadow: none; }

.rail__item--actual .rail__texto {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
}

@media (min-width: 52rem) {
  .rail {
    position: static;
    flex: 1;
    padding: 0;
    background: none;
    border: 0;
  }

  .rail__item + .rail__item::before { width: 18px; }
}

/* Con sitio de sobra, todos los capítulos llevan su nombre */
@media (min-width: 76rem) {
  .rail__texto {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
  }

  .rail__enlace { padding-right: 0.7rem; }
  .rail__item + .rail__item::before { width: 12px; }
}

/* ── Pie ── */

.pie {
  margin-top: 0;
  padding-block: clamp(40px, 6vw, 72px) 28px;
  background: var(--tinta);
  color: var(--crema);
  border-top: 3px solid var(--tinta);
}

.pie a {
  color: var(--crema);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: rgb(245 242 234 / 0.45);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.pie a:hover {
  color: var(--magenta-luminoso);
  text-decoration-color: currentColor;
}

.pie :focus-visible { outline-color: var(--magenta-luminoso); }

.pie__arriba {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgb(245 242 234 / 0.2);
}

.pie__logo { display: block; line-height: 0; text-decoration: none; }
.pie__logo img { width: min(280px, 70vw); }

.pie__menu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

.pie__abajo {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-top: 24px;
  color: var(--crema-tenue);
  font-size: 0.875rem;
}

.pie__abajo p { margin: 0; }
.pie__abajo a { color: var(--crema-tenue); }

/* ── Texto corrido ── */

.prosa {
  max-width: 38rem;   /* unos 65 caracteres por línea */
  font-size: 1.1875rem;
  line-height: 1.65;
}

.prosa > * { margin-block: 0 1.1em; }

.prosa h2 {
  margin-block: 2.2em 0.6em;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.prosa > h2:first-child { margin-top: 0; }

.prosa a {
  color: var(--enlace-c, var(--enlace));
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.2s;
}

.prosa a:hover {
  color: var(--enlace-c, var(--enlace-hover));
  text-decoration-thickness: 2px;
  text-decoration-color: currentColor;
}

.prosa strong { font-weight: 700; }

.prosa ul,
.prosa ol { padding-left: 1.5em; }

.prosa li { margin-bottom: 0.6em; padding-left: 0.25em; }

.prosa li::marker {
  color: var(--enlace-c, var(--enlace));
  font-weight: 700;
}

/* Llamadas: el párrafo que solo es un enlace («sigue leyendo»). Se reconoce con :has();
   un navegador que no lo conozca lo deja como un enlace normal, que sigue siendo usable. */

.prosa p:has(> a:only-child) { margin-top: 1.7em; }

.prosa p:has(> a:only-child) > a {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  color: var(--texto-c, var(--tinta));
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--acento-c, var(--magenta));
  padding-bottom: 0.15em;
  transition: color 0.2s, border-color 0.2s;
}

.prosa p:has(> a:only-child) > a::after {
  content: "";
  flex: none;
  width: 1.15em;
  height: 0.8em;
  background: currentColor;
  -webkit-mask: var(--flecha) center / contain no-repeat;
  mask: var(--flecha) center / contain no-repeat;
  transition: transform 0.2s;
}

.prosa p:has(> a:only-child) > a[target="_blank"]::after { transform: rotate(-45deg); }

.prosa p:has(> a:only-child) > a:hover {
  color: var(--enlace-c, var(--enlace));
  border-bottom-color: var(--enlace-c, var(--enlace));
}

.prosa p:has(> a:only-child) > a:hover::after { transform: translateX(0.3em); }

.prosa p:has(> a:only-child) > a[target="_blank"]:hover::after {
  transform: rotate(-45deg) translateX(0.3em);
}

/* El «sigue leyendo» que ya tiene su panel debajo (lo marca capitulo.twig) */
.prosa .encadena { display: none; }

/* ── Portada: el arranque ── */

.portada { overflow-x: clip; }

.heroe {
  position: relative;
  padding-block: clamp(28px, 5vw, 64px) clamp(56px, 8vw, 112px);
}

/* un fondo de puntos, como papel cuadriculado, que se desvanece hacia abajo */
.heroe::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--linea) 1.6px, transparent 1.8px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(#000 40%, transparent);
  mask-image: linear-gradient(#000 40%, transparent);
  pointer-events: none;
}

.heroe__rejilla {
  position: relative;
  display: grid;
  gap: 20px 0;
  align-items: center;
}

/* En pantallas pequeñas el orden es: titular, dibujo, texto, botones */
.heroe__texto { display: contents; }
.heroe__titular { order: 1; }
.heroe__arte { order: 2; }
.heroe__entradilla { order: 3; }
.heroe__acciones { order: 4; }

@media (min-width: 60rem) {
  .heroe__rejilla {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    column-gap: 24px;
  }

  .heroe__texto { display: block; }
  .heroe__titular, .heroe__arte, .heroe__entradilla, .heroe__acciones { order: 0; }
}

.heroe__titular {
  margin: 0;
  font-size: clamp(3.25rem, 9vw, 8rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

/* La palabra de las llaves: Fraunces cursiva en magenta, subrayada a mano */
.heroe__titular em {
  background: var(--subraya) 0 100% / 100% 0.2em no-repeat;
  color: var(--magenta);
  font-family: var(--letra-acento);
  font-size: 1.04em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.heroe__entradilla {
  max-width: 34rem;
  margin-top: clamp(20px, 3vw, 32px);
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.5;
  color: var(--texto-suave);
}

.heroe__entradilla > * { margin-block: 0 1em; }
.heroe__entradilla > :last-child { margin-bottom: 0; }

.heroe__acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  margin: clamp(28px, 4vw, 44px) 0 0;
}

/* El arte: una llave grande sobre un disco rosa, que flota */
.heroe__arte { position: relative; }

.heroe__arte::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 3px solid var(--tinta);
  border-radius: 50%;
  background: var(--bosque);
  box-shadow: 12px 12px 0 var(--tinta);
}

.heroe__arte .ilu { position: relative; }

@media (min-width: 60rem) {
  .heroe__arte { margin-right: calc(-1 * clamp(0px, 4vw, 56px)); }
}

/* ── Portada: el mapa de la historia ── */

.mapa { padding-block: 0 clamp(56px, 8vw, 104px); }

.mapa__titulo {
  margin: 0 0 clamp(18px, 3vw, 28px);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mapa__lista {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mapa__tarjeta {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 16px;
  min-height: 4.5rem;
  padding: 10px 18px 10px 16px;
  border: 3px solid var(--tinta);
  border-radius: 18px;
  background: var(--fondo-c);
  color: var(--texto-c);
  box-shadow: 5px 5px 0 var(--tinta);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.mapa__tarjeta:hover {
  color: var(--texto-c);
  transform: translate(-3px, -3px);
  box-shadow: 8px 8px 0 var(--tinta);
}

.mapa__tarjeta:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--tinta);
}

.mapa__numero {
  font-family: var(--letra-acento);
  font-size: 2.75rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
}

.mapa__nombre {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.mapa__ir { font-size: 1.125rem; }

@media (min-width: 48rem) {
  .mapa__lista { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }

  .mapa__tarjeta {
    grid-template-columns: 1fr auto;
    align-content: space-between;
    min-height: 11.5rem;
    padding: 16px 16px 16px 18px;
  }

  .mapa__numero { grid-column: 1 / -1; font-size: clamp(3.25rem, 5.4vw, 4.75rem); }
  .mapa__item:nth-child(even) .mapa__tarjeta { margin-top: 22px; }
}

/* ── Portada: los capítulos, en bandas de color ── */

.banda {
  position: relative;
  padding-block: clamp(56px, 9vw, 120px);
  background: var(--fondo-c);
  color: var(--texto-c);
  border-top: 3px solid var(--tinta);
  overflow: clip;
}

.banda__rejilla {
  display: grid;
  gap: 36px 64px;
  align-items: center;
}

@media (min-width: 52rem) {
  .banda__rejilla { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .banda--inversa .banda__arte { order: 2; }
}

.banda__arte {
  position: relative;
  max-width: 34rem;
  width: 100%;
  margin-inline: auto;
}

/* el numeral, enorme y hueco, detrás del dibujo */
.banda__numero,
.cubierta__numero,
.siguiente__numero {
  display: block;
  color: transparent;
  font-family: var(--letra-acento);
  font-style: italic;
  font-weight: 400;
  line-height: 0.8;
  -webkit-text-stroke: 2px var(--texto-c, var(--tinta));
  pointer-events: none;
  user-select: none;
}

.banda__numero {
  position: absolute;
  top: -0.35em;
  left: -0.12em;
  z-index: 0;
  color: transparent;
  font-size: clamp(8rem, 22vw, 17rem);
  opacity: 0.45;
}

.banda__arte .ilu { position: relative; z-index: 1; }

.banda__etiqueta {
  margin: 0 0 0.9em;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.banda__cabeza h2 {
  margin: 0 0 0.45em;
  font-size: clamp(2.25rem, 5.2vw, 4.25rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.banda__cuerpo { max-width: 34rem; }

.tema--marino .banda__cuerpo,
.tema--marino.cubierta,
.tema--bosque .banda__cuerpo,
.tema--bosque.cubierta { font-weight: 500; }

.banda__acciones { margin: 1.8em 0 0; }

/* ── Capítulo: la portada, el texto y el siguiente paso ── */

.cubierta {
  position: relative;
  background: var(--fondo-c);
  color: var(--texto-c);
  border-bottom: 3px solid var(--tinta);
  overflow: clip;
}

.cubierta__rejilla {
  display: grid;
  gap: 28px 56px;
  align-items: center;
  padding-block: clamp(28px, 5vw, 72px) clamp(40px, 7vw, 96px);
}

@media (min-width: 56rem) {
  .cubierta__rejilla { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}

.cubierta__etiqueta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7em;
  margin: 0 0 clamp(8px, 2vw, 20px);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cubierta__etiqueta a {
  color: inherit;
  text-underline-offset: 0.25em;
}

.cubierta__numero {
  margin: 0 0 clamp(4px, 1.5vw, 16px);
  font-size: clamp(7rem, 19vw, 14rem);
  opacity: 0.85;
}

.cubierta__titulo {
  margin: 0;
  font-size: clamp(2.25rem, 5.4vw, 4.75rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.cubierta__arte {
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
}

.cubierta--compacta .cubierta__rejilla {
  padding-block: clamp(24px, 4vw, 48px) clamp(32px, 5vw, 64px);
}

.cubierta--compacta .cubierta__titulo { font-size: clamp(2.25rem, 5vw, 4rem); }

.cubierta__entradilla { margin-top: 1.4em; }
.cubierta__entradilla > :first-child { font-size: 1.3125rem; line-height: 1.5; }

.lectura { padding-block: clamp(48px, 8vw, 104px) 0; }

.lectura__rejilla { display: grid; gap: 48px; }

/* Tu recorrido: el recuadro que te acompaña mientras lees (solo en pantallas grandes) */
.viaje { display: none; }

@media (min-width: 64rem) {
  .lectura__rejilla {
    grid-template-columns: minmax(0, 38rem) 16rem;
    column-gap: 5rem;
    align-items: start;
  }

  .viaje {
    position: sticky;
    top: 6.5rem;
    display: block;
    padding: 18px 18px 20px;
    border: 3px solid var(--tinta);
    border-radius: 18px;
    background: var(--papel);
    box-shadow: 5px 5px 0 var(--tinta);
  }
}

.viaje__titulo {
  margin: 0 0 16px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.viaje__lista {
  position: relative;
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* el hilo que une los tres pasos */
.viaje__lista::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 17px;
  width: 3px;
  background: var(--tinta);
}

.viaje__enlace {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tinta);
  text-decoration: none;
}

.viaje__marca {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border: 3px solid var(--tinta);
  border-radius: 50%;
  background: var(--papel);
  font-size: 0.8125rem;
  font-weight: 800;
  transition: transform 0.15s, background-color 0.15s;
}

.viaje__paso--antes .viaje__marca {
  background: var(--tinta);
  color: var(--crema);
}

.viaje__paso--ahora .viaje__marca {
  background: var(--magenta-texto);
  color: var(--blanco);
  box-shadow: 3px 3px 0 var(--tinta);
}

.viaje__texto { display: grid; gap: 1px; }

.viaje__rotulo {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--texto-tenue);
}

.viaje__nombre {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.viaje__paso--ahora .viaje__nombre { color: var(--magenta-texto); }

a.viaje__enlace:hover .viaje__marca {
  background: var(--ocre);
  color: var(--tinta);
  transform: translate(-1px, -1px);
}

a.viaje__enlace:hover .viaje__nombre {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* La entradilla del capítulo */
.prosa--articulo > p:first-child {
  margin-bottom: 1.5em;
  font-size: clamp(1.3125rem, 2.4vw, 1.5rem);
  line-height: 1.5;
  color: var(--texto-suave);
}

.prosa--articulo h2 { margin-top: 2.6em; }

/* De dónde vienes y a dónde vas */
.siguiente { margin-top: clamp(56px, 9vw, 112px); }

.siguiente__anterior {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: clamp(20px, 3vw, 32px);
  border-bottom: 2px solid var(--linea);
  color: var(--tinta);
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.siguiente__anterior:hover {
  color: var(--enlace);
  border-bottom-color: var(--magenta);
}

.siguiente__enlace {
  position: relative;
  display: block;
  background: var(--fondo-c);
  color: var(--texto-c);
  border-top: 3px solid var(--tinta);
  text-decoration: none;
  overflow: clip;
}

.siguiente__enlace:hover { color: var(--texto-c); }
.siguiente__enlace:focus-visible { outline-offset: -10px; }

.siguiente__rejilla {
  display: grid;
  gap: 24px 48px;
  align-items: center;
  padding-block: clamp(40px, 7vw, 88px) clamp(80px, 10vw, 112px);
}

@media (min-width: 52rem) {
  .siguiente__rejilla { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
}

.siguiente__texto { display: block; }

.siguiente__etiqueta {
  display: block;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.siguiente__numero {
  margin-block: 0.1em 0.12em;
  font-size: clamp(5rem, 13vw, 9.5rem);
}

.siguiente__titulo {
  display: block;
  max-width: 22ch;
  font-size: clamp(1.75rem, 3.8vw, 3.25rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.siguiente__nota {
  display: block;
  margin-top: 1em;
  font-weight: 600;
}

.siguiente__arte {
  display: block;
  width: 100%;
  max-width: 24rem;
  margin-inline: auto;
}

.siguiente__flecha {
  position: absolute;
  right: clamp(20px, 5vw, 48px);
  bottom: clamp(20px, 4vw, 36px);
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 3px solid var(--tinta);
  border-radius: 50%;
  background: var(--papel);
  color: var(--tinta);
  box-shadow: 4px 4px 0 var(--tinta);
  font-size: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.siguiente__enlace:hover .siguiente__flecha {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--tinta);
}

.siguiente__enlace:hover .flecha { transform: translateX(0.2em); }

/* Las ilustraciones de personas dentro del texto, con el marco de la casa */
.prosa figure { margin: 2.4em 0; }

.prosa figure img {
  width: 100%;
  height: auto;
  border: 3px solid var(--tinta);
  border-radius: 18px;
  box-shadow: 8px 8px 0 var(--tinta);
}

/* ── El formulario de «Consigue tu web» ──
   Lo envía js/ideforms.js (ideforms.com). Los mensajes de éxito y de error los crea ese script
   con las clases .ideforms-success y .ideforms-error. Los campos miden 1rem o más: así iOS no
   amplía la página al tocarlos. */

.consulta {
  margin-top: clamp(40px, 7vw, 72px);
  padding: clamp(22px, 4vw, 36px);
  border: 3px solid var(--tinta);
  border-radius: 18px;
  background: var(--papel);
  box-shadow: 8px 8px 0 var(--tinta), 0 26px 36px -18px rgb(0 0 0 / 0.38);
}

.consulta__titulo {
  margin: 0;
  font-size: clamp(1.625rem, 3.2vw, 2.25rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.consulta__intro {
  margin: 0.5em 0 1.6em;
  color: var(--texto-suave);
  font-size: 1.125rem;
}

.formulario { display: grid; gap: 1.25rem; }

/* ideforms.js esconde el formulario con «hidden» al enviarlo; el display de arriba lo anularía */
.formulario[hidden] { display: none; }

.campo {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* :where() para que las opciones y la casilla, que también son «label», mantengan lo suyo */
:where(.campo) label,
:where(.campo) legend { padding: 0; font-weight: 800; }

.campo__opcional { font-weight: 500; color: var(--texto-tenue); }

.campo input[type="text"],
.campo input[type="email"],
.campo textarea {
  width: 100%;
  padding: 0.7em 0.85em;
  border: 2px solid var(--tinta);
  border-radius: 12px;
  background: var(--blanco);
  color: var(--tinta);
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.4;
}

.campo textarea { min-height: 8rem; resize: vertical; }

.campo ::placeholder { color: var(--texto-tenue); opacity: 1; }

.campo input[type="text"]:focus-visible,
.campo input[type="email"]:focus-visible,
.campo textarea:focus-visible { outline-offset: 2px; }

/* Lo que necesitas: tres opciones a mano, la elegida con el ocre de la casa */
.campo--opciones { gap: 0.6rem; }
.campo--opciones legend { margin-bottom: 0.4rem; }

.opcion {
  display: flex;
  align-items: center;
  gap: 0.75em;
  padding: 0.7em 0.9em;
  border: 2px solid var(--tinta);
  border-radius: 12px;
  background: var(--blanco);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, translate 0.15s;
}

.opcion:hover { box-shadow: 3px 3px 0 var(--tinta); translate: -1px -1px; }

.opcion:has(input:checked) {
  background: var(--ocre);
  box-shadow: 3px 3px 0 var(--tinta);
  translate: -1px -1px;
}

.opcion:has(input:focus-visible) { outline: 3px solid var(--foco); outline-offset: 3px; }

.opcion input,
.casilla input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--magenta-texto);
}

.opcion input:focus-visible,
.casilla input:focus-visible { outline-offset: 2px; }

.casilla {
  display: flex;
  align-items: flex-start;
  gap: 0.75em;
  font-weight: 500;
  cursor: pointer;
}

.casilla input { margin-top: 0.2em; }

/* La trampa para programas: fuera de pantalla, y para una persona no existe */
.trampa {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.formulario__nota {
  margin: 0;
  color: var(--texto-tenue);
  font-size: 0.875rem;
  line-height: 1.5;
}

.formulario__enviar { justify-self: start; cursor: pointer; }

.formulario__enviar:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.ideforms-error {
  margin: 0;
  padding: 0.75em 0.95em;
  border: 2px solid var(--magenta-hondo);
  border-radius: 12px;
  background: var(--blanco);
  color: var(--magenta-hondo);
  font-weight: 700;
}

/* Enviado: el formulario se esconde y queda este aviso, con la llave de la casa */
.ideforms-success {
  display: flex;
  align-items: flex-start;
  gap: 0.9em;
  margin: 0;
  padding: 1.1em 1.2em;
  border: 3px solid var(--tinta);
  border-radius: 14px;
  background: var(--salvia);
  color: var(--tinta);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.4;
}

.ideforms-success::before {
  content: "";
  flex: none;
  width: 1.8rem;
  height: 1.8rem;
  background: var(--bosque);
  -webkit-mask: var(--llave) center / contain no-repeat;
  mask: var(--llave) center / contain no-repeat;
}

.consulta:has(.ideforms-success) .consulta__titulo,
.consulta:has(.ideforms-success) .consulta__intro { display: none; }

.consulta__sin-js { margin: 1.2em 0 0; font-weight: 600; }

.consulta__cliente {
  margin: 1.8em 0 0;
  padding-top: 1.2em;
  border-top: 2px solid var(--linea);
  color: var(--texto-suave);
  font-size: 0.9375rem;
}

/* ── Textos legales ── */

.prosa--legal {
  counter-reset: apartado;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.prosa--legal h2 {
  counter-increment: apartado;
  counter-reset: subapartado;
  margin-top: 2.4em;
  font-size: 1.3125rem;
  letter-spacing: -0.015em;
}

.prosa--legal h2::before {
  content: counter(apartado) ".";
  content: counter(apartado) "." / "";
  display: inline-block;
  min-width: 1.5em;
  color: var(--enlace);
}

/* Los subapartados de un texto legal: 3.1, 3.2… */
.prosa--legal h3 {
  counter-increment: subapartado;
  margin-block: 2em 0.6em;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.3;
}

.prosa--legal h3::before {
  content: counter(apartado) "." counter(subapartado);
  content: counter(apartado) "." counter(subapartado) / "";
  display: inline-block;
  min-width: 2.4em;
  color: var(--enlace);
}

.legal .lectura,
.pagina .lectura { padding-bottom: 0; }

/* ── Profundidad: luz, grano y capas ──
   Cada fondo recibe luz desde arriba a la izquierda y se oscurece un poco por abajo; sobre él
   va un grano de papel casi invisible. Detrás de cada dibujo, una nube de puntos de imprenta
   (el halftone) y un aro. Son capas distintas, para que luego puedan moverse a distinta velocidad. */

:root {
  --curva: cubic-bezier(0.2, 0.7, 0.2, 1);
  --brillo: 0.16;          /* la luz que cae sobre un fondo */
  --sombra-fondo: 0.05;    /* y lo que se oscurece por abajo (poco en los fondos claros) */
  --grano: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.tema--marino,
.tema--bosque { --brillo: 0.09; --sombra-fondo: 0.28; }

.tema--ocre { --brillo: 0.34; }

.banda,
.cubierta,
.siguiente__enlace {
  background-color: var(--fondo-c);
  background-image:
    radial-gradient(110% 85% at 12% 16%, rgb(255 255 255 / var(--brillo)), transparent 60%),
    linear-gradient(180deg, transparent 45%, rgb(0 0 0 / var(--sombra-fondo)));
  isolation: isolate;
}

.banda::after,
.cubierta::after,
.siguiente__enlace::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--grano);
  background-size: 220px;
  mix-blend-mode: multiply;
  opacity: 0.1;
  pointer-events: none;
}

.banda > .contenedor,
.cubierta > .contenedor,
.siguiente__enlace > .contenedor { position: relative; z-index: 1; }

.siguiente__flecha { z-index: 2; }

/* Detrás de cada dibujo: la nube de puntos y el aro */
.cubierta__arte,
.siguiente__arte { position: relative; }

.cubierta__arte .ilu,
.siguiente__arte .ilu,
.banda__arte .ilu { position: relative; z-index: 1; }

.banda__arte::before,
.cubierta__arte::before,
.siguiente__arte::before {
  content: "";
  position: absolute;
  inset: -12% -10% -8% 22%;
  z-index: 0;
  background-image: radial-gradient(currentColor 2.2px, transparent 2.6px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
  mask-image: radial-gradient(closest-side, #000, transparent);
  opacity: 0.2;
  pointer-events: none;
}

.banda__arte::after,
.cubierta__arte::after {
  content: "";
  position: absolute;
  right: -10%;
  bottom: -14%;
  z-index: 0;
  width: 68%;
  aspect-ratio: 1;
  border: 3px solid currentColor;
  border-radius: 50%;
  opacity: 0.16;
  pointer-events: none;
}

/* La portada: una atmósfera (ocre arriba a la derecha, salvia abajo a la izquierda) y un disco con volumen */
.heroe::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(60% 70% at 90% 6%, rgb(227 188 104 / 0.34), transparent 62%),
    radial-gradient(55% 65% at 2% 92%, rgb(197 211 194 / 0.6), transparent 62%);
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
  pointer-events: none;
}

/* el disco tiene volumen (luz arriba a la izquierda) y un resplandor magenta bajo la llave:
   la joya brilla sobre el verde oscuro */
.heroe__arte::before {
  z-index: 0;
  background:
    radial-gradient(circle at 22% 66%, rgb(230 0 126 / 0.5), transparent 36%),
    radial-gradient(circle at 30% 24%, #2F6552 0%, var(--bosque) 60%);
}

.heroe__arte .ilu { z-index: 1; }

/* Las sombras de ambiente, bajo las duras: lo que se levanta, proyecta */
.boton { box-shadow: 4px 4px 0 var(--b-sombra), 0 16px 24px -12px rgb(0 0 0 / 0.38); }
.boton:hover { box-shadow: 6px 6px 0 var(--b-sombra), 0 22px 30px -12px rgb(0 0 0 / 0.42); }
.boton:active { box-shadow: 1px 1px 0 var(--b-sombra); }

.acceso { box-shadow: 3px 3px 0 var(--tinta), 0 12px 20px -10px rgb(0 0 0 / 0.4); }
.acceso:hover { box-shadow: 5px 5px 0 var(--tinta), 0 18px 26px -10px rgb(0 0 0 / 0.45); }
.acceso:active { box-shadow: 1px 1px 0 var(--tinta); }

.mapa__tarjeta { box-shadow: 5px 5px 0 var(--tinta), 0 22px 30px -16px rgb(0 0 0 / 0.4); }
.mapa__tarjeta:hover { box-shadow: 8px 8px 0 var(--tinta), 0 28px 36px -16px rgb(0 0 0 / 0.45); }
.mapa__tarjeta:active { box-shadow: 1px 1px 0 var(--tinta); }

.viaje { box-shadow: 5px 5px 0 var(--tinta), 0 24px 34px -18px rgb(0 0 0 / 0.35); }

/* Las personas: un marco con la imagen dentro, que luego puede moverse al desplazarse */
.prosa figure {
  position: relative;
  overflow: hidden;
  overflow: clip;   /* como hidden, pero sin hacerse contenedor de scroll: así la imagen puede moverse con la página */
  border: 3px solid var(--tinta);
  border-radius: 18px;
  background: var(--papel);
  box-shadow: 8px 8px 0 var(--tinta), 0 26px 36px -18px rgb(0 0 0 / 0.38);
}

.prosa figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* ── Movimiento (siempre con mejora progresiva: sin él, todo está ya en su sitio) ── */

/* Entre páginas, el marcador y la cabecera se quedan y el resto se funde */
@view-transition { navigation: auto; }

.cabecera { view-transition-name: cabecera; }
.rail__item--actual .rail__enlace { view-transition-name: marcador; }

.llave {
  transform-box: fill-box;
  transform-origin: center;
}

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 0.3s; }

  /* La entrada: cada pieza llega a su hora. El titular no se anima: es lo primero que se lee. */
  .cubierta__etiqueta { animation: sube-suave 0.6s var(--curva) both; }
  .cubierta__numero { animation: numero-entra 0.9s 0.08s var(--curva) both; }
  .cubierta__arte { animation: arte-entra 1s 0.12s var(--curva) both; }
  .cubierta__entradilla { animation: sube-suave 0.7s 0.2s var(--curva) both; }

  .heroe__arte { animation: arte-entra 1.1s 0.05s var(--curva) both; }
  .heroe__entradilla { animation: sube-suave 0.7s 0.15s var(--curva) both; }
  .heroe__acciones { animation: sube-suave 0.7s 0.28s var(--curva) both; }

  .mapa__item { animation: sube-suave 0.7s var(--curva) both; }
  .mapa__item:nth-child(2) { animation-delay: 0.07s; }
  .mapa__item:nth-child(3) { animation-delay: 0.14s; }
  .mapa__item:nth-child(4) { animation-delay: 0.21s; }
  .mapa__item:nth-child(5) { animation-delay: 0.28s; }

  .heroe__titular em {
    background-size: 0% 0.2em;
    animation: subraya 0.9s 0.5s cubic-bezier(0.3, 0.6, 0.2, 1) forwards;
  }

  /* las llaves de la portada flotan, cada una a su ritmo */
  .ilu--grande .llave--grande { animation: flota 9s ease-in-out infinite alternate; }
  .ilu--grande .llave--a { animation: flota 7s -2s ease-in-out infinite alternate; }
  .ilu--grande .llave--b { animation: flota 8s -5s ease-in-out infinite alternate; }
  .ilu--grande .llave--c { animation: flota 6.5s -1s ease-in-out infinite alternate; }

  /* la llave de la cerradura gira, una vez, al llegar */
  .ilu .gira {
    transform-origin: 306px 240px;
    animation: gira 1.1s 0.5s cubic-bezier(0.5, 0, 0.2, 1) both;
  }

  .ilu .chispa { animation: parpadea 2.4s steps(1) infinite; }
}

/* Al desplazarse: la página se levanta de la cabecera y las capas del arranque se separan */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .cabecera {
      animation: sombra-cabecera linear both;
      animation-timeline: scroll(root);
      animation-range: 0 140px;
    }

    .heroe__arte::before {
      animation: p-fondo linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }

    .heroe__titular {
      animation: p-texto linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }

    .ilu--grande .llave--grande {
      animation: flota 9s ease-in-out infinite alternate, p-grande linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 100vh;
    }

    .ilu--grande .llave--a {
      animation: flota 7s -2s ease-in-out infinite alternate, p-a linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 100vh;
    }

    .ilu--grande .llave--b {
      animation: flota 8s -5s ease-in-out infinite alternate, p-b linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 100vh;
    }

    .ilu--grande .llave--c {
      animation: flota 6.5s -1s ease-in-out infinite alternate, p-c linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 100vh;
    }

    .cubierta__numero {
      animation: numero-entra 0.9s 0.08s var(--curva) both, p-numero linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 90vh;
    }

    .cubierta__arte .ilu {
      animation: p-arte linear both;
      animation-timeline: scroll(root);
      animation-range: 0 90vh;
    }
  }
}

/* Al cruzar la pantalla: los bloques entran, y numeral, dibujo e imágenes se mueven a su aire */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .banda__texto,
    .banda__arte,
    .siguiente__texto {
      animation: entra linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }

    .banda__numero {
      animation: p-banda-num linear both;
      animation-timeline: view();
      animation-range: cover;
    }

    .banda__arte .ilu,
    .siguiente__arte .ilu {
      animation: p-banda-arte linear both;
      animation-timeline: view();
      animation-range: cover;
    }

    .prosa figure img {
      scale: 1.14;
      animation: p-figura linear both;
      animation-timeline: view();
      animation-range: cover;
    }
  }
}

@keyframes sube-suave {
  from { opacity: 0; translate: 0 1.2rem; }
}

@keyframes numero-entra {
  from { opacity: 0; clip-path: inset(0 100% 0 0); translate: -1.5rem 0; }
  to { clip-path: inset(0 -10% 0 0); }
}

@keyframes arte-entra {
  from { opacity: 0; scale: 0.9; rotate: -3deg; translate: 0 2rem; }
}

@keyframes flota {
  from { transform: translateY(-6px) rotate(-0.8deg); }
  to { transform: translateY(8px) rotate(0.8deg); }
}

@keyframes subraya { to { background-size: 100% 0.2em; } }

@keyframes gira {
  from { transform: rotate(0); }
  to { transform: rotate(-80deg); }
}

@keyframes parpadea {
  0%, 60% { opacity: 1; }
  80% { opacity: 0.15; }
}

@keyframes sombra-cabecera {
  from { box-shadow: 0 0 0 0 rgb(0 0 0 / 0); }
  to { box-shadow: 0 12px 26px -14px rgb(0 0 0 / 0.4); }
}

@keyframes entra {
  from { opacity: 0; transform: translateY(2.5rem); }
  to { opacity: 1; transform: none; }
}

/* las capas de la portada: el fondo se queda atrás y las llaves se separan */
@keyframes p-fondo { to { translate: 0 3.5rem; } }
@keyframes p-texto { to { translate: 0 1.5rem; } }
@keyframes p-grande { to { translate: -20px -50px; } }
@keyframes p-a { to { translate: 40px -150px; } }
@keyframes p-b { to { translate: -30px -110px; } }
@keyframes p-c { to { translate: 20px 90px; } }

/* las portadas de capítulo: el numeral se queda y se apaga; el dibujo sube */
@keyframes p-numero { to { translate: 0 5rem; opacity: 0.2; } }
@keyframes p-arte { to { translate: 0 -3.5rem; rotate: 2deg; } }

/* las bandas y las imágenes: cada capa a su velocidad */
@keyframes p-banda-num { from { translate: 0 -3.5rem; } to { translate: 0 3.5rem; } }
@keyframes p-banda-arte { from { translate: 0 2.5rem; } to { translate: 0 -2.5rem; } }
@keyframes p-figura { from { translate: 0 -5%; } to { translate: 0 5%; } }
