:root {
  --soil: #14100c;
  --soil-2: #1e1812;
  --soil-3: #2a2119;
  --bone: #e8dcc0;
  --bone-dim: #b9ae95;
  --gold: #c9a24a;
  --blood: #5a0f0f;
  --salmon: #e89a8a;
  --wisp: #c8f5d2;
  --night: #0b0d0b;
  --stitch: rgba(232, 220, 192, .38);
  --display: "Libre Caslon Text", Georgia, serif;
  --carve: "IM Fell English SC", "Libre Caslon Text", serif;
  --body: "Source Sans 3", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--night); }
html.locked, html.locked body { overflow: hidden; }
body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--bone); }
img { max-width: 100%; display: block; }

/* ---------- scene ---------- */
#scene {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh;
  display: block; z-index: 0; touch-action: pan-y;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 85% 80% at 50% 45%, transparent 55%, rgba(0,0,0,.6) 100%);
}
#grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-1%)} 100%{transform:translate(1%,3%)} }

#tip {
  position: fixed; z-index: 6; pointer-events: none; left: 0; top: 0;
  font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--wisp); background: rgba(8, 10, 8, .82);
  padding: 8px 10px; border: 1px dashed rgba(200, 245, 210, .45);
  opacity: 0; transform: translate(14px, 14px); transition: opacity .2s;
  white-space: nowrap;
}
#tip.on { opacity: 1; }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 35%, #1c1f1a 0%, #0a0b09 70%);
  transition: opacity .9s ease, visibility .9s;
}
#loader.gone { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; width: min(320px, 80vw); }
.loader-bunny { margin: 0 auto 14px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px) rotate(-4deg); } }
.loader-word { font: 400 28px/1 var(--carve); margin: 0 0 18px; letter-spacing: .06em; }
.loader-word .dots::after { content: "…"; }
.loader-stitch { height: 2px; background: repeating-linear-gradient(90deg, var(--stitch) 0 8px, transparent 8px 14px); position: relative; }
#loader-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, transparent 8px 14px); transition: width .3s; }
.loader-note { font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-dim); margin-top: 14px; }
/* ready: the progress gives way to the Enter button, whose click is also what lets the sound start */
#loader.ready .loader-word, #loader.ready .loader-stitch, #loader.ready #loader-note { display: none; }
.loader-enter { margin-top: 4px; animation: enterIn .6s ease both; }
.loader-enter .btn { font-size: 14px; padding: 13px 22px; }
@keyframes enterIn { from { opacity: 0; transform: translateY(6px); } }
html.gate, html.gate body { overflow: hidden; } /* no scrolling the scene behind the loader */

