:root {
  --bg: #0b0806;
  --ink: #1d1611;
  --paper: #efe5cf;
  --paper-edge: #d9cba9;
  --brass: #d2a94e;
  --brass-dark: #7a5a1c;
  --red: #a3271b;
  --serif: "Baskerville", "Hoefler Text", "Libre Baskerville", Georgia, "Times New Roman", serif;
  --type: "American Typewriter", "Courier Prime", "Courier New", Courier, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: #f3ead6; font-family: var(--serif); font-size: 18px; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.layer { position: fixed; inset: 0; }
.screen { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; background: var(--bg); opacity: 0; transition: opacity .6s; }
.screen.on { opacity: 1; }

/* ---------- shared bits ---------- */
.chip {
  background: rgba(15, 10, 6, .72); border: 1px solid rgba(210, 169, 78, .55); color: #f3ead6;
  padding: 12px 20px; border-radius: 999px; font-size: 17px; letter-spacing: .02em; backdrop-filter: blur(6px);
}
.chip:hover, .chip:focus-visible { background: rgba(210, 169, 78, .22); outline: none; border-color: var(--brass); }
.chip-brass { background: var(--brass); color: #1b1206; border-color: var(--brass); font-weight: 600; }
.chip-brass:hover, .chip-brass:focus-visible { background: #e6c373; }
.brand { font-size: 20px; letter-spacing: .22em; text-transform: uppercase; color: var(--brass); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; background: linear-gradient(#0b0806 55%, rgba(11, 8, 6, 0));
}
.sound {
  position: fixed; right: 16px; bottom: 16px; z-index: 90; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(15, 10, 6, .72); border: 1px solid rgba(210, 169, 78, .55); font-size: 22px; color: var(--brass);
}
.sound.off { color: #7d7466; text-decoration: line-through; }

/* ---------- cine ---------- */
#cine { z-index: 70; background: #000; overflow: hidden; opacity: 1; transition: opacity .6s; }
#cine.away { opacity: 0; pointer-events: none; }
.stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
#cine-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .55s; }
#cine-stage video.on { opacity: 1; }
#cine-stage video.top { z-index: 2; }
#cine-stage.shake { animation: shake .5s; }
@keyframes shake { 0%,100% { margin-left: 0 } 20% { margin-left: -9px } 40% { margin-left: 8px } 60% { margin-left: -5px } 80% { margin-left: 3px } }
#blackout { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 5; }
#blackout.on { opacity: 1; }

.hotspot { position: absolute; z-index: 6; background: none; border: 0; padding: 0; display: none; }
.hotspot.on { display: block; }
.hotspot .ring {
  position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%;
  border: 2px solid rgba(255, 226, 150, .9); box-shadow: 0 0 22px rgba(255, 205, 110, .7), inset 0 0 14px rgba(255, 205, 110, .4);
  animation: pulse 1.9s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.7); opacity: 1 } 100% { transform: scale(1.5); opacity: 0 } }
#hs-door  { left: 45.4%; top: 46%; width: 11.2%; height: 36%; }
#hs-lever { left: 74%;   top: 6%;  width: 26%;   height: 84%; }
#hs-lever .ring { left: 69%; top: 40%; }

.caption {
  position: absolute; left: 0; right: 0; bottom: 9vh; z-index: 8; margin: 0; text-align: center; pointer-events: none;
  font-size: clamp(20px, 2.6vw, 30px); letter-spacing: .04em; text-shadow: 0 2px 14px #000, 0 0 3px #000; opacity: 0; transition: opacity .6s;
}
.caption.on { opacity: 1; }
.verdict {
  position: absolute; left: 0; right: 0; top: 12vh; z-index: 8; margin: 0; text-align: center; pointer-events: none;
  font-size: clamp(26px, 4vw, 48px); letter-spacing: .08em; text-transform: uppercase; color: #ffe9b8;
  text-shadow: 0 2px 18px #000, 0 0 4px #000; opacity: 0; transition: opacity .5s;
}
.verdict.on { opacity: 1; }
#btn-skip { position: absolute; right: 16px; top: 16px; z-index: 9; }
#btn-return { position: absolute; left: 50%; transform: translateX(-50%); bottom: 20vh; z-index: 9; }

/* ---------- map ---------- */
#map { z-index: 10; }
.map-bg { position: fixed; inset: -40px; background: url(assets/img/building.jpg) center / cover; filter: blur(28px) brightness(.28); pointer-events: none; }
.building { position: relative; width: min(100vw, 1150px); margin: -64px auto 0; }
.building img { display: block; width: 100%; height: auto; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.cage {
  position: absolute; left: 46.2%; width: 8.5%; aspect-ratio: 82 / 150; transform: translateY(-50%); z-index: 3; pointer-events: none;
  border: 3px solid #e3bd62; border-radius: 4px;
  background:
    repeating-linear-gradient(45deg, rgba(227, 189, 98, .85) 0 2px, transparent 2px 13px),
    repeating-linear-gradient(-45deg, rgba(227, 189, 98, .85) 0 2px, transparent 2px 13px),
    radial-gradient(ellipse at 50% 18%, rgba(255, 214, 130, .95), rgba(120, 70, 20, .9) 70%);
  box-shadow: 0 0 34px 8px rgba(255, 196, 90, .5), 0 10px 26px rgba(0, 0, 0, .7);
}
.cage::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 3px; height: 2400px; margin-left: -1.5px; background: linear-gradient(#3a2c14, #8c6b2a); opacity: .85; }
.cage i { position: absolute; left: 50%; top: 9%; width: 26%; aspect-ratio: 1; margin-left: -13%; border-radius: 50%; background: #fff3cf; box-shadow: 0 0 16px 6px #ffd98a; }

.band { position: absolute; left: 4.5%; width: 91%; z-index: 2; background: none; border: 2px solid transparent; border-radius: 10px; padding: 0; transition: background .3s, border-color .3s, box-shadow .3s; }
.band:hover, .band:focus-visible, .band.active { background: rgba(255, 210, 120, .07); border-color: rgba(227, 189, 98, .75); box-shadow: 0 0 40px rgba(255, 196, 90, .18) inset; outline: none; }
.band.locked { cursor: not-allowed; }
.band.locked::after { content: ""; position: absolute; inset: 0; background: rgba(6, 4, 3, .52); border-radius: 8px; }
.band.locked.active { border-color: rgba(160, 150, 130, .6); }

.panel {
  position: fixed; left: 18px; top: 50%; transform: translateY(-50%); z-index: 25; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 12px; border-radius: 14px; background: linear-gradient(#3a2b17, #1c140a); border: 2px solid var(--brass-dark); box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}
.panel button {
  width: 58px; height: 58px; border-radius: 50%; border: 2px solid #8f7333; background: radial-gradient(circle at 35% 30%, #5a4520, #1f160b);
  color: #f1d68f; font-family: var(--type); font-size: 17px; font-weight: 700;
}
.panel button:hover, .panel button:focus-visible { border-color: #ffe29a; outline: none; }
.panel button.active { background: radial-gradient(circle at 35% 30%, #fff0bf, #d2a94e); color: #1b1206; box-shadow: 0 0 18px #ffcf70; }

.floor-card {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 25; width: min(330px, 30vw);
  background: var(--paper); color: var(--ink); padding: 22px 22px 24px; border-radius: 4px; box-shadow: 0 16px 40px rgba(0, 0, 0, .7);
  border-top: 6px solid var(--brass-dark);
}
.floor-card h2 { margin: 0 0 2px; font-size: 34px; font-family: var(--type); }
.floor-card h3 { margin: 0 0 10px; font-size: 20px; letter-spacing: .12em; text-transform: uppercase; font-weight: 400; }
.floor-card p { margin: 0 0 14px; font-size: 18px; line-height: 1.4; }
.floor-card .meta { font-family: var(--type); font-size: 16px; }
.floor-card .dots { letter-spacing: .2em; color: var(--red); }
.btn {
  display: inline-block; background: var(--ink); color: var(--paper); border: 0; border-radius: 4px; padding: 14px 22px;
  font-size: 19px; letter-spacing: .04em;
}
.btn:hover, .btn:focus-visible { background: #3b2c1f; outline: 2px solid var(--brass); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-ghost { background: none; color: var(--ink); border: 1.5px solid var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: rgba(29, 22, 17, .1); }

/* ---------- floor ---------- */
#floor { z-index: 12; }
.floor-wrap { position: relative; height: calc(100vh - 78px); min-height: 240px; }
#floor-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vault { position: absolute; background: none; border: 0; padding: 0; transform: translate(-50%, -50%); width: 21.5%; aspect-ratio: 1; top: 52%; border-radius: 50%; }
.vault::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; transition: border-color .3s, box-shadow .3s; }
.vault.open:hover::before, .vault.open:focus-visible::before { border-color: #ffe29a; box-shadow: 0 0 46px 10px rgba(255, 205, 110, .55); }
.vault:focus-visible { outline: none; }
.vault.soon { cursor: default; }
.vault.soon::after { content: ""; position: absolute; left: -22%; right: -22%; top: -72%; bottom: -55%; background: radial-gradient(ellipse at 50% 55%, rgba(5, 3, 2, .86) 35%, rgba(5, 3, 2, .6) 60%, transparent 76%); pointer-events: none; }
.plate, .vtitle { position: absolute; transform: translateX(-50%); text-align: center; pointer-events: none; }
.plate { top: 25.4%; width: 9.8%; height: 5.4%; display: flex; align-items: center; justify-content: center; font-family: var(--type); font-weight: 700; color: #2a1c08; text-shadow: 0 1px 0 rgba(255, 235, 170, .6); letter-spacing: .12em; }
.plate.soon { opacity: .28; }
.vtitle { top: 76.5%; width: 23%; }
.vtitle b { display: block; font-size: 1.5em; letter-spacing: .1em; color: #ffe9b8; text-shadow: 0 2px 10px #000; font-weight: 600; }
.vtitle span { display: block; font-size: 1em; color: #e9dcc0; text-shadow: 0 2px 8px #000; margin-top: .2em; }
.vtitle.soon b { color: #8f8472; font-weight: 400; letter-spacing: .14em; font-size: 1.05em; text-transform: uppercase; }
.seal {
  position: absolute; transform: translate(-50%, -50%) rotate(-9deg); top: 52%; font-family: var(--type); font-weight: 700; color: #d7f0c8;
  border: 3px double #d7f0c8; padding: .25em .7em; letter-spacing: .16em; background: rgba(12, 40, 14, .55); pointer-events: none; font-size: 1.2em;
}
.pager { display: flex; gap: 8px; align-items: center; min-width: 110px; justify-content: flex-end; font-family: var(--type); font-size: 16px; }
.pager button { width: 44px; height: 44px; border-radius: 50%; background: rgba(15, 10, 6, .72); border: 1px solid rgba(210, 169, 78, .55); font-size: 20px; }
.case-list { display: none; list-style: none; margin: 0; padding: 0 16px 90px; }
.case-list li { margin: 0 0 12px; }
.case-list button { width: 100%; text-align: left; background: var(--paper); color: var(--ink); border: 0; border-left: 6px solid var(--brass-dark); border-radius: 4px; padding: 16px; font-size: 19px; }
.case-list button[disabled] { opacity: .45; }
.case-list small { display: block; font-family: var(--type); font-size: 15px; margin-bottom: 4px; }

/* ---------- case file ---------- */
.modal { z-index: 60; background: rgba(6, 4, 3, .86); overflow-y: auto; padding: 24px 16px 60px; }
.paper {
  position: relative; max-width: 940px; margin: 0 auto; background: var(--paper); color: var(--ink); padding: 34px clamp(18px, 4vw, 48px) 40px;
  border-radius: 3px; box-shadow: 0 20px 60px rgba(0, 0, 0, .8); font-size: 19px; line-height: 1.5;
  background-image: linear-gradient(rgba(120, 90, 40, .05) 1px, transparent 1px); background-size: 100% 32px;
}
.paper .close { position: absolute; right: 14px; top: 12px; background: none; border: 0; font-size: 32px; line-height: 1; width: 48px; height: 48px; color: var(--ink); }
.paper .kicker { font-family: var(--type); font-size: 16px; letter-spacing: .18em; text-transform: uppercase; color: var(--red); margin: 0 0 6px; }
.paper h1 { margin: 0; font-size: clamp(34px, 6vw, 56px); letter-spacing: .04em; line-height: 1.05; }
.paper h2 { font-size: 24px; margin: 30px 0 12px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.paper .dateline { font-family: var(--type); margin: 8px 0 18px; }
.paper .question { font-size: 23px; font-style: italic; border-left: 5px solid var(--red); padding: 4px 0 4px 16px; margin: 18px 0; }
.video-box { position: relative; aspect-ratio: 16 / 9; background: #14100c; color: #cdbf9f; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; border-radius: 3px; font-family: var(--type); font-size: 17px; }
.video-box iframe, .video-box video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.doc {
  position: relative; text-align: left; background: #fbf6e9; border: 1px solid var(--paper-edge); border-radius: 2px; padding: 14px 14px 16px; min-height: 132px;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, .12); color: var(--ink); font-size: 18px; line-height: 1.3;
}
.doc small { display: block; font-family: var(--type); font-size: 13px; color: #6d5d44; margin-bottom: 8px; letter-spacing: .1em; }
.doc img { display: block; width: 100%; height: 110px; object-fit: cover; margin-bottom: 8px; }
.doc:hover, .doc:focus-visible { outline: 3px solid var(--brass); }
.doc.picked { background: #fff3c9; outline: 4px solid var(--red); }
.doc.picked::after { content: "✓"; position: absolute; right: 8px; top: 4px; font-size: 26px; color: var(--red); font-weight: 700; }
.sheet { background: #fbf6e9; border: 1px solid var(--paper-edge); padding: 26px clamp(14px, 3vw, 34px); font-family: var(--type); font-size: clamp(16px, 2.2vw, 21px); line-height: 1.75; white-space: pre-wrap; box-shadow: 3px 4px 0 rgba(0, 0, 0, .12); overflow-x: auto; }
.sheet b { display: block; font-size: 1.1em; letter-spacing: .06em; margin-bottom: .5em; }
.sheet img { display: block; max-width: 100%; margin: 0 auto; }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.person { background: #fbf6e9; border: 1px solid var(--paper-edge); padding: 20px 16px; text-align: center; color: var(--ink); border-radius: 2px; box-shadow: 2px 3px 0 rgba(0, 0, 0, .12); }
.person .face { width: 110px; height: 110px; border-radius: 50%; margin: 0 auto 12px; background: radial-gradient(circle at 50% 38%, #6b6259 0 24%, transparent 25%), radial-gradient(ellipse at 50% 108%, #6b6259 0 46%, transparent 47%), #d8cdb6; filter: grayscale(1) contrast(1.1); }
.person b { display: block; font-size: 22px; }
.person span { font-family: var(--type); font-size: 15px; }
.person:hover, .person:focus-visible { outline: 3px solid var(--brass); }
.person.picked { background: #fff3c9; outline: 4px solid var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }
.steps { font-family: var(--type); font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: #6d5d44; margin: 0 0 4px; }
.note { font-family: var(--type); font-size: 16px; color: #5b4b35; }
.alert { background: #2a1512; color: #ffd9cf; padding: 16px 18px; border-left: 6px solid var(--red); margin: 0 0 22px; font-size: 20px; }
.alert b { letter-spacing: .08em; text-transform: uppercase; }
.review { list-style: none; padding: 0; margin: 0 0 8px; }
.review li { padding: 10px 0; border-bottom: 1px dashed #a8997a; }
.review small { font-family: var(--type); display: block; font-size: 14px; color: #6d5d44; letter-spacing: .1em; text-transform: uppercase; }
.stamp { display: inline-block; border: 4px double #1f5a2a; color: #1f5a2a; font-family: var(--type); font-weight: 700; letter-spacing: .16em; padding: 8px 18px; transform: rotate(-4deg); font-size: 22px; margin: 4px 0 18px; }
blockquote.edie { margin: 22px 0; font-size: 26px; font-style: italic; }
blockquote.edie footer { font-size: 17px; font-style: normal; font-family: var(--type); margin-top: 6px; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; font-family: var(--type); margin: 18px 0; }
.stats b { display: block; font-size: 30px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .floor-card { right: 10px; left: 10px; top: auto; bottom: 10px; transform: none; width: auto; padding: 14px 16px 16px; }
  .floor-card h2 { font-size: 26px; display: inline; margin-right: 8px; }
  .floor-card h3 { display: inline; font-size: 16px; }
  .floor-card p { margin: 8px 0 10px; font-size: 16px; }
  .panel { left: 8px; top: 86px; transform: none; padding: 8px 6px; gap: 6px; }
  .panel button { width: 46px; height: 46px; font-size: 14px; }
  .building { margin-bottom: 230px; }
  .brand { font-size: 15px; letter-spacing: .14em; }
  #btn-skip { font-size: 15px; padding: 10px 14px; }
}
@media (max-width: 700px) {
  .floor-wrap { height: 56.25vw; }
  .vtitle span, .vtitle b { display: none; }
  .case-list { display: block; padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .hotspot .ring { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* el anillo de la palanca aparece cuando Edie termina de hablar */
.hotspot.quiet .ring { display: none; }

.cage.glide { transition: top .9s ease-in-out; }
@media (max-width: 820px) { .floor-card { padding-right: 76px; } }

/* barra superior: inicio + título / elevador */
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
@media (max-width: 520px) { .tb-left .brand { display: none; } .btn-home { padding: 10px 14px; } }
