/* El capítulo 05 «Resonancias» dentro del porfolio (prueba de fusión, no publicada).
   Usa las variables y el lenguaje del porfolio: piezas algo giradas, bordes cálidos,
   sombras hondas, títulos en Georgia, el rojo de las marcas de la obra y su «señal»:
   capas que se mueven a distinta profundidad, glitch rojo y cian, barridos y nieve.
   El movimiento lo pone movimiento.js; aquí está cómo se ve cada capa. */

/* El botón de idioma, en la barra de arriba (la página de entrada es la inglesa; la española, es.html) */
.topbar .res-idioma { display: flex; gap: 4px; width: auto; margin-left: 18px; padding: 0; overflow: visible; }
.topbar .res-idioma a { display: block; margin: 0; padding: 6px 8px; border: 1px solid #ffffff2e; color: #b4afa5; font: 700 10px/1 Arial, sans-serif; letter-spacing: 0.14em; text-decoration: none; }
.topbar .res-idioma a:hover, .topbar .res-idioma a:focus-visible { color: #e5a08b; border-color: #e5a08b; }
.topbar .res-idioma a[aria-current] { background: var(--red); border-color: var(--red); color: #fbeee9; }
/* Que al saltar a una parte no quede debajo de la tira y la barra de arriba */
.res-capitulo, #resonancias { scroll-margin-top: 110px; }

/* Los capítulos siguen el fondo de la sección «Resonancias» del porfolio. */
.project + .res-capitulo, .res-capitulo + .res-capitulo { border-top: 1px solid #3a332c; }
.res-capitulo { position: relative; overflow: hidden; background: #1d1a17; padding-block: clamp(70px, 9vw, 130px); }
.res-capitulo > .wrap { position: relative; z-index: 1; }
.res-capitulo .section-head { margin-bottom: clamp(30px, 4vw, 50px); }
.res-ultimo { padding-bottom: clamp(90px, 12vw, 170px); }
.res-idea-bloque { padding-top: clamp(30px, 4vw, 60px); }
.res-capitulo strong { color: #eee6db; }

/* ---------- Capas: parallax, aparecer e inclinarse (los valores los pone movimiento.js) ---------- */
[data-capa] { translate: var(--px, 0px) var(--py, 0px); }
[data-capa], [data-aparece], [data-inclina] { transition: translate 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.35s ease-out, opacity 0.35s ease, clip-path 0.5s steps(5, end); }
/* Entra con un corte de señal: se destapa a saltos, de arriba abajo. */
.res-mueve [data-aparece] { opacity: 0; clip-path: inset(0 0 100% 0); }
.res-mueve [data-aparece].is-visible { opacity: 1; clip-path: inset(-160px -160px -160px -160px); }

/* Fondos: detalles de texturas de las obras del porfolio, como la obra que asoma en su portada.
   Mezcla «screen»: el negro desaparece y el color brilla sobre el fondo oscuro. Respiran despacio. */
.res-fondo { position: absolute; z-index: 0; pointer-events: none; opacity: 0.3; background-repeat: no-repeat; filter: saturate(1.6) contrast(1.25) brightness(0.62); mix-blend-mode: screen; will-change: transform;
  clip-path: polygon(3% 4%, 100% 0, 96% 91%, 0 100%); animation: res-respira 18s ease-in-out infinite alternate; }
.res-fondo::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(240, 226, 209, 0.3) 0.7px, transparent 1px) 0 0 / 6px 6px, repeating-linear-gradient(0deg, #00000055 0 1px, transparent 1px 4px); }
.res-fondo-torres { top: 4%; right: -6%; width: 58%; height: 62%; background-image: url("imagenes/obra-51.jpg"); background-size: 190%; background-position: 30% 62%; transform: rotate(2.5deg); }
.res-fondo-garabatos { top: 2%; right: -8%; width: 46%; height: 44%; background-image: url("imagenes/reserva-49.jpg"); background-size: 240%; background-position: 70% 40%; transform: rotate(-3deg); opacity: 0.2; }
.res-fondo-alambres { bottom: 6%; left: -10%; width: 52%; height: 46%; background-image: url("imagenes/obra-20.jpg"); background-size: 230%; background-position: 45% 45%; transform: rotate(1.5deg); filter: grayscale(0.3) contrast(1.5) brightness(0.55); opacity: 0.2; }
.res-fondo-trazos { top: 0; right: -6%; width: 54%; height: 40%; background-image: url("imagenes/reserva-34.jpg"); background-size: 220%; background-position: 85% 35%; transform: rotate(-2deg); opacity: 0.22; }
.res-fondo-amarillo { top: 52%; left: -12%; width: 48%; height: 40%; background-image: url("imagenes/reserva-50.jpg"); background-size: 260%; background-position: 75% 25%; transform: rotate(3deg); opacity: 0.22; }
.res-fondo-corteza { top: 8%; right: -8%; width: 44%; height: 50%; background-image: url("imagenes/favorita-13.jpg"); background-size: 360%; background-position: 50% 52%; transform: rotate(4deg); filter: contrast(1.6) saturate(1.2) brightness(0.55); opacity: 0.24; }
.res-fondo-ecualizador { top: 64%; right: -8%; width: 50%; height: 30%; background-image: url("fondos/aparato-ecualizador-2.jpg"); background-size: cover; background-position: 40% 40%; transform: rotate(-2deg); opacity: 0.28; }
/* El boceto de la figura y el panel (antes en «Hallazgos del móvil»), en negativo detrás de «Otras obras»:
   el papel se vuelve negro y desaparece; quedan las líneas, claras y casi transparentes. */
.res-fondo-boceto { top: -2%; right: -3%; width: 58%; height: 52%; background-image: url("imagenes/hallazgos_movil/boceto_figura_20250518.jpg"); background-size: cover; background-position: 50% 50%;
  transform: rotate(-1.5deg); filter: grayscale(1) invert(1) brightness(0.72) contrast(2.8); opacity: 0.5; }
/* «Sinestesia»: humo y chispas (foto de Carlos), sin marco, fundido con la luz */
.res-fondo-humo { top: -4%; right: -6%; width: 46%; height: 82%; background-image: url("fondos/humo.jpg"); background-size: cover; background-position: 50% 40%; transform: rotate(2deg); filter: saturate(1.2) contrast(1.2) brightness(0.8); opacity: 0.42;
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); mask-image: radial-gradient(closest-side, #000 50%, transparent 100%); clip-path: none; }
/* Capas de vídeo: Carlos tocando, grande y casi transparente, como el vídeo de la portada del porfolio. */
.res-fondo-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
.res-fondo-pearl { top: 6%; left: -5%; width: 50%; height: 90%; transform: rotate(-2deg); opacity: 0.26; filter: grayscale(0.2) contrast(1.35) brightness(0.7); }
.res-fondo-chemical { bottom: 4%; left: -8%; width: 50%; height: 44%; transform: rotate(-2.5deg); opacity: 0.24; filter: grayscale(0.2) contrast(1.35) brightness(0.7); }
.res-con-fondo { position: relative; overflow: hidden; }
/* «Siempre tocando»: dos tubos de luz, blanco y amarillo, de fondo (textura de Carlos) */
.res-fondo-tubos { top: 0; right: 4%; width: 34%; height: 78%; background-image: url("obras/obra-19.jpg"); background-size: cover; background-position: 50% 50%; transform: rotate(3deg); filter: contrast(1.3) brightness(0.8); opacity: 0.3; }
/* «Mestanza»: la valla oxidada con la hierba alta, de fondo (foto de Carlos) */
.res-fondo-valla { top: 4%; left: -6%; width: 60%; height: 55%; background-image: url("fondos/valla_hierba.jpg"); background-size: cover; background-position: 50% 60%; transform: rotate(-1.5deg); filter: grayscale(0.4) contrast(1.3) brightness(0.6); opacity: 0.22; }
/* El autorretrato de «Recorrido», al lado de la entradilla, algo girado */
.res-autorretrato { --giro: -2deg; position: relative; float: right; width: min(44%, 220px); margin: 22px 0 16px 22px; padding: 6px; background: #1b1c1a; border: 1px solid #61564a; box-shadow: 0 25px 60px #000c;
  transform: perspective(800px) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -8deg)) rotateY(calc(var(--tx, 0) * 10deg)); }
.res-autorretrato img { display: block; width: 100%; height: auto; }
.res-autorretrato figcaption { position: absolute; z-index: 2; left: 12px; bottom: 12px; padding: 4px 6px; background: #111d; color: #e8dfd4; font: 700 8px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
/* La foto de los cables, junto a «cablear, conectar»: una ficha suelta y algo girada, como los aparatos */
.res-conectar { --giro: 2deg; position: relative; width: min(100%, 300px); margin: 34px 0 0 auto; padding: 6px; background: #1b1c1a; border: 1px solid #61564a; box-shadow: 0 25px 60px #000c;
  transform: perspective(800px) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -8deg)) rotateY(calc(var(--tx, 0) * 10deg)); }
.res-conectar img { display: block; width: 100%; height: auto; filter: contrast(1.08); }
.res-conectar figcaption { position: absolute; z-index: 2; left: 12px; bottom: 12px; padding: 4px 6px; background: #111d; color: #e8dfd4; font: 700 8px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.res-con-fondo > .wrap { position: relative; z-index: 1; }

/* Palabras gigantes al fondo, solo el contorno: la capa más lejana. */
.res-fantasma { position: absolute; z-index: 0; left: -0.06em; top: 0.05em; font-family: Georgia, "Times New Roman", serif; font-size: clamp(110px, 21vw, 330px); line-height: 0.8; letter-spacing: -0.1em; color: #e9e3d804; -webkit-text-stroke: 1px #e9e3d812; white-space: nowrap; pointer-events: none; user-select: none; }
.res-fantasma-abajo { left: auto; right: -0.08em; top: auto; bottom: -0.12em; }
/* Una franja de texto en vertical que deriva sola, como en «Señal». */
.res-fragmento { position: absolute; z-index: 0; top: 14%; right: 0.1em; font: 700 clamp(40px, 4.6vw, 76px)/0.8 Arial, sans-serif; letter-spacing: -0.08em; white-space: nowrap; color: #f1e8dc16; writing-mode: vertical-rl; transform: rotate(180deg); animation: res-deriva 9s ease-in-out infinite alternate; pointer-events: none; user-select: none; }

/* ---------- Glitch: el texto con una capa roja y otra cian que se desplazan con el ratón ---------- */
.res-glitch { position: relative; }
/* (el «/ ""» hace que los lectores de pantalla no lean las copias) */
.res-glitch::before, .res-glitch::after { content: attr(data-text); content: attr(data-text) / ""; position: absolute; inset: 0; overflow: hidden; pointer-events: none; animation-delay: var(--retraso, 0s); }
.res-glitch::before { color: #ea4937; translate: var(--gx, 0px) calc(var(--gy, 0px) * -1); clip-path: inset(7% 0 73% 0); transform: translate(3px, -2px); opacity: 0.6; animation: res-glitch-arriba 3.3s infinite steps(1, end); }
.res-glitch::after { color: #77d5d4; translate: calc(var(--gx, 0px) * -1) var(--gy, 0px); clip-path: inset(68% 0 10% 0); transform: translate(-4px, 3px); opacity: 0.5; animation: res-glitch-abajo 4.1s infinite steps(1, end); }
/* Cuando se rompe (movimiento.js cambia unas letras de data-text un instante). */
.res-glitch.se-rompe { animation: res-sacudida 0.3s steps(2, end); }
.res-glitch.se-rompe::before { opacity: 1; animation-duration: 0.35s; }
.res-glitch.se-rompe::after { opacity: 1; animation-duration: 0.45s; }
.project-title .res-glitch { display: inline-block; }
/* Una palabra de un párrafo que se rompe: se queda su hueco y encima salen signos. */
.res-rota { position: relative; display: inline-block; color: transparent; animation: res-sacudida 0.3s steps(2, end); }
.res-rota::before, .res-rota::after { content: attr(data-text); content: attr(data-text) / ""; position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; }
.res-rota::before { color: #ea4937; translate: 2px -1px; }
.res-rota::after { color: #e9e3d8; translate: -2px 1px; clip-path: inset(0 0 45% 0); }

/* Una raya roja que salta, como en «Señal». Se mueve con transform (su propia capa),
   para no tener que volver a pintar lo que tiene debajo cada vez que salta. */
.res-barrido { position: absolute; z-index: 4; inset: 0; pointer-events: none; opacity: 0.7; transform: translateY(31%) rotate(-2deg); will-change: transform; animation: res-salto 5.3s steps(1, end) infinite; animation-delay: var(--retraso, 0s); }
.res-barrido::before { content: ""; position: absolute; left: -10%; top: 0; width: 120%; height: 2px; background: #c44735; box-shadow: 0 0 25px #c4473570; }

/* ---------- La pintura, sus detalles y la rejilla viva, en capas ---------- */
.res-idea { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(30px, 6vw, 90px); align-items: center; }
.res-collage { position: relative; }
.res-obra { position: relative; z-index: 2; margin: 0; padding: 8px; background: #211f1c; border: 1px solid #61564a; box-shadow: 0 25px 70px #0009; transform: rotate(-1.6deg); }
.res-obra-marco { position: relative; overflow: hidden; clip-path: polygon(0 1.5%, 99% 0, 97.5% 100%, 1.5% 98.5%); cursor: crosshair; }
.res-obra-marco img { display: block; width: 100%; height: auto; transform: scale(1.1); translate: calc(var(--px, 0px) * -0.35) calc(var(--py, 0px) * -0.35); transition: translate 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); }
.res-obra-base { filter: saturate(1.1) contrast(1.06); }
/* Trama de puntos, como las obras del porfolio */
.res-obra-marco::before { content: ""; position: absolute; z-index: 3; inset: 0; pointer-events: none; background-image: radial-gradient(circle, rgba(240, 226, 209, 0.28) 0.7px, transparent 1px); background-size: 6px 6px; mix-blend-mode: screen; opacity: 0.22; }
/* La lente: dos copias de la pintura, roja y cian, que solo se ven alrededor del ratón */
.res-obra-lente { position: absolute; top: 0; left: 0; height: 100% !important; object-fit: cover; mix-blend-mode: screen; opacity: 0; pointer-events: none; will-change: transform; transition: opacity 0.35s ease, translate 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
  -webkit-mask-image: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), #000 0 55px, transparent 135px); mask-image: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), #000 0 55px, transparent 135px); }
.res-lente-roja { left: 8px; top: -3px; filter: sepia(1) saturate(7) hue-rotate(-28deg) contrast(1.25); }
.res-lente-cian { left: -8px; top: 3px; filter: sepia(1) saturate(5) hue-rotate(140deg) contrast(1.25); }
.res-obra-marco:hover .res-obra-lente { opacity: 0.8; }
.res-obra-marco::after { content: ""; position: absolute; z-index: 5; left: 0; top: 0; transform: translate(calc(var(--mx, 0px) - 75px), calc(var(--my, 0px) - 75px)); will-change: transform; width: 150px; height: 150px; border: 1px solid #ea493799; border-radius: 50%; box-shadow: 0 0 0 1px #77d5d433 inset; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.res-obra-marco:hover::after { opacity: 1; }
.res-obra figcaption { font-size: 10px; letter-spacing: 0.06em; color: var(--muted); padding: 10px 2px 2px; }
.res-obra figcaption .pending { display: block; margin-top: 4px; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }

/* Detalles de la pintura sueltos, como los fragmentos del archivo en «Obras» */
.res-detalle { position: absolute; z-index: 3; margin: 0; width: clamp(110px, 12vw, 180px); padding: 5px; background: #141513; border: 1px solid #dfd1c455; box-shadow: 0 18px 50px #000b; }
/* La pintura se mueve por dentro del recorte, al revés que la ficha (otra capa más) */
.res-detalle-img { display: block; aspect-ratio: 0.74; background: url("resonancias/imagenes/retrato-de-partida.jpg") no-repeat; background-size: 420%; filter: saturate(1.55) contrast(1.25);
  background-position: calc(var(--bx) + var(--px, 0px) * -0.4) calc(var(--by) + var(--py, 0px) * -0.4); transition: background-position 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.res-detalle::after { content: ""; position: absolute; inset: 5px; background: linear-gradient(140deg, #ba402e55, transparent 58%), radial-gradient(circle, rgba(240, 226, 209, 0.25) 0.7px, transparent 1px); background-size: auto, 6px 6px; mix-blend-mode: screen; pointer-events: none; }
.res-detalle figcaption { position: absolute; z-index: 1; left: 9px; bottom: 9px; padding: 4px 6px; background: #111d; color: #e8dfd4; font: 700 8px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.res-detalle-1 { right: -11%; top: 5%; transform: rotate(6deg); }
.res-detalle-1 .res-detalle-img { --bx: 61%; --by: 41%; }
.res-detalle-2 { left: -12%; bottom: 16%; transform: rotate(-7deg); }
.res-detalle-2 .res-detalle-img { --bx: 30%; --by: 74%; background-size: 330%; }

.res-cita { font-family: Georgia, "Times New Roman", serif; font-size: clamp(40px, 6vw, 84px); line-height: 0.9; letter-spacing: -0.06em; text-transform: uppercase; color: #ece4d8; margin: 0 0 clamp(26px, 4vw, 44px); }

.res-rejilla { --celda: #2a2826; --paso-1: #c4391f; --paso-2: #e1832b; --paso-3: #e3bd34; --paso-4: #d9d1bd; --bajo: #5b97dc;
  position: relative; z-index: 4; margin: 0 0 0 clamp(-110px, -7vw, -40px); padding: clamp(14px, 2vw, 22px); background: #20211fee; border: 1px solid #61564a; box-shadow: 0 25px 60px #0008;
  transform: rotate(1.4deg); will-change: transform; backface-visibility: hidden; }
.res-rejilla .rejilla-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.res-rejilla .rejilla-tempo { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; color: var(--ink); white-space: nowrap; }
.res-rejilla .pistas { display: grid; gap: 7px; cursor: crosshair; }
.res-rejilla .pista { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; }
.res-rejilla .pista-nombre { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.res-rejilla .pasos { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
.res-rejilla .paso { aspect-ratio: 1 / 1.35; background: var(--celda); border-radius: 2px; transition: translate 0.15s ease-out; }
.res-rejilla .paso:nth-child(4n+1) { margin-left: 3px; }
.res-rejilla .paso.on { background: var(--color-paso); opacity: calc(0.45 + var(--fuerza, 1) * 0.55); }
.res-rejilla .pasos .paso:nth-child(-n+4) { --color-paso: var(--paso-1); }
.res-rejilla .pasos .paso:nth-child(n+5):nth-child(-n+8) { --color-paso: var(--paso-2); }
.res-rejilla .pasos .paso:nth-child(n+9):nth-child(-n+12) { --color-paso: var(--paso-3); }
.res-rejilla .pasos .paso:nth-child(n+13) { --color-paso: var(--paso-4); }
.res-rejilla .pista-bajo .pasos .paso.on { --color-paso: var(--bajo); }
.res-rejilla .paso.ahora { box-shadow: 0 0 0 2px var(--ink); }
.res-rejilla .paso.ahora.on { opacity: 1; box-shadow: 0 0 0 2px var(--ink), 0 0 10px var(--color-paso); }
/* La columna que está bajo el ratón se levanta, con el desfase rojo y cian */
.res-rejilla .paso.cerca { translate: 0 -3px; box-shadow: 2px 0 0 #ea4937aa, -2px 0 0 #77d5d4aa; }
.res-rejilla .paso.cerca.on { opacity: 1; box-shadow: 3px 0 0 #ea4937, -3px 0 0 #77d5d4, 0 0 14px var(--color-paso); }
.res-rejilla figcaption { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 16px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.res-rejilla .boton-pausa { flex: none; min-width: 7em; text-align: center; font: inherit; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); background: transparent; border: 1px solid #61564a; padding: 7px 12px; cursor: pointer; }
.res-rejilla .boton-pausa:hover { border-color: #d27a65; color: #d27a65; }

/* ---------- La cianotipia a todo lo ancho ---------- */
.res-banda { position: relative; margin: 0; padding-bottom: 16px; background: #0d0e0d; border-block: 1px solid #3a332c; }
.res-banda-ventana { position: relative; overflow: hidden; isolation: isolate; height: clamp(200px, 23vw, 360px); cursor: crosshair; }
/* La capa es más alta que la ventana para que el parallax tenga sitio; la tira se desplaza de lado (cqw = el ancho de la capa) */
.res-banda-capa { position: absolute; left: 0; right: 0; top: -12%; height: 124%; overflow: hidden; container-type: inline-size; }
.res-banda-tira { width: max-content; height: 100%; will-change: transform; animation: res-panea 46s ease-in-out infinite alternate; }
.res-banda-tira img { display: block; width: auto; max-width: none; height: 100%; filter: contrast(1.08); }
/* Donde está el ratón, la obra se vuelve azul de cianotipia */
.res-banda-azul { z-index: 1; pointer-events: none; opacity: 0; transition: opacity 0.35s ease; will-change: transform;
  -webkit-mask-image: radial-gradient(ellipse 170px 80% at var(--mx, -400px) 50%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 170px 80% at var(--mx, -400px) 50%, #000 30%, transparent 100%); }
.res-banda-azul img { filter: grayscale(1) sepia(1) hue-rotate(178deg) saturate(4.5) brightness(0.82) contrast(1.25); }
.res-banda-ventana:hover .res-banda-azul { opacity: 1; }
.res-banda-ventana::after { content: ""; position: absolute; z-index: 2; inset: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(240, 226, 209, 0.22) 0.7px, transparent 1px) 0 0 / 6px 6px, repeating-linear-gradient(0deg, #0000003d 0 1px, transparent 1px 4px), linear-gradient(90deg, #0d0e0d, transparent 7%, transparent 93%, #0d0e0d); }
.res-banda-ventana > .res-barrido { z-index: 3; opacity: 0.55; }
.res-banda-rotulo { position: absolute; z-index: 3; left: var(--gutter); top: 16px; padding: 5px 8px; background: #111d; color: #e8dfd4; font: 700 9px/1 Arial, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; }
.res-banda figcaption { padding-top: 12px; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.res-banda figcaption .pending { margin-left: 8px; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
/* Sin ratón (móvil), una franja azul la recorre sola */
@media (hover: none) {
  .res-banda-azul { opacity: 0.85; -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent); mask-image: linear-gradient(90deg, transparent, #000 35%, #000 65%, transparent);
    -webkit-mask-size: 32% 100%; mask-size: 32% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; animation: res-barre 11s ease-in-out infinite alternate; }
}

/* ---------- Los aparatos: fotos sueltas en capas, que se inclinan hacia el ratón ---------- */
.res-aparatos-fotos { position: relative; height: clamp(320px, 34vw, 470px); margin-top: clamp(28px, 4vw, 48px); }
.res-aparato { --giro: 0deg; position: absolute; margin: 0; padding: 6px; background: #1b1c1a; border: 1px solid #61564a; box-shadow: 0 18px 45px #000b;
  transform: perspective(800px) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -8deg)) rotateY(calc(var(--tx, 0) * 10deg)); }
.res-aparato img { display: block; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.2) contrast(1.12); }
.res-aparato::before { content: ""; position: absolute; inset: 6px; z-index: 1; pointer-events: none; background: linear-gradient(140deg, #ba402e44, transparent 58%), radial-gradient(circle, rgba(240, 226, 209, 0.22) 0.7px, transparent 1px) 0 0 / 6px 6px; mix-blend-mode: screen; }
.res-aparato figcaption { position: absolute; z-index: 2; left: 12px; bottom: 12px; padding: 4px 6px; background: #111d; color: #e8dfd4; font: 700 8px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.res-aparato-mesa { left: 0; top: 0; width: 38%; aspect-ratio: 0.75; --giro: -3deg; z-index: 2; }
.res-aparato-minilab { left: 33%; top: 5%; width: 54%; aspect-ratio: 1.33; --giro: 2deg; z-index: 1; }
.res-aparato-pedal { left: 54%; top: 52%; width: 44%; aspect-ratio: 1.33; --giro: -1.5deg; z-index: 3; }
.res-aparato-ecualizador { left: 6%; top: 60%; width: 46%; aspect-ratio: 1.33; --giro: 3deg; z-index: 2; }

/* ---------- El relevo en cuatro pasos: fichas giradas que se inclinan hacia el ratón ---------- */
.res-pasos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 22px); }
.res-pasos li { --giro: 0deg; --baja: 0px; position: relative; padding: 24px 20px 26px; background: #1b1c1a; border: 1px solid #594b41; box-shadow: 0 20px 50px #0008;
  transform: perspective(900px) translateY(var(--baja)) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -8deg)) rotateY(calc(var(--tx, 0) * 10deg)); }
.res-pasos li:nth-child(1) { --giro: -1.4deg; }
.res-pasos li:nth-child(2) { --giro: 1deg; --baja: 26px; }
.res-pasos li:nth-child(3) { --giro: -0.6deg; --baja: -8px; border-color: #9c392b; }
.res-pasos li:nth-child(4) { --giro: 1.6deg; --baja: 18px; }
/* El brillo que sigue al ratón dentro de la ficha */
[data-inclina]::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--lx, 50%) var(--ly, 50%), #b53d2b38, transparent 58%); opacity: 0; transition: opacity 0.3s ease; }
[data-inclina]:hover::after { opacity: 1; }
.res-numero { display: block; width: max-content; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: 70px; line-height: 0.8; color: var(--red); margin-bottom: 16px; translate: calc(var(--tx, 0) * 14px) calc(var(--ty, 0) * 10px); transition: translate 0.3s ease-out; }
.res-pasos h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(21px, 2vw, 27px); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 10px; color: #ece4d8; }
.res-pasos p { margin: 0; font-size: 14px; line-height: 1.7; color: #c6c0b5; }

.res-nota { max-width: 760px; margin: clamp(46px, 6vw, 70px) 0 0; padding-left: 16px; border-left: 2px solid var(--red); font-size: 14px; line-height: 1.75; color: #c6c0b5; }
.res-dos { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 6vw, 90px); margin-top: clamp(50px, 7vw, 90px); align-items: start; }
.res-subtitulo { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(30px, 4vw, 52px); line-height: 0.95; letter-spacing: -0.05em; margin: 0 0 16px; color: #ece4d8; }
.res-entrada { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.55; color: #d1c9be; }
.res-capitulo .timeline { margin-top: 0; border-top: 1px solid #524a41; }
.res-capitulo .timeline div { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid #524a41; font-size: 13px; line-height: 1.6; transition: background 0.25s ease, padding 0.25s ease; }
.res-capitulo .timeline div:hover { background: linear-gradient(90deg, #b53d2b1f, transparent 70%); padding-left: 10px; }
.res-capitulo .timeline b { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #d27a65; }
.res-capitulo .timeline span { color: #c9c2b7; }
/* La realización, a ritmo: la multivista de la ATEM, como una pantalla algo girada, con su botón de sonido */
/* El relevo, de noche: a todo lo ancho, debajo de los pasos */
.res-relevo-video { margin-top: clamp(40px, 6vw, 72px); }

/* La cabecera, con los planos del 04-11-2026: el vídeo ya viene tratado, sin más color ni contraste */
.hero-video { filter: none; mix-blend-mode: normal; opacity: 0.94; }

/* «De cerca»: las fotos del 04-11-2026, en columnas, cada una con su forma */
.res-cerca { margin: clamp(48px, 7vw, 96px) 0; }
.res-cerca-fotos { columns: 3; column-gap: clamp(8px, 1.2vw, 16px); margin-top: 22px; }
.res-cerca-foto { position: relative; margin: 0 0 clamp(8px, 1.2vw, 16px); overflow: hidden; break-inside: avoid; background: #0b0c0b; }
.res-cerca-foto img { display: block; width: 100%; height: auto; transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.res-cerca-foto:hover img { transform: scale(1.04); }
.res-cerca-foto figcaption { position: absolute; left: 12px; bottom: 10px; color: #e9e3da; font: 700 10px/1.4 Arial, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; text-shadow: 0 1px 6px #000; }
@media (max-width: 700px) { .res-cerca-fotos { columns: 2; } }

.res-realizacion { align-items: center; }
.res-realizacion-video { position: relative; margin: 0; padding: 6px; background: #141513; border: 1px solid #dfd1c455;
  box-shadow: 0 25px 60px #000c, 4px 0 0 #ea493755, -4px 0 0 #77d5d455; transform: rotate(-1.2deg); }
.res-realizacion-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.res-realizacion-video figcaption { margin: 10px 2px 2px; color: #b9b1a6; font: 700 10px/1.5 Arial, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; }
.res-sonido { position: absolute; z-index: 3; top: 16px; right: 16px; padding: 7px 10px; background: #111d; border: 1px solid #dfd1c466; color: #e8dfd4;
  font: 700 10px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; }
.res-sonido:hover, .res-sonido:focus-visible { border-color: #e8dfd4; }
.res-sonido[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fbeee9; }

/* ---------- «Escúchalo»: el reproductor con quién toca ---------- */
.res-reproductor { position: relative; overflow: hidden; padding: clamp(18px, 3vw, 34px); background: #1b1c1a; border: 1px solid #594b41; box-shadow: 0 30px 80px #0009; }
.res-reproductor::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: repeating-linear-gradient(0deg, #ffffff07 0 1px, transparent 1px 4px); }
.res-reproductor > .ahora, .res-reproductor > audio, .res-reproductor > .res-mando, .res-reproductor > .linea-tiempo, .res-reproductor > p { position: relative; z-index: 1; }
/* El reproductor propio: el botón que late al tempo, el espectro como la rejilla y el tiempo */
.res-mando { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(12px, 2vw, 24px); margin: 4px 0 2px; }
.res-mando[hidden] { display: none; }
.res-play { position: relative; display: inline-flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px 0 18px; border: 0; background: var(--red); color: #fbeee9; font: 700 12px/1 Arial, Helvetica, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; cursor: pointer; transform: rotate(-1.2deg); box-shadow: 0 14px 30px #0008; transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.res-play:hover, .res-play:focus-visible { background: #cf4a33; transform: rotate(-1.2deg) translate(-1px, -1px); box-shadow: 4px 0 0 #77d5d4, -4px 0 0 #ea4937, 0 14px 30px #0008; }
.res-play:focus-visible { outline: 2px solid #eee7db; outline-offset: 4px; }
.res-play-icono { width: 0; height: 0; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent currentColor; }
.res-play.suena .res-play-icono { width: 16px; height: 22px; border: 0; background: linear-gradient(90deg, currentColor 0 36%, transparent 36% 64%, currentColor 64%); }
/* Mientras suena, un marco late a 121,5 BPM (el tempo de la canción: 0,494 s por golpe) */
.res-play::after { content: ""; position: absolute; inset: -7px; border: 1px solid #d27a65; opacity: 0; pointer-events: none; }
.res-play.suena::after { animation: res-latido 0.494s ease-out infinite; }
.res-espectro { display: block; width: 100%; height: 64px; }
.res-tiempo { font-family: Consolas, "Cascadia Mono", monospace; font-size: 14px; letter-spacing: 0.04em; color: var(--ink); white-space: nowrap; }
.res-reproductor > .res-barrido { z-index: 2; opacity: 0.45; }
.res-reproductor audio { display: block; width: 100%; }
.res-reproductor .ahora { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.res-reproductor .ahora-quien { margin: 0; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; text-transform: uppercase; letter-spacing: -0.02em; font-size: clamp(46px, 7vw, 92px); line-height: 0.85; color: #d4c7b4; text-shadow: 3px 2px 0 #0009; }
.res-reproductor .ahora-quien[data-quien="ella"] { color: #d27a65; text-shadow: 3px 2px 0 #5a1d14; }
.res-reproductor .linea-tiempo { margin-top: 18px; padding-top: 6px; }
.res-reproductor .tramos { display: flex; gap: 3px; height: 46px; }
.res-reproductor .tramo { flex-basis: 0; min-width: 6px; border: 0; padding: 0 6px; cursor: pointer; background: #2a2826; overflow: hidden; text-align: left; transition: transform 0.2s ease-out, filter 0.2s ease-out; }
.res-reproductor .tramo span { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #1b1c1a; }
.res-reproductor .tramo.yo { background: #d4c7b4; }
.res-reproductor .tramo.ella { background: var(--red); }
.res-reproductor .tramo.ella span { color: #fbeee9; }
.res-reproductor .tramo:hover { transform: translateY(-4px) skewX(-4deg); filter: drop-shadow(3px 0 0 #ea4937) drop-shadow(-3px 0 0 #77d5d4); }
.res-reproductor .aguja { position: absolute; top: 0; bottom: -6px; left: 0; width: 2px; background: var(--ink); box-shadow: 0 0 0 1px #0008; pointer-events: none; }
.res-leyenda { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.res-leyenda > span { display: inline-flex; align-items: center; gap: 7px; }
.res-leyenda .muestra { display: inline-block; width: 14px; height: 14px; }
.res-leyenda .muestra.yo { background: #d4c7b4; }
.res-leyenda .muestra.ella { background: var(--red); }
.res-reproductor-nota { margin: 14px 0 0; font-size: 13px; line-height: 1.65; color: #c6c0b5; max-width: 760px; }
/* La pisada del pedal: la señal se corta un instante */
.res-reproductor.res-pisada { animation: res-corte 0.6s steps(3, end); }
.res-reproductor.res-pisada > .res-barrido { opacity: 1; animation-duration: 0.5s; }

/* El grito (grito.js), detrás del reproductor: una capa casi transparente, como un VHS roto. Con «screen»
   el negro desaparece y solo brilla lo claro; el reproductor, encima, lo tapa en parte. */
.res-grito { position: absolute; z-index: 0; top: clamp(-170px, -9vw, -50px); right: -2%; width: min(50vw, 700px); aspect-ratio: 1; margin: 0; pointer-events: none;
  opacity: 0.58; mix-blend-mode: screen; transform: rotate(2deg); }
.res-grito img, .res-grito canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.res-grito img { filter: contrast(1.2) brightness(0.8); }
.res-grito canvas { opacity: 0; }
.res-grito.en-marcha canvas { opacity: 1; }
.res-grito.en-marcha img { opacity: 0; }
/* El texto que cae encima del grito, con un fondo oscuro para que se lea */
#escuchalo .section-head p { position: relative; z-index: 2; padding: 10px 14px; background: #1d1a17d9; }
/* Rayas de pantalla y los bordes que se funden con el fondo */
.res-grito::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, #0000006b 0 1px, transparent 1px 3px), radial-gradient(closest-side, transparent 62%, #1d1a17 100%); }

/* La imagen de los golpes, con sus copias roja y cian y una raya que lee donde está el ratón */
.res-golpes { margin: clamp(40px, 6vw, 70px) 0 0; }
.res-golpes-lienzo { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #594b41 transparent; background: #101110; border: 1px solid #594b41; box-shadow: 0 25px 70px #0009; transform: rotate(-0.5deg); }
/* Cada copia de la imagen va en su propia capa (will-change): el ordenador la dibuja una vez
   y luego solo la desplaza. Antes se volvían a dibujar las tres con sus filtros a cada movimiento. */
.res-golpes-capas { position: relative; overflow: hidden; min-width: 620px; cursor: crosshair; }
.res-golpes-capas img { display: block; width: 100%; height: auto; will-change: transform; }
.res-golpes-fantasma { position: absolute; inset: 0; height: 100% !important; mix-blend-mode: screen; opacity: 0.32; pointer-events: none; transition: translate 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease; }
.res-fantasma-roja { filter: sepia(1) saturate(8) hue-rotate(-30deg); translate: calc(var(--gx, 0px) * 1.6 + 3px) calc(var(--gy, 0px) * 1.3); }
.res-fantasma-cian { filter: sepia(1) saturate(6) hue-rotate(150deg); translate: calc(var(--gx, 0px) * -1.6 - 3px) calc(var(--gy, 0px) * -1.3); }
.res-golpes-capas:hover .res-golpes-fantasma { opacity: 0.55; }
.res-golpes-lectura { position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; transform: translateX(var(--mx, -10px)); will-change: transform; width: 1px; background: #ea4937; box-shadow: 0 0 12px #ea4937, 2px 0 0 #77d5d455; opacity: 0; transition: opacity 0.3s ease; pointer-events: none; }
.res-golpes-capas:hover .res-golpes-lectura { opacity: 0.9; }
.res-golpes figcaption { max-width: 860px; font-size: 12px; line-height: 1.7; color: var(--muted); padding: 14px 2px 0; }

/* ---------- Huecos para lo que falta: el vídeo y las fotos del relevo ---------- */
.res-pendientes { position: relative; margin: clamp(70px, 9vw, 120px) 0 clamp(40px, 6vw, 80px); padding-inline: clamp(0px, 7vw, 110px); }
.res-pendiente { position: relative; z-index: 2; margin: 0; padding: 10px; background: #211f1c; border: 1px solid #51483e; box-shadow: 0 30px 80px #000a; transform: rotate(-0.8deg); }
.res-pendiente figcaption { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 11px 2px 2px; }
.res-pantalla { position: relative; overflow: hidden; isolation: isolate; min-height: clamp(300px, 38vw, 520px); display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(22px, 5vw, 64px); background: #0b0c0b; color: #f3ece2; cursor: crosshair; }
/* La nieve: ruido de verdad (un SVG con turbulencia) que salta a pasos */
.res-pantalla::before { content: ""; position: absolute; inset: -50%; z-index: 0; pointer-events: none; opacity: var(--nieve, 0.22); transition: opacity 0.25s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: res-nieve 0.5s steps(5) infinite; }
.res-pantalla::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, #080909dd 0%, #08090955 50%, transparent 100%), repeating-linear-gradient(0deg, #ffffff0a 0 1px, transparent 1px 4px); }
.res-pantalla-pista { position: absolute; z-index: 1; left: 0; right: 0; top: 0; transform: translateY(var(--sy, -20px)); will-change: transform; height: 3px; background: #ffffff26; box-shadow: 0 0 18px #ffffff40, 0 6px 0 #ea493722, 0 -6px 0 #77d5d422; pointer-events: none; }
.res-pantalla-indice { position: absolute; z-index: 3; left: clamp(16px, 3vw, 28px); right: clamp(16px, 3vw, 28px); top: 18px; display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid #ffffff44; font: 9px Arial, sans-serif; letter-spacing: 0.14em; color: #e7ded1aa; }
.res-pantalla-rotulo, .res-pantalla-titulo, .res-pantalla-texto { position: relative; z-index: 2; }
.res-pantalla-rotulo { font: 10px Arial, sans-serif; letter-spacing: 0.18em; text-transform: uppercase; color: #d68b79; }
.res-pantalla-titulo { width: max-content; margin: 18px 0 22px; font: 400 clamp(60px, 11vw, 160px)/0.78 Arial, Helvetica, sans-serif; letter-spacing: -0.09em; text-transform: uppercase; white-space: nowrap; color: #f3ece2; }
.res-pantalla-texto { max-width: 470px; margin: 0; padding-left: 12px; border-left: 2px solid #b73e2c; font: 12px/1.6 Arial, sans-serif; letter-spacing: 0.13em; text-transform: uppercase; color: #d2cbc0; }
.res-pantalla > .res-barrido { z-index: 2; }
/* Las fotos que faltan: fichas sueltas encima del vídeo */
.res-foto-pendiente { position: absolute; z-index: 3; margin: 0; width: clamp(120px, 14vw, 200px); padding: 6px; background: #1b1c1a; border: 1px solid #61564a; box-shadow: 0 18px 50px #000b; }
.res-foto-1 { left: 0; top: -14%; transform: rotate(-5deg); }
.res-foto-2 { right: 0; top: 42%; transform: rotate(4deg); }
.res-foto-hueco { display: grid; place-items: center; aspect-ratio: 0.75; background: repeating-linear-gradient(135deg, #ffffff08 0 2px, transparent 2px 9px), #121312; border: 1px dashed #6b5a4e; font: 700 10px/1 Arial, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: #aaa39a; }
.res-foto-pendiente figcaption { font-size: 9px; letter-spacing: 0.06em; color: var(--muted); padding: 8px 2px 1px; }

/* ---------- La pantalla con señal: el vídeo de Mestanza (videos.js) ---------- */
.res-pantalla-video { min-height: clamp(380px, 44vw, 600px); }
.res-pantalla-fondo { position: absolute; inset: -6%; z-index: 0; background: url("videos/mestanza.jpg") center / cover no-repeat; filter: blur(18px) brightness(0.42) saturate(1.3); }
/* (un vídeo no se estira entre top y bottom: hay que darle el alto) */
.res-pantalla-movil { position: absolute; z-index: 1; top: 7%; right: 9%; height: 86%; width: auto; aspect-ratio: 540 / 970; object-fit: cover; background: #000; border: 1px solid #dfd1c455;
  box-shadow: 0 25px 60px #000c, 4px 0 0 #ea493755, -4px 0 0 #77d5d455; transform: rotate(1.5deg); transition: opacity 0.4s ease, filter 0.15s steps(2, end); }
.res-pantalla-video .res-pantalla-titulo { font-size: clamp(52px, 8vw, 118px); }
/* Hasta que sintoniza, solo nieve y «NO SEÑAL»; con señal, la nieve baja */
.res-mueve .res-pantalla-video:not(.con-senal) .res-pantalla-movil { opacity: 0; }
.res-pantalla-video.con-senal::before { opacity: calc(var(--nieve, 0.22) * 0.45); }
/* Cuando se corta la señal un instante */
.res-pantalla-video.sin-senal::before { opacity: 0.85; }
.res-pantalla-video.sin-senal .res-pantalla-movil { opacity: 0.25; filter: contrast(2.2) saturate(0) hue-rotate(90deg); transform: rotate(1.5deg) translateX(-8px) skewX(-6deg); }
/* La foto 01 ahora es un vídeo pequeño */
.res-foto-con-video .res-foto-hueco { overflow: hidden; border-style: solid; }
.res-foto-hueco video, .res-foto-hueco img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Antes de la máquina: «Redrum» ---------- */
.res-antes-rejilla { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(30px, 6vw, 90px); align-items: center; }
.res-antes-titulo { margin: 12px 0 22px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(52px, 8vw, 112px); line-height: 0.84; letter-spacing: -0.07em; text-transform: uppercase; color: #e9e3d8; }
.res-antes-texto .res-nota { margin-top: 28px; }
.res-antes-collage { position: relative; min-height: clamp(380px, 42vw, 580px); }
.res-antes-cartel { --giro: -2.5deg; position: absolute; left: 0; top: 4%; width: 80%; margin: 0; padding: 8px; background: #1b1c1a; border: 1px solid #61564a; box-shadow: 0 25px 70px #000a;
  transform: perspective(900px) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -7deg)) rotateY(calc(var(--tx, 0) * 9deg)); }
.res-antes-cartel img { display: block; width: 100%; height: auto; }
/* «+LOOP+IA» a rotulador rojo encima del cartel: cada trazo se escribe en su turno (--t) al aparecer el cartel */
.res-cartel-lienzo { position: relative; display: block; }
.res-rotulador { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.res-rotulador path { fill: none; stroke: #e2412c; stroke-width: 21; stroke-linecap: round; stroke-linejoin: round; opacity: 0.93; }
.res-rotulador path:last-child { stroke-width: 12; opacity: 0.8; }
.res-mueve .res-rotulador path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.res-mueve .is-visible .res-rotulador path { animation: res-escribe 0.32s cubic-bezier(0.4, 0, 0.6, 1) forwards; animation-delay: calc(0.6s + var(--t) * 0.24s); }
.res-antes-video { position: absolute; z-index: 2; right: 0; bottom: 0; width: 36%; margin: 0; padding: 6px; background: #141513; border: 1px solid #dfd1c455; box-shadow: 0 25px 60px #000c, 4px 0 0 #ea493755, -4px 0 0 #77d5d455; transform: rotate(3deg); }
.res-antes-video video { display: block; width: 100%; aspect-ratio: 540 / 954; object-fit: cover; background: #000; }
.res-antes-cartel figcaption, .res-antes-video figcaption { position: absolute; z-index: 2; left: 14px; bottom: 14px; padding: 4px 6px; background: #111d; color: #e8dfd4; font: 700 8px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.res-fondo-redrum { top: 10%; left: -8%; width: 55%; height: 60%; background-image: url("videos/redrum_cartel.jpg"); background-size: 160%; background-position: 50% 80%; transform: rotate(-2deg); opacity: 0.22; }

/* ---------- La multivista: todos los vídeos en los que toco, como en la mesa de realización ---------- */
/* Arriba, el previo (borde cian) y el programa (borde rojo); abajo, las entradas. Cada pantalla, con sus
   rayas y su trama. Las grandes se dibujan desde las entradas (multivista.js); la imagen fija va debajo. */
.res-mv { --previo: #77d5d4; --programa: #ea4937; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: clamp(6px, 0.8vw, 10px); background: #070807; border: 1px solid #61564a;
  box-shadow: 0 30px 80px #000b, 5px 0 0 #ea493722, -5px 0 0 #77d5d422; transform: rotate(-0.5deg); }
.res-mv-grande, .res-mv-entrada { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 4 / 3; background: #000; border: 2px solid #2b2a27; }
.res-mv-grande { grid-column: span 2; }
.res-mv-quieta, .res-mv-lienzo, .res-mv-entrada video { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.res-mv-lienzo { z-index: 1; }
/* Rayas de pantalla y trama de puntos encima de cada imagen */
.res-mv-grande::after, .res-mv-entrada::after { content: ""; position: absolute; z-index: 2; inset: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(240, 226, 209, 0.16) 0.7px, transparent 1px) 0 0 / 6px 6px, repeating-linear-gradient(0deg, #00000047 0 1px, transparent 1px 3px); }
/* El rótulo de cada pantalla, abajo y en el centro, como en una multivista de verdad */
.res-mv-rotulo, .res-mv-nombre { position: absolute; z-index: 3; left: 50%; bottom: 6px; translate: -50% 0; max-width: calc(100% - 12px); padding: 4px 8px; background: #000c; color: #e8dfd4; font: 700 9px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-mv-rotulo { bottom: 10px; padding: 5px 12px; font-size: 10px; letter-spacing: 0.2em; }
.res-mv-nombre b { color: var(--programa); font-size: 10px; }
.res-mv-previo { border-color: var(--previo); }
.res-mv-previo .res-mv-rotulo { background: #0f3a3a; }
.res-mv-programa { border-color: var(--programa); box-shadow: 0 0 22px #ea493755; }
.res-mv-programa .res-mv-rotulo { background: var(--red); color: #fbeee9; }
/* El titular del programa, con sus capas roja y cian, y el año */
.res-mv-titulo, .res-mv-ano { position: absolute; z-index: 3; left: clamp(12px, 2vw, 22px); margin: 0; text-shadow: 0 2px 14px #000c; pointer-events: none; }
.res-mv-titulo { bottom: clamp(34px, 3.6vw, 46px); font: 400 clamp(34px, 4.6vw, 70px)/0.8 Arial, Helvetica, sans-serif; letter-spacing: -0.08em; text-transform: uppercase; color: #f3ece2; white-space: nowrap; }
.res-mv-ano { top: 12px; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(22px, 2.4vw, 34px); line-height: 0.8; color: var(--programa); }
/* Al cortar: la pantalla grande da un tirón de señal */
.res-mv-programa.corta .res-mv-lienzo, .res-mv-programa.corta .res-mv-quieta { animation: res-corte 0.35s steps(3, end); }
.res-mv-programa.corta .res-mv-titulo { animation: res-sacudida 0.3s steps(2, end); }
/* Las entradas: pequeñas y algo apagadas; la del previo y la del programa, encendidas y con su borde */
.res-mv-entradas { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.res-mv-entrada { display: block; width: 100%; padding: 0; color: inherit; cursor: pointer; transition: transform 0.25s ease-out, border-color 0.2s ease, box-shadow 0.2s ease; }
.res-mv-entrada video { filter: brightness(0.72) saturate(0.85); transition: filter 0.25s ease; }
.res-mv-entrada.en-previo { border-color: var(--previo); }
.res-mv-entrada.en-programa { border-color: var(--programa); box-shadow: 0 0 16px #ea493755; }
.res-mv-entrada.en-previo video, .res-mv-entrada.en-programa video { filter: none; }
/* Al pasar por encima, la pantallita crece y da un corte de señal */
.res-mv-entrada:hover, .res-mv-entrada:focus-visible { z-index: 4; transform: scale(1.07); box-shadow: 0 18px 40px #000c, 4px 0 0 #ea493788, -4px 0 0 #77d5d488; }
.res-mv-entrada:hover video, .res-mv-entrada:focus-visible video { filter: none; animation: res-corte 0.35s steps(3, end); }
.res-mv-entrada:focus-visible { outline: 2px solid #eee7db; outline-offset: 3px; }
/* La nieve: la entrada de la máquina (todavía sin señal) y las que la pierden un instante */
.res-mv-entrada.sin-senal::before, .res-mv-maquina::before { content: ""; position: absolute; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: res-nieve 0.5s steps(5) infinite; }
.res-mv-entrada.sin-senal video { filter: contrast(2.2) saturate(0) hue-rotate(90deg); transform: translateX(-6px) skewX(-6deg); }
.res-mv-maquina { display: grid; place-items: center; text-decoration: none; background: #0b0c0b; }
.res-mv-maquina::before { opacity: 0.32; }
.res-mv-sin { position: relative; z-index: 3; font: 400 clamp(16px, 1.8vw, 26px)/0.9 Arial, Helvetica, sans-serif; letter-spacing: -0.06em; text-transform: uppercase; color: #f3ece2; text-shadow: 3px 0 0 #ea493799, -3px 0 0 #77d5d499; }
.res-mv-maquina:hover .res-mv-sin, .res-mv-maquina:focus-visible .res-mv-sin { animation: res-sacudida 0.3s steps(2, end); }
/* Al lado, la ficha de lo que sale en programa: el número, de dónde es y, si la tiene, su sección */
.res-mv-zona { display: grid; grid-template-columns: minmax(170px, 0.3fr) minmax(0, 1fr); grid-template-areas: "pie mv"; gap: clamp(24px, 4vw, 60px); align-items: end; }
.res-mv-zona > .res-mv { grid-area: mv; }
.res-mv-pie { grid-area: pie; padding: 0 0 6px 14px; border-left: 2px solid var(--red); }
/* Su batería acústica, encima de la ficha: sin marco, fundida con la luz (screen) */
.res-yamaha { --giro: -2.5deg; position: relative; margin: 0 0 clamp(26px, 4vw, 48px) -30px; mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 100%); mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
  transform: perspective(800px) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -8deg)) rotateY(calc(var(--tx, 0) * 10deg)); }
.res-yamaha img { display: block; width: 100%; height: auto; }
.res-yamaha figcaption { position: absolute; z-index: 2; left: 30%; bottom: 14%; padding: 4px 6px; background: #111d; color: #e8dfd4; font: 700 8px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.res-mv-pie b { display: block; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #d27a65; }
.res-mv-pie-num { display: block; margin: 12px 0 10px; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(64px, 7vw, 104px); line-height: 0.8; color: var(--red); }
.res-mv-pie p { margin: 0 0 14px; font-size: 14px; line-height: 1.65; color: #c6c0b5; }
.res-mv-pie a { font-size: 13px; color: #eee6db; text-underline-offset: 3px; }
.res-mv-pie a:hover { color: #d27a65; }
.res-mv-pie a[hidden] { display: none !important; }

/* ---------- Capas: obras de Carlos sin marcos, mezcladas con modos de fusión de la luz (capas.js) ---------- */
.res-capas { padding-block: 0 clamp(60px, 8vw, 110px); background: #0b0a09; }
.res-capas-lienzo { position: relative; overflow: hidden; isolation: isolate; height: clamp(440px, 62vw, 860px); background: #0b0a09; }
/* Cada capa: sin marco, con los bordes fundidos en negro; se desplaza y respira a su ritmo (--dur, --dx, --dy) */
.res-capa { position: absolute; display: block; max-width: none; object-fit: cover; pointer-events: none; will-change: transform;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
  transition: opacity 1.4s ease; animation: res-capa-deriva var(--dur, 30s) ease-in-out infinite alternate; }
.res-capa-cielo { inset: -6% -4%; width: 108%; height: 112%; mix-blend-mode: screen; opacity: 0.55; --dur: 41s; --dx: -3%; --dy: 2%;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 80%, transparent); mask-image: linear-gradient(180deg, transparent, #000 18%, #000 80%, transparent); }
.res-capa-salto { left: 15%; top: -3%; width: 70%; height: 106%; mix-blend-mode: hard-light; opacity: 0.92; --dur: 23s; --dx: -1.5%; --dy: 1%; object-position: 50% 42%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent); mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent); }
.res-capa-muneca { left: 62%; top: 30%; width: 36%; height: 62%; mix-blend-mode: screen; opacity: 0.55; --dur: 29s; --dx: 3%; --dy: -2%; }
@media (max-width: 700px) { .res-capa-salto { left: -8%; width: 116%; } }   /* en el móvil, el salto entero: si no, se recorta por los lados */
.res-capas:not(.en-marcha) .res-capa { animation-play-state: paused; }
/* El corte de señal cuando una capa cambia de modo */
.res-capa.corta { clip-path: inset(var(--c1, 30%) 0 var(--c2, 40%) 0); filter: contrast(1.7) hue-rotate(var(--h, 60deg)); translate: var(--cx, 12px) 0; }
/* Rayas de pantalla y trama por encima de todas */
.res-capas-lienzo::after { content: ""; position: absolute; z-index: 3; inset: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(240, 226, 209, 0.14) 0.7px, transparent 1px) 0 0 / 6px 6px, repeating-linear-gradient(0deg, #0000004d 0 1px, transparent 1px 3px), radial-gradient(ellipse at 55% 45%, transparent 35%, #0b0a09d0 100%), linear-gradient(180deg, transparent 70%, #0b0a09); }
.res-capas-lienzo > .res-barrido { z-index: 4; opacity: 0.5; }
.res-capas-texto { position: relative; z-index: 5; margin-top: clamp(-150px, -10vw, -80px); }
.res-capas-texto h2 { margin: 10px 0 14px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(48px, 7vw, 100px); line-height: 0.85; letter-spacing: -0.06em; text-transform: uppercase; color: #ece4d8; }
.res-capas-texto p { max-width: 560px; margin: 0; padding-left: 14px; border-left: 2px solid var(--red); font-size: 14px; line-height: 1.7; color: #c6c0b5; }
@keyframes res-capa-deriva { from { transform: translate(0, 0) scale(1.02); } to { transform: translate(var(--dx, 0), var(--dy, 0)) scale(1.1); } }

/* ---------- «Recorrido» (recorrido.js): palabras clave con glitch y un poco de movimiento en las demás ---------- */
#recorrido .res-pal, #recorrido .res-clave { display: inline-block; }
#recorrido .res-clave { color: #f1e6d8; background: linear-gradient(transparent 62%, #b53d2b55 62% 92%, transparent 92%); }
#recorrido .res-clave::before { opacity: 0.75; }
#recorrido .res-clave::after { opacity: 0.6; }
/* Al llegar al párrafo, las palabras entran a saltos, una detrás de otra */
.res-recorrido-mueve #recorrido .profile-text > p:not(.visto) .res-pal,
.res-recorrido-mueve #recorrido .profile-text > p:not(.visto) .res-clave { opacity: 0; transform: translateY(0.5em); }
.res-recorrido-mueve #recorrido .res-pal, .res-recorrido-mueve #recorrido .res-clave {
  transition: opacity 0.5s ease, transform 0.6s steps(3, end); transition-delay: calc(var(--i, 0) * 14ms); }
/* La que tiembla un instante */
#recorrido .res-pal.tiembla { animation: res-tiembla 0.7s steps(4, end); }
@keyframes res-tiembla { 0% { transform: none; } 25% { transform: translate(-2px, 1px); color: #ea4937; } 50% { transform: translate(2px, -1px); color: #77d5d4; } 75% { transform: translate(-1px, 0); } 100% { transform: none; } }

/* ---------- Lo que investigo ---------- */
.res-pregunta { max-width: 980px; margin: 0; padding: clamp(22px, 3vw, 34px) clamp(22px, 3vw, 38px); background: #111311; border-left: 3px solid var(--red); box-shadow: 0 20px 55px #0006; font-family: Georgia, "Times New Roman", serif; font-size: clamp(22px, 2.8vw, 36px); line-height: 1.35; letter-spacing: -0.02em; color: #e6dfd3; transform: rotate(-0.4deg); }
/* «Recorrido»: la lágrima, grande y sin marco, con los bordes fundidos en el fondo */
.res-lagrima { clear: both; width: min(100%, 380px); margin: clamp(30px, 4vw, 50px) 0 0; -webkit-mask-image: radial-gradient(ellipse 75% 70% at 55% 45%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 75% 70% at 55% 45%, #000 55%, transparent 100%); }
/* Las imágenes que salieron de «Capas», debajo de la línea de vida: el camino grande y las otras dos al lado, algo giradas */
.res-recorrido-fotos { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(12px, 1.6vw, 20px); margin-top: clamp(34px, 5vw, 64px); align-items: start; }
.res-recorrido-fotos figure { --giro: -1.2deg; position: relative; margin: 0; padding: 6px; background: #1b1c1a; border: 1px solid #61564a; box-shadow: 0 25px 60px #000c; transform: rotate(var(--giro)); }
.res-recorrido-fotos figure:first-child { grid-row: span 2; }
.res-recorrido-fotos figure:nth-child(2) { --giro: 1.5deg; }
.res-recorrido-fotos figure:nth-child(3) { --giro: -0.8deg; }
.res-recorrido-fotos img { display: block; width: 100%; height: auto; }
.res-lagrima img { display: block; width: 100%; height: auto; filter: contrast(1.15) brightness(0.92); }
/* «Lo que investigo»: la pregunta y, a su lado, la cara a tinta en su papel rasgado (sin marco: el papel es el marco) */
.res-pregunta-zona { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 0.36fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.res-tinta { --giro: 2.5deg; position: relative; margin: 0; filter: drop-shadow(0 30px 50px #000c);
  transform: perspective(900px) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -7deg)) rotateY(calc(var(--tx, 0) * 9deg)); }
.res-tinta img { display: block; width: 100%; height: auto; -webkit-mask-image: linear-gradient(180deg, #000 85%, transparent); mask-image: linear-gradient(180deg, #000 85%, transparent); }
/* «Mestanza»: la cara de cartón en grande, debajo del texto, algo girada */
.res-cara { --giro: 2deg; position: relative; width: min(78%, 520px); margin: clamp(60px, 7vw, 110px) 0 0 clamp(20px, 6vw, 90px); padding: 8px; background: #1b1c1a; border: 1px solid #61564a; box-shadow: 0 30px 80px #000b, 5px 0 0 #ea493733, -5px 0 0 #77d5d433;
  transform: perspective(900px) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -7deg)) rotateY(calc(var(--tx, 0) * 9deg)); }
.res-cara img { display: block; width: 100%; height: auto; }
.res-cara figcaption { position: absolute; z-index: 2; left: 16px; bottom: 16px; padding: 4px 6px; background: #111d; color: #e8dfd4; font: 700 8px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.res-bloques { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 26px); margin-top: clamp(50px, 7vw, 90px); }
.res-bloque { --giro: 0deg; position: relative; padding: 24px 22px 26px; background: #1b1c1a; border: 1px solid #3f3a33;
  transform: perspective(900px) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -6deg)) rotateY(calc(var(--tx, 0) * 8deg)); }
.res-bloque p { margin: 12px 0 0; font-size: 14px; line-height: 1.75; color: #c6c0b5; }
.res-colabora { --giro: 0.8deg; border-color: #9c392b; box-shadow: 0 20px 50px #0008; }
.res-colabora h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 24px; line-height: 1.1; margin: 10px 0 0; color: #ece4d8; }
.res-enlace { margin: clamp(46px, 6vw, 70px) 0 0; }
.res-enlace .button { display: inline-block; background: var(--red); color: #fbeee9; }
.res-enlace .button:hover { background: #d27a65; color: #1b1c1a; }
.res-enlace .res-boton-memoria { margin: 10px 0 0 10px; background: transparent; color: #ece4d8; box-shadow: inset 0 0 0 1px #ece4d8aa; }
.res-enlace .res-boton-memoria:hover { background: #ece4d8; color: #1b1c1a; }

/* ---------- Otras obras: pequeñas, algo giradas, como piezas en un muro; al pulsar, el visor ---------- */
.res-otras .section-head p { color: #c6c0b5; }
.res-obras { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-flow: dense; gap: clamp(16px, 2.2vw, 30px); }
.res-obras li { aspect-ratio: 4 / 5; }
.res-obras .res-obra-ancha { grid-column: span 2; aspect-ratio: auto; }
.res-obra-mini { --giro: 0deg; position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 1px solid #594b41; background: #111311; color: inherit; cursor: zoom-in; box-shadow: 0 18px 45px #0008;
  transform: perspective(900px) rotate(var(--giro)) rotateX(calc(var(--ty, 0) * -8deg)) rotateY(calc(var(--tx, 0) * 10deg));
  transition: transform 0.35s ease-out, box-shadow 0.25s ease, border-color 0.25s ease; }
.res-obras li:nth-child(3n+1) .res-obra-mini { --giro: -1.3deg; }
.res-obras li:nth-child(3n+2) .res-obra-mini { --giro: 0.9deg; }
.res-obras li:nth-child(4n) .res-obra-mini { --giro: 1.6deg; }
.res-obra-mini::after { z-index: 2; }
.res-obra-img, .res-obra-pila, .res-obra-pila img { position: absolute; inset: 0; width: 100%; height: 100%; }
.res-obra-img, .res-obra-pila img { object-fit: cover; }
.res-obra-img { z-index: 1; filter: grayscale(0.35) brightness(0.82); transition: filter 0.25s ease; }
/* Las obras con más fotos: las otras asoman por detrás, como un montón; con el ratón se abren. */
.res-obra-pila img { border: 1px solid #594b41; filter: grayscale(0.6) brightness(0.45); transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.res-obra-pila img:nth-child(1) { transform: rotate(4deg) translate(7px, -5px); }
.res-obra-pila img:nth-child(2) { transform: rotate(-3.5deg) translate(-7px, 6px); }
.res-obra-mini:hover .res-obra-pila img:nth-child(1), .res-obra-mini:focus-visible .res-obra-pila img:nth-child(1) { transform: rotate(9deg) translate(18px, -12px); }
.res-obra-mini:hover .res-obra-pila img:nth-child(2), .res-obra-mini:focus-visible .res-obra-pila img:nth-child(2) { transform: rotate(-8deg) translate(-18px, 10px); }
/* Al pasar por encima: color, borde rojo, capas roja y cian y un corte de señal. */
.res-obra-mini:hover, .res-obra-mini:focus-visible { border-color: #9c392b; box-shadow: 0 25px 60px #000c, 4px 0 0 #ea493755, -4px 0 0 #77d5d455; }
.res-obra-mini:hover .res-obra-img, .res-obra-mini:focus-visible .res-obra-img { filter: none; animation: res-corte 0.35s steps(3, end); }
.res-obra-mini:focus-visible { outline: 2px solid #eee7db; outline-offset: 5px; }
.res-obra-num { position: absolute; z-index: 3; left: 10px; bottom: 6px; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-size: clamp(26px, 2.6vw, 38px); line-height: 0.8; color: var(--red); text-shadow: 0 2px 12px #000c;
  translate: calc(var(--tx, 0) * 10px) calc(var(--ty, 0) * 8px); transition: translate 0.3s ease-out; }
.res-obra-fotos { position: absolute; z-index: 3; right: 8px; top: 8px; padding: 4px 6px; background: #111d; color: #e8dfd4; font: 700 8px/1 Arial, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }

/* El visor: la obra en grande sobre un fondo casi negro con rayas de pantalla. */
html.res-visor-abierto { overflow: hidden; }
.res-visor { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: clamp(14px, 3vw, 40px) clamp(64px, 7vw, 100px); border: 0; background: transparent; color: #eee6db; overflow: hidden; }
.res-visor[open] { display: grid; place-items: center; }
.res-visor::backdrop { background: repeating-linear-gradient(0deg, #00000070 0 1px, transparent 1px 4px), #0d0c0bf2; }
.res-visor-marco { margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; width: 100%; height: 100%; min-height: 0; }
.res-visor-foto, .res-visor-capa { grid-area: 1 / 1; display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; min-height: 0; object-fit: contain; }
.res-visor-foto { position: relative; z-index: 1; border: 1px solid #594b41; box-shadow: 0 30px 90px #000, 6px 0 0 #ea493744, -6px 0 0 #77d5d444; }
.res-visor-capa { position: relative; z-index: 2; opacity: 0; mix-blend-mode: screen; pointer-events: none; }
.res-visor-roja { filter: sepia(1) saturate(8) hue-rotate(-30deg); }
.res-visor-cian { filter: sepia(1) saturate(6) hue-rotate(150deg); }
.res-visor.cambia .res-visor-foto { animation: res-visor-entra 0.45s steps(5, end); }
.res-visor.cambia .res-visor-roja { animation: res-visor-roja 0.5s steps(4, end); }
.res-visor.cambia .res-visor-cian { animation: res-visor-cian 0.55s steps(4, end); }
.res-visor-pie { grid-area: 2 / 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; margin-top: 16px; font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #d27a65; }
.res-visor-puntos { display: flex; gap: 6px; }
.res-visor-puntos button { width: 32px; height: 32px; padding: 0; border: 1px solid #594b41; background: transparent; color: #c6c0b5; font: 700 11px/1 Arial, sans-serif; cursor: pointer; }
.res-visor-puntos button:hover { border-color: #9c392b; }
.res-visor-puntos button[aria-current] { background: var(--red); border-color: var(--red); color: #fbeee9; }
.res-visor-boton { position: absolute; z-index: 3; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid #594b41; background: #111311cc; color: #eee6db; font: 400 22px/1 Arial, sans-serif; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease; }
.res-visor-boton:hover, .res-visor-boton:focus-visible { background: var(--red); border-color: var(--red); }
.res-visor-boton:focus-visible, .res-visor-puntos button:focus-visible { outline: 2px solid #eee7db; outline-offset: 3px; }
.res-visor-antes { left: clamp(8px, 2vw, 28px); top: 50%; translate: 0 -50%; }
.res-visor-despues { right: clamp(8px, 2vw, 28px); top: 50%; translate: 0 -50%; }
.res-visor-cerrar { right: clamp(8px, 2vw, 28px); top: clamp(8px, 2vw, 28px); font-size: 28px; }

/* ---------- Movimientos ---------- */
@keyframes res-glitch-arriba { 0%, 86%, 100% { clip-path: inset(7% 0 73% 0); transform: translate(3px, -2px); } 87% { clip-path: inset(35% 0 49% 0); transform: translate(-10px, 1px); } 90% { clip-path: inset(2% 0 88% 0); transform: translate(8px, -4px); } 93% { clip-path: inset(18% 0 64% 0); transform: translate(-3px, 2px); } }
@keyframes res-glitch-abajo { 0%, 76%, 100% { clip-path: inset(68% 0 10% 0); transform: translate(-4px, 3px); } 78% { clip-path: inset(57% 0 30% 0); transform: translate(13px, -1px); } 80% { clip-path: inset(81% 0 4% 0); transform: translate(-8px, 2px); } 83% { clip-path: inset(63% 0 22% 0); transform: translate(5px, 0); } }
@keyframes res-sacudida { 0% { transform: none; } 33% { transform: translate(-3px, 1px) skewX(-9deg); } 66% { transform: translate(4px, -1px) skewX(7deg); } 100% { transform: none; } }
@keyframes res-salto { 0%, 44%, 100% { transform: translateY(31%) rotate(-2deg); } 45% { transform: translateY(67%) rotate(1deg); } 46% { transform: translateY(19%) rotate(-1deg); } 47% { transform: translateY(72%) rotate(2deg); } 48% { transform: translateY(31%) rotate(-2deg); } }
@keyframes res-deriva { from { translate: 0 0; } to { translate: -24px 11px; } }
@keyframes res-respira { from { scale: 1; } to { scale: 1.08; } }
@keyframes res-panea { from { transform: translateX(0); } to { transform: translateX(calc(-100% + 100cqw)); } }
@keyframes res-barre { from { -webkit-mask-position: 0% 0; mask-position: 0% 0; } to { -webkit-mask-position: 100% 0; mask-position: 100% 0; } }
@keyframes res-escribe { to { stroke-dashoffset: 0; } }
@keyframes res-latido { from { opacity: 0.9; scale: 1; } to { opacity: 0; scale: 1.18; } }
@keyframes res-nieve { 0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); } 60% { transform: translate(-3%, 6%); } 80% { transform: translate(7%, -2%); } 100% { transform: translate(-2%, 3%); } }
@keyframes res-corte { 0% { transform: none; filter: none; } 30% { transform: translateX(-5px) skewX(-3deg); filter: contrast(1.5) hue-rotate(-18deg); } 65% { transform: translateX(6px) skewX(2deg); filter: contrast(1.3) hue-rotate(14deg); } 100% { transform: none; filter: none; } }
/* La obra entra en el visor a saltos, de arriba abajo, con sus capas roja y cian descolocadas. */
@keyframes res-visor-entra { 0% { clip-path: inset(0 0 100% 0); transform: translateX(-8px) skewX(-4deg); } 40% { clip-path: inset(0 0 45% 0); transform: translateX(6px) skewX(3deg); filter: contrast(1.5) hue-rotate(-18deg); } 100% { clip-path: inset(0 0 0 0); transform: none; filter: none; } }
@keyframes res-visor-roja { 0% { opacity: 0.85; transform: translate(16px, -3px); clip-path: inset(8% 0 62% 0); } 50% { opacity: 0.6; transform: translate(-11px, 2px); clip-path: inset(48% 0 22% 0); } 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); } }
@keyframes res-visor-cian { 0% { opacity: 0.75; transform: translate(-15px, 3px); clip-path: inset(60% 0 12% 0); } 50% { opacity: 0.55; transform: translate(10px, -2px); clip-path: inset(20% 0 55% 0); } 100% { opacity: 0; transform: none; clip-path: inset(0 0 0 0); } }

@media (max-width: 1100px) {
  .res-obras { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .res-pasos { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 34px; }
  .res-mv-zona { grid-template-columns: 1fr; grid-template-areas: "mv" "pie"; }
  .res-cara { width: min(100%, 380px); margin: 70px auto 0; }
  .res-pregunta-zona { grid-template-columns: 1fr; }
  .res-tinta { width: min(80%, 320px); margin-inline: auto; }
  .res-lagrima { margin-inline: auto; }
  .res-grito { top: 10px; right: -14%; width: 84vw; opacity: 0.45; }
  .res-yamaha { display: none; }
  .res-mv-pie-num { float: left; margin: 6px 14px 0 0; font-size: 56px; }
  .res-mv-pie p { min-height: 48px; }
  .res-mv-pie a { display: block; clear: left; }
  .res-bloques { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .res-idea, .res-dos { grid-template-columns: 1fr; }
  .res-collage { max-width: 460px; margin-inline: auto; }
  .res-detalle { width: clamp(84px, 24vw, 130px); }
  .res-detalle-1 { right: -4%; top: 3%; }
  .res-detalle-2 { left: -4%; bottom: 12%; }
  .res-rejilla { margin-left: 0; }
  .res-rejilla .pista { grid-template-columns: 1fr; gap: 4px; }
  .res-rejilla .pasos { gap: 3px; }
  .res-rejilla .paso:nth-child(4n+1) { margin-left: 2px; }
  .res-rejilla figcaption { flex-direction: column; align-items: flex-start; }
  .res-capitulo .timeline div { grid-template-columns: 100px 1fr; }
  .res-fragmento { display: none; }
  .res-fondo { opacity: 0.14; }
  .res-pendientes { padding-inline: 0; margin: 130px 0 60px; }
  .res-foto-pendiente { width: clamp(90px, 27vw, 140px); }
  .res-foto-1 { left: 2%; top: -100px; }
  .res-foto-2 { right: 2%; top: -60px; }
  .res-pantalla { min-height: 330px; }
  .res-pantalla-indice span:nth-child(2) { display: none; }
  .res-pantalla-video { min-height: 600px; }
  .res-pantalla-movil { top: 12%; height: 52%; right: auto; left: 50%; transform: translateX(-50%) rotate(1.5deg); }
  .res-pantalla-video.sin-senal .res-pantalla-movil { transform: translateX(-50%) rotate(1.5deg) skewX(-6deg); }
  .res-antes-rejilla { grid-template-columns: 1fr; }
  .res-antes-collage { min-height: clamp(340px, 95vw, 480px); }
  .res-antes-video { width: 40%; }
  .res-obras { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .res-mv { transform: none; }
  .topbar .res-idioma { margin-left: 0; }
  .res-mv-previo { display: none; }
  .res-mv-programa { grid-column: 1 / -1; }
  .res-mv-nombre { bottom: 4px; padding: 3px 6px; }
  .res-mv-nombre > span { display: none; }
  .res-mv-sin { font-size: 12px; }
  .res-visor { padding: 14px 14px 76px; }
  .res-visor-antes, .res-visor-despues { top: auto; bottom: 14px; translate: none; }
}
@media (max-width: 520px) {
  .res-pasos { grid-template-columns: 1fr; }
  .res-pasos li:nth-child(n) { --giro: 0deg; --baja: 0px; }
  .res-capitulo .timeline div { grid-template-columns: 1fr; gap: 4px; }
  .res-reproductor .tramo span { display: none; }
  .res-mando { grid-template-columns: auto minmax(0, 1fr); row-gap: 12px; }
  .res-espectro { grid-column: 1 / -1; grid-row: 2; height: 52px; }
  .res-tiempo { grid-column: 2; grid-row: 1; justify-self: end; font-size: 12px; }
  .res-play { height: 54px; padding: 0 18px 0 14px; }
  .res-pantalla-titulo { font-size: clamp(52px, 17vw, 76px); }
  .res-obras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-obras .res-obra-ancha { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  .res-rejilla, .res-pasos li, .res-golpes-lienzo, .res-pregunta, .res-bloque, .res-obra, .res-detalle, .res-pendiente, .res-foto-pendiente { transform: none !important; }
  [data-capa], .res-obra-marco img, .res-detalle-img, .res-numero, .res-golpes-fantasma { translate: none !important; }
  .res-glitch::before, .res-glitch::after, .res-barrido, .res-fragmento, .res-pantalla::before, .res-reproductor.res-pisada, .res-fondo, .res-play.suena::after, .res-banda-tira, .res-banda-azul { animation: none !important; }
  .res-aparato, .res-conectar, .res-autorretrato, .res-grito, .res-cara, .res-yamaha, .res-tinta { transform: none !important; }
  .res-obra-mini, .res-obra-pila img { transform: none !important; }
  .res-mv, .res-mv-entrada { transform: none !important; }
  .res-mv-entrada video, .res-mv-programa *, .res-mv-maquina::before { animation: none !important; }
  .res-capa { animation: none !important; }
  .res-obra-mini:hover .res-obra-img, .res-visor.cambia * { animation: none !important; }
}