/* ---------- chrome ---------- */
.wordmark {
  position: fixed; z-index: 5; top: 20px; left: 24px;
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.wordmark img { width: 40px; height: 40px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.wordmark span { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark b { font: 700 17px/1.1 var(--display); letter-spacing: .01em; }
.wordmark i { font: 400 10px/1.3 var(--mono); font-style: normal; letter-spacing: .2em; text-transform: uppercase; color: var(--bone-dim); }

.badge {
  position: fixed; z-index: 5; left: 24px; bottom: 18px;
  font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--bone-dim); padding: 7px 10px;
  border: 1px dashed rgba(232,220,192,.3); background: rgba(10,10,8,.55);
}

/* lantern nav */
.lantern { position: fixed; z-index: 5; top: 0; right: 32px; width: 230px; }
.lantern::before { /* the chain */
  content: ""; position: absolute; top: 0; right: 30px; width: 2px; height: 24px;
  background: repeating-linear-gradient(180deg, #4b4136 0 5px, transparent 5px 7px);
}
.lantern-toggle {
  all: unset; cursor: pointer; position: relative; margin: 24px 0 0 auto;
  display: flex; align-items: center; gap: 10px; flex-direction: row-reverse; width: max-content;
  font: 600 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--bone-dim);
}
.lantern-toggle:focus-visible { outline: 1px dashed var(--gold); outline-offset: 6px; }
.lamp {
  position: relative; width: 26px; height: 36px; margin-right: 18px;
  border: 2px solid #3b332a; border-radius: 6px 6px 3px 3px;
  background: radial-gradient(ellipse at 50% 62%, rgba(255,200,110,.55), rgba(201,162,74,.12) 60%, rgba(20,16,12,.6));
  box-shadow: 0 0 22px 4px rgba(233,170,80,.25), inset 0 0 6px rgba(0,0,0,.6);
}
.lamp::before { content: ""; position: absolute; left: 4px; right: 4px; top: -7px; height: 5px; background: #3b332a; border-radius: 3px 3px 0 0; }
.lamp::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(59,51,42,.75); }
.flame {
  position: absolute; left: 50%; top: 11px; width: 8px; height: 13px; margin-left: -4px;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 70%, #fff6d8, #ffc560 45%, rgba(233,120,40,0) 75%);
  animation: flick 2.3s infinite;
}
@keyframes flick { 0%,100%{transform:scale(1) skewX(0)} 20%{transform:scale(.92,1.06) skewX(3deg)} 45%{transform:scale(1.05,.95) skewX(-2deg)} 70%{transform:scale(.96,1.08)} }
#lantern-list { list-style: none; margin: 16px 0 0; padding: 0; text-align: right; }
#lantern-list li + li { margin-top: 2px; }
#lantern-list a {
  display: inline-flex; gap: 10px; align-items: baseline; padding: 5px 0;
  text-decoration: none; color: var(--bone-dim); font: 400 15px/1.2 var(--display);
  transition: color .3s, text-shadow .3s;
}
#lantern-list .num { font: 600 10px/1 var(--mono); letter-spacing: .1em; color: rgba(201,162,74,.6); min-width: 24px; text-align: right; order: 2; }
#lantern-list a:hover, #lantern-list a:focus-visible { color: var(--bone); }
#lantern-list a.on { color: #ffe3a6; text-shadow: 0 0 14px rgba(255,190,90,.55); }
#lantern-list a.on .num { color: var(--gold); }

/* ---------- scroll track / plates ---------- */
#track { position: relative; z-index: 2; pointer-events: none; }
.stop { height: 100vh; height: 100svh; position: relative; display: flex; align-items: flex-end; padding: 0 0 92px 48px; }
.plate {
  pointer-events: auto; position: relative; max-width: 440px;
  padding: 24px 26px 22px; background: linear-gradient(180deg, rgba(20,16,12,.86), rgba(14,11,8,.92));
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease;
}
.plate::before { /* stitches */
  content: ""; position: absolute; inset: 7px; border: 1.5px dashed var(--stitch); pointer-events: none;
}
.stop.seen .plate { opacity: 1; transform: none; }
html.locked .plate { opacity: 0 !important; pointer-events: none; }
html.card-open body:not(.no-webgl) .stop.seen .plate { opacity: 0 !important; pointer-events: none; } /* an open relic/slab card replaces the caption */
html.locked .wordmark { opacity: .25; transition: opacity .5s; }
html.locked #lantern-list { opacity: 0; visibility: hidden; }
html.locked .lantern.open #lantern-list { opacity: 1; visibility: visible; }
.lantern { z-index: 12; }
.plate h1, .plate h2 { font-family: var(--display); font-weight: 400; margin: 6px 0 10px; line-height: 1.08; }
.plate h1 { font-size: clamp(30px, 3.3vw, 46px); letter-spacing: -.01em; }
.plate h1 span { display: block; color: #f3e6c5; font-style: italic; }
.plate h2 { font-size: 30px; }
.plate p { margin: 0 0 14px; color: #d8ccb0; }
.plate .lede { font-size: 18px; }
.plate .epitaph { font-family: var(--display); font-style: italic; color: var(--bone); }
.plate-hero { max-width: 500px; padding: 30px 32px 24px; }
.eyebrow { font: 600 11px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hint { font: 400 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--bone-dim); margin: 18px 0 0 !important; display: flex; align-items: center; gap: 10px; }
.hint-line { width: 2px; height: 26px; background: repeating-linear-gradient(180deg, var(--bone-dim) 0 4px, transparent 4px 7px); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 50% { transform: translateY(6px); opacity: .5; } }

.btn {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative;
  display: inline-flex; align-items: center; min-height: 44px; padding: 11px 18px;
  font: 600 13px/1.1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--soil); background: var(--bone); text-decoration: none;
  transition: background .25s, color .25s, box-shadow .25s;
}
.btn::after { content: ""; position: absolute; inset: 4px; border: 1.2px dashed rgba(20,16,12,.45); pointer-events: none; }
.btn:hover, .btn:focus-visible { background: #fff1cf; box-shadow: 0 0 24px rgba(201,162,74,.35); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn.ghost { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 1px rgba(232,220,192,.45); }
.btn.ghost::after { border-color: rgba(232,220,192,.22); }
.btn.ghost:hover, .btn.ghost:focus-visible { background: rgba(232,220,192,.08); }

.plate-footer { max-width: 520px; }
.socials { list-style: none; padding: 0; margin: 4px 0 14px; display: grid; gap: 0; }
.socials li { border-top: 1px dashed rgba(232,220,192,.2); }
.socials li:last-child { border-bottom: 1px dashed rgba(232,220,192,.2); }
.socials a { display: flex; justify-content: space-between; gap: 16px; padding: 9px 2px; text-decoration: none; }
.socials span { font: 400 17px/1.2 var(--display); }
.socials em { font: 400 12px/1.6 var(--mono); font-style: normal; color: var(--bone-dim); letter-spacing: .04em; }
.socials a:hover span, .socials a:focus-visible span { color: #ffe3a6; }
.home { margin: 0 0 6px !important; }
.home a { font: 400 22px/1.2 var(--display); font-style: italic; color: var(--gold); }
.fine { font: 400 11px/1.5 var(--mono) !important; color: #9b917b !important; letter-spacing: .02em; }

/* ---------- panels risen from the ground ---------- */
#panels { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.grave-panel {
  position: absolute; right: 56px; bottom: 0; width: min(540px, 44vw); max-height: 88vh; max-height: 88svh;
  pointer-events: auto; display: flex; flex-direction: column;
  transform: translateY(110%); transition: transform 1s cubic-bezier(.2,.9,.25,1);
  filter: drop-shadow(0 -10px 40px rgba(0,0,0,.6));
}
.grave-panel[hidden] { display: flex !important; visibility: hidden; }
.grave-panel.up { transform: translateY(0); visibility: visible; }
.grave-panel::before { /* torn soil edge */
  content: ""; display: block; height: 28px; flex: none; margin-bottom: -1px;
  background: var(--soil);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 540 28' preserveAspectRatio='none'><path d='M0 28 L0 16 L18 9 L31 15 L47 4 L66 13 L79 8 L97 17 L112 6 L131 12 L150 2 L163 11 L181 7 L198 15 L214 5 L236 13 L251 9 L268 18 L286 6 L303 12 L321 3 L338 14 L356 8 L371 16 L389 5 L408 12 L424 7 L443 17 L459 6 L477 13 L494 4 L512 12 L527 8 L540 15 L540 28 Z' fill='black'/></svg>") 0 0 / 100% 100% no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 540 28' preserveAspectRatio='none'><path d='M0 28 L0 16 L18 9 L31 15 L47 4 L66 13 L79 8 L97 17 L112 6 L131 12 L150 2 L163 11 L181 7 L198 15 L214 5 L236 13 L251 9 L268 18 L286 6 L303 12 L321 3 L338 14 L356 8 L371 16 L389 5 L408 12 L424 7 L443 17 L459 6 L477 13 L494 4 L512 12 L527 8 L540 15 L540 28 Z' fill='black'/></svg>") 0 0 / 100% 100% no-repeat;
}
.panel-body {
  position: relative; overflow-y: auto; overscroll-behavior: contain;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201,162,74,.14), transparent 60%),
    linear-gradient(180deg, var(--soil) 0%, #110d0a 100%);
  padding: 22px 34px 34px; scrollbar-width: thin; scrollbar-color: #4b3f31 transparent;
}
.panel-body::before { content: ""; position: absolute; left: 10px; right: 10px; top: 0; bottom: 10px; border: 1.5px dashed var(--stitch); border-top: 0; pointer-events: none; }
.panel-body > * { position: relative; }
#panel-reaper .panel-body { background: radial-gradient(ellipse at 50% 0%, rgba(201,162,74,.22), transparent 55%), linear-gradient(180deg, var(--soil), #100b08); }
#panel-crypt .panel-body { background: radial-gradient(ellipse at 50% 0%, rgba(255,122,42,.16), transparent 55%), linear-gradient(180deg, #13110f, #0d0b0a); }
#panel-studio .panel-body { background: radial-gradient(ellipse at 50% 0%, rgba(120,170,90,.14), transparent 55%), linear-gradient(180deg, var(--soil), #100c09); }
.grave-panel h2 { font: 400 40px/1.05 var(--display); margin: 8px 0 6px; letter-spacing: -.01em; }
.grave-panel h3 { font: 400 13px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 26px 0 8px; }
.grave-panel p { margin: 0 0 14px; color: #ddd1b5; }
.grave-panel b { color: var(--bone); }
.tagline { font: 400 19px/1.35 var(--display) !important; font-style: italic !important; color: var(--salmon) !important; }
.pull { font: 400 22px/1.3 var(--display) !important; color: var(--bone) !important; border-left: 3px solid var(--blood); padding-left: 14px; }
.small { font-size: 14px; color: #b8ad94 !important; }
.close {
  all: unset; cursor: pointer; float: right; margin: 0 -6px 8px 12px;
  font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--bone-dim);
  padding: 10px 12px; border: 1px dashed rgba(232,220,192,.3);
}
.close:hover, .close:focus-visible { color: var(--bone); border-color: var(--gold); }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 6px; }
.shots img { width: 100%; height: auto; aspect-ratio: 540/1202; object-fit: cover; border: 1px solid #3a3027; }
.shots.landscape { grid-template-columns: 1fr 1fr; }
.shots.landscape img { aspect-ratio: 16/9; }
img.wide { width: 100%; height: auto; margin: 12px 0 16px; border: 1px solid #3a3027; }
.ledger { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 8px; }
.ledger dt { font: 400 16px/1.4 var(--display); color: var(--bone); }
.ledger dd { margin: 0; color: #c9bea4; font-size: 15px; line-height: 1.45; }
.ledger dd.mono { font-family: var(--mono); font-size: 13px; }
.devlog { list-style: none; padding: 0; margin: 0 0 18px; }
.devlog li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-top: 1px dashed rgba(232,220,192,.18); }
.devlog time { font: 600 11px/1.6 var(--mono); letter-spacing: .06em; color: var(--gold); text-transform: uppercase; }
.socials.compact span { font-size: 16px; }

.noscript { position: fixed; inset: auto 20px 20px; z-index: 40; background: var(--soil); padding: 16px; }

/* ---------- no-webgl fallback ---------- */
body.no-webgl #scene { background: url(../assets/reaper/halloween.jpg) center/cover; filter: brightness(.35) sepia(.4); }
body.no-webgl .plate { opacity: 1; transform: none; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wordmark { top: 14px; left: 14px; }
  .wordmark img { width: 34px; height: 34px; }
  .wordmark b { font-size: 15px; }
  .badge { left: 14px; bottom: auto; top: 58px; font-size: 9.5px; padding: 5px 7px; }
  .stop { padding: 0 14px 18px; align-items: flex-end; }
  .plate { max-width: none; width: 100%; padding: 18px 18px 16px; }
  .plate h1 { font-size: 32px; }
  .plate h2 { font-size: 24px; }
  .plate p { font-size: 15px; margin-bottom: 10px; }
  .plate .lede { font-size: 16px; }
  .plate-hero { padding: 20px 18px 16px; }
  /* the opening plate on a phone: just the title and the scroll hint, so the graveyard shows (owner, 2026-10-19) */
  .plate-hero .eyebrow, .plate-hero .lede, .plate-hero .row, .plate-hero .hint-more { display: none; }
  .plate-hero { padding: 12px 16px 10px; }
  .plate-hero h1 { font-size: 25px; margin: 0; }
  .plate-hero .hint { margin-top: 8px !important; }
  .btn { font-size: 12px; padding: 10px 14px; }

  .lantern { top: auto; bottom: auto; right: 12px; top: 12px; width: auto; }
  .lantern::before { display: none; }
  .lantern-toggle { margin-top: 2px; gap: 6px; }
  .lamp { width: 22px; height: 30px; margin-right: 6px; }
  .lantern-label { display: none; }
  #lantern-list {
    display: none; position: absolute; right: 0; top: 46px; width: 230px; padding: 10px 14px;
    background: rgba(14,11,8,.95); border: 1px dashed var(--stitch);
  }
  .lantern.open #lantern-list { display: block; }

  .grave-panel { right: 0; left: 0; width: 100%; max-height: 66svh; max-height: 66vh; }
  .panel-body { padding: 14px 18px 28px; }
  .grave-panel h2 { font-size: 30px; }
  .shots { gap: 6px; }
}
@media (min-width: 761px) {
  .lantern-toggle { pointer-events: none; }
}

@media (prefers-reduced-motion: reduce) {
  #grain, .loader-bunny, .flame, .hint-line { animation: none; }
  .plate { transition: opacity .3s; transform: none; }
  .grave-panel { transition: transform .01s; }
}

/* =====================================================================
   Mockup 8 additions: the open grave, the descent, the underworld
   ===================================================================== */

/* the black that the acts swap under */
#veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 55%, #0d0805 0%, #030201 70%);
  display: grid; place-items: center;
}
#veil-note { margin: 0; font: 400 22px/1 var(--carve); letter-spacing: .08em; color: var(--bone-dim); opacity: 0; transition: opacity .4s; }
#veil-note.on { opacity: 1; }
#veil-note .dots::after { content: "…"; }

/* lantern: the levels below, quieter */
#lantern-list .below-head {
  font: 600 10px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: rgba(201,162,74,.55);
  margin: 10px 0 2px; padding-top: 8px; border-top: 1px dashed rgba(232,220,192,.18);
}
#lantern-list .below a { font-size: 13px; padding: 3px 0; color: rgba(185,174,149,.8); }
#lantern-list .below .num { min-width: 28px; }
body.act-under .lantern { opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
body.act-grave .lantern { opacity: 1; visibility: visible; transition: opacity .5s; }

/* depth gauge: Mockup 1's, hung on the right once you are underground */
.gauge {
  position: fixed; z-index: 5; right: 28px; top: 64px; bottom: 30px; width: 214px;
  display: flex; flex-direction: column; align-items: flex-end;
  opacity: 0; visibility: hidden; transition: opacity .6s, visibility .6s;
}
body.act-under .gauge { opacity: 1; visibility: visible; }
html.locked .gauge { opacity: .2; }
/* it sat on top of the scene (the ossuary's skulls were under it): it now reads as the frame's shadowed edge, and its
   labels rest dim until the pointer or focus comes to it; the current stop always stays lit, and every stop stays */
@media (min-width: 761px) {
  .gauge { width: 184px; right: 22px; }
  .gauge::before { content: ""; position: fixed; top: 0; right: 0; bottom: 0; width: 250px; z-index: -1; pointer-events: none;
    background: linear-gradient(90deg, rgba(8,5,3,0), rgba(8,5,3,.38) 55%, rgba(8,5,3,.6)); }
  .gauge-list a, .gauge-surface a, .gauge-galleries a { opacity: .6; transition: opacity .3s, color .3s; }
  .gauge:hover a, .gauge:focus-within a, .gauge a.on { opacity: 1; }
  .gauge-list a { font-size: 13px; padding: 4px 26px 4px 6px; gap: 8px; }
  .gauge-surface a { font-size: 11px; padding-right: 26px; }
  .gauge-up { white-space: nowrap; }
}
.gauge-now { margin: 0 0 6px; font: 600 26px/1 var(--mono); color: var(--gold); letter-spacing: -.02em; text-shadow: 0 2px 10px rgba(0,0,0,.9); }
.gauge-now small { font-size: 11px; margin-left: 4px; color: var(--bone-dim); font-weight: 400; }
.gauge-surface { list-style: none; margin: 0 0 10px; padding: 0 0 8px; text-align: right; border-bottom: 1px dashed rgba(232,220,192,.18); }
.gauge-surface a { display: block; padding: 1px 30px 1px 0; font: 400 12px/1.45 var(--display); color: rgba(185,174,149,.7); text-decoration: none; text-shadow: 0 2px 8px rgba(0,0,0,.95); }
.gauge-surface a:hover, .gauge-surface a:focus-visible { color: var(--bone); }
.gauge-shaft { position: relative; flex: 1; width: 100%; margin: 12px 0 18px; }
.gauge-rope { position: absolute; right: 8px; top: 0; bottom: 0; width: 2px; background: repeating-linear-gradient(180deg, var(--salmon) 0 9px, transparent 9px 16px); opacity: .7; }
.gauge-bob { position: absolute; left: 50%; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 0 3px rgba(20,16,12,.9), 0 0 18px rgba(201,162,74,.7); }
.gauge-list { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.gauge-list li { position: absolute; right: 0; transform: translateY(-50%); }
.gauge-list a {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end; text-decoration: none; color: var(--bone-dim);
  padding: 5px 30px 5px 8px; font: 400 14px/1.15 var(--display); white-space: nowrap; text-shadow: 0 2px 8px rgba(0,0,0,.95); transition: color .3s;
}
.gauge-list a .ft { font: 400 11px var(--mono); color: #8a6f4e; }
.gauge-list a::after { content: ""; position: absolute; right: 3px; width: 12px; height: 2px; background: var(--bone-dim); }
.gauge-list a:hover, .gauge-list a:focus-visible, .gauge-list a.on, .gauge-surface a.on { color: #ffe3a6; }
.gauge-list a.on .ft { color: var(--gold); }
.gauge a:focus-visible { outline: 1px dashed var(--salmon); outline-offset: 2px; }
.gauge-up { font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); text-decoration: none; padding: 9px 10px; border: 1px dashed rgba(201,162,74,.45); background: rgba(14,11,8,.7); }
.gauge-up:hover, .gauge-up:focus-visible { color: var(--bone); border-color: var(--bone-dim); }

/* plates below ground */
.eyebrow .ft { font: 600 12px/1 var(--mono); color: #ffe3a6; letter-spacing: 0; margin-right: 8px; }
.stop.under .plate { background: linear-gradient(180deg, rgba(22,14,10,.88), rgba(14,9,7,.94)); }
.plate .devlog { margin: 4px 0 12px; }
.plate .devlog li { grid-template-columns: 92px 1fr; padding: 7px 0; font-size: 15px; }
.plate .devlog a { color: var(--gold); }
.onward { margin: 12px 0 0 !important; font: italic 400 16px/1.4 var(--display); color: #f0dfb8 !important; }
.onward a { color: #ffd38a; font-style: normal; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-left: 6px; white-space: nowrap; }

/* relic cards */
#cards { position: fixed; inset: 0; z-index: 9; pointer-events: none; }
.relic-card {
  position: absolute; left: 50%; top: 30%; width: 340px; pointer-events: auto;
  padding: 18px 20px 16px; background: linear-gradient(180deg, #1a120c, #100b08);
  box-shadow: 0 24px 60px rgba(0,0,0,.65); border: 1px solid rgba(201,162,74,.4);
  opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .35s, transform .35s;
}
.relic-card::before { content: ""; position: absolute; inset: 6px; border: 1.5px dashed var(--stitch); pointer-events: none; }
.relic-card.on { opacity: 1; transform: none; }
.relic-card > * { position: relative; }
.relic-card h3 { font: 400 22px/1.15 var(--display); margin: 6px 0 8px; }
.relic-card p { margin: 0 0 10px; color: #ddd1b5; font-size: 15px; }
.relic-card .close { margin: -4px -8px 6px 10px; }
.relic-card .btn { min-height: 40px; padding: 9px 14px; font-size: 12px; }

/* fallback: no WebGL, a readable stacked page */
body.no-webgl #veil, body.no-webgl .gauge { display: none; }
body.no-webgl .stop { height: auto; min-height: 0; padding: 40px 24px; display: block; }
body.no-webgl #track { padding-top: 90px; }
body.no-webgl .plate { max-width: 620px; margin: 0 auto; }
body.no-webgl .relic-card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); }

@media (max-width: 760px) {
  /* the lantern stays as the menu in every act */
  body.act-under .lantern { opacity: 1; visibility: visible; }
  #lantern-list { max-height: calc(100svh - 80px); overflow-y: auto; }
  .gauge { top: 60px; bottom: auto; height: 34vh; right: 6px; width: 46px; align-items: flex-end; }
  .gauge-surface, .gauge-up { display: none; }
  .gauge-now { position: absolute; bottom: -26px; right: 0; margin: 0; font-size: 14px; }
  .gauge-now small { font-size: 9px; }
  .gauge-shaft { margin: 0; }
  .gauge-list a { padding: 6px 22px 6px 6px; min-height: 26px; min-width: 40px; }
  .gauge-list a .lbl, .gauge-list a .ft { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .gauge-list a::after { width: 10px; }
  .stop.under .plate { padding-right: 18px; }
  .plate .devlog li { grid-template-columns: 78px 1fr; font-size: 14px; padding: 5px 0; }
  .onward { font-size: 15px; }
  .relic-card { left: 10px !important; right: 10px; top: auto !important; bottom: 10px; width: auto; max-height: 60svh; overflow-y: auto; }
  #veil-note { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .relic-card { transition: opacity .2s; transform: none; }
  #veil-note .dots::after { content: "…"; }
}

/* ---------- v2: the catacomb galleries in the gauge, a longer lantern list ---------- */
#lantern-list { max-height: calc(100vh - 110px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #4b3f31 transparent; padding-right: 2px; }
#lantern-list .below a { font-size: 12.5px; padding: 2px 0; }
.gauge-surface a { font-size: 11.5px; line-height: 1.38; }
.gauge-shaft { margin: 10px 0 14px; min-height: 160px; }
.gauge-galleries { list-style: none; margin: 0 0 12px; padding: 8px 0 0; text-align: right; border-top: 1px dashed rgba(232,220,192,.18); }
.gauge-galleries a { display: block; padding: 1px 30px 1px 0; font: 400 12.5px/1.45 var(--display); color: rgba(232,220,192,.78); text-decoration: none; text-shadow: 0 2px 8px rgba(0,0,0,.95); position: relative; }
.gauge-galleries a::after { content: ""; position: absolute; right: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border: 1px solid rgba(201,162,74,.6); transform: rotate(45deg); }
.gauge-galleries a:hover, .gauge-galleries a:focus-visible, .gauge-galleries a.on { color: #ffe3a6; }
.gauge-galleries a.on::after { background: var(--gold); }
.about-line { font-size: 15px !important; }
.slab-card { border-color: rgba(232,154,138,.45); }
@media (max-width: 760px) {
  .gauge-galleries { display: none; }
}
@media (max-height: 760px) and (min-width: 761px) {
  .gauge-surface { display: none; }
}

/* ---------- v2.1: one caption at a time, fixed in place, cross-fading (never over the logo or the badge) ---------- */
.stop .plate {
  position: fixed; left: 48px; bottom: 92px; z-index: 3;
  max-height: calc(100vh - 190px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #4b3f31 transparent;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
}
.stop.seen .plate { opacity: 1; visibility: visible; transform: none; transition: opacity .42s ease .26s, transform .42s ease .26s, visibility 0s linear .26s; }
@media (max-width: 760px) {
  .stop .plate { left: 14px; right: 14px; bottom: 18px; width: auto; max-height: calc(100svh - 130px); }
}
@media (prefers-reduced-motion: reduce) {
  .stop .plate, .stop.seen .plate { transform: none; transition: opacity .2s ease, visibility 0s; }
}
body.no-webgl .stop .plate { position: static; opacity: 1; visibility: visible; transform: none; max-height: none; }

/* ---------- v3: cuts, sound, and every panel/card on top and fully reachable ---------- */
#cut { position: fixed; inset: 0; z-index: 25; background: #030201; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
#cut.on { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { #cut { transition: none; } }

/* open things sit above the nav and the gauge; the nav's own box never catches clicks, only its links do */
#cards { z-index: 13; }
#panels { z-index: 14; }
.lantern { pointer-events: none; }
.lantern a, .lantern button { pointer-events: auto; }
html.locked .lantern, html.locked .gauge { visibility: hidden; opacity: 0; }
/* the close control is always on top of its card's own text, and pinned to the top of a long panel */
.relic-card > .close { z-index: 3; }
.grave-panel .panel-body { flex: 1 1 auto; min-height: 0; }
.grave-panel .panel-body > .close { position: sticky; top: 6px; z-index: 3; background: rgba(28,21,15,.96); }
.grave-panel { max-height: calc(100vh - 24px); max-height: calc(100svh - 24px); }
@media (max-width: 760px) { .grave-panel { max-height: 70svh; max-height: 70vh; } }

/* lantern: the underground groups fold until opened (or until you are down there) */
#lantern-list .g-stair, #lantern-list .g-cata { display: none; }
#lantern-list.show-stair .g-stair, #lantern-list.show-cata .g-cata { display: list-item; }
.group-toggle {
  all: unset; cursor: pointer; font: 600 10px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: rgba(201,162,74,.7);
  padding: 4px 0;
}
.group-toggle::after { content: "+"; display: inline-block; width: 14px; margin-left: 6px; text-align: center; color: var(--gold); }
.group-toggle[aria-expanded="true"]::after { content: "−"; }
.group-toggle:hover, .group-toggle:focus-visible { color: var(--bone); }
.group-toggle:focus-visible { outline: 1px dashed var(--gold); outline-offset: 3px; }

/* sound */
.sound-toggle {
  all: unset; cursor: pointer; position: fixed; z-index: 6; top: 74px; left: 24px; width: 34px; height: 34px;
  display: grid; place-items: center; color: var(--bone-dim); border: 1px dashed rgba(232,220,192,.28); background: rgba(10,10,8,.5);
  transition: color .3s, border-color .3s, opacity .3s;
}
.sound-toggle:hover, .sound-toggle:focus-visible { color: var(--bone); border-color: var(--gold); }
.sound-toggle .slash { display: none; }
.sound-toggle.muted .slash { display: inline; }
.sound-toggle.muted .wave { display: none; }
.sound-toggle.muted { opacity: .7; }
.sound-toggle.hint { animation: soundhint 2.4s ease-in-out 2.5s 1; }
@keyframes soundhint { 0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,74,0); } 40% { box-shadow: 0 0 0 5px rgba(201,162,74,.22); color: var(--bone); } }
html.locked .sound-toggle { opacity: .25; }
body.no-webgl .sound-toggle { display: none; }
@media (max-width: 760px) { .sound-toggle { top: 12px; left: auto; right: 62px; width: 32px; height: 32px; } }
@media (prefers-reduced-motion: reduce) { .sound-toggle.hint { animation: none; } }
