/* Relato de las páginas del menú: Para abogados, Servicios, Quién firma y Recursos.
   Solo se carga donde la plantilla la pide con `estilos`. No usa fotografías ni vídeos de la portada: el arte es
   CSS y SVG. Cada página tiene su propia figura y su propia historia:

   · Para abogados  (ab-)  de la petición vaga a la pregunta que puede examinarse; fuentes en orden, informe.
   · Servicios      (sv-)  de un punto salen cinco rutas, una por pregunta pericial.
   · Quién firma    (jq-)  criterio comprobable: anillos, línea de formación, registro ORCID.
   · Recursos       (bi-)  de un campo disperso a un índice ordenado; una lente lo recorre.

   Cada página usa una ilustración propia (generada con IA, sin personas identificables), distinta de las de la
   portada y sin repetirse entre páginas: es ambientación, no la fotografía de un caso.

   Estado por defecto: todo visible y en flujo. El movimiento solo existe con `prefers-reduced-motion:
   no-preference` y soporte de animaciones por scroll; las escenas fijas ([data-fija]) piden además JavaScript
   (relato.js comprueba que quepan) y pantalla de escritorio. Nada captura la rueda ni el teclado. */

/* ───────── Arte de las cabeceras (estado estático) ───────── */

:is(.ab-inicio, .sv-inicio, .jq-inicio, .bi-inicio, .fs-inicio) {
  position: relative;
  isolation: isolate;
  /* Solo recorta el arte decorativo; el contenido hace crecer la sección. */
  overflow: clip;
}

:is(.sv-mapa, .jq-anillos, .bi-campo) {
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

/* En escritorio el texto de la cabecera deja libre la franja del arte. */
.ab-inicio { --arte: clamp(14rem, 30vw, 27rem); }
.sv-inicio { --arte: clamp(14rem, 30vw, 27rem); }
.bi-inicio { --arte: clamp(14rem, 30vw, 27rem); }
.fs-inicio { --arte: clamp(14rem, 28vw, 25rem); }

@media (min-width: 60rem) {
  :is(.ab-inicio, .sv-inicio, .bi-inicio, .fs-inicio) :is(h1, .entrada, .pregunta-guia) {
    max-inline-size: min(100%, calc(100% - var(--arte) - 9rem));
  }
}

/* Servicios · un punto de partida y cinco rutas. */

.sv-mapa {
  inset-block-start: 50%;
  inset-inline-end: max(var(--margen), (100% - var(--ancho)) / 2);
  inline-size: var(--arte);
  block-size: auto;
  translate: 0 -50%;
}

.sv-mapa path {
  stroke: var(--agua);
  stroke-width: 1.25;
  stroke-dasharray: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.7;
}

.sv-mapa circle {
  fill: var(--agua);
  transform-box: fill-box;
  transform-origin: center;
}

.sv-mapa circle:first-of-type {
  fill: var(--oro);
}

/* Quién firma · anillos concéntricos detrás del retrato existente. */

.jq-anillos {
  inset-block-start: 50%;
  inset-inline-end: calc(max(var(--margen), (100% - var(--ancho)) / 2) + 13rem);
  inline-size: clamp(30rem, 46vw, 44rem);
  aspect-ratio: 1;
  translate: 50% -50%;
}

.jq-anillos span {
  position: absolute;
  inset: 0;
  border: 1px solid rgb(131 220 200 / 0.3);
  border-radius: 50%;
}

.jq-anillos span:nth-child(2) { inset: 12%; border-color: rgb(131 220 200 / 0.2); border-style: dashed; }
.jq-anillos span:nth-child(3) { inset: 25%; border-color: rgb(221 185 80 / 0.28); }

.jq-anillos span:nth-child(1)::after {
  content: "";
  position: absolute;
  inset-block-start: 14.6%;
  inset-inline-start: 14.6%;
  inline-size: 0.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--agua);
  box-shadow: 0 0 1rem rgb(131 220 200 / 0.7);
  translate: -50% -50%;
}

.jq-inicio .perfil__foto {
  position: relative;
}

/* Recursos · campo de puntos y una lente. */

.bi-campo {
  inset: 0;
  mask-image: linear-gradient(to right, transparent 56%, #000 84%);
}

.bi-campo::before,
.bi-campo::after {
  content: "";
  position: absolute;
  inset: -20%;
}

.bi-campo::before {
  background: radial-gradient(circle, rgb(131 220 200 / 0.55) 1.25px, transparent 1.75px) 0 0 / 2rem 2rem;
}

.bi-campo::after {
  background: radial-gradient(circle, rgb(243 245 241 / 0.22) 1px, transparent 1.5px) 1rem 1rem / 2rem 2rem;
}

.bi-campo span {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 74%;
  z-index: 1;
  inline-size: clamp(9rem, 16vw, 14rem);
  aspect-ratio: 1;
  border: 1px solid var(--agua);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(131 220 200 / 0.14), rgb(131 220 200 / 0.02) 70%);
  box-shadow: 0 0 3rem rgb(131 220 200 / 0.18);
  translate: -50% -50%;
}

