:root {
  color-scheme: dark;
  --gold: #dfbd72;
  --ink: #080604;
  --line: rgba(223, 189, 114, .5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

button, a { color: inherit; font: inherit; }
button { cursor: pointer; }

.tower, .floors, .floor { position: absolute; inset: 0; }

.floors {
  transition: transform 1.15s cubic-bezier(.76, 0, .24, 1);
  will-change: transform;
}

.floors.is-instant {
  transition: none;
}

.floor {
  top: calc(var(--floor, 0) * 100%);
  bottom: auto;
  height: 100%;
  overflow: hidden;
  background: #050403;
}

.floor-loading {
  position: fixed;
  z-index: 18;
  left: 50%;
  bottom: max(5rem, calc(env(safe-area-inset-bottom) + 4rem));
  transform: translateX(-50%);
  padding: .75rem 1rem;
  border: 1px solid rgba(223, 189, 114, .5);
  background: rgba(8, 6, 4, .94);
  color: #f0d9a9;
  font-size: .86rem;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 .6rem 2rem #0009;
}
.floor-loading button {
  margin-left: .75rem;
  padding: .35rem .65rem;
  border: 1px solid #f0d9a9;
  background: #3e2816;
  color: #fff0cf;
  cursor: pointer;
}
.floor-loading button:focus-visible { outline: 2px solid #fff0cf; outline-offset: 2px; }

.floor::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(90deg, rgba(0,0,0,.25), transparent 20%, transparent 80%, rgba(0,0,0,.32)), rgba(0, 5, 11, var(--shade, 0));
}

.floor img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: none;
  transform: scale(1.035);
  transition: transform 1.5s cubic-bezier(.2,.7,.2,1), filter .8s ease;
}

.floor.is-active img { transform: scale(1); }

.stories-stage,
.poems-stage,
.books-stage,
.author-stage,
.gabinete-stage,
.contact-stage {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: min(100vw, calc(100vh * 1.7777778));
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  transform: translate(-50%, -50%);
}

.stories-stage img,
.poems-stage img,
.books-stage img,
.author-stage img,
.gabinete-stage img,
.contact-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.stories-stage img.stories-local-repair,
.books-stage img.books-local-repair,
.books-stage img.books-wall-repair,
.books-stage img.books-background-repair,
.books-stage img.books-gargoyle-repair,
.books-stage img.books-stair-repair,
.books-stage img.books-corner-repair,
.books-stage img.books-final-repair,
.contact-stage img.contact-eye-repair {
  z-index: 2;
  pointer-events: none;
}

.gabinete-stage img.gabinete-free-chain {
  position: absolute;
  z-index: 3;
  left: var(--chain-x);
  top: var(--chain-y);
  width: var(--chain-width);
  height: var(--chain-height);
  object-fit: fill;
  pointer-events: none;
  transform-origin: 50% 1%;
  animation: gabinete-chain-swing var(--chain-period) ease-in-out var(--chain-delay) infinite alternate;
  filter: brightness(.68) drop-shadow(0 .1rem .15rem rgba(0, 0, 0, .75));
  will-change: transform;
}

.gabinete-free-chain--left {
  --chain-x: 45%; --chain-y: -1%; --chain-width: 8%; --chain-height: 28%;
  --chain-period: 5.8s; --chain-delay: -1.4s;
}
.gabinete-free-chain--right {
  --chain-x: 65%; --chain-y: -1%; --chain-width: 8%; --chain-height: 28%;
  --chain-period: 6.7s; --chain-delay: -3s;
}
.gabinete-stage img.gabinete-free-chain--foreground {
  --chain-x: 97%; --chain-y: -3%; --chain-width: 22%; --chain-height: 108%;
  --chain-period: 8.2s; --chain-delay: -2.2s;
  filter: blur(2.5px) brightness(.54) drop-shadow(0 .2rem .4rem #000);
}

@keyframes gabinete-chain-swing {
  from { transform: translateX(-50%) rotate(-2.2deg); }
  to { transform: translateX(-50%) rotate(2.2deg); }
}

.stories-door {
  position: absolute;
  z-index: 4;
  left: 73.35%;
  top: 53.90%;
  width: 11.8%;
  height: 30.60%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 48% 48% .3rem .3rem;
  background: transparent;
  color: transparent;
}

.stories-door:hover,
.stories-door:focus-visible {
  border-color: rgba(223, 189, 114, .58);
  box-shadow: inset 0 0 2rem rgba(223, 189, 114, .11), 0 0 1.5rem rgba(0, 0, 0, .55);
  outline: none;
}

.book-door {
  position: absolute;
  z-index: 4;
  top: 81.05%;
  width: 5.35%;
  height: 3.75%;
  padding: 0;
  overflow: visible;
  border: 1px solid transparent;
  border-radius: .15rem;
  background: transparent;
  box-shadow: none;
  transition: border-color .3s ease, box-shadow .3s ease, filter .3s ease;
}

.book-door--gardens { left: 35.40%; }
.book-door--tenebrosa { left: 48.31%; width: 5.83%; }
.book-door--tormentos { left: 62.14%; width: 5.63%; }

.book-door:hover,
.book-door:focus-visible {
  border-color: rgba(238, 197, 117, .86);
  box-shadow: 0 0 1.5rem rgba(217, 149, 52, .28), inset 0 0 1rem rgba(0, 0, 0, .55);
  outline: none;
}

.poem-door {
  position: absolute;
  z-index: 4;
  top: 76.9%;
  width: 4.65%;
  height: 3.45%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: .15rem;
  background: transparent;
  transition: border-color .3s ease, box-shadow .3s ease;
}

.poem-door--poetry { left: 39.55%; }
.poem-door--prose { left: 55.45%; }

.poem-door:hover,
.poem-door:focus-visible {
  border-color: rgba(238, 197, 117, .86);
  box-shadow: 0 0 1.5rem rgba(217, 149, 52, .28), inset 0 0 1rem rgba(0, 0, 0, .55);
  outline: none;
}

.poems-next-door {
  position: absolute;
  z-index: 4;
  left: 76.35%;
  top: 49.00%;
  width: 10.20%;
  height: 34.00%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 48% 48% .3rem .3rem;
  background: transparent;
  color: transparent;
}

.poems-next-door:hover,
.poems-next-door:focus-visible {
  border-color: rgba(223, 189, 114, .58);
  box-shadow: inset 0 0 2rem rgba(223, 189, 114, .11), 0 0 1.5rem rgba(0, 0, 0, .55);
  outline: none;
}

.books-next-door {
  position: absolute;
  z-index: 4;
  left: 78.50%;
  top: 52.20%;
  width: 9.40%;
  height: 31.20%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 48% 48% .3rem .3rem;
  background: transparent;
  color: transparent;
}

.books-next-door:hover,
.books-next-door:focus-visible {
  border-color: rgba(223, 189, 114, .58);
  box-shadow: inset 0 0 2rem rgba(223, 189, 114, .11), 0 0 1.5rem rgba(0, 0, 0, .55);
  outline: none;
}

.book-download {
  position: absolute;
  z-index: 5;
  top: 78.2%;
  width: 5.55%;
  height: 4.2%;
  border: 1px solid transparent;
  border-radius: .15rem;
  background: transparent;
}

.book-download--gardens { left: 25.3%; }
.book-download--tenebrosa { left: 35.6%; }
.book-download--insondable { left: 47.25%; }
.book-download--abominacion { left: 58.9%; }
.book-download--tormentos { left: 70.5%; }

.book-download:hover,
.book-download:focus-visible {
  border-color: rgba(239, 199, 112, .82);
  box-shadow: inset 0 0 .8rem rgba(239, 199, 112, .15), 0 0 .8rem rgba(239, 199, 112, .22);
  outline: none;
}

.author-next-door {
  position: absolute;
  z-index: 4;
  left: 76.55%;
  top: 57.70%;
  width: 10.00%;
  height: 27.50%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 48% 48% .3rem .3rem;
  background: transparent;
  color: transparent;
}

.author-next-door:hover,
.author-next-door:focus-visible {
  border-color: rgba(223, 189, 114, .58);
  box-shadow: inset 0 0 2rem rgba(223, 189, 114, .11), 0 0 1.5rem rgba(0, 0, 0, .55);
  outline: none;
}

.gabinete-next-door {
  position: absolute;
  z-index: 4;
  left: 71.55%;
  top: 62.80%;
  width: 9.80%;
  height: 28.20%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 48% 48% .3rem .3rem;
  background: transparent;
  color: transparent;
}

.gabinete-next-door:hover,
.gabinete-next-door:focus-visible {
  border-color: rgba(223, 189, 114, .58);
  box-shadow: inset 0 0 2rem rgba(223, 189, 114, .11), 0 0 1.5rem rgba(0, 0, 0, .55);
  outline: none;
}

.scene-heading {
  position: absolute;
  z-index: 4;
  left: 50%;
  width: 48%;
  transform: translateX(-50%);
  color: #f4e9d7;
  font-family: Georgia, 'Times New Roman', serif;
  text-align: center;
  text-shadow: 0 1px 2px #080604;
  pointer-events: none;
}

.scene-heading span {
  display: block;
  color: #d7af65;
  font-size: clamp(.58rem, 1.06cqw, 1.15rem);
  line-height: 1.15;
  letter-spacing: .09em;
}

.scene-heading h2 {
  margin: .18em 0 0;
  font-size: clamp(.95rem, 2.05cqw, 2.25rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: .055em;
  white-space: nowrap;
}

.scene-heading--stories { top: 43.5%; }
.scene-heading--poems { top: 41.7%; }
.scene-heading--books { top: 41.0%; }
.scene-heading--author { top: 60.5%; }
.scene-heading--author h2 { color: #e6d4aa; }
.scene-heading--gabinete { top: 59%; }
.gabinete-eddas {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 49%;
  transform: translateX(-50%);
  padding: .55rem 1.15rem;
  border: 1px solid rgba(217, 174, 104, .65);
  border-radius: 2rem;
  background: rgba(15, 9, 6, .88);
  box-shadow: 0 .5rem 1.8rem #000b;
  color: #ead5ab;
  font-size: clamp(.7rem, .9vw, .96rem);
  letter-spacing: .06em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.gabinete-eddas span { margin-left: .35em; }
.gabinete-eddas:hover, .gabinete-eddas:focus-visible { border-color: #ffe0a1; background: #493021; outline: 2px solid #f4d899; outline-offset: 3px; }
.scene-heading--contact { top: 40%; }
.scene-heading--contact span { color: #e2b871; }
.scene-heading--contact h2 { color: #f3dfb6; }

.contact-links {
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
}

.contact-link {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  width: 17%;
  min-height: 4.4%;
  padding: .32em .45em;
  border: 1px solid #c49b62;
  background: linear-gradient(145deg, #33291e, #111319);
  box-shadow: inset 0 0 0 1px #0b0a0a, 0 .25rem .65rem #000d;
  color: #fff0d2;
  font: 600 clamp(.76rem, 1.1cqw, 1.1rem)/1.2 Georgia, 'Times New Roman', serif;
  letter-spacing: .03em;
  text-decoration: none;
  text-shadow: 0 1px 1px #000;
  pointer-events: auto;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.contact-link span[aria-hidden] { color: #e8b767; font-family: Arial, sans-serif; font-size: 1.2em; line-height: 1; }
.contact-link--instagram { left: 19.5%; top: 66%; }
.contact-link--tiktok { right: 19.5%; top: 66%; }
.contact-link--email { left: 19.5%; top: 73%; }
.contact-link--youtube { right: 19.5%; top: 73%; }
.contact-link:hover, .contact-link:focus-visible { border-color: #f2d8a7; background: linear-gradient(145deg, rgba(79, 53, 30, .98), rgba(16, 18, 22, .98)); box-shadow: inset 0 0 0 2px #0b0a0a, 0 0 1.2rem rgba(245, 187, 104, .45); outline: none; }

.contact-stage { transition: transform .48s cubic-bezier(.2,.7,.2,1), filter .48s ease; }
.contact-stage.is-entering { transform: translate(-50%, -50%) scale(2.65); transform-origin: 50% 56%; filter: brightness(.38); }
.contact-door {
  position: absolute;
  z-index: 6;
  left: 46.45%;
  top: 47.9%;
  width: 7.2%;
  height: 18.5%;
  padding: 0;
  border: 0;
  border-radius: 48% 48% .25rem .25rem;
  background: transparent;
  color: transparent;
}
.contact-door { cursor: pointer; }
.contact-door:focus-visible { outline: 2px solid #f4dca5; outline-offset: 3px; }

.contact-realm {
  position: fixed;
  z-index: 101;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #090402;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.contact-realm.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .3s ease, visibility 0s;
}
.contact-realm__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: linear-gradient(90deg, #080301bb, transparent 25%, transparent 75%, #080301bb), var(--realm-image, linear-gradient(#080301, #080301)) center / cover;
  filter: blur(22px) brightness(.18);
  transform: scale(1.1);
}
.contact-realm__scene {
  position: relative;
  width: min(100vw, 66.6667vh);
  height: 100vh;
  overflow: hidden;
  box-shadow: 0 0 5rem #000, 0 0 9rem #0b040388;
}
.contact-realm__scene > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.19);
  filter: brightness(.52);
  transition: transform .65s cubic-bezier(.16,.8,.22,1), filter .65s ease;
}
.contact-realm.is-open .contact-realm__scene > img { transform: scale(1.02); filter: brightness(.88); }
.contact-realm.has-arrived .contact-realm__scene > img { animation: realm-breathe 11s ease-in-out infinite; }
.contact-realm__light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 19% 18% at 50% 48%, #e78b2615, transparent 80%), radial-gradient(ellipse 12% 25% at 10% 55%, #f77a2028, transparent 80%), radial-gradient(ellipse 12% 22% at 88% 81%, #f77a2026, transparent 80%);
  mix-blend-mode: screen;
  animation: realm-pulse 3.6s ease-in-out infinite;
}
.contact-realm__ambience {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.contact-realm__title {
  display: block;
  position: absolute;
  z-index: 4;
  right: 8%;
  bottom: max(4.5rem, calc(env(safe-area-inset-bottom) + 3.5rem));
  left: 8%;
  margin: 0;
  padding: .8rem 1rem .9rem;
  color: #dcc397;
  background: linear-gradient(90deg, transparent, rgba(12, 7, 4, .72) 15%, rgba(12, 7, 4, .72) 85%, transparent);
  font: small-caps 400 clamp(.9rem, 2vw, 1.3rem)/1.3 Georgia, serif;
  letter-spacing: .13em;
  text-align: center;
  text-shadow: 0 2px 3px #060302, 0 0 10px rgba(205, 154, 87, .5);
  text-decoration: none;
  cursor: pointer;
}
.contact-realm__title:hover,
.contact-realm__title:focus-visible { color: #ffe2aa; text-shadow: 0 0 16px #eaa453, 0 2px 3px #060302; }
.contact-realm__title:focus-visible { outline: 2px solid #e4b977; outline-offset: 3px; }
.contact-realm__title::before,
.contact-realm__title::after {
  content: "";
  display: block;
  width: min(11rem, 55%);
  height: 1px;
  margin: 0 auto .65rem;
  background: linear-gradient(90deg, transparent, rgba(197, 151, 86, .6), transparent);
}
.contact-realm__title::after { margin: .65rem auto 0; }
.realm-candle-life {
  z-index: 3;
  transform: scale(1.19);
  transition: transform .65s cubic-bezier(.16,.8,.22,1);
}
.contact-realm.is-open .realm-candle-life { transform: scale(1.02); }
.contact-realm.has-arrived .realm-candle-life { animation: realm-breathe 11s ease-in-out infinite; }
.contact-realm__scene .contact-realm__close { z-index: 4; }
.contact-realm__close {
  position: absolute;
  z-index: 2;
  top: max(1.25rem, env(safe-area-inset-top));
  right: 1.25rem;
  padding: .55rem .75rem;
  border: 1px solid rgba(236, 186, 115, .75);
  background: rgba(17, 8, 5, .78);
  color: #ffebcf;
  font: 600 .78rem Georgia, serif;
  letter-spacing: .08em;
  cursor: pointer;
}
.contact-realm__close span { margin-left: .5rem; font-size: 1.15rem; line-height: .6; }
.contact-realm__close:hover, .contact-realm__close:focus-visible { background: #4a2317; outline: 2px solid #f4c88d; outline-offset: 2px; }
@keyframes realm-breathe { 0%, 100% { transform: scale(1.02) translateY(0); } 50% { transform: scale(1.055) translateY(-.35%); } }
@keyframes realm-pulse { 0%, 100% { opacity: .48; } 42% { opacity: .82; } 58% { opacity: .57; } 68% { opacity: .9; } }

.contact-stage .contact-candle-life i {
  animation: contact-candle-pulse 1.7s var(--delay) ease-in-out infinite alternate;
  box-shadow:
    0 0 .25rem .05rem rgba(255, 244, 210, .78),
    0 0 .68rem .13rem rgba(255, 151, 52, .42),
    0 0 1.05rem .18rem rgba(238, 105, 21, .15);
}
.contact-stage .contact-candle-life i::before {
  animation: contact-flame-flicker 1.2s var(--delay) ease-in-out infinite alternate;
}
@keyframes contact-candle-pulse {
  from { opacity: .53; transform: scale(.88); }
  to { opacity: .96; transform: scale(1.12); }
}
@keyframes contact-flame-flicker {
  from { opacity: .55; transform: scale(.9, .88) rotate(-2deg); }
  to { opacity: .9; transform: scale(1.06, 1.12) rotate(2deg); }
}
.scene-heading--gabinete p {
  margin: .55em 0 0;
  color: #d7af65;
  font-size: clamp(.65rem, 1.05cqw, 1.12rem);
  line-height: 1.2;
  letter-spacing: .12em;
}

@media (max-width: 700px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  .scene-heading span { font-size: .5rem; }
  .scene-heading h2 { font-size: .7rem; }
  .scene-heading--gabinete { top: 54%; }
  .scene-heading--gabinete p { font-size: .52rem; }
  .scene-heading--contact { top: 37%; }
  .contact-links { inset: auto 10% 3%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
  .contact-link { position: static; width: 100%; min-height: 1.8rem; padding: .2rem .25rem; transform: none; font-size: clamp(.58rem, 2.6vw, .8rem); }
  .contact-link--youtube, .contact-link--tiktok, .contact-link--instagram, .contact-link--email { transform: none; }
  .contact-email { font-size: .9em; }
}

.clock-pendulum {
  position: absolute;
  z-index: 6;
  left: 63.38%;
  top: 32.84%;
  width: 2.82%;
  height: auto;
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transform-origin: 50% 1.2%;
  animation: pendulum-swing 2.55s ease-in-out infinite alternate;
  filter: drop-shadow(0 .12rem .12rem rgba(0, 0, 0, .75));
  will-change: transform;
}

.author-stage .clock-pendulum img {
  position: static !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  display: block;
  object-fit: contain;
  transform: none !important;
  transition: none;
}

@keyframes pendulum-swing {
  from { transform: translateX(-50%) rotate(-4.1deg) scaleX(.94); }
  to { transform: translateX(-50%) rotate(4.7deg) scaleX(.97); }
}

.author-portrait-link {
  position: absolute;
  z-index: 4;
  left: 34.45%;
  top: 18.1%;
  width: 8.45%;
  height: 24.8%;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
}

.author-portrait-link:hover,
.author-portrait-link:focus-visible {
  border-color: rgba(223, 189, 114, .7);
  box-shadow: inset 0 0 2.2rem rgba(223, 189, 114, .12), 0 0 1.35rem rgba(223, 189, 114, .18);
  outline: none;
}

.story-modal {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(.7rem, 2vw, 1.6rem);
  visibility: hidden;
  opacity: 0;
  transition: opacity .42s ease, visibility 0s linear .42s;
}

.story-modal.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.story-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0, 0, 0, .88);
  backdrop-filter: blur(10px);
}

.story-modal__panel {
  position: relative;
  width: min(68rem, 96vw, calc(90vh * 1.5));
  aspect-ratio: 3 / 2;
  overflow: hidden;
  color: #ead9b2;
  filter: drop-shadow(0 1.5rem 3rem rgba(0, 0, 0, .82));
  transform: translateY(1.2rem) scale(.97);
  transition: transform .52s cubic-bezier(.2,.75,.2,1);
}

.story-modal.is-open .story-modal__panel {
  transform: translateY(0) scale(1);
}

.story-modal__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.story-modal__ambience {
  position: absolute;
  z-index: 1;
  inset: 7% 8%;
  overflow: hidden;
  pointer-events: none;
}

.modal-candle-life {
  z-index: 1;
}

.story-modal__close {
  position: absolute;
  z-index: 3;
  top: 5.7%;
  right: 6.2%;
  display: grid;
  place-items: center;
  width: clamp(2rem, 3.2vw, 2.8rem);
  aspect-ratio: 1;
  padding: 0 0 .14em;
  border: 1px solid rgba(224, 186, 111, .55);
  border-radius: 50%;
  background: rgba(9, 6, 4, .72);
  color: #f0d49c;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1;
}

.story-modal__close:hover,
.story-modal__close:focus-visible {
  border-color: #f0d49c;
  background: rgba(52, 31, 12, .9);
  outline: none;
}

.story-modal__content {
  position: absolute;
  z-index: 2;
  inset: 16% 18% 12% 19%;
  display: grid;
  grid-template-columns: minmax(7rem, .61fr) minmax(0, 1.5fr);
  align-items: center;
  gap: clamp(1rem, 3.4vw, 3rem);
}

.story-modal__content.is-list-only {
  inset: 15% 19% 12%;
  grid-template-columns: minmax(0, 1fr);
}

.story-modal__content.is-list-only .story-modal__reliquary {
  display: none;
}

.story-modal__content.is-list-only .story-modal__text {
  padding-right: 1rem;
}

.story-modal__cover {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  max-height: min(42vh, 23rem);
  min-height: 0;
  object-fit: contain;
  border: 1px solid rgba(235, 194, 109, .42);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .7);
  opacity: 1;
  transition: opacity .14s ease;
}

.story-modal__cover-link { display: block; position: relative; z-index: 5; cursor: pointer; }
.story-modal__cover-link:focus-visible { outline: 2px solid #f0d49c; outline-offset: 4px; }
.story-modal__cover-link:hover .story-modal__cover { border-color: #f4d798; box-shadow: 0 1rem 2.5rem rgba(0,0,0,.7), 0 0 1rem rgba(234,190,105,.45); }

.story-modal__cover.is-loading {
  opacity: 0;
}

.story-modal__reliquary {
  --relic-color: 151, 42, 31;
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(94%, 16rem);
  height: auto;
  min-height: 0;
  padding: .72rem .72rem 2.75rem;
  border: 1px solid rgba(184, 139, 67, .48);
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--relic-color), .28), transparent 58%),
    linear-gradient(145deg, rgba(45, 29, 15, .92), rgba(8, 6, 5, .97) 62%);
  box-shadow:
    inset 0 0 0 3px rgba(18, 12, 7, .88),
    inset 0 0 1.8rem rgba(var(--relic-color), .19),
    0 1.1rem 2.5rem rgba(0, 0, 0, .58),
    0 0 1.8rem rgba(var(--relic-color), .14);
}

.story-modal__reliquary[data-book="tenebrosa"] { --relic-color: 213, 113, 25; }
.story-modal__reliquary[data-book="tormentos"] { --relic-color: 91, 119, 137; }

.story-modal__reliquary::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: .72rem;
  bottom: 2.75rem;
  left: .72rem;
  width: 24%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 225, 165, .15), transparent);
  mix-blend-mode: screen;
  opacity: .28;
  transform: translateX(-180%) skewX(-10deg);
  animation: reliquary-glint 7.5s ease-in-out infinite;
}

.story-modal__corner {
  --corner-metal: rgba(214, 168, 82, .82);
  position: absolute;
  z-index: 3;
  width: 1.4rem;
  height: 1.4rem;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px #000);
}

.story-modal__corner--tl { top: .28rem; left: .28rem; border-top: 2px solid var(--corner-metal); border-left: 2px solid var(--corner-metal); }
.story-modal__corner--tr { top: .28rem; right: .28rem; border-top: 2px solid var(--corner-metal); border-right: 2px solid var(--corner-metal); }
.story-modal__corner--bl { bottom: .28rem; left: .28rem; border-bottom: 2px solid var(--corner-metal); border-left: 2px solid var(--corner-metal); }
.story-modal__corner--br { right: .28rem; bottom: .28rem; border-right: 2px solid var(--corner-metal); border-bottom: 2px solid var(--corner-metal); }

.story-modal__bookplate {
  position: absolute;
  z-index: 4;
  right: .6rem;
  bottom: .48rem;
  left: .6rem;
  padding: .42rem .45rem .36rem;
  border: 1px solid rgba(207, 159, 75, .58);
  background: linear-gradient(180deg, rgba(68, 42, 18, .96), rgba(25, 17, 9, .98));
  box-shadow: inset 0 0 0 2px rgba(10, 7, 4, .8), 0 4px 10px rgba(0, 0, 0, .55);
  text-align: center;
}

.story-modal__bookplate strong {
  display: block;
  white-space: nowrap;
}

.story-modal__bookplate strong {
  color: #ead09a;
  font-size: clamp(.62rem, .82vw, .86rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: .12em;
  text-transform: uppercase;
}

@keyframes reliquary-glint {
  0%, 62% { opacity: 0; transform: translateX(-180%) skewX(-10deg); }
  72% { opacity: .36; }
  88%, 100% { opacity: 0; transform: translateX(470%) skewX(-10deg); }
}

.story-modal__text {
  min-width: 0;
  max-height: 100%;
  overflow: auto;
  padding: .35rem .8rem .35rem 0;
  scrollbar-color: rgba(221, 175, 86, .55) transparent;
}

.story-modal__eyebrow,
.story-modal__intro {
  margin: 0;
  color: #b9975d;
  font-size: clamp(.58rem, .8vw, .78rem);
  letter-spacing: .19em;
  text-transform: uppercase;
}

.story-modal h2 {
  margin: .45rem 0 .55rem;
  color: #f2dfb8;
  font-size: clamp(1.3rem, 2.25vw, 2.5rem);
  font-weight: 400;
  line-height: 1.03;
  text-wrap: balance;
  text-shadow: 0 2px 8px #000;
}

.story-modal__intro {
  padding-bottom: .75rem;
  border-bottom: 1px solid rgba(214, 168, 85, .28);
  color: #8f7954;
  letter-spacing: .11em;
}

.story-modal ol {
  margin: .8rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: stories;
  columns: 2;
  column-gap: 2.25rem;
}

.story-modal li {
  position: relative;
  break-inside: avoid;
  counter-increment: stories;
  margin: 0 0 .62rem;
  padding-left: 3.25rem;
  color: #ddcaa2;
  font-size: clamp(.7rem, 1vw, 1rem);
  line-height: 1.28;
}

.story-modal li a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: .2em;
  transition: color .2s ease, text-shadow .2s ease;
}

.story-modal li a:hover,
.story-modal li a:focus-visible {
  color: #f0d49c;
  text-decoration: underline;
  text-shadow: 0 0 .8rem rgba(223, 189, 114, .42);
  outline: none;
}

.story-modal li::before {
  content: counter(stories, upper-roman);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.7rem;
  text-align: right;
  color: #a98141;
  font-size: .72em;
  letter-spacing: .06em;
}

.story-modal.is-poem-modal .story-modal__intro { border-color: rgba(161, 143, 192, .35); color: #b4a0ca; }
.story-modal.is-poem-modal .story-modal__eyebrow, .story-modal.is-poem-modal li::before { color: #b7a0d0; }
.story-modal.is-poem-modal li a:hover, .story-modal.is-poem-modal li a:focus-visible { color: #eadcf4; }

.story-modal.is-book-options .story-modal__cover-link { pointer-events: none; cursor: default; }
.book-ficha-preview {
  margin-top: .85rem;
  padding: .8rem 1rem;
  border-left: 2px solid rgba(218, 170, 88, .7);
  background: rgba(9, 7, 5, .48);
  color: #e3d0ab;
  font-size: clamp(.82rem, 1.05vw, .98rem);
  line-height: 1.45;
}
.book-ficha-preview p { margin: 0 0 .55rem; }
.book-ficha-preview__meta { color: #bf9d67; font-size: .86em; letter-spacing: .04em; }
.book-ficha-preview a { color: #f0cc85; text-underline-offset: .22em; }
.book-ficha-preview a:hover, .book-ficha-preview a:focus-visible { color: #fff0c4; outline: 2px solid #f0cc85; outline-offset: 3px; }
.story-modal.is-book-options ol { columns: 1; display: grid; gap: .8rem; margin-top: 1.3rem; }
.story-modal.is-book-options li { margin: 0; padding: 0; font-size: clamp(.8rem, 1.2vw, 1rem); }
.story-modal.is-book-options li::before { display: none; }
.story-modal.is-book-options li a {
  display: block;
  width: min(100%, 19rem);
  padding: .78rem 1rem;
  border: 1px solid rgba(206, 166, 94, .52);
  background: linear-gradient(135deg, rgba(68, 43, 20, .9), rgba(24, 17, 12, .95));
  color: #f0d9a7;
  text-align: center;
  letter-spacing: .06em;
}
.story-modal.is-book-options li a:hover, .story-modal.is-book-options li a:focus-visible {
  border-color: #f0d49c;
  background: rgba(94, 60, 27, .96);
  outline: none;
}

.author-modal {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(.7rem, 2vw, 1.6rem);
  visibility: hidden;
  opacity: 0;
  transition: opacity .42s ease, visibility 0s linear .42s;
}

.author-modal.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.author-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0, 0, 0, .9);
  backdrop-filter: blur(10px);
}

.author-modal__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(14rem, .72fr) minmax(22rem, 1.28fr);
  width: min(72rem, 96vw);
  height: min(48rem, 91vh);
  overflow: hidden;
  border: 1px solid rgba(205, 156, 76, .62);
  background:
    radial-gradient(circle at 18% 20%, rgba(145, 86, 27, .19), transparent 35%),
    linear-gradient(135deg, rgba(31, 20, 12, .99), rgba(7, 6, 5, .99) 62%);
  box-shadow: inset 0 0 0 4px rgba(7, 5, 3, .95), inset 0 0 4rem rgba(145, 86, 27, .12), 0 1.6rem 4rem rgba(0, 0, 0, .9);
  color: #dcc8a0;
  transform: translateY(1.2rem) scale(.97);
  transition: transform .52s cubic-bezier(.2,.75,.2,1);
}

.author-modal.is-open .author-modal__panel { transform: translateY(0) scale(1); }

.author-modal__panel::before,
.author-modal__panel::after {
  content: "";
  position: absolute;
  z-index: 3;
  pointer-events: none;
  inset: .5rem;
  border: 1px solid rgba(202, 153, 73, .25);
}

.author-modal__panel::after {
  inset: .85rem;
  border-color: rgba(202, 153, 73, .1);
}

.author-modal__close {
  position: absolute;
  z-index: 6;
  top: 1rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 2.65rem;
  aspect-ratio: 1;
  padding: 0 0 .13em;
  border: 1px solid rgba(224, 186, 111, .55);
  border-radius: 50%;
  background: rgba(9, 6, 4, .86);
  color: #f0d49c;
  font-size: 1.85rem;
  line-height: 1;
}

.author-modal__close:hover,
.author-modal__close:focus-visible {
  border-color: #f0d49c;
  background: rgba(52, 31, 12, .94);
  outline: none;
}

.author-modal__portrait {
  position: relative;
  z-index: 2;
  min-width: 0;
  margin: 1.1rem 0 1.1rem 1.1rem;
  overflow: hidden;
  border-right: 1px solid rgba(205, 156, 76, .34);
  background: #080604;
}

.author-modal__portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 24%;
  filter: sepia(.22) contrast(1.08) brightness(.8);
}

.author-modal__portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 64%, rgba(8, 6, 4, .84)), linear-gradient(0deg, rgba(8, 6, 4, .58), transparent 28%);
}

.author-modal__portrait span {
  position: absolute;
  z-index: 2;
  inset: 1rem;
  border: 1px solid rgba(224, 186, 111, .28);
  pointer-events: none;
}

.author-modal__biography {
  position: relative;
  z-index: 4;
  min-width: 0;
  overflow: auto;
  padding: clamp(2.2rem, 4vw, 4rem) clamp(2rem, 4.2vw, 4.5rem) 3rem clamp(1.6rem, 3.3vw, 3.4rem);
  scrollbar-color: rgba(221, 175, 86, .55) transparent;
}

.author-modal__eyebrow {
  margin: 0;
  color: #b9975d;
  font-size: .72rem;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.author-modal h2 {
  margin: .35rem 0 .7rem;
  color: #f1dfb9;
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 2px 12px #000;
}

.author-modal__rule {
  width: 5rem;
  height: 1px;
  margin: 0 0 1.4rem;
  background: linear-gradient(90deg, #c99c50, transparent);
}

.author-modal__biography p {
  margin: 0 0 1.05rem;
  color: #d4c29f;
  font-size: clamp(.92rem, 1.18vw, 1.08rem);
  line-height: 1.66;
  text-align: justify;
  hyphens: auto;
}

.author-modal__biography a {
  color: #e2bf77;
  text-decoration-color: rgba(226, 191, 119, .45);
  text-underline-offset: .18em;
}

.author-modal__biography a:hover,
.author-modal__biography a:focus-visible {
  color: #ffe0a0;
  text-decoration-color: currentColor;
  outline: none;
}

.author-modal__biography blockquote {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  border-left: 2px solid #b88a45;
  background: rgba(174, 116, 43, .08);
  color: #ecd5a8;
  font-size: clamp(1rem, 1.38vw, 1.2rem);
  font-style: italic;
  line-height: 1.55;
  text-align: justify;
}

/* La portada debe mostrarse completa: el retrato y la estatua superior
   no pueden quedar fuera del encuadre en pantallas muy anchas. */
.floor--intro img {
  object-fit: contain;
  object-position: center top;
}

.intro-stage {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  width: min(100vw, calc(100vh * 1.7779));
  aspect-ratio: 3344 / 1882;
  transform: translateX(-50%);
}

.intro-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro-stage img.intro-local-repair { pointer-events: none; }

.intro-stage::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 52% 14%, rgba(255, 224, 157, .18), transparent 25%),
    radial-gradient(circle at 72% 48%, rgba(222, 157, 74, .07), transparent 20%);
  mix-blend-mode: screen;
  opacity: .45;
  animation: breathe-light 9s ease-in-out infinite alternate;
}

.intro-ambience,
.stories-ambience,
.poems-ambience,
.books-ambience,
.author-ambience,
.gabinete-ambience,
.contact-ambience,
.story-modal__ambience {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.contact-stage .contact-ambience,
.contact-stage .contact-candle-life {
  transform: scale(1.035);
  transition: transform 1.5s cubic-bezier(.2,.7,.2,1);
}
.floor.is-active .contact-stage .contact-ambience,
.floor.is-active .contact-stage .contact-candle-life { transform: scale(1); }

.intro-ambience i,
.stories-ambience i,
.poems-ambience i,
.books-ambience i,
.author-ambience i,
.gabinete-ambience i,
.contact-ambience i,
.contact-realm__ambience i,
.story-modal__ambience i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 232, 183, .86);
  box-shadow: 0 0 5px rgba(255, 193, 98, .48);
  opacity: 0;
  animation: drift-particle var(--duration) linear var(--delay) infinite;
}

.stories-ambience i,
.poems-ambience i,
.books-ambience i,
.author-ambience i,
.gabinete-ambience i,
.contact-ambience i,
.contact-realm__ambience i,
.story-modal__ambience i {
  background: rgba(255, 230, 177, .94);
  box-shadow: 0 0 6px rgba(255, 193, 98, .68);
}

.intro-ambience i.is-light-focused,
.stories-ambience i.is-light-focused,
.poems-ambience i.is-light-focused,
.books-ambience i.is-light-focused,
.author-ambience i.is-light-focused,
.gabinete-ambience i.is-light-focused,
.contact-ambience i.is-light-focused,
.contact-realm__ambience i.is-light-focused,
.story-modal__ambience i.is-light-focused {
  background: rgba(255, 242, 202, .98);
  box-shadow:
    0 0 4px rgba(255, 237, 190, .95),
    0 0 10px rgba(255, 181, 71, .7);
}

.page-in-background .intro-ambience i,
.page-in-background .stories-ambience i,
.page-in-background .poems-ambience i,
.page-in-background .books-ambience i,
.page-in-background .author-ambience i,
.page-in-background .gabinete-ambience i,
.page-in-background .contact-ambience i,
.page-in-background .contact-realm__ambience i,
.page-in-background .story-modal__ambience i {
  animation-play-state: paused;
}
.floor:not(.is-active) .contact-ambience i,
.floor:not(.is-active) .contact-candle-life i,
.floor:not(.is-active) .contact-candle-life i::before,
.contact-realm:not(.is-open) .contact-realm__ambience i,
.contact-realm:not(.is-open) .realm-candle-life i,
.contact-realm:not(.is-open) .realm-candle-life i::before,
.page-in-background .realm-candle-life i,
.page-in-background .realm-candle-life i::before {
  animation-play-state: paused;
}

.page-in-background .gabinete-free-chain { animation-play-state: paused; }

.story-modal__ambience {
  z-index: 1;
  inset: 7% 8%;
}

@keyframes breathe-light {
  from { opacity: .28; transform: translate3d(-.4%, .15%, 0) scale(.985); }
  to { opacity: .56; transform: translate3d(.45%, -.2%, 0) scale(1.025); }
}

@keyframes drift-particle {
  0% { opacity: 0; transform: translate3d(0, 8px, 0) scale(.65); }
  16% { opacity: var(--opacity); }
  68% { opacity: calc(var(--opacity) * .52); }
  100% { opacity: 0; transform: translate3d(var(--drift-x), var(--drift-y), 0) scale(1.05); }
}

.candle-life {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.candle-life i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  width: 1px;
  height: 1px;
  border-radius: 50%;
  background: transparent;
  box-shadow:
    0 0 .28rem .07rem rgba(255, 246, 201, .95),
    0 0 .82rem .18rem rgba(255, 157, 52, .52),
    0 0 1.38rem .26rem rgba(238, 105, 21, .21);
  transform-origin: 50% 50%;
  mix-blend-mode: screen;
  animation: candle-glow 1.9s var(--delay) ease-in-out infinite alternate;
}

.candle-life i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(1.2px, .12vw, 2.4px);
  height: clamp(4px, .38vw, 7px);
  border-radius: 55% 45% 58% 42%;
  background: radial-gradient(ellipse at 50% 68%, rgba(255, 255, 226, .94), rgba(255, 188, 67, .62) 46%, transparent 75%);
  translate: -50% -56%;
  transform-origin: 50% 85%;
  mix-blend-mode: screen;
  animation: flame-breathe 1.35s var(--delay) ease-in-out infinite alternate;
}

.intro-candle-life i,
.stories-candle-life i,
.poems-candle-life i,
.books-candle-life i,
.author-candle-life i,
.gabinete-candle-life i,
.contact-candle-life i,
.realm-candle-life i,
.modal-candle-life i {
  box-shadow:
    0 0 .34rem .09rem rgba(255, 249, 214, 1),
    0 0 1rem .24rem rgba(255, 163, 52, .74),
    0 0 1.7rem .36rem rgba(238, 105, 21, .35);
  animation: stories-candle-drift 1.65s var(--delay) ease-in-out infinite alternate;
}

.modal-candle-life {
  z-index: 1;
}

.intro-candle-life i::before,
.stories-candle-life i::before,
.poems-candle-life i::before,
.books-candle-life i::before,
.author-candle-life i::before,
.gabinete-candle-life i::before,
.contact-candle-life i::before,
.realm-candle-life i::before,
.modal-candle-life i::before {
  animation: stories-flame-drift 1.15s var(--delay) ease-in-out infinite alternate;
}

@keyframes candle-glow {
  0% { opacity: .48; transform: scale(.76); }
  35% { opacity: .9; transform: scale(1.1); }
  68% { opacity: .62; transform: scale(.9); }
  100% { opacity: .98; transform: scale(1.26); }
}

@keyframes flame-breathe {
  0% { opacity: .44; transform: scale(.72, .84) rotate(-1.5deg); }
  45% { opacity: .82; transform: scale(1, 1.12) rotate(1deg); }
  100% { opacity: .62; transform: scale(.84, 1.22) rotate(-.5deg); }
}

@keyframes stories-candle-drift {
  0% { opacity: .58; transform: translate3d(-1.5px, 2px, 0) scale(.82); }
  35% { opacity: .95; transform: translate3d(1.5px, -1px, 0) scale(1.12); }
  70% { opacity: .7; transform: translate3d(-1px, -2.5px, 0) scale(.94); }
  100% { opacity: 1; transform: translate3d(1px, 1px, 0) scale(1.3); }
}

@keyframes stories-flame-drift {
  0% { opacity: .55; transform: translate3d(-1px, 1px, 0) scale(.78, .9) rotate(-2deg); }
  50% { opacity: .95; transform: translate3d(1px, -2px, 0) scale(1.05, 1.18) rotate(1.5deg); }
  100% { opacity: .7; transform: translate3d(-.5px, -3px, 0) scale(.9, 1.28) rotate(-1deg); }
}

.door-enter {
  position: absolute;
  z-index: 4;
  left: 68.2%;
  top: 50%;
  width: 6.35%;
  height: 29.5%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 48% 48% .35rem .35rem;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.door-enter:hover,
.door-enter:focus-visible {
  border-color: rgba(223, 189, 114, .58);
  box-shadow: inset 0 0 2rem rgba(223, 189, 114, .12), 0 0 1.5rem rgba(0, 0, 0, .5);
  outline: none;
}

.door-transition {
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity .35s ease;
}

.door-transition.is-dark {
  opacity: 1;
}
.door-transition.is-contact-transition { transition-duration: .18s; }

.intro-copy {
  position: absolute;
  z-index: 3;
  top: clamp(5.5rem, 9.5vh, 7.5rem);
  left: 50%;
  width: min(34rem, 42vw);
  transform: translateX(-50%);
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .95), 0 0 22px rgba(0, 0, 0, .72);
}

.intro-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1.5rem -3rem;
  background: radial-gradient(ellipse, rgba(5, 3, 2, .52), rgba(5, 3, 2, .12) 55%, transparent 75%);
  filter: blur(4px);
  pointer-events: none;
}

.intro-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 3.1vw, 3.7rem);
  font-weight: 400;
  line-height: .86;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.intro-copy p {
  max-width: 31rem;
  margin: .9rem auto .42rem;
  color: #f8ecd4;
  font-size: clamp(.78rem, .94vw, 1.08rem);
  line-height: 1.4;
  letter-spacing: .035em;
}

.intro-copy blockquote {
  margin: 0;
  color: rgba(248, 236, 212, .9);
  font-size: clamp(.7rem, .82vw, .94rem);
  font-style: italic;
  line-height: 1.4;
}

.intro-shortcuts {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: clamp(8.5rem, 16vh, 12rem);
  width: min(95vw, 44rem);
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem;
}
.intro-shortcuts button {
  min-height: 2.7rem;
  border: 1px solid rgba(244, 223, 180, .8);
  border-radius: .2rem;
  padding: .45rem .9rem;
  background: rgba(10, 6, 3, .85);
  color: #fff0cf;
  font: inherit;
  font-size: clamp(.88rem, 1vw, 1rem);
  line-height: 1.2;
  text-shadow: 0 2px 4px #000;
  cursor: pointer;
}
.intro-shortcuts button:hover, .intro-shortcuts button:focus-visible {
  color: #fff;
  background: rgba(42, 26, 13, .94);
  border-color: #fff;
  outline: 2px solid #e4b977;
  outline-offset: 3px;
}
@media (max-width: 700px) {
  .intro-shortcuts { bottom: max(5.25rem, env(safe-area-inset-bottom)); width: min(92vw, 24rem); gap: .45rem; }
  .intro-shortcuts button { flex: 1 1 45%; font-size: .9rem; }
  .intro-shortcuts button:first-child { flex-basis: 100%; }
}
.floor:nth-child(1) { --floor: 0; --shade: .00; }
.floor:nth-child(2) { --floor: 1; --shade: .03; }
.floor:nth-child(3) { --floor: 2; --shade: .07; }
.floor:nth-child(4) { --floor: 3; --shade: .12; }
.floor:nth-child(5) { --floor: 4; --shade: .17; }
.floor:nth-child(6) { --floor: 5; --shade: .22; }
.floor:nth-child(7) { --floor: 6; --shade: .27; }

.chrome {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  padding: clamp(1rem, 2.6vw, 2rem) clamp(1rem, 3.8vw, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold);
  text-shadow: 0 2px 12px #000;
}

.counter {
  position: absolute;
  top: clamp(.45rem, 1.2vw, .8rem);
  left: 50%;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .72rem;
  transform: translateX(-50%);
}

.counter i { width: 2.5rem; height: 1px; background: var(--line); }

.menu-toggle {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 0;
  background: none;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.menu-toggle b, .menu-toggle b::before, .menu-toggle b::after {
  display: block;
  width: 1.35rem;
  height: 1px;
  background: currentColor;
}
.menu-toggle b { position: relative; }
.menu-toggle b::before, .menu-toggle b::after { content: ""; position: absolute; left: 0; }
.menu-toggle b::before { top: -.38rem; }
.menu-toggle b::after { top: .38rem; }

.floor-menu {
  position: fixed;
  z-index: 19;
  inset: 0 0 0 auto;
  width: min(28rem, 100%);
  padding: 8rem 3rem 3rem;
  background: rgba(5, 4, 3, .94);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(18px);
  transform: translateX(100%);
  transition: transform .55s cubic-bezier(.76,0,.24,1);
}

.floor-menu.is-open { transform: translateX(0); }
.floor-menu p { margin: 0 0 1.5rem; color: #806c43; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; }
.floor-menu ol, .rail ol { list-style: none; margin: 0; padding: 0; }
.floor-menu button { width: 100%; padding: .85rem 0; border: 0; border-bottom: 1px solid rgba(223,189,114,.16); background: none; color: #d9c9a6; text-align: left; font-size: 1.35rem; }
.floor-menu button:hover, .floor-menu button[aria-current="step"] { color: var(--gold); padding-left: .65rem; }
.floor-menu__catalogue { display: block; margin-top: 1.5rem; padding: .8rem 0; border-top: 1px solid rgba(223,189,114,.25); color: #d9c9a6; font-size: 1rem; text-decoration: none; }
.floor-menu__catalogue:hover { color: var(--gold); }
.floor-menu__catalogue:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.menu-toggle:focus-visible, .floor-menu button:focus-visible,
.rail button:focus-visible, .controls button:focus-visible {
  outline: 2px solid #f4dca5;
  outline-offset: 4px;
}

.rail {
  position: fixed;
  z-index: 10;
  right: clamp(1rem, 2.5vw, 2.5rem);
  top: 50%;
  transform: translateY(-50%);
}
.rail li + li { margin-top: .65rem; }
.rail button { display: block; width: .55rem; height: .55rem; padding: 0; border: 1px solid var(--gold); background: transparent; transform: rotate(45deg); transition: background .3s, transform .3s; }
.rail button[aria-current="step"] { background: var(--gold); transform: rotate(45deg) scale(1.35); }

.controls {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .17em;
  font-size: .72rem;
  text-shadow: 0 2px 8px #000;
}
.controls button { width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: 50%; background: rgba(4,3,2,.55); }
.controls button:disabled { opacity: .25; cursor: default; }
.controls span { min-width: 7.5rem; text-align: center; }

.hint {
  position: fixed;
  z-index: 9;
  left: clamp(1rem, 3.8vw, 3.5rem);
  bottom: 1.8rem;
  margin: 0;
  color: rgba(245,224,181,.75);
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  transition: opacity .4s;
}
.hint.is-hidden { opacity: 0; }

@media (max-width: 700px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  .counter, .hint { display: none; }
  .floor-loading { width: max-content; max-width: calc(100vw - 2rem); white-space: normal; text-align: center; }
  .chrome { padding: 1rem; }
  .menu-toggle span { display: none; }
  .floor-menu { padding: 6rem 1.5rem 2rem; }
  .rail { right: .7rem; }
  .floor img { object-fit: cover; object-position: 50% 50%; }
  .floor--intro img { object-fit: contain; object-position: center top; }
  .intro-copy {
    top: 5.25rem;
    left: 50%;
    width: min(76vw, 24rem);
    transform: translateX(-50%);
    padding: .75rem 1rem;
    color: #f2dfb8;
    background: linear-gradient(90deg, transparent, rgba(8, 5, 3, .72) 18%, rgba(8, 5, 3, .72) 82%, transparent);
    text-shadow: 0 2px 8px #000;
  }
  .intro-copy h1 { font-size: clamp(1.8rem, 9vw, 2.8rem); }
  .story-modal__panel {
    width: min(98vw, calc(92vh * 1.5));
  }
  .story-modal__content {
    inset: 15% 16.5% 11% 17%;
    grid-template-columns: minmax(4.5rem, .45fr) minmax(0, 1.55fr);
    gap: .85rem;
  }
  .story-modal__reliquary { width: 94%; height: auto; padding: .45rem .45rem 2.3rem; }
  .story-modal__reliquary::after { top: .45rem; bottom: 2.3rem; left: .45rem; }
  .story-modal__bookplate { right: .38rem; bottom: .34rem; left: .38rem; padding: .3rem .25rem .25rem; }
  .story-modal h2 { margin: .24rem 0 .35rem; }
  .story-modal__intro { padding-bottom: .35rem; }
  .story-modal ol { margin-top: .45rem; column-gap: 1rem; }
  .story-modal li { margin-bottom: .45rem; padding-left: 2.6rem; }
  .story-modal li::before { width: 2.25rem; }
  .story-modal.is-book-options ol { gap: .4rem; margin-top: .55rem; }
  .story-modal.is-book-options li a { padding: .45rem .4rem; font-size: .75rem; }
  .author-modal__panel {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(9rem, 30vh) minmax(0, 1fr);
    width: min(96vw, 38rem);
    height: 92vh;
  }
  .author-modal__portrait { margin: .75rem .75rem 0; border: 0; border-bottom: 1px solid rgba(205, 156, 76, .34); }
  .author-modal__portrait img { object-position: center 29%; }
  .author-modal__portrait::after { background: linear-gradient(0deg, rgba(8, 6, 4, .9), transparent 45%); }
  .author-modal__biography { padding: 1.25rem 1.6rem 2rem; }
  .author-modal h2 { padding-right: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .floors, .floor img, .floor-menu, .door-transition, .story-modal, .story-modal__panel, .author-modal, .author-modal__panel { transition-duration: .01ms; }
  .intro-stage::after, .intro-ambience i, .stories-ambience i, .poems-ambience i, .books-ambience i, .author-ambience i, .gabinete-ambience i, .contact-ambience i, .contact-realm__ambience i, .story-modal__ambience i, .candle-life i, .story-modal__reliquary::after, .clock-pendulum, .gabinete-stage img.gabinete-free-chain { animation: none; }
  .clock-pendulum { transform: translateX(-50%) scaleX(.95); }
  .contact-stage, .contact-realm, .contact-realm__scene > img, .realm-candle-life { transition-duration: .01ms; }
  .contact-realm.has-arrived .contact-realm__scene > img, .contact-realm.has-arrived .realm-candle-life, .contact-realm__light { animation: none; }
  .gabinete-stage img.gabinete-free-chain { transform: translateX(-50%); }
  .intro-ambience, .stories-ambience, .poems-ambience, .books-ambience, .author-ambience, .gabinete-ambience, .contact-ambience, .contact-realm__ambience, .story-modal__ambience, .candle-life { display: none; }
}

/* Las zonas interactivas siguen activas, pero sin marcos o halos visibles. */
.door-enter,
.stories-door,
.book-door,
.poem-door,
.poems-next-door,
.books-next-door,
.book-download,
.author-next-door,
.gabinete-next-door,
.author-portrait-link,
.door-enter:hover,
.stories-door:hover,
.book-door:hover,
.poem-door:hover,
.poems-next-door:hover,
.books-next-door:hover,
.book-download:hover,
.author-next-door:hover,
.gabinete-next-door:hover,
.author-portrait-link:hover,
.door-enter:focus-visible,
.stories-door:focus-visible,
.book-door:focus-visible,
.poem-door:focus-visible,
.poems-next-door:focus-visible,
.books-next-door:focus-visible,
.book-download:focus-visible,
.author-next-door:focus-visible,
.gabinete-next-door:focus-visible,
.author-portrait-link:focus-visible {
  border-color: transparent !important;
  box-shadow: none !important;
  outline: none;
}

/* Nivel I: pistas discretas en escritorio y recorrido legible en móvil. */
.stories-discover {
  position: absolute;
  z-index: 4;
  top: 51%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: .42rem .9rem;
  border: 1px solid rgba(223, 189, 114, .3);
  border-radius: 2rem;
  background: rgba(6, 4, 3, .72);
  color: #f0d9a9;
  font-size: clamp(.7rem, .8vw, .86rem);
  letter-spacing: .08em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 5px #000;
}

.book-door::after {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  bottom: calc(100% + .55rem);
  transform: translate(-50%, .3rem);
  padding: .45rem .7rem;
  border: 1px solid rgba(223, 189, 114, .6);
  border-radius: .2rem;
  background: rgba(8, 5, 3, .94);
  color: #f4dfb4;
  font-size: clamp(.7rem, .75vw, .88rem);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.book-door:hover::after, .book-door:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.floor--stories .stories-door::after {
  content: "Ir a Los poemas";
  position: absolute;
  left: 50%;
  bottom: calc(100% + .5rem);
  transform: translateX(-50%);
  padding: .45rem .7rem;
  border: 1px solid rgba(223, 189, 114, .6);
  background: rgba(8, 5, 3, .94);
  color: #f4dfb4;
  font-size: clamp(.7rem, .75vw, .88rem);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.floor--stories .stories-door:hover::after,
.floor--stories .stories-door:focus-visible::after { opacity: 1; }
.floor--stories .book-door:focus-visible,
.floor--stories .stories-door:focus-visible {
  outline: 2px solid #f4dca5 !important;
  outline-offset: 3px;
}
.stories-mobile { display: none; }

@media (max-width: 700px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  .floor--stories .stories-stage {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
  }
  .floor--stories .stories-stage > img {
    object-fit: cover;
    object-position: center top;
  }
  .floor--stories .scene-heading,
  .floor--stories .stories-discover,
  .floor--stories .book-door,
  .floor--stories .stories-door,
  .floor--stories .stories-candle-life { display: none; }
  .stories-mobile {
    position: absolute;
    z-index: 5;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: .65rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 4rem 1rem max(5.2rem, calc(env(safe-area-inset-bottom) + 4.2rem));
    background: linear-gradient(180deg, rgba(2, 2, 3, .18) 0%, transparent 29%, rgba(3, 3, 5, .4) 46%, rgba(4, 3, 4, .91) 79%, #070506 100%);
    color: #f3e2bf;
  }
  .stories-mobile__intro { text-align: center; text-shadow: 0 2px 8px #000; }
  .stories-mobile__intro span { color: #e8c784; font-size: .73rem; letter-spacing: .24em; }
  .stories-mobile__intro h2 { margin: .2rem 0; font-size: clamp(1.55rem, 7vw, 2.1rem); font-weight: 400; }
  .stories-mobile__intro p { margin: .1rem 0 .55rem; color: #e9d5af; font-size: .9rem; }
  .stories-mobile__choices { display: grid; gap: .5rem; }
  .stories-mobile__choices button {
    min-height: 3.7rem;
    padding: .6rem .9rem;
    border: 1px solid rgba(232, 196, 127, .66);
    border-radius: .2rem;
    background-image: linear-gradient(90deg, rgba(8, 5, 4, .94), rgba(8, 5, 4, .65) 68%, rgba(8, 5, 4, .4)), url('assets/01-cuentos-poe-ojos-v29.webp');
    background-size: cover, 340% auto;
    background-position: center, var(--door-pos) 76%;
    color: #f8e9c8;
    font-size: .92rem;
    text-align: left;
    line-height: 1.25;
    box-shadow: 0 .3rem 1.2rem rgba(0, 0, 0, .55);
  }
  .stories-mobile__choices button span { display: inline-block; min-width: 2.1rem; color: #e8c784; }
  .stories-mobile__choices button:focus-visible,
  .stories-mobile__next:focus-visible { outline: 2px solid #f4dca5; outline-offset: 2px; }
  .stories-mobile__choices button:active { background-color: rgba(97, 59, 31, .8); }
  .stories-mobile__next {
    align-self: center;
    min-height: 2.75rem;
    padding: .4rem .75rem;
    border: 0;
    background: transparent;
    color: #d6bd8e;
    font-size: .82rem;
  }
  .stories-mobile__next span { padding-left: .4rem; }
}

@media (max-width: 700px) and (max-height: 660px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  .stories-mobile { gap: .3rem; padding-top: 3rem; padding-bottom: 4.2rem; }
  .stories-mobile__intro p { margin-bottom: .1rem; }
  .stories-mobile__choices { gap: .3rem; }
  .stories-mobile__choices button { min-height: 3.2rem; }
}

/* Las pistas de los demás niveles usan las imágenes originales. */
.intro-mobile-hint, .floor-mobile { display: none; }
.floor-discover {
  position: absolute;
  z-index: 5;
  top: var(--guide-top, 50%);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: .42rem .9rem;
  border: 1px solid rgba(223, 189, 114, .3);
  border-radius: 2rem;
  background: rgba(6, 4, 3, .76);
  color: #f0d9a9;
  font-size: clamp(.7rem, .8vw, .86rem);
  letter-spacing: .08em;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 5px #000;
}
.intro-stage .door-enter::after,
.poem-door::after,
.poems-next-door::after,
.book-download::after,
.books-next-door::after,
.author-portrait-link::after,
.author-next-door::after,
.gabinete-next-door::after {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  bottom: calc(100% + .5rem);
  transform: translateX(-50%);
  padding: .45rem .7rem;
  border: 1px solid rgba(223, 189, 114, .6);
  background: rgba(8, 5, 3, .94);
  color: #f4dfb4;
  font-size: clamp(.7rem, .75vw, .88rem);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.intro-stage .door-enter:hover::after, .intro-stage .door-enter:focus-visible::after,
.poem-door:hover::after, .poem-door:focus-visible::after,
.poems-next-door:hover::after, .poems-next-door:focus-visible::after,
.book-download:hover::after, .book-download:focus-visible::after,
.books-next-door:hover::after, .books-next-door:focus-visible::after,
.author-portrait-link:hover::after, .author-portrait-link:focus-visible::after,
.author-next-door:hover::after, .author-next-door:focus-visible::after,
.gabinete-next-door:hover::after, .gabinete-next-door:focus-visible::after { opacity: 1; }
.intro-stage .door-enter:focus-visible,
.poem-door:focus-visible, .poems-next-door:focus-visible,
.book-download:focus-visible, .books-next-door:focus-visible,
.author-portrait-link:focus-visible, .author-next-door:focus-visible,
.gabinete-next-door:focus-visible {
  outline: 2px solid #f4dca5 !important;
  outline-offset: 3px;
}

@media (max-width: 700px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  .intro-stage { width: 100vw; height: 100dvh; aspect-ratio: auto; }
  .intro-stage img { object-fit: cover; object-position: 72% center; }
  .intro-mobile-hint { display: block; font-size: .82rem !important; }

  .poems-stage, .books-stage, .author-stage, .gabinete-stage, .contact-stage {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
  }
  .poems-stage > img, .books-stage > img, .author-stage > img,
  .gabinete-stage > img:first-child, .contact-stage > img:first-child {
    object-fit: cover;
    object-position: center top;
  }
  .author-stage > img:first-child { object-position: 40% top; }
  .contact-stage > img.contact-eye-repair { object-fit: cover; object-position: center top; }
  .floor-discover,
  .poems-stage .scene-heading, .books-stage .scene-heading, .author-stage .scene-heading,
  .gabinete-stage .scene-heading, .contact-stage .scene-heading,
  .poem-door, .poems-next-door, .book-download, .books-next-door,
  .author-portrait-link, .author-next-door, .gabinete-next-door, .gabinete-eddas,
  .contact-door, .contact-links,
  .poems-candle-life, .books-candle-life, .author-candle-life,
  .gabinete-candle-life, .contact-candle-life { display: none; }
  .floor-mobile {
    position: absolute;
    z-index: 8;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: .65rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 4rem 1rem max(5.2rem, calc(env(safe-area-inset-bottom) + 4.2rem));
    background: linear-gradient(180deg, rgba(2, 2, 3, .17) 0%, transparent 29%, rgba(3, 3, 5, .4) 46%, rgba(4, 3, 4, .91) 79%, #070506 100%);
    color: #f3e2bf;
  }
  .floor-mobile__intro { text-align: center; text-shadow: 0 2px 8px #000; }
  .floor-mobile__intro span { color: #e8c784; font-size: .73rem; letter-spacing: .24em; }
  .floor-mobile__intro h2 { margin: .2rem 0; font-size: clamp(1.55rem, 7vw, 2.1rem); font-weight: 400; }
  .floor-mobile__intro p { margin: .1rem 0 .55rem; color: #e9d5af; font-size: .9rem; }
  .floor-mobile__choices { display: grid; gap: .5rem; }
  .floor-mobile__choices button, .floor-mobile__choices a,
  .floor-mobile__next--primary {
    display: flex;
    align-items: center;
    min-height: 3.7rem;
    padding: .6rem .9rem;
    border: 1px solid rgba(232, 196, 127, .66);
    border-radius: .2rem;
    background-image: linear-gradient(90deg, rgba(8, 5, 4, .94), rgba(8, 5, 4, .65) 68%, rgba(8, 5, 4, .4)), var(--scene);
    background-size: cover, 340% auto;
    background-position: center, var(--door-pos, 50%) 76%;
    color: #f8e9c8;
    font-size: .92rem;
    text-align: left;
    text-decoration: none;
    line-height: 1.25;
    box-shadow: 0 .3rem 1.2rem rgba(0, 0, 0, .55);
  }
  .floor-mobile__choices button span { display: inline-block; min-width: 2.1rem; color: #e8c784; }
  .floor-mobile__choices button:focus-visible, .floor-mobile__choices a:focus-visible,
  .floor-mobile__next:focus-visible { outline: 2px solid #f4dca5; outline-offset: 2px; }
  .floor-mobile__next {
    align-self: center;
    min-height: 2.75rem;
    padding: .4rem .75rem;
    border: 0;
    background: transparent;
    color: #d6bd8e;
    font-size: .82rem;
  }
  .floor-mobile__next span { padding-left: .4rem; }
  .floor-mobile__next--primary { align-self: stretch; justify-content: center; margin-top: .5rem; }
  .floor-mobile--books, .floor-mobile--contact { justify-content: flex-start; padding-top: clamp(13rem, 34vh, 22rem); }
}

@media (max-width: 700px) and (max-height: 660px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  .floor-mobile { gap: .3rem; padding-bottom: 4.2rem; }
  .floor-mobile__choices { gap: .3rem; }
  .floor-mobile__choices button, .floor-mobile__choices a, .floor-mobile__next--primary { min-height: 3.2rem; }
  .floor-mobile--books, .floor-mobile--contact { padding-top: 10rem; }
}

@media (max-width: 700px) and (max-height: 600px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  .stories-mobile, .floor-mobile {
    justify-content: flex-start;
    padding-top: 4.25rem;
    padding-bottom: max(3.6rem, calc(env(safe-area-inset-bottom) + 3rem));
  }
  .floor-mobile--books, .floor-mobile--contact { padding-top: 4.25rem; }
  .stories-mobile__intro, .stories-mobile__choices, .stories-mobile__next,
  .floor-mobile__intro, .floor-mobile__choices, .floor-mobile__next { flex-shrink: 0; }
  .intro-copy {
    top: 3.25rem;
    max-height: calc(100dvh - 5.5rem);
    overflow-y: auto;
  }
  .intro-copy h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
  .intro-copy p { margin-top: .4rem; }
}

/* Las listas y la biografía ocupan el alto útil del teléfono. */
@media (max-width: 700px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  .story-modal, .author-modal { padding: .4rem; }
  .story-modal__panel {
    width: min(100%, 34rem);
    height: calc(100dvh - .8rem);
    max-height: 56rem;
    aspect-ratio: auto;
    border: 1px solid rgba(205, 156, 76, .55);
    background: #130e0a;
  }
  .story-modal__frame { object-fit: cover; object-position: center; }
  .story-modal__panel::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background: rgba(10, 7, 5, .76);
    pointer-events: none;
  }
  .story-modal__close {
    top: .75rem;
    right: .75rem;
    width: 2.75rem;
    font-size: 1.7rem;
  }
  .story-modal__content,
  .story-modal__content.is-list-only {
    inset: 4.2rem 1.15rem 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .8rem;
    min-height: 0;
  }
  .story-modal__reliquary {
    flex: none;
    align-self: center;
    width: 6.2rem;
    padding: .3rem .3rem 1.65rem;
  }
  .story-modal__reliquary::after { top: .3rem; bottom: 1.65rem; left: .3rem; }
  .story-modal__cover { max-height: 6rem; }
  .story-modal__bookplate { right: .22rem; bottom: .2rem; left: .22rem; padding: .22rem; }
  .story-modal__bookplate strong { font-size: .55rem; letter-spacing: .04em; }
  .story-modal__text,
  .story-modal__content.is-list-only .story-modal__text {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: .2rem .4rem 1.5rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .story-modal__eyebrow, .story-modal__intro { font-size: .72rem; letter-spacing: .12em; }
  .story-modal h2 { margin: .4rem 0 .65rem; font-size: clamp(1.4rem, 6vw, 2rem); line-height: 1.18; }
  .story-modal ol { columns: 1; margin-top: .8rem; }
  .story-modal li { min-height: 2.65rem; margin-bottom: .2rem; padding-left: 2.55rem; font-size: 1rem; line-height: 1.4; }
  .story-modal li::before { width: 2.1rem; font-size: .8rem; }
  .story-modal li a { display: block; padding: .42rem 0; }
  .story-modal.is-book-options ol { gap: .6rem; }
  .book-ficha-preview { margin-top: .65rem; padding: .65rem .75rem; font-size: .92rem; }
  .story-modal.is-book-options li { min-height: 0; padding: 0; }
  .story-modal.is-book-options li a { width: 100%; min-height: 2.8rem; padding: .7rem .8rem; font-size: .9rem; }

  .author-modal__panel {
    width: min(100%, 42rem);
    height: calc(100dvh - .8rem);
    max-height: 56rem;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(11rem, 30%) minmax(0, 1fr);
  }
  .author-modal__close { top: .75rem; right: .75rem; width: 2.75rem; }
  .author-modal__portrait { margin: 0; border: 0; border-bottom: 1px solid rgba(205, 156, 76, .34); }
  .author-modal__portrait img { object-position: center 53%; filter: sepia(.12) contrast(1.05) brightness(.96); }
  .author-modal__portrait::after { background: linear-gradient(0deg, rgba(8, 6, 4, .45), transparent 35%); }
  .author-modal__biography {
    min-height: 0;
    padding: 1.3rem 1.25rem 2.5rem;
    overscroll-behavior: contain;
  }
  .author-modal h2 { padding-right: 2rem; font-size: clamp(1.85rem, 7vw, 2.5rem); line-height: 1.12; }
  .author-modal__biography p { margin-bottom: 1.2rem; font-size: 1rem; line-height: 1.72; text-align: left; hyphens: none; }
  .author-modal__biography blockquote { padding: 1rem; font-size: 1.02rem; line-height: 1.65; text-align: left; }
}

@media (max-width: 700px) and (max-height: 600px), (max-width: 1000px) and (max-height: 600px) and (pointer: coarse) {
  .story-modal__content, .story-modal__content.is-list-only { top: 3.7rem; }
  .story-modal__reliquary { width: 4.5rem; padding-bottom: 1.35rem; }
  .story-modal__reliquary::after { bottom: 1.35rem; }
  .story-modal__cover { max-height: 4.3rem; }
  .author-modal__panel { grid-template-rows: minmax(9rem, 28%) minmax(0, 1fr); }
}

/* Aparición ligeramente transparente de Inicio, durante diez segundos. */
.intro-stage .intro-ghost {
  position: absolute;
  left: 34.26%;
  top: 40.5%;
  width: 10.8%;
  height: 29.7%;
  pointer-events: none;
  clip-path: inset(0 36.7% 0 0);
  z-index: 3;
  opacity: 0;
  visibility: hidden;
}
.intro-stage .intro-ghost img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  transform: scaleX(-1);
}

.intro-stage .intro-ghost.is-appearing {
  visibility: visible;
  animation: intro-ghost-ten-seconds 10s linear both;
}
@keyframes intro-ghost-ten-seconds {
  0%, 70% { opacity: .75; }
  0%, 22%, 34%, 49%, 61%, 76%, 88% { filter: blur(0); }
  28%, 55%, 82% { filter: blur(2.5px); }
  100% { opacity: 0; filter: blur(0); visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-stage .intro-ghost.is-appearing { animation-name: intro-ghost-ten-seconds-still; }
  @keyframes intro-ghost-ten-seconds-still {
    0%, 70% { opacity: .75; }
    100% { opacity: 0; visibility: hidden; }
  }
}

/* Apariciones de Cuentos, asomadas por el borde de las dos columnas. */
.stories-stage .stories-ghost {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.stories-stage .stories-ghost--column {
  left: 33%; top: 16%; width: 12%; height: 26%;
  clip-path: polygon(0 0, 100% 0, 100% 50%, 0 52%);
}
.stories-stage .stories-ghost--column-right {
  left: 60.5%; top: 16%; width: 12%; height: 26%;
  clip-path: polygon(0 0, 65% 0, 65% 62%, 0 54%);
}
.stories-stage .stories-ghost img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill;
}
.stories-stage .stories-ghost--column img { transform: scaleX(-1); }
.stories-stage .stories-ghost.is-appearing {
  visibility: visible;
  animation: intro-ghost-ten-seconds 10s linear both;
}
@media (prefers-reduced-motion: reduce) {
  .stories-stage .stories-ghost.is-appearing { animation-name: intro-ghost-ten-seconds-still; }
}

/* Poemas: figura sentada en los escalones y aparición detrás del parapeto. */
.poems-stage .poems-ghost {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.poems-stage .poems-ghost--seated {
  left: 78.8%; top: 71.5%; width: 8%; height: 21.36%;
}
.poems-stage .poems-ghost--parapet {
  left: 28%; top: 16%; width: 12%; height: 26%;
  clip-path: polygon(0 0, 100% 0, 100% 66%, 0 54%);
}
.poems-stage .poems-ghost img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill;
}
.poems-stage .poems-ghost.is-appearing {
  visibility: visible;
  animation: intro-ghost-ten-seconds 10s linear both;
}
@media (prefers-reduced-motion: reduce) {
  .poems-stage .poems-ghost.is-appearing { animation-name: intro-ghost-ten-seconds-still; }
}


/* Libros: aparición sentada sobre los peldaños y otra detrás del ala. */
.books-stage .books-ghost {
  position: absolute; z-index: 3; pointer-events: none;
  opacity: 0; visibility: hidden;
}
.books-stage .books-ghost--seated {
  left: 90.9%; top: 73.2%; width: 6.6%; height: 17.64%;
}
.books-stage .books-ghost--wing {
  left: 51.8%; top: 20%; width: 12%; height: 26%;
  clip-path: none;
}
.books-stage .books-ghost img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill;
}
.books-stage img.books-wing-foreground {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 4; pointer-events: none;
  clip-path: polygon(54.4% 13%, 55% 14.3%, 55.8% 14.9%, 56.4% 16.5%, 56.8% 19%, 57.1% 22.5%, 57.5% 25%, 58% 29%, 58.4% 32.8%, 57.4% 31.9%, 56.3% 29.4%, 55.9% 26%, 55.1% 24%, 54.4% 22%, 53.8% 17%);
}
.books-stage .books-ghost.is-appearing {
  visibility: visible; animation: intro-ghost-ten-seconds 10s linear both;
}
@media (prefers-reduced-motion: reduce) {
  .books-stage .books-ghost.is-appearing { animation-name: intro-ghost-ten-seconds-still; }
}

.books-stage img.books-parapet-foreground {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 4; pointer-events: none;
  clip-path: polygon(45% 33.5%, 65% 33.5%, 65% 48%, 45% 48%);
}

/* Autor: una aparición a la izquierda de la escalera de biblioteca. */
.author-stage .author-ghost {
  position: absolute; z-index: 3; pointer-events: none;
  left: 11.3%; top: 33.5%; width: 13.5%; height: 36%;
  opacity: 0; visibility: hidden;
}
.author-stage .author-ghost img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill;
}
.author-stage .author-ghost.is-appearing {
  visibility: visible; animation: intro-ghost-ten-seconds 10s linear both;
}
.author-stage img.author-parapet-foreground {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 4; pointer-events: none;
  clip-path: polygon(11% 42%, 25% 45.7%, 25% 72%, 11% 72%);
}
@media (prefers-reduced-motion: reduce) {
  .author-stage .author-ghost.is-appearing { animation-name: intro-ghost-ten-seconds-still; }
}

/* Gabinete: aparición detrás de la mesa central, con objetos delante. */
.gabinete-stage .gabinete-ghost {
  position: absolute; z-index: 3; pointer-events: none;
  left: 42.4546875%; top: 74.3008375%; width: 4.090625%; height: 10.924375%;
  opacity: 0; visibility: hidden;
}
.gabinete-stage .gabinete-ghost img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill;
}
.gabinete-stage .gabinete-ghost.is-appearing {
  visibility: visible; animation: intro-ghost-ten-seconds 10s linear both;
}
.gabinete-stage img.gabinete-table-foreground {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 4; pointer-events: none;
  clip-path: polygon(40% 80.2%, 47.5% 80.2%, 47.5% 75%, 47.9% 73.8%, 48.5% 72.8%, 49% 71.8%, 49.7% 72.8%, 50.5% 73.4%, 51.2% 75%, 51.2% 80.2%, 54% 80.2%, 54% 91%, 40% 91%);
}
@media (prefers-reduced-motion: reduce) {
  .gabinete-stage .gabinete-ghost.is-appearing { animation-name: intro-ghost-ten-seconds-still; }
}

/* Enlaces de las apariciones y ventana vacía. */
.ghost-hit {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; padding: 0; background: transparent; cursor: pointer;
  pointer-events: auto;
}
.author-ghost .ghost-hit { height: 28%; }
.gabinete-ghost .ghost-hit { height: 54%; }
.books-ghost--wing .ghost-hit { height: 52%; }
.ghost-hit:focus-visible { outline: 1px solid #dcc6a1; outline-offset: -2px; }

/* Reliquia: fondo negro opaco y vitrina de plata envejecida. */
.ghost-modal .story-modal__backdrop { background: #000; backdrop-filter: none; }
.ghost-modal .ghost-relic {
  width: min(74rem, 94vw); height: auto; max-height: 90dvh;
  aspect-ratio: auto; display: grid; grid-template-columns: 46% minmax(0, 1fr);
  overflow: auto; background: radial-gradient(ellipse at 65% 20%, #19232a, #090d11 75%);
  border: 1px solid #817e72; padding: 5px;
  box-shadow: inset 0 0 0 2px #111619, inset 0 0 0 3px #444942, 0 0 45px #0d151b;
  color: #e4e0d5;
}
.ghost-modal .ghost-relic::before { display: none; }
.ghost-relic__art { position: relative; min-height: 26rem; overflow: hidden; }
.ghost-relic__art img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.ghost-relic__copy { align-self: center; padding: clamp(1.5rem, 4vw, 4rem); }
.ghost-relic__copy h2 { margin: 0; font: 400 clamp(1.65rem, 3vw, 2.9rem)/1.2 Georgia, serif; letter-spacing: .08em; text-transform: uppercase; }
.ghost-relic__rule { display: flex; align-items: center; gap: 1rem; margin: 1.7rem 0; color: #939a99; }
.ghost-relic__rule::before, .ghost-relic__rule::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, #78827e, transparent); }
.ghost-relic__copy blockquote { margin: 0; font: 400 clamp(1.15rem, 2vw, 1.75rem)/1.6 Georgia, serif; }
.ghost-relic__attribution { margin: 1.4rem 0 2.3rem; font: .95rem/1.6 Georgia, serif; color: #aeb0a9; }
.ghost-relic__attribution cite { font-style: normal; }
.ghost-relic__read { display: block; padding: 1rem; border: 1px solid #878c82; box-shadow: inset 0 0 0 3px #090d11, inset 0 0 0 4px #363e3d; color: #e4e0d5; text-align: center; text-decoration: none; font: 1.1rem/1.4 Georgia, serif; }
.ghost-relic__read:hover, .ghost-relic__read:focus-visible { background: #1b252c; border-color: #d4d4c5; outline: 2px solid #b9c4c4; outline-offset: 3px; }
.ghost-modal .story-modal__close { top: .8rem; right: .8rem; z-index: 5; background: #0b1015; border-color: #6c756f; color: #e4e0d5; }
@media (max-width: 700px), (max-height: 600px) and (pointer: coarse) {
  .ghost-modal .ghost-relic { width: min(94vw, 34rem); max-height: 94dvh; height: auto; grid-template-columns: 1fr; }
  .ghost-relic__art { min-height: 0; height: 30dvh; }
  .ghost-relic__art img { object-position: center 48%; }
  .ghost-relic__copy { padding: 1.4rem; }
  .ghost-relic__copy blockquote { font-size: 1.1rem; }
  .ghost-relic__rule { margin: 1rem 0; }
  .ghost-relic__attribution { margin: 1rem 0 1.3rem; }
}

.ghost-relic__copy h2 { overflow-wrap: anywhere; font-size: clamp(1.55rem, 2.65vw, 2.6rem); }
.ghost-relic__art img { transition: opacity .3s ease; }
@media (prefers-reduced-motion: reduce) { .ghost-relic__art img { transition: none; } }

/* Keep hidden floors and dialogs from spending time on decorative motion. */
.floor:not(.is-active) :is(.intro-ambience, .stories-ambience, .poems-ambience, .books-ambience, .author-ambience, .gabinete-ambience, .candle-life) i,
.floor:not(.is-active) .candle-life i::before,
.floor:not(.is-active) .gabinete-free-chain,
.story-modal:not(.is-open) .story-modal__ambience i,
.page-in-background .candle-life i,
.page-in-background .candle-life i::before {
  animation-play-state: paused;
}

.floor-menu { overflow-y: auto; overscroll-behavior: contain; }
.floor-menu__catalogue { overflow-wrap: anywhere; }

/* Scroll táctil de los paneles, separado de los gestos entre pisos. */
.floor-menu, .floor-mobile, .stories-mobile, .story-modal__text, .author-modal__biography, .ghost-modal .ghost-relic {
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.poems-floor-repair { position:absolute; z-index:1; inset:0; width:100%; height:100%; pointer-events:none; }

.stories-floor-repair { position:absolute; z-index:1; inset:0; width:100%; height:100%; pointer-events:none; }
