:root {
  --ink: #1b1712;
  --night: #0c0a08;
  --bronze-1: #6e5129;
  --bronze-2: #b48a4a;
  --bronze-3: #e0c07e;
  --wall: #e8e0d0;
  --slate: #1e2a23;
  --chalk: #f1eee4;
  --chalk-red: #ff8f7a;
  --chalk-yellow: #ffe28a;
  --paper: #f5efe1;
  --red: #b3261e;
  --f-engrave: "IM Fell English SC", Georgia, serif;
  --f-fell: "IM Fell English", Georgia, serif;
  --f-serif: "Cormorant Garamond", Georgia, serif;
  --f-chalk-h: "Fredericka the Great", "Kalam", cursive;
  --f-chalk: "Kalam", cursive;
  --f-mono: "Courier Prime", ui-monospace, monospace;
  --f-instr: "VT323", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: 19px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
code { font-family: var(--f-mono); font-size: .9em; background: rgba(0,0,0,.07); padding: 0 .25em; }

.act { position: relative; min-height: 100vh; }

/* ---------- film grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); }
  60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } 100% { transform: translate(0,0); }
}

/* ---------- curtain ---------- */
.curtain { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; }
.js .curtain { display: grid; }
.curtain__panel {
  position: absolute; top: 0; bottom: 0; width: 51%;
  background:
    linear-gradient(180deg, rgba(0,0,0,.35), transparent 18%, transparent 80%, rgba(0,0,0,.5)),
    repeating-linear-gradient(90deg, #5c0d12 0 18px, #8e1a20 30px, #b2262c 40px, #8e1a20 50px, #5c0d12 64px);
  transition: transform 2.2s cubic-bezier(.7,0,.2,1);
  box-shadow: inset 0 0 80px rgba(0,0,0,.6);
}
.curtain__panel--l { left: 0; transform-origin: left top; }
.curtain__panel--r { right: 0; transform-origin: right top; }
.curtain__pelmet {
  position: absolute; top: 0; left: 0; right: 0; height: 70px;
  background: repeating-radial-gradient(circle at 50% -20px, #7a1218 0 40px, #4a0a0e 41px 44px);
  background-size: 90px 70px;
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
  border-bottom: 4px solid #c9a45c;
  transition: transform 1.6s ease 1s;
}
.curtain__card {
  position: relative; text-align: center; color: #f3e3bd; padding: 2rem 1.5rem;
  transition: opacity .6s ease;
}
.curtain__kicker { font-family: var(--f-fell); font-style: italic; letter-spacing: .08em; margin: 0 0 .5rem; opacity: .85; }
.curtain__title { font-family: var(--f-engrave); font-weight: 400; font-size: clamp(2.4rem, 8vw, 5rem); line-height: 1; margin: 0 0 2rem; text-shadow: 0 3px 0 #3a0508, 0 0 40px rgba(255,200,120,.25); }
.curtain__title span { font-size: .5em; letter-spacing: .2em; }
.curtain__btn {
  font-family: var(--f-engrave); font-size: 1.15rem; letter-spacing: .12em;
  color: #2a1a06; background: linear-gradient(180deg, var(--bronze-3), var(--bronze-2) 60%, var(--bronze-1));
  border: 0; padding: .9rem 2rem; border-radius: 3px;
  box-shadow: 0 2px 0 #4a3414, 0 10px 30px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .2s ease, filter .2s ease;
}
.curtain__btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.curtain__fine { font-family: var(--f-fell); font-style: italic; font-size: .9rem; opacity: .6; margin-top: 1.2rem; }
.curtain.open .curtain__panel--l { transform: translateX(-100%) skewX(-4deg); }
.curtain.open .curtain__panel--r { transform: translateX(100%) skewX(4deg); }
.curtain.open .curtain__pelmet { transform: translateY(-110%); }
/* hold the curtain text back until its fonts arrive, so it never swaps font in view */
.js:not(.fonts-ready) .curtain__card { opacity: 0; }
.js .curtain.open .curtain__card { opacity: 0; pointer-events: none; }
.curtain.gone { display: none; }

/* ---------- museum map ---------- */
.map {
  position: fixed; left: 18px; top: 50%; transform: translateY(-50%); z-index: 80;
  display: flex; flex-direction: column; gap: 10px;
}
.map a {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--f-engrave); color: #c9a45c; mix-blend-mode: difference;
}
.map span {
  width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%;
  font-size: .75rem; transition: background .3s, color .3s;
}
.map em { font-style: normal; font-size: .8rem; letter-spacing: .1em; opacity: 0; transform: translateX(-6px); transition: .3s; white-space: nowrap; }
.map a:hover em, .map a.on em { opacity: 1; transform: none; }
.map a.on span { background: #c9a45c; color: #111; }

/* ---------- sound toggle ---------- */
.sound {
  position: fixed; right: 16px; bottom: 16px; z-index: 85;
  display: flex; align-items: center; gap: 8px;
  background: rgba(20,16,10,.8); color: #e8d3a5; border: 1px solid #6e5129;
  padding: 8px 14px; border-radius: 999px; font-family: var(--f-engrave); font-size: .85rem; letter-spacing: .08em;
  backdrop-filter: blur(6px);
}
.sound__icon { width: 10px; height: 10px; border-radius: 50%; background: #6a5a44; box-shadow: 0 0 0 3px rgba(106,90,68,.3); }
.sound[aria-pressed="true"] .sound__icon { background: #ffb347; box-shadow: 0 0 10px #ffb347; }

/* ---------- reveal helper ---------- */
.js .reveal { opacity: 0; transform: translateY(40px); }

/* ---------- scroll cue ---------- */
.scrollcue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--f-engrave); letter-spacing: .14em; font-size: .85rem; text-decoration: none; color: #c9a45c; opacity: .8;
}
.scrollcue span { animation: bob 1.6s ease-in-out infinite; font-size: 1.2rem; }
.scrollcue--dark { color: #6e5129; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* =========================================================
   ACT I · PLAQUE
   ========================================================= */
.plaque {
  display: grid; place-items: center; padding: 80px 16px 140px;
  background: radial-gradient(ellipse at 50% 40%, #2b2015 0%, #120e09 55%, #070605 100%);
  overflow: hidden;
}
.plaque__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255,180,90,.18), transparent 45%);
  animation: flicker 3.2s infinite;
}
@keyframes flicker {
  0%,100% { opacity: 1; } 12% { opacity: .85; } 20% { opacity: 1; } 47% { opacity: .9; } 55% { opacity: .78; } 63% { opacity: 1; }
}
.motes { position: absolute; inset: 0; pointer-events: none; }
.motes i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(255,220,160,.6);
  animation: mote linear infinite;
}
@keyframes mote { from { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-60vh) translateX(30px); opacity: 0; } }

.candle { position: absolute; bottom: 12vh; width: 34px; height: 160px; background: linear-gradient(90deg, #d8cfb8, #f4ecd6 40%, #bfb39a); border-radius: 4px 4px 2px 2px; box-shadow: 0 0 60px rgba(255,170,80,.25); }
.candle--l { left: max(4vw, 20px); }
.candle--r { right: max(4vw, 20px); height: 120px; }
.candle i {
  position: absolute; left: 50%; top: -38px; width: 18px; height: 36px; margin-left: -9px;
  background: radial-gradient(ellipse at 50% 70%, #fff8d0 0%, #ffcc55 35%, #ff7b1c 70%, transparent 72%);
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  filter: blur(.5px); transform-origin: 50% 100%;
  animation: flame 1.3s ease-in-out infinite alternate;
  box-shadow: 0 0 30px 10px rgba(255,160,60,.35);
}
@keyframes flame { 0% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.06,.94) rotate(2deg); } 100% { transform: scale(.95,1.08) rotate(-1deg); } }
@media (max-width: 700px) { .candle { display: none; } }

.plaque__bronze {
  position: relative; max-width: 640px; width: 100%; text-align: center;
  padding: 56px clamp(20px, 6vw, 64px) 48px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,240,200,.35), transparent 50%),
    linear-gradient(160deg, #8b6a34 0%, #c8a159 25%, #7a5a2a 50%, #b48a4a 75%, #5e431f 100%);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 3px #4d3716, inset 0 0 0 9px #a98146, inset 0 0 0 11px #4d3716,
    inset 0 0 50px rgba(0,0,0,.45), 0 30px 80px rgba(0,0,0,.7);
  color: #3a2a10;
}
.plaque__bronze > * { position: relative; }
.plaque__rivet { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f0d79c, #6e5129 70%); box-shadow: 0 1px 2px rgba(0,0,0,.6); }
.plaque__rivet.tl { top: 20px; left: 20px; } .plaque__rivet.tr { top: 20px; right: 20px; }
.plaque__rivet.bl { bottom: 20px; left: 20px; } .plaque__rivet.br { bottom: 20px; right: 20px; }
.plaque__bronze p, .plaque__bronze h2, .plaque__bronze blockquote {
  text-shadow: 0 1px 0 rgba(255,235,190,.55), 0 -1px 0 rgba(40,25,5,.7);
}
.plaque__on { font-family: var(--f-engrave); letter-spacing: .35em; font-size: 1rem; margin: 0; }
.plaque__date { font-family: var(--f-engrave); font-size: clamp(1.2rem, 3.6vw, 1.6rem); letter-spacing: .12em; margin: .2rem 0 1rem; }
.plaque__rule { height: 2px; margin: 18px auto; width: 60%; background: linear-gradient(90deg, transparent, #4d3716, transparent); box-shadow: 0 1px 0 rgba(255,235,190,.4); }
.plaque__name { font-family: var(--f-engrave); font-weight: 400; font-size: clamp(2.8rem, 11vw, 5.2rem); line-height: .95; margin: .1rem 0 .8rem; letter-spacing: .06em; }
.plaque__name span { display: block; font-size: .78em; }
.plaque__body { font-family: var(--f-fell); font-size: clamp(1.05rem, 2.8vw, 1.3rem); margin: 0 0 .5rem; }
.plaque__body--decree { max-width: 32ch; margin-inline: auto; text-wrap: balance; }
.plaque__body--small { font-style: italic; font-size: 1rem; margin-top: .6rem; }
.plaque__verdict { font-family: var(--f-engrave); font-size: clamp(1.4rem, 4.6vw, 2.2rem); letter-spacing: .06em; margin: .2rem 0 0; }
.plaque__quote { font-family: var(--f-fell); font-style: italic; margin: 0; font-size: 1rem; }
.plaque__quote cite { display: block; font-style: normal; font-family: var(--f-engrave); font-size: .8rem; letter-spacing: .15em; margin-top: .4rem; }
.plaque__notice { position: relative; color: #8a7556; font-family: var(--f-fell); font-style: italic; font-size: .95rem; margin-top: 28px; text-align: center; }

/* =========================================================
   ACT II · EXHIBIT
   ========================================================= */
.exhibit {
  padding: 120px 16px 160px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,250,235,.9), transparent 60%),
    linear-gradient(180deg, #ece5d6 0%, #ddd3bf 78%, #a99b80 78.2%, #8c7f66 100%);
  overflow: hidden;
}
.exhibit__spot {
  position: absolute; top: -10%; left: 50%; width: 900px; height: 120%; transform: translateX(-62%);
  background: conic-gradient(from 168deg at 50% 0%, transparent 0deg, rgba(255,245,215,.55) 12deg, transparent 24deg);
  pointer-events: none; filter: blur(8px);
}
.exhibit__head { position: relative; text-align: center; margin-bottom: 48px; }
.kicker { font-family: var(--f-engrave); letter-spacing: .25em; font-size: .85rem; color: #7a6a4e; margin: 0 0 .5rem; }
.exhibit__head h2 { font-family: var(--f-serif); font-weight: 400; font-size: clamp(2.2rem, 6vw, 3.8rem); margin: 0; line-height: 1.05; }
.exhibit__head em { font-style: italic; color: #6e5129; }

.exhibit__floor {
  position: relative; max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: start;
}
@media (max-width: 860px) { .exhibit__floor { grid-template-columns: 1fr; gap: 40px; } }

.case { position: relative; perspective: 1200px; }
.case__glass {
  position: relative; padding: clamp(18px, 4vw, 40px);
  background: linear-gradient(135deg, rgba(255,255,255,.35), rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: inset 0 0 0 1px rgba(120,110,90,.25), 0 40px 60px -30px rgba(60,45,20,.5);
  backdrop-filter: blur(2px);
  overflow: hidden;
}
.case__sheen {
  position: absolute; inset: -40%; pointer-events: none; z-index: 2;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.55) 48%, transparent 56%);
  animation: sheen 6s ease-in-out infinite;
}
@keyframes sheen { 0%, 60% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.case__plinth { height: 90px; background: linear-gradient(180deg, #faf7f0, #d9d0bd); box-shadow: 0 20px 30px -10px rgba(0,0,0,.35); }

.artefact {
  position: relative; background: #1d1f24; color: #e6e7ea; border-radius: 10px; padding: 16px 18px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transform: rotateX(4deg) rotateY(-6deg);
  transition: transform .6s ease;
}
.case:hover .artefact { transform: rotateX(0) rotateY(0) scale(1.02); }
.artefact__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-family: system-ui, sans-serif; font-size: .9rem; }
.artefact__avatar { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: #c0662a; color: #fff; font-weight: 700; }
.artefact__who { font-weight: 700; }
.artefact__when { color: #8b8f98; font-size: .8rem; }
.artefact__msg { margin: 0; white-space: pre-wrap; font-family: var(--f-mono); font-size: clamp(.95rem, 2.4vw, 1.15rem); line-height: 1.6; }

.stanchions { position: relative; height: 70px; margin-top: 14px; }
.stanchions i { position: absolute; bottom: 0; width: 10px; height: 64px; background: linear-gradient(90deg, #8b6a34, #e0c07e, #8b6a34); border-radius: 4px 4px 0 0; }
.stanchions i::after { content: ""; position: absolute; bottom: -4px; left: -12px; width: 34px; height: 8px; border-radius: 50%; background: #6e5129; }
.stanchions i:nth-child(1) { left: 4%; } .stanchions i:nth-child(2) { left: 50%; } .stanchions i:nth-child(3) { right: 4%; }
.stanchions b { position: absolute; top: 4px; height: 30px; width: 46%; border-bottom: 7px solid #8e1a20; border-radius: 0 0 50% 50%; }
.stanchions b:nth-of-type(1) { left: 5%; } .stanchions b:nth-of-type(2) { left: 51%; }

.placard {
  position: relative; background: #fbf8f1; padding: 28px 28px 24px; color: #2b2620;
  box-shadow: 0 1px 0 #fff inset, 0 12px 30px -12px rgba(60,45,20,.35);
  border-top: 4px solid #6e5129;
  font-size: 1.05rem;
}
.placard__no { font-family: var(--f-engrave); letter-spacing: .2em; font-size: .8rem; color: #8a7a5e; margin: 0; }
.placard h3 { font-family: var(--f-serif); font-style: italic; font-weight: 600; font-size: 1.9rem; margin: .1rem 0 .2rem; }
.placard__artist { margin: 0; font-weight: 600; }
.placard__artist span { font-weight: 400; color: #7a6a4e; }
.placard__medium { margin: 0 0 1rem; font-style: italic; color: #6b5e48; }
.placard p { margin: 0 0 .8rem; }

.audioguide {
  display: flex; align-items: center; gap: 14px; margin-top: 18px; width: 100%;
  background: #1f1c18; color: #f0e6d0; border: 0; border-radius: 10px; padding: 12px 16px; text-align: left;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  transition: transform .2s;
}
.audioguide { position: relative; animation: guidepulse 2.4s ease-out infinite; }
.audioguide:hover { transform: translateY(-2px); }
.audioguide__text { flex: 1; }
.audioguide__led { width: 10px; height: 10px; border-radius: 50%; background: #ff3b30; box-shadow: 0 0 8px #ff3b30; animation: led 1.2s steps(2) infinite; }
.audioguide__play { width: 40px; height: 40px; border-radius: 50%; background: #f0e6d0; position: relative; flex: none; }
.audioguide__play::before { content: ""; position: absolute; left: 15px; top: 12px; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #1f1c18; }
.audioguide.playing { animation: none; }
.audioguide.playing .audioguide__led { animation: none; background: #4cff4c; box-shadow: 0 0 8px #4cff4c; }
.audioguide.playing .audioguide__play::before { left: 13px; top: 13px; width: 14px; height: 14px; border: 0; background: #1f1c18; }
@keyframes led { 50% { opacity: .2; box-shadow: none; } }
@keyframes guidepulse { 0% { box-shadow: 0 6px 18px rgba(0,0,0,.25), 0 0 0 0 rgba(255,59,48,.45); } 70%, 100% { box-shadow: 0 6px 18px rgba(0,0,0,.25), 0 0 0 14px rgba(255,59,48,0); } }
.audioguide small { display: block; font-size: .8rem; opacity: .65; }
.audioguide__dial { font-family: var(--f-instr); font-size: 1.8rem; background: #1a2b1a; color: #8dff8d; padding: 0 10px; border-radius: 4px; box-shadow: inset 0 0 8px rgba(0,0,0,.8); text-shadow: 0 0 6px #4cff4c; }
.audioguide.playing .audioguide__dial { animation: blink .6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* =========================================================
   ACT III · PROOF
   ========================================================= */
.proof { background: #3b2a1c; }
.proof__pin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.board {
  position: relative; width: min(1100px, 100%);
  min-height: min(86vh, 760px);
  padding: clamp(22px, 4vw, 48px) clamp(18px, 5vw, 64px) 70px;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255,255,255,.06), transparent 40%),
    radial-gradient(ellipse at 80% 70%, rgba(255,255,255,.05), transparent 45%),
    var(--slate);
  border: 18px solid #6b4423;
  border-image: linear-gradient(135deg, #8a5a30, #5a3519 40%, #8a5a30 60%, #4a2b14) 1;
  box-shadow: inset 0 0 80px rgba(0,0,0,.6), 0 30px 60px rgba(0,0,0,.5);
  color: var(--chalk);
  overflow: hidden;
}
.board__filters { position: absolute; }
.board__dust {
  position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background:
    repeating-linear-gradient(8deg, transparent 0 30px, rgba(255,255,255,.025) 30px 34px),
    repeating-linear-gradient(-12deg, transparent 0 55px, rgba(255,255,255,.02) 55px 60px);
}
.board__title, .step, .qed { filter: url(#chalk); }
.board__title { font-family: var(--f-chalk-h); font-weight: 400; font-size: clamp(1.7rem, 4.5vw, 2.8rem); margin: 0 0 1.4rem; text-align: center; color: var(--chalk-yellow); }
.board__title small { display: block; font-family: var(--f-chalk); font-size: .45em; color: var(--chalk); opacity: .8; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(14px, 2.4vh, 26px); }
.step { position: relative; display: grid; gap: 2px; }
.step__label { font-family: var(--f-chalk); font-size: clamp(.85rem, 2vw, 1rem); color: #b9c7bc; }
.step__label::before { content: attr(data-n) ". "; }
.step--qed .step__label::before { content: none; }
.step__eq { font-family: var(--f-chalk); font-weight: 700; font-size: clamp(1.15rem, 3.6vw, 2rem); line-height: 1.25; }
.step__eq--result { color: var(--chalk-yellow); }
.step__eq--result::before { content: "∴ "; color: var(--chalk); }
.op { display: inline-block; position: relative; min-width: 1ch; text-align: center; }
.op--neq { color: var(--chalk-red); }
.op--morph s { text-decoration: none; color: var(--chalk-red); }
.op--morph b { position: absolute; left: 0; right: 0; top: 0; color: var(--chalk-yellow); opacity: 0; }
.x { position: relative; display: inline-block; }
.x::after {
  content: ""; position: absolute; left: -4%; right: -4%; top: 52%; height: 4px; border-radius: 2px;
  background: var(--chalk-red); transform: rotate(-8deg) scaleX(var(--strike, 1)); transform-origin: left center;
}
.note { font-family: var(--f-chalk); font-size: clamp(.85rem, 2vw, 1.05rem); color: var(--chalk); opacity: .9; transform: rotate(-1.5deg); justify-self: start; }
.note::before { content: "↳ "; }
.note--r { color: var(--chalk-red); }
.tick { color: #a6f0a6; }
.qed { font-family: var(--f-chalk-h); font-size: clamp(1.4rem, 4.6vw, 2.8rem); color: var(--chalk-yellow); display: inline-flex; align-items: center; gap: .4em; border: 3px solid var(--chalk); padding: .2em .6em; border-radius: 10px 4px 12px 6px; justify-self: start; }
.qed__box { color: var(--chalk); }
.board__ledge { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: linear-gradient(180deg, #7a4d28, #4a2b14); }
.board__ledge i { position: absolute; bottom: 16px; width: 46px; height: 10px; border-radius: 3px; background: #f4f0e6; }
.board__ledge i:nth-child(1) { left: 12%; transform: rotate(-4deg); }
.board__ledge i:nth-child(2) { left: 18%; width: 30px; background: #ffb4a6; transform: rotate(6deg); }
.board__ledge b { position: absolute; bottom: 14px; right: 10%; width: 90px; height: 24px; border-radius: 4px; background: linear-gradient(180deg, #a77a4f 0 50%, #3c3c3c 50%); }

/* hidden starting states, only when JS animates */
.js .step { opacity: 0; }

/* =========================================================
   ACT IV · HOIST
   ========================================================= */
.hoist { background: #000; }
.hoist__pin { position: relative; height: 100vh; overflow: hidden; }
.world {
  position: absolute; left: 0; right: 0; bottom: 0; height: 1000vh;
  background: linear-gradient(0deg,
    #f2a65a 0%, #f6c48a 3%, #9fd0f0 8%, #6fb2e6 20%, #3d7fc9 32%, #1f4c99 42%,
    #121e52 52%, #070a22 62%, #020308 75%, #000 100%);
  will-change: transform;
}
.world__stars {
  position: absolute; left: 0; right: 0; top: 0; height: 55%;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 10%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 40% 70%, #fff, transparent),
    radial-gradient(1px 1px at 85% 55%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 10% 85%, #fff, transparent),
    radial-gradient(1px 1px at 55% 45%, #fff, transparent);
  background-size: 260px 260px;
  mask-image: linear-gradient(0deg, transparent, #000 30%);
}
.ground { position: absolute; left: 0; right: 0; bottom: 0; height: 100vh; }
.castle { position: absolute; left: 50%; bottom: 0; width: min(1100px, 130vw); transform: translateX(-50%); }
.ground__sign { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); margin: 0; font-family: var(--f-fell); font-style: italic; color: #f4ecd6; font-size: .9rem; opacity: 0; }

.lm { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 16px; padding: 0 8vw; color: #fff; font-family: var(--f-instr); font-size: clamp(1.05rem, 2.8vw, 1.5rem); line-height: 1.1; }
.lm span { background: rgba(0,0,0,.35); padding: 6px 10px; border-left: 3px solid #ffe28a; }
.lm em { font-style: normal; opacity: .8; }
.lm:nth-child(odd) { flex-direction: row-reverse; text-align: right; }
.lm:nth-child(odd) span { border-left: 0; border-right: 3px solid #ffe28a; }

.moon { width: clamp(160px, 30vw, 300px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fbf8ee, #cfc8b6 55%, #8f8878); box-shadow: 0 0 80px rgba(255,255,230,.35), inset -30px -20px 60px rgba(0,0,0,.35); position: relative; }
.moon::before, .moon::after { content: ""; position: absolute; border-radius: 50%; background: rgba(120,112,95,.45); }
.moon::before { width: 22%; height: 22%; left: 25%; top: 30%; } .moon::after { width: 14%; height: 14%; left: 60%; top: 58%; }
.flag { position: absolute; left: 50%; bottom: 96%; width: 46%; transform-origin: 6% 100%; transform: scaleY(0); transition: transform .6s cubic-bezier(.2,1.4,.4,1); }
.hoist__pin.landed .flag { transform: scaleY(1); }
.adi.flying.landed svg { animation: none; transform: none; }
.adi.flying.landed .adi__face-smug { display: inline; }
.adi.flying.landed .adi__face-shock { display: none; }
.sat { width: 90px; height: 30px; background: linear-gradient(90deg, #2b4d8f 0 35%, #ccc 35% 65%, #2b4d8f 65%); border-radius: 2px; }
.iss { width: 160px; height: 50px; background:
  linear-gradient(90deg, #a77d1a 0 18%, transparent 18% 82%, #a77d1a 82%),
  linear-gradient(0deg, transparent 40%, #ddd 40% 60%, transparent 60%);
  border-radius: 3px; }
.karman { width: 40vw; max-width: 380px; border-top: 2px dashed #ffe28a; }
.balloon { width: 60px; height: 74px; border-radius: 50% 50% 45% 45%; background: radial-gradient(circle at 35% 30%, #fff, #e8e8e8 60%, #aaa); position: relative; }
.balloon::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 60px; background: #fff; }
.plane { width: 150px; height: 40px; position: relative; }
.plane::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 14px; border-radius: 10px 40px 40px 10px; background: #f3f3f3; }
.plane::after { content: ""; position: absolute; left: 50px; top: 0; width: 36px; height: 40px; background: #d71920; clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.cloud { width: 220px; height: 70px; border-radius: 50px; background: #fff; position: relative; box-shadow: 0 10px 0 rgba(0,0,0,.05); }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 100px; height: 100px; left: 30px; top: -50px; } .cloud::after { width: 80px; height: 80px; left: 110px; top: -36px; }
.gull { width: 60px; height: 20px; border-top: 4px solid #222; border-radius: 50% 50% 0 0; position: relative; }
.gull::after { content: ""; position: absolute; left: 28px; top: -4px; width: 30px; height: 16px; border-top: 4px solid #222; border-radius: 50% 50% 0 0; }

.adi {
  position: absolute; z-index: 5; width: clamp(70px, 11vw, 120px);
  left: 64%; bottom: 7vh; transform-origin: 50% 50%;
}
.adi svg { width: 100%; height: auto; display: block; overflow: visible; }
.adi__tag { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); font-family: var(--f-instr); font-size: 1.1rem; color: #fff; background: #b3261e; padding: 0 6px; }
.adi__face-shock { display: none; }
.adi.flying .adi__face-smug { display: none; }
.adi.flying .adi__face-shock { display: inline; }
.adi.flying .adi__sign { display: none; }
.adi.flying svg { animation: tumble 2.4s linear infinite; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 10px rgba(255,255,255,.35)); }
@keyframes tumble { to { transform: rotate(360deg); } }

.boom { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; }
.flash { position: absolute; inset: 0; background: #fff6d8; opacity: 0; z-index: 7; pointer-events: none; }
.hoist__pin.shake { animation: shake .6s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(6px, -4px); }
  30%, 50%, 70% { transform: translate(-12px, 6px); } 40%, 60% { transform: translate(12px, -6px); }
}

.captions { position: absolute; top: 12vh; left: 0; right: 0; z-index: 8; text-align: center; padding: 0 16px; pointer-events: none; }
.cap { position: absolute; left: 0; right: 0; margin: 0 auto; max-width: 30ch; font-family: var(--f-fell); font-style: italic; font-size: clamp(1.4rem, 4vw, 2.4rem); line-height: 1.15; color: #2a1a06; text-shadow: 0 1px 0 rgba(255,255,255,.4); opacity: 0; }

.altimeter {
  position: absolute; z-index: 9; right: 16px; top: 16px;
  background: #0b120b; border: 3px solid #333; border-radius: 8px; padding: 8px 14px 10px;
  box-shadow: inset 0 0 18px rgba(0,0,0,.9), 0 8px 24px rgba(0,0,0,.4);
  font-family: var(--f-instr); color: #8dff8d; text-shadow: 0 0 6px #3cff3c;
  min-width: 200px; opacity: 0;
}
.altimeter__label { display: block; font-size: .9rem; color: #5fbf5f; letter-spacing: .1em; text-transform: uppercase; }
.altimeter__val { display: block; font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1; }
.altimeter__sub:empty { display: none; }
.altimeter__sub { display: block; font-size: 1rem; color: #b6ffb6; max-width: 26ch; }

/* =========================================================
   ACT V · EPILOGUE
   ========================================================= */
.epilogue {
  padding: 120px 16px 60px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.6), transparent 60%),
    var(--paper);
  color: #2b2620;
}
.journal {
  position: relative; max-width: 760px; margin: 0 auto 100px; background: #fffdf7; padding: clamp(24px, 5vw, 56px);
  box-shadow: 0 1px 0 #fff inset, 0 30px 60px -30px rgba(60,45,20,.4), 0 0 0 1px rgba(60,45,20,.08);
}
.journal__mast { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-bottom: 3px double #2b2620; padding-bottom: 10px; margin-bottom: 28px; font-family: var(--f-engrave); font-size: .8rem; letter-spacing: .12em; }
.journal__title { font-family: var(--f-serif); font-weight: 600; font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.1; margin: 0 0 .5rem; }
.journal__author { font-style: italic; margin: 0 0 2rem; color: #5c5040; }
.journal__notice { border-left: 4px solid var(--red); padding: 4px 0 4px 18px; }
.journal__notice h3 { font-family: var(--f-engrave); letter-spacing: .15em; font-weight: 400; color: var(--red); margin: 0 0 .5rem; font-size: 1rem; }
.journal__notice p { margin: 0 0 .8rem; }
.stamp {
  position: absolute; right: clamp(8px, 4vw, 40px); top: clamp(150px, 26vw, 250px);
  font-family: var(--f-mono); font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  font-size: clamp(1.4rem, 5vw, 2.4rem); color: var(--red);
  border: 5px solid var(--red); padding: 4px 16px; border-radius: 6px;
  transform: rotate(-14deg); opacity: .85; mix-blend-mode: multiply;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.6' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.js .stamp { opacity: 0; transform: rotate(-14deg) scale(3); }

.section-h { font-family: var(--f-engrave); font-weight: 400; text-align: center; letter-spacing: .2em; font-size: clamp(1.3rem, 3.6vw, 1.8rem); margin: 0 0 1.5rem; }

.shop { max-width: 1080px; margin: 0 auto 90px; }
.shop__sub { text-align: center; font-style: italic; margin: -0.6rem 0 2rem; color: #5c5040; }
.shop__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.item { background: #fffdf7; padding: 18px 18px 20px; display: flex; flex-direction: column; box-shadow: 0 16px 30px -20px rgba(60,45,20,.5); transition: transform .3s; }
.item:hover { transform: translateY(-6px) rotate(-.6deg); }
.item h4 { font-family: var(--f-serif); font-weight: 600; font-size: 1.3rem; margin: 14px 0 .3rem; line-height: 1.15; }
.item p { margin: 0 0 .6rem; font-size: 1rem; }
.item__price { font-family: var(--f-mono); font-size: .95rem !important; color: #6e5129; margin-top: auto !important; }
.item__buy { border: 2px solid #2b2620; background: transparent; padding: .5rem; font-family: var(--f-engrave); letter-spacing: .1em; transition: background .2s, color .2s; }
.item__buy:hover { background: #2b2620; color: #fffdf7; }
.item__pic { height: 170px; display: grid; place-items: center; background: #efe7d6; position: relative; overflow: hidden; }
.item__pic--mug span { width: 104px; height: 110px; background: #fff; border-radius: 6px 6px 18px 18px; display: grid; place-items: center; text-align: center; font-family: var(--f-chalk); font-weight: 700; line-height: 1.05; font-size: 1.1rem; position: relative; box-shadow: inset -12px 0 0 rgba(0,0,0,.05); }
.item__pic--mug span::after { content: ""; position: absolute; right: -30px; top: 24px; width: 30px; height: 52px; border: 10px solid #fff; border-left: 0; border-radius: 0 30px 30px 0; }
.item__pic--kit span { width: 130px; height: 100px; background: #c9a27a; border: 3px dashed #6e5129; display: grid; place-items: center; text-align: center; font-family: var(--f-mono); font-weight: 700; color: #3a2510; transform: rotate(-4deg); }
.item__pic--globe::before { content: ""; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.9), rgba(160,200,240,.5) 40%, rgba(30,60,120,.6)); box-shadow: inset 0 0 20px rgba(255,255,255,.6); }
.item__pic--globe::after { content: ""; position: absolute; bottom: 14px; width: 110px; height: 26px; background: #6e5129; border-radius: 4px; }
.globe-adi { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #f2d9b8; border: 3px solid #1b1712; animation: orbit 4s linear infinite; top: 50px; overflow: hidden; }
.globe-adi::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 7px; background: #2a2320; border-radius: 50% 50% 0 0; }
.globe-adi::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 8px; background: #2a2320; border-radius: 0 0 50% 50%; }
@keyframes orbit { from { transform: rotate(0) translateX(34px) rotate(0); } to { transform: rotate(360deg) translateX(34px) rotate(-360deg); } }

.foot { text-align: center; padding: 40px 0 70px; }
.foot__count { font-family: var(--f-engrave); letter-spacing: .12em; font-size: 1.1rem; margin: 0; }
.foot__count span:first-child { font-family: var(--f-instr); font-size: 2.6rem; color: var(--red); letter-spacing: 0; }
.foot__eq { font-family: var(--f-chalk-h); font-size: clamp(2.4rem, 9vw, 5rem); margin: 1rem 0; color: #2b2620; }
.foot__small { font-size: .95rem; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, calc(100% + 40px)); z-index: 95; visibility: hidden;
  max-width: min(520px, calc(100vw - 32px)); background: #1b1712; color: #f4ecd6; padding: 14px 18px; border-left: 4px solid var(--red);
  font-size: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .4s cubic-bezier(.2,.9,.3,1.3);
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }

@media (max-width: 700px) {
  body { font-size: 17px; }
  .map { left: auto; right: 10px; top: 14px; transform: none; flex-direction: row; gap: 6px; }
  .map em { display: none; }
  .map span { width: 26px; height: 26px; }
  .sound .sound__label { display: none; }
  .altimeter { top: 52px; right: 10px; min-width: 0; }
  .adi { left: 60%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .plaque__glow, .candle i, .case__sheen, .scrollcue span, .globe-adi, .motes i, .audioguide, .audioguide__led { animation: none !important; }
}