@media (max-width: 59.99rem) {
  /* Desplazamiento lateral corto: cabe en el margen y no crea desborde horizontal. */
  :root {
    --r-dx: 1rem;
  }

  /* En pantallas estrechas el arte queda arriba a la derecha, tenue, sin competir con el texto. */
  .sv-mapa {
    inset-block-start: 1.5rem;
    inline-size: 9rem;
    opacity: 0.32;
    translate: 0 0;
  }

  .jq-anillos {
    display: none;
  }

  .bi-campo {
    opacity: 0.5;
    mask-image: linear-gradient(to bottom, #000, transparent 70%);
  }

  .bi-campo span {
    display: none;
  }
}

/* ───────── Ilustración de cada página ─────────
   Para abogados, Servicios y Recursos: un panel a la derecha de la cabecera, fundido hacia el texto.
   Quién firma: la pluma sobre el papel, en la franja baja de «Publicaciones» (la cabecera ya lleva el retrato). */

.ab-inicio { --foto: url("/recursos/medios/abogados-pluma-poster-800.webp"); --foco: 62% 60%; }
.sv-inicio { --foto: url("/recursos/medios/interior-servicios-800.webp"); --foco: 12% 45%; }
.bi-inicio { --foto: url("/recursos/medios/biblioteca-contemporanea-800.webp"); --foco: 78% 48%; }
.jq-publicaciones { --foto: url("/recursos/medios/interior-firma-800.webp"); }

@media (min-width: 60rem) {
  .ab-inicio { --foto: url("/recursos/medios/abogados-pluma-poster-1200.webp"); }
  .sv-inicio { --foto: url("/recursos/medios/interior-servicios-1200.webp"); }
  .bi-inicio { --foto: url("/recursos/medios/biblioteca-contemporanea-1200.webp"); }
  .jq-publicaciones { --foto: url("/recursos/medios/interior-firma-1200.webp"); }
}

@media (min-width: 100rem) {
  .ab-inicio { --foto: url("/recursos/medios/abogados-pluma-poster-1600.webp"); }
  .sv-inicio { --foto: url("/recursos/medios/interior-servicios-1600.webp"); }
  .bi-inicio { --foto: url("/recursos/medios/biblioteca-contemporanea-1600.webp"); }
  .jq-publicaciones { --foto: url("/recursos/medios/interior-firma-1600.webp"); }
}

:is(.ab-inicio, .sv-inicio, .bi-inicio)::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: -2;
  inline-size: 60%;
  background:
    linear-gradient(to bottom, rgb(8 13 16 / 0.5), rgb(8 13 16 / 0) 22%, rgb(8 13 16 / 0) 72%, var(--negro)),
    var(--foto) var(--foco) / cover no-repeat;
  mask-image: linear-gradient(to right, transparent 10%, rgb(0 0 0 / 0.4) 36%, #000 62%);
  pointer-events: none;
}

.jq-publicaciones::after {
  content: "";
  position: absolute;
  inset-block: 34% 0;
  inset-inline: 0;
  z-index: -2;
  background:
    linear-gradient(to right, rgb(12 39 37 / 0.35), rgb(12 39 37 / 0.82) 52%, var(--petroleo) 78%),
    var(--foto) 0% 72% / cover no-repeat;
  mask-image: linear-gradient(to bottom, transparent, #000 42%);
  pointer-events: none;
}

@media (max-width: 59.99rem) {
  /* En pantallas estrechas la ilustración ocupa la parte alta de la cabecera, bajo un velo, y se funde hacia abajo. */
  :is(.ab-inicio, .sv-inicio, .bi-inicio)::after {
    inset-block: 0 auto;
    inline-size: 100%;
    block-size: min(100%, 22rem);
    background:
      linear-gradient(to bottom, rgb(8 13 16 / 0.62), rgb(8 13 16 / 0.78)),
      var(--foto) var(--foco) / cover no-repeat;
    mask-image: linear-gradient(to bottom, #000 45%, transparent);
  }
}

/* ───────── Figuras estáticas de las secciones ───────── */

/* Para abogados · 3 · las fuentes llegan en tres momentos: una línea de tiempo sobre las tarjetas. */
.ab-fuentes .tres {
  position: relative;
  padding-block-start: 1.75rem;
}

.ab-fuentes .tres::before {
  content: "";
  position: absolute;
  inset-block-start: 0.25rem;
  inset-inline: 0;
  block-size: 1px;
  background: linear-gradient(to right, var(--agua), rgb(131 220 200 / 0.2));
  transform-origin: left;
}

.ab-fuentes .tarjeta {
  position: relative;
}

.ab-fuentes .tarjeta::before {
  content: "";
  position: absolute;
  inset-block-start: calc(-1.5rem - 0.21875rem);
  inset-inline-start: 0;
  inline-size: 0.4375rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--agua);
  box-shadow: 0 0 0 0.25rem rgb(131 220 200 / 0.16);
}

/* Quién firma · formación sobre un raíl, con un nodo por título. */
.jq-formacion .lista-definida {
  position: relative;
  padding-inline-start: 1.75rem;
}

.jq-formacion .lista-definida::before {
  content: "";
  position: absolute;
  inset-block: 0.5rem;
  inset-inline-start: 0;
  inline-size: 1px;
  background: linear-gradient(to bottom, var(--agua), rgb(131 220 200 / 0.15));
  transform-origin: top;
}

.jq-formacion .lista-definida li {
  position: relative;
}

.jq-formacion .lista-definida li::before {
  content: "";
  position: absolute;
  inset-block-start: 1.6rem;
  inset-inline-start: calc(-1.75rem - 0.1875rem);
  inline-size: 0.4375rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--agua);
  box-shadow: 0 0 0 0.25rem rgb(131 220 200 / 0.16);
}

/* Quién firma · publicaciones: el identificador ORCID real, en grande y de fondo. */
.jq-publicaciones {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.jq-publicaciones::before {
  content: "0000-0003-3937-0669" / "";
  position: absolute;
  inset-block-end: 4%;
  inset-inline-start: 0;
  z-index: -1;
  color: transparent;
  font-size: clamp(4.5rem, 13vw, 12rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  -webkit-text-stroke: 1px rgb(131 220 200 / 0.16);
  pointer-events: none;
}

/* Recursos · cada tema lleva su número de orden, de fondo. */
.bi-indice {
  counter-reset: tema;
}

.bi-indice .tema {
  position: relative;
  counter-increment: tema;
}

.bi-indice .tema::before {
  content: "";
  position: absolute;
  inset-block-start: clamp(1.5rem, 3vw, 2.5rem);
  inset-inline: 0;
  block-size: 1px;
  background: linear-gradient(to right, var(--agua), rgb(131 220 200 / 0.12) 60%);
  transform-origin: left;
}

.bi-indice .tema::after {
  content: counter(tema, decimal-leading-zero) / "";
  position: absolute;
  inset-block-start: clamp(2rem, 4vw, 3.25rem);
  inset-inline-end: 0;
  z-index: -1;
  color: transparent;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  font-weight: 600;
  line-height: 1;
  -webkit-text-stroke: 1px rgb(131 220 200 / 0.2);
  pointer-events: none;
}

.bi-indice {
  position: relative;
  isolation: isolate;
}

/* ───────── Movimiento ───────── */

@media (prefers-reduced-motion: no-preference) {
  /* Entrada de las cabeceras, una sola vez al cargar. */
  .sv-mapa path { animation: r-dibuja 1.1s cubic-bezier(0.4, 0, 0.2, 1) both; }
  .sv-mapa path:nth-of-type(2) { animation-delay: 0.18s; }
  .sv-mapa path:nth-of-type(3) { animation-delay: 0.36s; }
  .sv-mapa path:nth-of-type(4) { animation-delay: 0.54s; }
  .sv-mapa path:nth-of-type(5) { animation-delay: 0.72s; }
  .sv-mapa circle { animation: r-nodo 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .sv-mapa circle:nth-of-type(2) { animation-delay: 0.95s; }
  .sv-mapa circle:nth-of-type(3) { animation-delay: 1.13s; }
  .sv-mapa circle:nth-of-type(4) { animation-delay: 1.31s; }
  .sv-mapa circle:nth-of-type(5) { animation-delay: 1.49s; }
  .sv-mapa circle:nth-of-type(6) { animation-delay: 1.67s; }

  .jq-anillos span { animation: r-anillo 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .jq-anillos span:nth-child(2) { animation-delay: 0.15s; }
  .jq-anillos span:nth-child(3) { animation-delay: 0.3s; }
  .jq-inicio .perfil__foto { animation: r-descubre 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  :is(.ab-inicio, .sv-inicio, .bi-inicio)::after { animation: r-foto 1.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  .bi-campo::before { animation: r-ordena 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .bi-campo span { animation: r-lente 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

  @supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
    /* Línea de tiempo de cada sección y de cada tema. */
    :is(.ab-inicio, .sv-inicio, .jq-inicio, .bi-inicio, .fs-inicio, .rel, .cierre) { view-timeline: --sec block; }
    .bi-indice .tema { view-timeline: --tema block; }

    /* Salida de las cabeceras: el arte se abre y se aleja mientras el texto sube. */
    .sv-mapa,
    .jq-anillos,
    .bi-campo span {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: --sec;
      animation-range: exit 0% exit 100%;
    }

    /* La ilustración se mueve más despacio que el texto y se apaga al salir. */
    :is(.ab-inicio, .sv-inicio, .bi-inicio)::after {
      animation: r-foto 1.8s cubic-bezier(0.2, 0.7, 0.2, 1) both, r-foto-sale linear both;
      animation-timeline: auto, --sec;
      animation-range: normal, exit 0% exit 100%;
    }

    /* Quién firma · la pluma sube despacio con la sección mientras el ORCID la cruza. */
    .jq-publicaciones::after {
      animation: r-pluma linear both;
      animation-timeline: --sec;
      animation-range: cover 0% cover 100%;
    }

    .sv-mapa { animation-name: r-mapa-sale; }
    .jq-anillos { animation-name: r-anillos-sale; }
    .bi-campo span { animation: r-lente 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both, r-lente-sale linear both; animation-timeline: auto, --sec; animation-range: normal, exit 0% exit 100%; }

    /* Titulares de sección. */
    .rel :is(.antetitulo, h2:not(.visualmente-oculto)),
    .rel > .contenedor > div:first-child > p:not(.antetitulo) {
      animation: r-sube linear both;
      animation-timeline: --sec;
      animation-range: entry 8% entry 62%;
    }

    .rel h2:not(.visualmente-oculto) { animation-range: entry 16% entry 72%; }
    .rel > .contenedor > div:first-child > p:not(.antetitulo) { animation-range: entry 26% entry 82%; }

    /* Elementos que entran uno a uno, cada cual con su propia línea de tiempo. */
    :is(.ab-opciones, .sv-rutas, .jq-trabajo) .necesidades li,
    .ab-informe .definiciones > div,
    .jq-publicaciones .lista-definida li,
    .jq-entrevista .lista-numerada li,
    .bi-indice .ficha,
    .rel-firma .perito {
      animation: r-sube linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 100%;
    }

    /* Para abogados · 2 y Servicios: las opciones llegan alternando el lado, como rutas que se abren. */
    :is(.ab-opciones, .sv-rutas) .necesidades li:nth-child(odd) { animation-name: r-izquierda; }
    :is(.ab-opciones, .sv-rutas) .necesidades li:nth-child(even) { animation-name: r-lado; }

    /* Para abogados · 3 · la línea de tiempo se traza y cada momento se enciende. */
    .ab-fuentes .tres::before,
    .ab-fuentes .tarjeta,
    .ab-fuentes .tarjeta::before {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: --sec;
    }

    .ab-fuentes .tres::before { animation-name: r-traza-x; animation-range: entry 30% entry 100%; }
    .ab-fuentes .tarjeta { animation-name: r-sube; }
    .ab-fuentes .tarjeta::before { animation-name: r-nodo; }
    .ab-fuentes .tarjeta:nth-child(1) { animation-range: entry 34% entry 64%; }
    .ab-fuentes .tarjeta:nth-child(2) { animation-range: entry 52% entry 82%; }
    .ab-fuentes .tarjeta:nth-child(3) { animation-range: entry 70% entry 100%; }
    .ab-fuentes .tarjeta:nth-child(1)::before { animation-range: entry 30% entry 44%; }
    .ab-fuentes .tarjeta:nth-child(2)::before { animation-range: entry 52% entry 66%; }
    .ab-fuentes .tarjeta:nth-child(3)::before { animation-range: entry 74% entry 88%; }

    /* Para abogados · 4 · el informe se arma por apartados: término desde la izquierda, definición después. */
    .ab-informe .definiciones > div { animation-name: r-borde; }

    .ab-informe .definiciones :is(dt, dd) {
      animation: r-izquierda linear both;
      animation-timeline: view();
      animation-range: entry 20% entry 160%;
    }

    .ab-informe .definiciones dd { animation-name: r-sube; animation-range: entry 60% entry 220%; }

    /* Quien firma (tarjeta del perito): el retrato se descubre de arriba abajo. */
    .rel-firma .perito__foto {
      animation: r-descubre linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 45%;
    }

    /* Quién firma · áreas de trabajo desde la derecha. */
    .jq-trabajo .necesidades li { animation-name: r-lado; }

    /* Quién firma · publicaciones: el ORCID de fondo se desplaza con la sección. */
    .jq-publicaciones::before {
      animation: r-deriva linear both;
      animation-timeline: --sec;
      animation-range: cover 0% cover 100%;
    }

    /* Quién firma · preguntas de la entrevista: el número llega antes que el texto. */
    .jq-entrevista .lista-numerada li { animation-name: r-lado; }

    .jq-entrevista .lista-numerada li::before {
      animation: r-nodo linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }

    /* Recursos · cada tema: la regla se traza, el título entra y el número se desplaza. */
    .bi-indice .tema::before,
    .bi-indice .tema::after,
    .bi-indice .tema__cabeza > * {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: --tema;
    }

    .bi-indice .tema::before { animation-name: r-traza-x; animation-range: cover 0% cover 22%; }
    .bi-indice .tema::after { animation-name: r-numero; animation-range: cover 0% cover 100%; }
    .bi-indice .tema__cabeza > * { animation-name: r-izquierda; animation-range: cover 3% cover 20%; }
    .bi-indice .tema__cabeza > :nth-child(2) { animation-range: cover 6% cover 24%; }

    .bi-indice .ficha:nth-child(3n + 2) { animation-range: entry 20% entry 130%; }
    .bi-indice .ficha:nth-child(3n) { animation-range: entry 40% entry 160%; }

    /* Teclado y anclas: nada enfocable ni enlazado queda a medio aparecer. */
    /* Las cabeceras quedan fuera: su arte es decorativo y, si se anulara con el foco, la entrada y los bucles
       volverían a empezar al retirarlo. */
    main :is(section:not(.encabezado), .tema, li, article):is(:has(:focus-visible), :target, :has(:target)),
    main :is(section:not(.encabezado), .tema, li, article):is(:has(:focus-visible), :target, :has(:target)) :is(*, *::before, *::after) {
      animation-name: none !important;
    }
  }
}

/* ───────── Escenas fijas ([data-fija]) ─────────
   La sección mide una pantalla más un tramo y su contenido queda pegado mientras se recorre.
   Orden común: entra → se fija con una pausa de lectura → desarrollo por etapas → pausa → suelta. */

@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  @supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
    @media (min-width: 60rem) and (min-height: 40rem) {
      [data-fija]:not(.fluye) {
        display: block;
        align-content: normal;
        block-size: calc(100svh + var(--tramo, 140svh));
        min-block-size: 0;
        padding-block: 0;
        view-timeline: --fija block;
      }

      [data-fija]:not(.fluye) > .contenedor {
        position: sticky;
        inset-block-start: 0;
        align-content: safe center;
        block-size: 100svh;
        padding-block: clamp(2.5rem, 5svh, 4.5rem);
      }

      /* Para abogados · 1 · de la petición vaga a la pregunta que puede examinarse.
         Pausa con la petición tal como llega → se atenúa → un trazo baja → la pregunta delimitada se
         descubre → se resalta → pausa. */
      .ab-pregunta:not(.fluye) { --tramo: 150svh; }

      .ab-pregunta:not(.fluye) .comparacion__fila,
      .ab-pregunta:not(.fluye) .comparacion__fila--bien > *,
      .ab-pregunta:not(.fluye) .comparacion__fila--bien::before {
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-timeline: --fija;
      }

      .ab-pregunta:not(.fluye) .comparacion__fila:not(.comparacion__fila--bien) { animation-name: r-atenua; animation-range: contain 14% contain 34%; }

      .ab-pregunta:not(.fluye) .comparacion__fila--bien {
        position: relative;
        animation-name: r-descubre-caja, r-resalta;
        animation-range: contain 34% contain 56%, contain 62% contain 82%;
      }

      .ab-pregunta:not(.fluye) .comparacion__fila--bien::before {
        content: "";
        position: absolute;
        inset-block-end: 100%;
        inset-inline-start: 1.5rem;
        inline-size: 1px;
        block-size: 1.25rem;
        background: var(--agua);
        transform-origin: top;
        animation-name: r-traza-y;
        animation-range: contain 28% contain 36%;
      }

      .ab-pregunta:not(.fluye) .comparacion__fila--bien > * { animation-name: r-sube; animation-range: contain 42% contain 58%; }
      .ab-pregunta:not(.fluye) .comparacion__fila--bien > :last-child { animation-range: contain 46% contain 62%; }

      /* Quién firma · formación: el raíl baja y enciende cada título.
         Pausa con el titular → el raíl se traza → cinco credenciales, una a una → pausa. */
      .jq-formacion:not(.fluye) { --tramo: 170svh; }

      .jq-formacion:not(.fluye) .lista-definida::before,
      .jq-formacion:not(.fluye) .lista-definida li,
      .jq-formacion:not(.fluye) .lista-definida li::before {
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-timeline: --fija;
      }

      .jq-formacion:not(.fluye) .lista-definida::before { animation-name: r-traza-y; animation-range: contain 10% contain 78%; }
      .jq-formacion:not(.fluye) .lista-definida li { animation-name: r-lado-borde; }
      .jq-formacion:not(.fluye) .lista-definida li::before { animation-name: r-nodo; }

      .jq-formacion:not(.fluye) .lista-definida li:nth-child(1) { --a: 12%; }
      .jq-formacion:not(.fluye) .lista-definida li:nth-child(2) { --a: 26%; }
      .jq-formacion:not(.fluye) .lista-definida li:nth-child(3) { --a: 40%; }
      .jq-formacion:not(.fluye) .lista-definida li:nth-child(4) { --a: 54%; }
      .jq-formacion:not(.fluye) .lista-definida li:nth-child(5) { --a: 68%; }
      .jq-formacion:not(.fluye) .lista-definida li { animation-range: contain var(--a) contain calc(var(--a) + 12%); }
      .jq-formacion:not(.fluye) .lista-definida li::before { animation-range: contain calc(var(--a) - 2%) contain calc(var(--a) + 5%); }

      /* Teclado y anclas dentro de una escena fija: todo visible de una vez. */
      [data-fija]:is(:has(:focus-visible), :has(:target)):not(.fluye) :is(*, *::before, *::after) {
        animation-name: none !important;
      }
    }
  }
}

@keyframes r-sube { from { opacity: 0; translate: 0 2.75rem; } }
@keyframes r-lado { from { opacity: 0; translate: var(--r-dx, 3.5rem) 0; } }
@keyframes r-lado-borde { from { opacity: 0; translate: var(--r-dx, 3.5rem) 0; border-color: transparent; } }
@keyframes r-izquierda { from { opacity: 0; translate: -3.5rem 0; } }
@keyframes r-traza-x { from { scale: 0 1; } }
@keyframes r-traza-y { from { scale: 1 0; } }
@keyframes r-nodo { from { opacity: 0; scale: 0; } }
@keyframes r-borde { from { border-color: transparent; } }
@keyframes r-atenua { to { opacity: 0.42; } }
@keyframes r-descubre { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes r-descubre-caja { from { clip-path: inset(0 100% 0 0 round 0.5rem); } to { clip-path: inset(-2rem round 0.5rem); } }
@keyframes r-resalta { to { background-color: rgb(131 220 200 / 0.1); box-shadow: 0 0 3rem rgb(131 220 200 / 0.22); } }
@keyframes r-deriva { from { translate: 12% 0; } to { translate: -34% 0; } }
@keyframes r-numero { from { translate: 0 3.5rem; } to { translate: 0 -2.5rem; } }

@keyframes r-dibuja { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes r-mapa-sale { to { opacity: 0.2; scale: 1.18; translate: 8% -62%; } }
@keyframes r-anillo { from { opacity: 0; scale: 0.6; } }
@keyframes r-anillos-sale { to { opacity: 0.2; scale: 1.3; rotate: 50deg; } }
@keyframes r-ordena { from { rotate: 13deg; scale: 1.25; opacity: 0.2; } }
@keyframes r-lente { from { opacity: 0; inset-inline-start: 52%; } }
@keyframes r-lente-sale { to { scale: 1.5; translate: -120% -50%; } }
@keyframes r-foto { from { opacity: 0; scale: 1.12; clip-path: inset(0 0 0 60%); } to { opacity: 1; scale: 1; clip-path: inset(0); } }
@keyframes r-foto-sale { to { translate: 0 34%; filter: brightness(0.45); } }
@keyframes r-pluma { from { translate: -3% 14%; scale: 1.12; opacity: 0.35; } 45% { opacity: 1; } to { translate: 0 -6%; scale: 1; opacity: 0.85; } }

/* ═════════ Segunda parte: fichas de servicio, preguntas, lecturas, DosMentes y contacto ═════════ */

/* ───────── Fichas de servicio · figura de la cabecera ─────────
   Una figura vectorial por servicio (figura-servicio.njk). Cada una se arma al cargar con su propio gesto
   (trazar, caer, brotar, crecer) y responde al scroll de forma distinta al salir la cabecera. */

.fs-inicio::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(42% 60% at 80% 50%, rgb(20 65 58 / 0.55), transparent 72%);
  pointer-events: none;
}

.fs-figura {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: max(var(--margen), (100% - var(--ancho)) / 2);
  z-index: -1;
  inline-size: var(--arte);
  block-size: auto;
  overflow: visible;
  translate: 0 -50%;
  pointer-events: none;
}

.fs-figura :is(line, path, rect, circle) {
  stroke: var(--agua);
  stroke-width: 1.25;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
}

.fs-figura .d { stroke-dasharray: 1; }
.fs-figura .g { stroke-width: 3; opacity: 0.8; }
.fs-figura .b { fill: rgb(131 220 200 / 0.18); transform-origin: bottom; }
.fs-figura .fs-fuerte { stroke-width: 2.25; }
.fs-figura .fs-oro { stroke: var(--oro); }
.fs-figura .b.fs-oro { fill: rgb(221 185 80 / 0.16); }
.fs-figura .fs-lleno { fill: currentColor; color: var(--agua); }
.fs-figura .fs-lleno.fs-oro { color: var(--oro); }
.fs-figura .fs-duda { stroke-dasharray: 5 6; opacity: 0.7; }
.fs-figura .fs-resalte { fill: rgb(131 220 200 / 0.16); stroke: none; transform-origin: left; }
.fs-figura .fs-cursor { stroke-width: 1.5; }
.fs-figura :is(.fs-hoja, .fs-fuentes, .fs-marca, .fs-entorno, .fs-izq, .fs-der) { transform-box: view-box; transform-origin: center; }

@media (max-width: 59.99rem) {
  .fs-figura {
    inset-block-start: 1.25rem;
    inline-size: 9.5rem;
    opacity: 0.34;
    translate: 0 0;
  }
}

/* ───────── Figuras estáticas de las secciones nuevas ───────── */

/* Metapericia · «Para quién» y «Qué recibe» unidos por un trazo. */
.fs-resumen .dos {
  position: relative;
}

@media (min-width: 60rem) {
  .fs-resumen .dos::before {
    content: "";
    position: absolute;
    inset-block-start: 50%;
    inset-inline: calc(50% - clamp(1rem, 2.5vw, 2.5rem)) calc(50% - clamp(1rem, 2.5vw, 2.5rem));
    block-size: 1px;
    background: var(--agua);
    transform-origin: left;
  }
}

/* Metapericia · alcance y límites: un borde dorado marca hasta dónde llega. */
.fs-limites .lista-definida {
  position: relative;
  padding-inline-start: 1.5rem;
}

.fs-limites .lista-definida::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 2px;
  background: var(--oro);
  transform-origin: top;
}

/* Metapericia · cuatro pasos: una línea de avance sobre la fila. */
.fs-pasos .pasos {
  position: relative;
}

.fs-pasos .pasos::before {
  content: "";
  position: absolute;
  inset-block-start: -1px;
  inset-inline: 0;
  z-index: 1;
  block-size: 2px;
  background: linear-gradient(to right, var(--agua), var(--oro));
  transform-origin: left;
}

/* Metapericia · ejemplo: mismo resaltado, como degradado, para poder recorrerlo de izquierda a derecha. */
.fs-ejemplo .folio mark {
  background: linear-gradient(rgb(221 185 80 / 0.42), rgb(221 185 80 / 0.42)) 0 0 / 100% 100% no-repeat;
}

/* Fichas en preparación: un marco discontinuo, como un espacio reservado. */
.fs-preparacion .contenedor {
  position: relative;
}

.fs-preparacion .contenedor::before {
  content: "";
  position: absolute;
  inset: -2rem -0.75rem;
  z-index: -1;
  border: 1px dashed rgb(131 220 200 / 0.4);
  border-radius: var(--radio);
  pointer-events: none;
}

.fs-preparacion {
  isolation: isolate;
}

/* Preguntas: un signo de interrogación de fondo y un trazo por pregunta. */
.rel-faq,
.rel-lecturas,
.jq-dosmentes {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.rel-faq::before {
  content: "?" / "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: max(var(--margen), (100% - var(--ancho)) / 2);
  z-index: -1;
  color: transparent;
  font-size: clamp(14rem, 34vw, 30rem);
  font-weight: 600;
  line-height: 0.8;
  translate: 0 -50%;
  -webkit-text-stroke: 1px rgb(131 220 200 / 0.16);
  pointer-events: none;
}

.rel-faq .faq__item {
  position: relative;
}

.rel-faq .faq__item::before {
  content: "";
  position: absolute;
  inset-block-start: -1px;
  inset-inline: 0;
  block-size: 1px;
  background: linear-gradient(to right, var(--agua), rgb(131 220 200 / 0) 70%);
  transform-origin: left;
  pointer-events: none;
}

/* Lecturas: un hilo une las fichas. */
.rel-lecturas .fichas {
  position: relative;
  padding-block-start: 1.5rem;
}

.rel-lecturas .fichas::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  block-size: 1px;
  background: linear-gradient(to right, var(--oro), var(--agua));
  transform-origin: left;
}

/* DosMentes: dos círculos distintos, uno por proyecto, en el espacio libre junto al texto. */
.jq-dosmentes::before,
.jq-dosmentes::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: max(var(--margen), (100% - var(--ancho)) / 2);
  z-index: -1;
  inline-size: clamp(9rem, 17vw, 15rem);
  aspect-ratio: 1;
  border: 1px solid rgb(131 220 200 / 0.4);
  border-radius: 50%;
  translate: 0 -50%;
  pointer-events: none;
}

.jq-dosmentes::before { translate: -82% -50%; }
.jq-dosmentes::after { border-color: rgb(221 185 80 / 0.45); }

@media (max-width: 59.99rem) {
  .jq-dosmentes::before,
  .jq-dosmentes::after {
    inset-block-start: 6rem;
    inline-size: 7rem;
    opacity: 0.5;
  }

  .rel-faq::before {
    inset-block-start: 1rem;
    font-size: 11rem;
    translate: 0 0;
  }
}

/* Contacto en estas páginas: un haz de luz que cruza y una marca por canal. No es la escena de la portada. */
.cierre {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.cierre::before {
  content: "";
  position: absolute;
  inset: -20% -40%;
  z-index: -1;
  background: linear-gradient(112deg, transparent 38%, rgb(131 220 200 / 0.13) 47%, rgb(131 220 200 / 0.03) 55%, transparent 62%);
  pointer-events: none;
}

.cierre .canales li {
  position: relative;
}

.cierre .canales li::before {
  content: "";
  position: absolute;
  inset-block-start: -1px;
  inset-inline-end: 0;
  inline-size: 3.5rem;
  block-size: 2px;
  background: var(--agua);
  transform-origin: right;
  pointer-events: none;
}

/* ───────── Movimiento de la segunda parte ───────── */

@media (prefers-reduced-motion: no-preference) {
  /* Figura del servicio: cada pieza con su gesto, en el orden del dibujo. */
  .fs-figura .d { animation: r-dibuja 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
  .fs-figura .p { animation: r-nodo 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .fs-figura .f { animation: r-asoma 0.8s ease-out both; }
  .fs-figura .w { animation: r-traza-x 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .fs-figura .g { animation: r-brota 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .fs-figura .b { animation: r-crece 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .fs-figura .c { animation: r-cae 0.8s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
  .fs-figura .s:nth-child(1) { animation-delay: 0.15s; }
  .fs-figura .s:nth-child(2) { animation-delay: 0.22s; }
  .fs-figura .s:nth-child(3) { animation-delay: 0.29s; }
  .fs-figura .s:nth-child(4) { animation-delay: 0.36s; }
  .fs-figura .s:nth-child(5) { animation-delay: 0.43s; }
  .fs-figura .s:nth-child(6) { animation-delay: 0.50s; }
  .fs-figura .s:nth-child(7) { animation-delay: 0.57s; }
  .fs-figura .s:nth-child(8) { animation-delay: 0.64s; }
  .fs-figura .s:nth-child(9) { animation-delay: 0.71s; }
  .fs-figura .s:nth-child(10) { animation-delay: 0.78s; }
  .fs-figura .s:nth-child(11) { animation-delay: 0.85s; }
  .fs-figura .s:nth-child(12) { animation-delay: 0.92s; }
  .fs-figura .s:nth-child(13) { animation-delay: 0.99s; }
  .fs-figura .s:nth-child(14) { animation-delay: 1.06s; }
  .fs-figura .s:nth-child(15) { animation-delay: 1.13s; }
  .fs-figura .s:nth-child(16) { animation-delay: 1.20s; }
  .fs-figura .s:nth-child(17) { animation-delay: 1.27s; }
  .fs-figura .s:nth-child(18) { animation-delay: 1.34s; }
  .fs-figura .s:nth-child(19) { animation-delay: 1.41s; }
  .fs-figura .s:nth-child(20) { animation-delay: 1.48s; }
  .fs-figura .s:nth-child(21) { animation-delay: 1.55s; }
  .fs-figura .s:nth-child(22) { animation-delay: 1.62s; }
  .fs-figura .s:nth-child(23) { animation-delay: 1.69s; }
  .fs-figura .s:nth-child(24) { animation-delay: 1.76s; }
  .fs-figura .fs-fuentes .s:nth-child(n) { animation-delay: calc(0.9s + var(--n, 0s)); }
  .fs-figura .fs-fuentes .s:nth-child(2) { --n: 0.12s; }
  .fs-figura .fs-fuentes .s:nth-child(3) { --n: 0.24s; }
  .fs-figura .fs-fuentes .s:nth-child(n + 4) { --n: 0.5s; }
  .fs-figura .fs-der .s:nth-child(1) { animation-delay: 0.5s; }
  .fs-figura .fs-der .s:nth-child(2) { animation-delay: 0.64s; }
  .fs-figura .fs-der .s:nth-child(3) { animation-delay: 0.78s; }
  .fs-figura .fs-der .s:nth-child(4) { animation-delay: 0.92s; }

  @supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
    /* Respuesta de cada figura al scroll, al salir la cabecera. */
    .fs-figura,
    .fs-figura :is(.fs-hoja, .fs-fuentes, .fs-marca, .fs-entorno, .fs-izq, .fs-der, .fs-cursor) {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: --sec;
      animation-range: exit 0% exit 100%;
    }

    .fs-figura { animation-name: r-figura-sale; }
    .fs-metapericia .fs-hoja { animation-name: r-hoja-gira; }
    .fs-metapericia .fs-fuentes { animation-name: r-fuentes-separan; }
    .fs-dano .fs-marca { animation-name: r-hecho-atras; }
    .fs-custodia .fs-entorno { animation-name: r-entorno-gira; }
    .fs-testimonio .fs-cursor { animation-name: r-cursor-avanza; animation-range: exit 0% exit 70%; }
    .fs-riesgo .fs-izq { animation-name: r-aparta-izq; }
    .fs-riesgo .fs-der { animation-name: r-aparta-der; }

    /* Metapericia · resumen: una tarjeta desde cada lado y el trazo que las une. */
    .fs-resumen .tarjeta,
    .fs-resumen .dos::before {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: --sec;
    }

    .fs-resumen .tarjeta:first-child { animation-name: r-izquierda; animation-range: entry 20% entry 70%; }
    .fs-resumen .dos::before { animation-name: r-traza-x; animation-range: entry 60% entry 85%; }
    .fs-resumen .tarjeta:last-child { animation-name: r-lado; animation-range: entry 55% entry 100%; }

    /* Metapericia · límites: el borde baja y cada condición aparece a su paso. */
    .fs-limites .lista-definida::before { animation: r-traza-y linear both; animation-timeline: --sec; animation-range: entry 30% entry 100%; }
    .fs-limites .lista-definida li { animation: r-lado linear both; animation-timeline: view(); animation-range: entry 0% entry 120%; }

    /* Metapericia · pasos: la línea avanza y cada paso sube cuando le llega. */
    .fs-pasos .pasos::before,
    .fs-pasos .pasos li {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: --sec;
    }

    .fs-pasos .pasos::before { animation-name: r-traza-x; animation-range: entry 30% entry 100%; }
    .fs-pasos .pasos li { animation-name: r-sube; }
    .fs-pasos .pasos li:nth-child(1) { animation-range: entry 30% entry 55%; }
    .fs-pasos .pasos li:nth-child(2) { animation-range: entry 45% entry 70%; }
    .fs-pasos .pasos li:nth-child(3) { animation-range: entry 60% entry 85%; }
    .fs-pasos .pasos li:nth-child(4) { animation-range: entry 75% entry 100%; }

    /* Metapericia · ejemplo: el folio se endereza y el subrayado recorre la conclusión. */
    .fs-ejemplo .folio { animation: r-folio-asienta linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
    .fs-ejemplo .folio mark { animation: r-subraya linear both; animation-timeline: view(); animation-range: entry 40% cover 45%; }
    .fs-ejemplo .folio__nota { animation: r-sube linear both; animation-timeline: view(); animation-range: entry 0% entry 160%; }
    .fs-ejemplo .ejemplo__pasos > div { animation: r-izquierda linear both; animation-timeline: view(); animation-range: entry 0% entry 130%; }

    /* Fichas en preparación: el marco se dibuja alrededor del aviso. */
    .fs-preparacion .contenedor::before { animation: r-marco linear both; animation-timeline: --sec; animation-range: entry 25% entry 95%; }

    /* Preguntas: el signo se desplaza con la sección; cada pregunta traza su línea y entra. */
    .rel-faq::before { animation: r-signo linear both; animation-timeline: --sec; animation-range: cover 0% cover 100%; }

    .rel-faq .faq__item,
    .rel-faq .faq__item::before {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: view();
    }

    .rel-faq .faq__item { animation-name: r-izquierda; animation-range: entry 0% entry 110%; }
    .rel-faq .faq__item:nth-child(even) { animation-name: r-lado; }
    .rel-faq .faq__item::before { animation-name: r-traza-x; animation-range: entry 30% entry 170%; }
    .rel-faq > .contenedor > p:last-child { animation: r-sube linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }

    /* Lecturas: las fichas llegan ladeadas, como folios sobre la mesa, y se alinean sobre el hilo. */
    .rel-lecturas .fichas::before,
    .rel-lecturas .ficha {
      animation-timing-function: linear;
      animation-fill-mode: both;
    }

    .rel-lecturas .fichas::before { animation-name: r-traza-x; animation-timeline: --sec; animation-range: entry 25% entry 90%; }
    .rel-lecturas .ficha { animation-name: r-folio-a; animation-timeline: view(); animation-range: entry 0% entry 130%; }
    .rel-lecturas .ficha:nth-child(even) { animation-name: r-folio-b; animation-range: entry 15% entry 150%; }

    @media (max-width: 59.99rem) {
      /* En pantallas estrechas, sin giro ni desplazamiento lateral: no cabe en el margen. */
      .rel-lecturas .ficha,
      .rel-lecturas .ficha:nth-child(even),
      .fs-ejemplo .folio {
        animation-name: r-sube;
      }
    }

    /* DosMentes: los dos círculos parten superpuestos y se separan: dos proyectos distintos. */
    .jq-dosmentes::before,
    .jq-dosmentes::after {
      animation: r-separa-a linear both;
      animation-timeline: --sec;
      animation-range: entry 10% cover 55%;
    }

    .jq-dosmentes::after { animation-name: r-separa-b; }
    .jq-dosmentes .contenedor > * { animation: r-sube linear both; animation-timeline: view(); animation-range: entry 0% entry 110%; }

    /* Contacto: el haz cruza la sección; el texto sube por capas y cada canal recibe su marca. */
    .cierre::before { animation: r-haz linear both; animation-timeline: --sec; animation-range: cover 0% cover 100%; }

    .cierre .cierre__texto > *,
    .cierre .canales li > *,
    .cierre .canales li::before {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: --sec;
    }

    .cierre .cierre__texto > * { animation-name: r-sube; }
    .cierre .cierre__texto > :nth-child(1) { animation-range: entry 15% entry 50%; }
    .cierre .cierre__texto > :nth-child(2) { animation-range: entry 25% entry 62%; }
    .cierre .cierre__texto > :nth-child(3) { animation-range: entry 38% entry 76%; }
    .cierre .cierre__texto > :nth-child(4) { animation-name: r-boton; animation-range: entry 52% entry 90%; }
    .cierre .canales li > * { animation-name: r-lado; }
    .cierre .canales li::before { animation-name: r-traza-x; }
    .cierre .canales li:nth-child(1) > *, .cierre .canales li:nth-child(1)::before { animation-range: entry 40% entry 72%; }
    .cierre .canales li:nth-child(2) > *, .cierre .canales li:nth-child(2)::before { animation-range: entry 54% entry 86%; }
    .cierre .canales li:nth-child(3) > *, .cierre .canales li:nth-child(3)::before { animation-range: entry 68% entry 100%; }
  }
}

/* Escena fija de metapericia · «Qué se revisa» y «Qué se contrasta».
   Pausa con el material → cada material, uno a uno → pasa a la columna del análisis → cada contraste →
   la definición → pausa. Solo si cabe (relato.js). */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  @supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
    @media (min-width: 60rem) and (min-height: 40rem) {
      .fs-material:not(.fluye) { --tramo: 170svh; }

      .fs-material:not(.fluye) .lista-definida li,
      .fs-material:not(.fluye) .dos > div:last-child > * {
        animation-timing-function: linear;
        animation-fill-mode: both;
        animation-timeline: --fija;
      }

      .fs-material:not(.fluye) .lista-definida li { animation-name: r-izquierda; }
      .fs-material:not(.fluye) .lista-definida li:nth-child(1) { animation-range: contain 8% contain 18%; }
      .fs-material:not(.fluye) .lista-definida li:nth-child(2) { animation-range: contain 17% contain 27%; }
      .fs-material:not(.fluye) .lista-definida li:nth-child(3) { animation-range: contain 26% contain 36%; }
      .fs-material:not(.fluye) .lista-definida li:nth-child(n + 4) { animation-range: contain 34% contain 44%; }

      .fs-material:not(.fluye) .dos > div:last-child > * { animation-name: r-lado; animation-range: contain 44% contain 54%; }
      .fs-material:not(.fluye) .dos > div:last-child > .aparte { animation-name: r-sube; animation-range: contain 74% contain 86%; }

      .fs-material:not(.fluye) .lista-numerada li {
        animation: r-sube linear both;
        animation-timeline: --fija;
      }

      .fs-material:not(.fluye) .lista-numerada li:nth-child(1) { animation-range: contain 50% contain 58%; }
      .fs-material:not(.fluye) .lista-numerada li:nth-child(2) { animation-range: contain 56% contain 64%; }
      .fs-material:not(.fluye) .lista-numerada li:nth-child(3) { animation-range: contain 62% contain 70%; }
      .fs-material:not(.fluye) .lista-numerada li:nth-child(n + 4) { animation-range: contain 68% contain 76%; }
    }
  }
}

@keyframes r-asoma { from { opacity: 0; } }
@keyframes r-brota { from { scale: 1 0; opacity: 0; } }
@keyframes r-crece { from { scale: 1 0; } }
@keyframes r-cae { from { opacity: 0; translate: 0 -3rem; } }
@keyframes r-figura-sale { to { opacity: 0.25; translate: 4% -78%; } }
@keyframes r-hoja-gira { to { rotate: -7deg; translate: -4% 0; } }
@keyframes r-fuentes-separan { to { translate: 9% 0; } }
@keyframes r-hecho-atras { to { translate: -22% 0; } }
@keyframes r-entorno-gira { to { rotate: 110deg; } }
@keyframes r-cursor-avanza { to { translate: 19.5rem 0; } }
@keyframes r-aparta-izq { to { translate: -7% 0; } }
@keyframes r-aparta-der { to { translate: 7% 0; } }
@keyframes r-folio-asienta { from { rotate: 4deg; translate: 2.5rem 3rem; opacity: 0.3; } }
@keyframes r-subraya { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
@keyframes r-marco { from { clip-path: inset(0 100% 0 0); opacity: 0; } to { clip-path: inset(0); opacity: 1; } }
@keyframes r-signo { from { translate: 6% -30%; rotate: 8deg; } to { translate: -4% -70%; rotate: -6deg; } }
@keyframes r-folio-a { from { opacity: 0; rotate: -4deg; translate: -1.5rem 3.5rem; } }
@keyframes r-folio-b { from { opacity: 0; rotate: 3.5deg; translate: 1.5rem 4.5rem; } }
@keyframes r-separa-a { from { translate: -41% -50%; opacity: 0.2; } }
@keyframes r-separa-b { from { translate: -41% -50%; opacity: 0.2; } }
@keyframes r-haz { from { translate: -34% 0; } to { translate: 34% 0; } }
@keyframes r-boton { from { opacity: 0; scale: 0.82; translate: 0 1.5rem; } }

/* ═════════ Bucles de las cabeceras ═════════
   Servicios, Quién firma y Recursos: tras la entrada, el arte sigue en movimiento lento y continuo.
   Solo `translate`, `scale`, `rotate`, `opacity` y el trazo del SVG; nada toca el texto ni la altura.
   Sin movimiento (o con movimiento reducido) queda la composición estática de siempre. */

/* Servicios · una señal recorre cada ruta. Oculta mientras no se anima. */
.sv-mapa .sv-pulsos path {
  stroke: var(--oro);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-dasharray: 0.14 2;
  stroke-dashoffset: 0.14;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  /* Servicios · cada 2 s sale una señal del origen; al llegar, su destino responde. Ciclo de 10 s. */
  .sv-mapa .sv-pulsos path { animation: r-pulso 10s linear 2.4s infinite; }
  .sv-mapa .sv-pulsos path:nth-of-type(2) { animation-delay: 4.4s; }
  .sv-mapa .sv-pulsos path:nth-of-type(3) { animation-delay: 6.4s; }
  .sv-mapa .sv-pulsos path:nth-of-type(4) { animation-delay: 8.4s; }
  .sv-mapa .sv-pulsos path:nth-of-type(5) { animation-delay: 10.4s; }

  .sv-mapa circle:first-of-type {
    animation: r-nodo 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both, r-emite 2s ease-out 2.4s infinite;
  }

  .sv-mapa circle:nth-of-type(n + 2) {
    animation: r-nodo 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both, r-llega 10s ease-in-out infinite;
  }

  .sv-mapa circle:nth-of-type(2) { animation-delay: 0.95s, 2.4s; }
  .sv-mapa circle:nth-of-type(3) { animation-delay: 1.13s, 4.4s; }
  .sv-mapa circle:nth-of-type(4) { animation-delay: 1.31s, 6.4s; }
  .sv-mapa circle:nth-of-type(5) { animation-delay: 1.49s, 8.4s; }
  .sv-mapa circle:nth-of-type(6) { animation-delay: 1.67s, 10.4s; }

  /* Quién firma · los anillos giran despacio en sentidos opuestos, el dorado respira y el retrato flota apenas. */
  .jq-anillos span:nth-child(1) {
    animation: r-anillo 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) both, r-gira 48s linear infinite;
  }

  .jq-anillos span:nth-child(2) {
    animation: r-anillo 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both, r-gira 72s linear infinite reverse;
  }

  .jq-anillos span:nth-child(3) {
    animation: r-anillo 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s both, r-respira 8s ease-in-out 1.6s infinite alternate;
  }

  .jq-inicio .perfil__foto {
    animation: r-descubre 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both, r-flota-retrato 9s ease-in-out 1.1s infinite alternate;
  }

  /* Recursos · las dos mallas de puntos derivan un módulo exacto (2rem), así el bucle no tiene salto;
     la lente recorre el campo. */
  .bi-campo::before {
    animation: r-ordena 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both, r-malla-a 18s linear infinite;
  }

  .bi-campo::after { animation: r-malla-b 30s linear infinite; }

  .bi-campo span {
    animation: r-lente 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both, r-lente-flota 16s ease-in-out 1.6s infinite;
  }

  @supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
    /* La salida por scroll va al final de la lista: parte de donde esté la lente en ese momento. */
    .bi-campo span {
      animation: r-lente 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both, r-lente-flota 16s ease-in-out 1.6s infinite, r-lente-sale linear both;
      animation-timeline: auto, auto, --sec;
      animation-range: normal, normal, exit 0% exit 100%;
    }
  }
}

@keyframes r-pulso {
  0% { stroke-dashoffset: 0.14; opacity: 0; animation-timing-function: cubic-bezier(0.5, 0, 0.3, 1); }
  5% { opacity: 1; }
  30% { opacity: 1; }
  36% { stroke-dashoffset: -1; opacity: 0; }
  100% { stroke-dashoffset: -1; opacity: 0; }
}
@keyframes r-emite { 0% { scale: 1; } 14% { scale: 1.5; } 55%, 100% { scale: 1; } }
@keyframes r-llega { 0%, 29% { scale: 1; } 36% { scale: 2; } 52%, 100% { scale: 1; } }
@keyframes r-gira { to { rotate: 1turn; } }
@keyframes r-respira { to { scale: 1.06; opacity: 0.6; } }
@keyframes r-flota-retrato { to { translate: 0 -0.5rem; } }
@keyframes r-malla-a { to { translate: 2rem 2rem; } }
@keyframes r-malla-b { to { translate: -2rem 0; } }
@keyframes r-lente-flota {
  0%, 100% { translate: -50% -50%; }
  33% { translate: -26% -64%; }
  66% { translate: -68% -34%; }
}

/* ═════════ Películas de las cabeceras de «Para abogados» y «Recursos» ═════════
   Ocupa exactamente el panel de la ilustración (misma caja, foco, velo y máscara) y lleva la ilustración de fondo.
   Está oculta hasta que la película se reproduce: entonces sustituye al panel sin cambio visible y la película
   aparece encima con un fundido. Sin JS, sin movimiento o si no reproduce, queda el panel de siempre. */

:is(.ab-pelicula, .bi-pelicula) {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: -2;
  inline-size: 60%;
  background: var(--foto) var(--foco) / cover no-repeat;
  mask-image: linear-gradient(to right, transparent 10%, rgb(0 0 0 / 0.4) 36%, #000 62%);
  pointer-events: none;
  visibility: hidden;
}

:is(.ab-pelicula, .bi-pelicula) video {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: var(--foco);
  opacity: 0;
  transition: opacity 1.2s ease;
}

:is(.ab-pelicula, .bi-pelicula)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(8 13 16 / 0.5), rgb(8 13 16 / 0) 22%, rgb(8 13 16 / 0) 72%, var(--negro));
}

@media (max-width: 59.99rem) {
  :is(.ab-pelicula, .bi-pelicula) {
    inset-block: 0 auto;
    inline-size: 100%;
    block-size: min(100%, 22rem);
    mask-image: linear-gradient(to bottom, #000 45%, transparent);
  }

  :is(.ab-pelicula, .bi-pelicula)::after {
    background: linear-gradient(to bottom, rgb(8 13 16 / 0.62), rgb(8 13 16 / 0.78));
  }
}

:is(.ab-inicio, .bi-inicio).con-pelicula::after { visibility: hidden; }
:is(.ab-inicio, .bi-inicio).con-pelicula :is(.ab-pelicula, .bi-pelicula) { visibility: visible; }
:is(.ab-inicio, .bi-inicio).con-pelicula :is(.ab-pelicula, .bi-pelicula) video { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: 0% 100%)) {
    /* Misma salida por scroll que la ilustración. */
    :is(.ab-pelicula, .bi-pelicula) {
      animation: r-foto-sale linear both;
      animation-timeline: --sec;
      animation-range: exit 0% exit 100%;
    }
  }
}

/* Biblioteca: tamaños adaptados a la densidad de pantalla. */
@supports (background-image: image-set(url("/recursos/medios/biblioteca-contemporanea-800.webp") 1x)) {
  .bi-inicio { --foto: image-set(url("/recursos/medios/biblioteca-contemporanea-800.webp") 1x, url("/recursos/medios/biblioteca-contemporanea-1600.webp") 2x); }
  @media (min-width: 60rem) {
    .bi-inicio { --foto: image-set(url("/recursos/medios/biblioteca-contemporanea-1200.webp") 1x, url("/recursos/medios/biblioteca-contemporanea-1600.webp") 2x); }
  }
  @media (min-width: 100rem) {
    .bi-inicio { --foto: url("/recursos/medios/biblioteca-contemporanea-1600.webp"); }
  }
}
@media (min-width: 60rem) {
  .bi-inicio::after {
    inline-size: 66%;
    mask-image: linear-gradient(to right, transparent 2%, rgb(0 0 0 / 0.5) 22%, #000 42%);
  }
}

@media (min-width: 60rem) {
  .bi-pelicula { inline-size: 66%; mask-image: linear-gradient(to right, transparent 2%, rgb(0 0 0 / 0.5) 22%, #000 42%); }
}

/* La lente sigue el puntero y abre un claro en las dos mallas. */
@media (hover: hover) and (pointer: fine) and (min-width: 60rem) {
  .bi-campo--activo span {
    inset-inline-start: var(--bi-x);
    inset-block-start: var(--bi-y);
    translate: -50% -50%;
    animation: none;
    background: transparent;
  }
  .bi-campo--activo::before,
  .bi-campo--activo::after {
    mask-image: radial-gradient(circle clamp(4.5rem, 8vw, 7rem) at var(--bi-mascara-x) var(--bi-mascara-y), transparent 98%, #000 100%);
    mask-repeat: no-repeat;
  }
  .bi-campo--activo::before { animation: bi-malla-activa-a 18s linear infinite; }
  .bi-campo--activo::after { animation: bi-malla-activa-b 30s linear infinite; }
}
@keyframes bi-malla-activa-a { to { background-position: 2rem 2rem; } }
@keyframes bi-malla-activa-b { to { background-position: -1rem 1rem; } }
@media (prefers-reduced-motion: reduce) {
  .bi-campo--activo::before, .bi-campo--activo::after { animation: none; }
}

/* El claro acompaña el círculo también durante su movimiento automático. */
@media (min-width: 60rem) {
  .bi-campo span { background: transparent; }
  .bi-campo::before, .bi-campo::after,
  .bi-campo--activo::before, .bi-campo--activo::after {
    mask-image: radial-gradient(circle var(--bi-radio, clamp(4.5rem, 8vw, 7rem)) at var(--bi-mascara-x, 67.1429%) var(--bi-mascara-y, 50%), transparent 98%, #000 100%);
    mask-repeat: no-repeat;
  }
}
@media (min-width: 60rem) and (prefers-reduced-motion: no-preference) {
  .bi-campo::before { animation: bi-malla-activa-a 18s linear infinite; }
  .bi-campo::after { animation: bi-malla-activa-b 30s linear infinite; }
}
