:root {
  --rojo: #a63d2f;
  --ancho-lado: minmax(300px, 34%);
  --fondo: #f8f6f2;
  --panel: #e6e1d9;
  --etiqueta: #d3cabd;
  --texto: #2f2b27;
  --suave: #776f66;
  --linea: #dbd4c9;
  --letra: "IBM Plex Sans Condensed", "Arial Narrow", Arial, sans-serif;
  --borde: clamp(16px, 2vw, 28px);
  color-scheme: light;
}

:root[data-tema="oscuro"] {
  --rojo: #e3957f;
  --fondo: #1d1b19;
  --panel: #272421;
  --etiqueta: #3b3631;
  --texto: #ece6dd;
  --suave: #a69d92;
  --linea: #36322d;
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--letra);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  transition: background .4s, color .4s;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; }

.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.app {
  display: grid;
  grid-template-columns: var(--ancho-lado) 1fr;
  height: 100vh;
  height: 100dvh;
}

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--borde);
  background: var(--panel);
  overflow: hidden;
  transition: background .4s;
}

.logo { display: block; width: clamp(96px, 9vw, 128px); color: var(--texto); }
.logo svg { display: block; width: 100%; }

.flecha { margin: 48px 0 18px; font-size: 22px; line-height: 1; }

.menu { display: flex; flex-direction: column; align-items: flex-start; }
.menu button {
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.menu button:hover { font-style: italic; }

.tema {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tema-icono {
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--texto);
  border-radius: 50%;
  background: linear-gradient(90deg, var(--texto) 50%, transparent 50%);
  transition: transform .4s;
}
:root[data-tema="oscuro"] .tema-icono { transform: rotate(180deg); }


.etiqueta {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: min(48%, 460px);
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 24px 0 70px;
  overflow: hidden;
  background: var(--etiqueta);
  font-size: clamp(17px, 1.5vw, 21px);
  font-style: italic;
  line-height: 1;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .01em;
  transition: background .4s;
}
.etiqueta::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 18px;
  background: var(--texto);
}
.etiqueta:hover { background: color-mix(in srgb, var(--etiqueta) 85%, var(--texto)); }

.pajaro {
  position: absolute;
  top: 0;
  right: -16px;
  width: min(62%, 360px);
  aspect-ratio: 760 / 558;
  background: url("pajaro.webp") right top / contain no-repeat;
  opacity: .55;
  pointer-events: none;
}
:root[data-tema="oscuro"] .pajaro { filter: invert(1); opacity: .32; }

.siguiente-vista {
  align-self: center;
  margin: auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 62%;
}
.siguiente-texto { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); transition: color .2s; }
.siguiente-texto:hover { color: var(--texto); }
.siguiente-cuadro { display: block; cursor: zoom-in; }
.siguiente-vista img { max-height: 34vh; width: auto; transition: transform .5s ease; }
.siguiente-cuadro:hover img { transform: translateY(-4px); }


.escena {
  position: relative;
  touch-action: pan-y;
  display: grid;
  place-items: center;
  padding: 140px clamp(40px, 6vw, 96px) 104px;
  overflow: hidden;
}

.esquina {
  position: absolute;
  top: var(--borde);
  right: var(--borde);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}
.boton-galeria {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1.5px solid var(--texto);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: background .2s, color .2s;
}
.boton-galeria svg { width: 13px; height: 13px; fill: currentColor; }
.boton-galeria:hover { background: var(--texto); color: var(--fondo); }

.numero {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  padding: 0 2px 0 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.numero-actual { font-size: 34px; font-style: italic; font-weight: 400; letter-spacing: -.02em; }
.numero-total { font-size: 13px; letter-spacing: .08em; color: var(--suave); }

.pieza { position: relative; margin: 0; }
.pieza-boton { display: block; cursor: pointer; }
.pieza-img {
  width: auto;
  max-width: calc(66vw - 2 * clamp(40px, 6vw, 96px));
  max-height: calc(100vh - 250px);
  max-height: calc(100dvh - 250px);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .45);
}


.controles {
  position: absolute;
  left: clamp(24px, 3vw, 40px);
  bottom: var(--borde);
  display: flex;
  align-items: center;
  gap: 16px;
}
.flechita { font-size: 24px; line-height: 1; padding: 6px 2px; transition: transform .2s; }
.flechita[data-paso="-1"]:hover { transform: translateX(-3px); }
.flechita[data-paso="1"]:hover { transform: translateX(3px); }
.titulo-bloque { display: grid; gap: 3px; text-align: left; }
.titulo { display: block; font-size: 19px; font-style: italic; }
.ficha { display: block; font-size: 15px; color: var(--suave); }
.titulo-bloque:hover .titulo { text-decoration: underline; text-underline-offset: 4px; }

