:root {
  --ink: #d8d5cb;
  --ink-dim: rgba(216, 213, 203, .5);
  --red: #a3170d;
  --serif: 'IM Fell English SC', 'Times New Roman', serif;
  --pixel: 'VT323', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #000; color: var(--ink);
  font-family: var(--pixel);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* 240p framebuffer scaled up with hard pixels */
#scene {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ───────────── the noticeboard ───────────── */
/* keyboard / screen-reader copies of the links: invisible, but focusing one lifts its slip on the board */
.sr, #links { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#links[hidden], .sr[hidden] { display: none; }

/* ───────────── footer ───────────── */
#footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 12;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  font-size: 18px; letter-spacing: .08em;
  color: rgba(216, 213, 203, .45);
  text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}
#footer > * { pointer-events: auto; }
#sound { background: none; border: 0; padding: 4px 0; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer; }
#sound:hover, #sound:focus-visible { color: var(--ink); outline: none; }
#sound.locked { color: rgba(216, 213, 203, .8); animation: blink 1.6s steps(2) infinite; }

/* ───────────── loader ───────────── */
#loader { position: fixed; inset: 0; z-index: 20; background: #000; transition: opacity 1.4s ease, visibility 1.4s; }
#loader.gone { opacity: 0; visibility: hidden; }
#loader .loading { position: absolute; right: 7vw; bottom: calc(9vh + 14px); font-size: 30px; letter-spacing: .14em; color: #cfccc2; }
#loader .dots { animation: blink 1.1s steps(2) infinite; }
#loader .bar { position: absolute; right: 7vw; bottom: 9vh; width: 190px; height: 3px; background: #1a1a1a; }
#loader .fill { width: 0; height: 100%; background: #cfccc2; }
#loader .pct { position: absolute; right: calc(7vw + 200px); bottom: calc(9vh - 7px); font-size: 18px; color: #6a675f; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; }

/* ───────────── no WebGL: the links as a plain list ───────────── */
html:has(#fallback), body:has(#fallback) { overflow: auto; }
#fallback { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; gap: 22px; padding: 32px 16px 80px; text-align: center; }
#fallback p { margin: 0; color: rgba(216, 213, 203, .45); font-size: 20px; letter-spacing: .08em; }
#fallback ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
#fallback a { display: inline-block; padding: 6px 14px; color: var(--ink); font-size: 30px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }
#fallback a:hover, #fallback a:focus-visible { color: #fff; background: #7a0d07; outline: none; }

@media (max-aspect-ratio: 4/5) {
  #loader .pct { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #loader .dots, #sound.locked { animation: none !important; }
}