.mas-info {
  position: absolute;
  top: 88px;
  left: clamp(24px, 3vw, 40px);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-style: italic;
}
.mas-info-signo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--texto);
  border-radius: 50%;
  font-size: 20px;
  font-style: normal;
  line-height: 1;
  transition: background .25s, color .25s, rotate .4s cubic-bezier(.2, .7, .2, 1);
}
.mas-info:hover .mas-info-signo { background: var(--texto); color: var(--fondo); rotate: 90deg; }
.escena { cursor: pointer; }
.escena :is(.controles, .esquina, .cta, .etiqueta) { cursor: auto; }

.cta {
  position: absolute;
  right: var(--borde);
  bottom: var(--borde);
  padding: 10px 26px 12px;
  background: var(--texto);
  color: var(--fondo);
  font-size: 19px;
  font-style: italic;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .2s;
}
.cta:hover { opacity: .85; }

.capa {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--fondo);
  color: var(--texto);
}
.capa::backdrop { background: var(--fondo); }
.capa[open] { animation: subir .45s cubic-bezier(.2, .7, .2, 1); }
.capa-obra[open],
.capa-artista[open] { display: grid; grid-template-columns: var(--ancho-lado) 1fr; }

.cerrar {
  position: absolute;
  top: var(--borde);
  right: var(--borde);
  z-index: 2;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.cerrar:hover { font-style: italic; }

.capa-lado {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: calc(var(--borde) * 2.5) var(--borde) var(--borde);
  background: var(--panel);
  overflow-y: auto;
}
.capa-num { margin: 0 0 14px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); }
.capa-titulo { margin: 0; font-size: clamp(40px, 4.6vw, 68px); font-style: italic; font-weight: 500; line-height: .95; letter-spacing: -.02em; }
.capa-serie { margin: 14px 0 0; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; }
.capa-serie:empty { display: none; }

.datos { margin: 40px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 22px; font-size: 18px; }
.datos dt { color: var(--suave); }
.datos dd { margin: 0; }
.capa-desc { margin: 24px 0 0; max-width: 26em; font-size: 18px; line-height: 1.5; }
.capa-desc:empty { display: none; }
.capa-pasos { display: flex; gap: 22px; margin-top: auto; padding-top: 32px; }
.cta-lado { position: static; margin-top: 18px; }

.capa-texto { margin-top: 32px; max-width: 30em; }
.capa-texto p { margin: 0 0 1em; font-size: 19px; line-height: 1.55; }

.capa-vista {
  display: grid;
  place-items: center;
  padding: calc(var(--borde) * 3) var(--borde) var(--borde);
  min-height: 0;
}
.capa-img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
}
.capa-obra .capa-vista { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.capa-obra .capa-img { max-width: calc(66vw - 2 * var(--borde)); max-height: calc(100dvh - 150px); }
.lienzo { position: relative; cursor: crosshair; touch-action: pan-y; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.lupa {
  position: absolute;
  width: clamp(180px, 16vw, 260px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--fondo);
  box-shadow: 0 0 0 1px var(--texto), 0 20px 44px -12px rgba(0, 0, 0, .55);
  background-color: var(--fondo);
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.6);
  transition: opacity .2s, transform .2s;
}
.lupa.activa { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.pista { margin: 14px 0 0; font-size: 14px; color: var(--suave); text-align: center; }
.capa-figura { margin: 0; }
.capa-figura .capa-img { max-height: calc(100dvh - 160px); }
.capa-pie { margin-top: 10px; font-size: 15px; font-style: italic; color: var(--suave); }

.capa-contacto[open] { display: grid; grid-template-columns: var(--ancho-lado) 1fr; }
.contacto-texto { margin: 28px 0 0; max-width: 26em; font-size: 18px; line-height: 1.5; color: var(--suave); }
.contacto-obra { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.contacto-obra[hidden] { display: none; }
.contacto-obra img { width: auto; max-width: 96px; max-height: 96px; }
.contacto-obra p { margin: 0; }
.contacto-obra .capa-num { display: block; margin-bottom: 4px; }
.contacto-obra-titulo { display: block; font-size: 22px; font-style: italic; }
.contacto-obra-ficha { display: block; margin-top: 2px; font-size: 14px; color: var(--suave); }
.contacto-directo { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--linea); width: 100%; }
.contacto-directo .capa-num { margin-bottom: 6px; }
.contacto-email {
  display: inline-block;
  font-size: clamp(24px, 2.4vw, 32px);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -.01em;
  text-decoration: none;
  word-break: break-word;
}
.contacto-email:hover { text-decoration: underline; text-underline-offset: 6px; }
.contacto-botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.capa-lado .cta { position: static; }
.cta-claro { background: none; color: var(--texto); box-shadow: inset 0 0 0 1.5px var(--texto); }
.contacto-pie { margin: auto 0 0; padding-top: 28px; font-size: 13px; color: var(--suave); }
.contacto-vista { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.contacto-figura { margin: 0; text-align: center; }
.contacto-figura .capa-img { max-height: 22vh; max-height: 22dvh; width: auto; margin: 0 auto; box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .45); }

.formulario { width: min(520px, 100%); display: grid; gap: 14px; }
.formulario[hidden] { display: none; }
.formulario label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--suave);
}
.formulario input,
.formulario textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--linea);
  border-radius: 0;
  background: var(--fondo);
  color: var(--texto);
  font: inherit;
  font-size: 18px;
  letter-spacing: normal;
  text-transform: none;
  resize: vertical;
}
.formulario input:focus,
.formulario textarea:focus { border-color: var(--texto); outline: none; }
.formulario .cta { position: static; justify-self: start; }
.formulario .cta:disabled { opacity: .5; cursor: wait; }
.trampa { display: none; }
.formulario label:has(:required) > span::after,
.obligatorio::before { content: "*"; margin-left: 3px; color: var(--rojo); font-weight: 500; }
.obligatorio::before { margin: 0 4px 0 0; }
.obligatorio { margin: -4px 0 0; font-size: 13px; color: var(--suave); }
.formulario .acepto {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--texto);
  cursor: pointer;
}
.acepto input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: #b8913d; cursor: pointer; }
.privacidad { margin-top: -6px; font-size: 13px; color: var(--suave); }
.privacidad summary { cursor: pointer; width: fit-content; }
.privacidad summary:hover { color: var(--texto); }
.privacidad p { margin: 6px 0 0; line-height: 1.45; }
.form-estado { margin: 0; min-height: 1.4em; font-size: 18px; font-style: italic; }
.form-estado.error { color: #9b3b2e; }
:root[data-tema="oscuro"] .form-estado.error { color: #e3957f; }

.capa-indice { overflow-y: auto; }
.indice-cabecera {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  padding: var(--borde) calc(var(--borde) + 110px) var(--borde) var(--borde);
  background: var(--fondo);
}
.indice-titulo { margin: 0; font-size: clamp(30px, 3.4vw, 44px); font-style: italic; font-weight: 500; line-height: 1; }
.capa-indice .cerrar { position: fixed; }

.filtros { display: flex; flex-wrap: wrap; gap: 6px; }
.filtros button {
  padding: 5px 12px;
  border: 1px solid var(--linea);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .03em;
  transition: background .2s, color .2s, border-color .2s;
}
.filtros button:hover { background: var(--texto); border-color: var(--texto); color: var(--fondo); }

.grupos { padding: 0 var(--borde) 64px; }
.grupo { scroll-margin-top: 100px; }
.grupo-titulo {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 44px 0 20px;
  font-size: clamp(26px, 2.6vw, 34px);
  font-style: italic;
  font-weight: 500;
}
.grupo-cuenta { font-size: 14px; font-style: normal; color: var(--suave); letter-spacing: .04em; }

.rejilla {
  --alto-fila: 240px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rejilla::after { content: ""; flex-grow: 1000; }
.miniatura { flex: var(--r) 1 calc(var(--r) * var(--alto-fila)); min-width: 0; }
.miniatura button { display: block; width: 100%; text-align: left; }
.miniatura-marco { display: block; overflow: hidden; background: var(--linea); }
.miniatura img { width: 100%; aspect-ratio: var(--r); object-fit: cover; transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.miniatura button:hover img { transform: scale(1.06); }
.miniatura[aria-current="true"] .miniatura-marco { outline: 2px solid var(--texto); outline-offset: 5px; }
.miniatura-titulo { display: block; margin-top: 8px; font-size: 15px; font-style: italic; }
.miniatura-ficha { display: block; margin-top: 2px; font-size: 13px; color: var(--suave); }
.miniatura[aria-current="true"] .miniatura-titulo::after { content: attr(data-viendo); font-style: normal; color: var(--suave); }

@keyframes subir { from { opacity: 0; transform: translateY(24px); } }
@keyframes entrar { from { opacity: 0; transform: translateX(var(--desde, 24px)); } }

.ajustes { display: flex; align-items: center; gap: 18px; margin-top: 18px; }
.idioma { font-size: 13px; letter-spacing: .06em; color: var(--suave); }
.idioma .activo { color: var(--texto); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.idioma:hover { color: var(--texto); }

.logo path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: firmar 1s cubic-bezier(.6, 0, .3, 1) both; }
.logo path:nth-child(2) { animation-delay: .45s; animation-duration: .5s; }
.logo path:nth-child(3) { animation-delay: .8s; animation-duration: .7s; }
.logo path:nth-child(4) { animation-delay: 1.3s; animation-duration: 1s; }
.logo path:nth-child(5) { animation-delay: 2.05s; animation-duration: .45s; }
.logo path:nth-child(6) { animation-delay: 2.4s; animation-duration: .35s; }
.logo path:nth-child(7) { animation-delay: 2.65s; animation-duration: .6s; }

.panel > *,
.esquina,
.etiqueta,
.controles,
.escena > .cta { animation: aparecer-subir .8s cubic-bezier(.2, .7, .2, 1) both; }
.panel > :nth-child(2) { animation-delay: .15s; }
.panel > :nth-child(3) { animation-delay: .25s; }
.panel > :nth-child(4) { animation-delay: .35s; }
.panel > :nth-child(5) { animation-delay: .45s; }
.panel > :nth-child(6) { animation-delay: .55s; }
.panel > :nth-child(7) { animation-delay: .65s; }
.esquina, .etiqueta { animation-delay: .3s; }
.controles, .escena > .cta { animation-delay: .5s; }
.pieza { animation: aparecer-cuadro 1.1s cubic-bezier(.2, .7, .2, 1) .2s both; }
.panel > .pajaro { animation: aparecer-pajaro 2.4s ease .9s both; }
.flecha { display: inline-block; animation: aparecer-subir .8s cubic-bezier(.2, .7, .2, 1) .15s both, flotar 2.8s ease-in-out 1.2s infinite; }

.capa[open] .capa-lado { animation: lado .6s cubic-bezier(.2, .7, .2, 1) both; }
.capa[open] .capa-lado > * { animation: aparecer-subir .6s cubic-bezier(.2, .7, .2, 1) .12s both; }
.capa[open] .capa-lado > :nth-child(2) { animation-delay: calc(.08s + .12s); }
.capa[open] .capa-lado > :nth-child(3) { animation-delay: calc(.14s + .12s); }
.capa[open] .capa-lado > :nth-child(4) { animation-delay: calc(.2s + .12s); }
.capa[open] .capa-lado > :nth-child(5) { animation-delay: calc(.26s + .12s); }
.capa[open] .capa-lado > :nth-child(n + 6) { animation-delay: .44s; }
.capa-obra[open] { animation: none; }
.capa-indice[open] .miniatura { animation: aparecer-subir .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(min(var(--i), 24) * 35ms + .1s); }
.capa-indice[open] .grupo-titulo { animation: aparecer-subir .6s cubic-bezier(.2, .7, .2, 1) both; }

#etiqueta-texto { view-transition-name: etiqueta; }
.numero { view-transition-name: numero; }
.titulo { view-transition-name: titulo; }
.ficha { view-transition-name: ficha; }
#siguiente-img { view-transition-name: siguiente; }

::view-transition-group(*) { animation-duration: .6s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .35s; }
::view-transition-old(numero),
::view-transition-old(ficha),
::view-transition-old(titulo),
::view-transition-old(etiqueta) { animation: texto-sale .3s ease both; }
::view-transition-new(numero),
::view-transition-new(ficha),
::view-transition-new(titulo),
::view-transition-new(etiqueta) { animation: texto-entra .5s cubic-bezier(.2, .7, .2, 1) .1s both; }
html[data-direccion="adelante"]::view-transition-old(cuadro) { animation: sale-izquierda .5s cubic-bezier(.4, 0, .2, 1) both; }
html[data-direccion="adelante"]::view-transition-new(cuadro) { animation: entra-derecha .7s cubic-bezier(.2, .7, .2, 1) .05s both; }
html[data-direccion="atras"]::view-transition-old(cuadro) { animation: sale-derecha .5s cubic-bezier(.4, 0, .2, 1) both; }
html[data-direccion="atras"]::view-transition-new(cuadro) { animation: entra-izquierda .7s cubic-bezier(.2, .7, .2, 1) .05s both; }

:is(.abriendo, .cerrando) :is(#etiqueta-texto, .numero, .titulo, .ficha, #siguiente-img) { view-transition-name: none; }
.abriendo::view-transition-old(root) { animation: fondo-se-aleja .45s cubic-bezier(.4, 0, .2, 1) both; }
.abriendo::view-transition-new(root) { animation: capa-entra .5s cubic-bezier(.2, .7, .2, 1) .05s both; }
.cerrando::view-transition-old(root) { animation: capa-sale .35s cubic-bezier(.4, 0, .2, 1) both; }
.cerrando::view-transition-new(root) { animation: fondo-vuelve .55s cubic-bezier(.2, .7, .2, 1) both; }
:is(.abriendo, .cerrando)::view-transition-group(cuadro) { animation-duration: .65s; animation-timing-function: cubic-bezier(.3, .8, .2, 1); z-index: 2; }

@keyframes fondo-se-aleja { to { opacity: 0; transform: scale(.96); filter: blur(8px); } }
@keyframes capa-entra { from { opacity: 0; } }
@keyframes capa-sale { to { opacity: 0; } }
@keyframes fondo-vuelve { from { opacity: 0; transform: scale(.96); filter: blur(8px); } }
@keyframes firmar { 0% { stroke-dashoffset: 1; opacity: 0; } 1% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes aparecer-subir { from { opacity: 0; transform: translateY(14px); } }
@keyframes aparecer-cuadro { from { opacity: 0; transform: scale(.96); filter: blur(6px); } }
@keyframes aparecer-pajaro { from { opacity: 0; transform: translateX(16px); } }
@keyframes flotar { 50% { transform: translateY(5px); } }
@keyframes lado { from { transform: translateX(-24px); opacity: 0; } }
@keyframes texto-sale { to { opacity: 0; transform: translateY(-10px); } }
@keyframes texto-entra { from { opacity: 0; transform: translateY(12px); } }
@keyframes sale-izquierda { to { opacity: 0; transform: translateX(-70px) scale(.97); filter: blur(5px); } }
@keyframes entra-derecha { from { opacity: 0; transform: translateX(70px) scale(.97); filter: blur(5px); } }
@keyframes sale-derecha { to { opacity: 0; transform: translateX(70px) scale(.97); filter: blur(5px); } }
@keyframes entra-izquierda { from { opacity: 0; transform: translateX(-70px) scale(.97); filter: blur(5px); } }

.boton-sala {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--linea);
  background: var(--fondo);
  font-size: 16px;
  transition: border-color .2s, transform .3s cubic-bezier(.2, .7, .2, 1);
}
.boton-sala[hidden] { display: none; }
.boton-sala:hover { border-color: var(--texto); transform: translateY(-2px); }
.boton-sala svg { width: 38px; height: 38px; flex: none; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.boton-sala:hover svg { transform: rotate(-6deg) scale(1.06); }
.sala-icono-pared { fill: var(--etiqueta); }
.sala-icono-suelo { fill: color-mix(in srgb, var(--etiqueta) 65%, var(--texto)); }
.sala-icono-linea { fill: none; stroke: var(--texto); stroke-width: 1.2; stroke-linejoin: round; }
.sala-icono-cuadro { fill: #c79a3e; stroke: var(--texto); stroke-width: .8; }
.boton-sala[aria-pressed="true"] { border-color: var(--texto); }

.sala {
  --texto: #2f2b27;
  position: relative;
  width: min(100%, calc((100dvh - 150px) * var(--proporcion)));
  aspect-ratio: var(--proporcion);
  container-type: size;
  overflow: hidden;
  background: var(--foto) center / cover no-repeat;
  color: var(--texto);
  animation: aparecer .5s ease both;
}
.sala[hidden] { display: none; }
.sala > * { --cm: calc(100cqw / var(--ancho-cm)); }

.sala-cuadro {
  position: absolute;
  left: var(--centro);
  bottom: calc(var(--suelo) * 1cqh + var(--cm) * var(--abajo));
  width: calc(var(--cm) * var(--an));
  height: calc(var(--cm) * var(--al));
  translate: -50% 0;
  box-shadow: calc(var(--cm) * -1) calc(var(--cm) * 2.5) calc(var(--cm) * 4) rgba(40, 30, 20, .32), 0 0 0 1px rgba(0, 0, 0, .08);
  animation: colgar .8s cubic-bezier(.2, .7, .2, 1) .15s both;
}
.sala-cuadro img { width: 100%; height: 100%; object-fit: cover; }

.cota {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  white-space: nowrap;
  color: var(--texto);
  animation: aparecer .5s ease .7s both;
}
.cota-ancho { left: 0; right: 0; top: calc(100% + 8px); padding-top: 4px; border-top: 1px solid var(--texto); }
.cota-ancho::before,
.cota-ancho::after { content: ""; position: absolute; top: -5px; width: 1px; height: 9px; background: var(--texto); }
.cota-ancho::before { left: 0; }
.cota-ancho::after { right: 0; }
.cota-alto { top: 0; bottom: 0; left: calc(100% + 12px); padding-left: 6px; border-left: 1px solid var(--texto); writing-mode: vertical-rl; }
.cota-alto::before,
.cota-alto::after { content: ""; position: absolute; left: -5px; width: 9px; height: 1px; background: var(--texto); }
.cota-alto::before { top: 0; }
.cota-alto::after { bottom: 0; }

.sala-nota {
  position: absolute;
  left: 12px;
  bottom: 10px;
  margin: 0;
  padding: 4px 9px;
  background: rgba(255, 255, 255, .7);
  font-size: 12px;
  color: var(--texto);
}

@keyframes colgar { from { opacity: 0; transform: translateY(calc(var(--cm) * -12)); } }

.panel::after,
.capa-lado::after,
.indice-cabecera::after {
  content: "";
  position: absolute;
  z-index: 2;
  background: url("pan-de-oro.webp") center top / 60px auto repeat-y;
  box-shadow: 0 0 1px rgba(74, 52, 16, .35);
  pointer-events: none;
}
.panel::after,
.capa-lado::after { top: 0; bottom: 0; right: 0; width: 2px; }
.indice-cabecera::after { left: 0; right: 0; bottom: 0; height: 2px; background-image: url("pan-de-oro-horizontal.webp"); background-size: 1600px auto; background-repeat: repeat-x; }

@media (max-width: 820px) {
  .panel::after { top: auto; left: 0; width: auto; height: 2px; background-image: url("pan-de-oro-horizontal.webp"); background-size: 1600px auto; background-repeat: repeat-x; }
  .capa-lado::after { display: none; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100dvh; }
  .panel { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 16px; }
  .logo { width: 80px; }
  .flecha, .etiqueta, .pajaro, .siguiente-vista { display: none; }
  .menu { flex-direction: row; gap: 16px; }
  .menu button { font-size: 17px; }
  .tema { margin: 0 0 0 auto; }
  .escena { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 76px 16px 24px; min-height: calc(100dvh - 66px); }
  .esquina { top: 16px; right: 16px; }
  .numero-actual { font-size: 28px; }
  .pieza-img { max-width: 100%; max-height: calc(100dvh - 300px); }
  .mas-info { top: 18px; left: 16px; }
  .controles, .cta { position: static; }
  .controles { width: 100%; justify-content: space-between; }
  .titulo-bloque { text-align: center; }

  .capa-obra[open],
  .capa-artista[open],
  .capa-contacto[open] { display: flex; flex-direction: column; overflow-y: auto; }
  .capa > .capa-lado,
  .capa > .capa-vista { flex: none; }
  .capa-obra .capa-vista { order: -1; }
  .contacto-figura { display: none; }
  .contacto-pie { margin-top: 28px; }
  .capa-vista { padding: 64px 16px 16px; }
  .capa-img, .capa-figura .capa-img { max-height: 62dvh; }
  .capa-obra .capa-img { max-width: 100%; max-height: 58dvh; }
  .capa-lado { padding: 24px 16px 32px; overflow: visible; }
  .capa-pasos { margin-top: 28px; padding-top: 0; }
  .indice-cabecera { padding-right: 110px; }
  .grupos { padding-inline: 16px; }
  .rejilla { --alto-fila: 140px; gap: 24px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .logo path { stroke-dashoffset: 0; }
}
