/* The Ossuary, the wall. Dark stone, phosphor green, bone. */
:root {
  --night: #050605;
  --stone: #0d0f0d;
  --stone-2: #141714;
  --edge: #1f241f;
  --bone: #d9d4c4;
  --dim: #7d8a7d;
  --faint: #4b554b;
  --phos: #5ff58a;
  --state-0: #5ff58a;  /* alive */
  --state-1: #b8f05f;  /* the turn */
  --state-2: #e8c86a;  /* the flesh */
  --state-3: #d9d4c4;  /* bone */
  --state-4: #a59d88;  /* the bone goes */
  --state-5: #6f6a5e;  /* remains */
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--night);
  color: var(--bone);
  font: 300 16px/1.6 'IBM Plex Sans', system-ui, sans-serif;
  min-height: 100vh;
}
.mono { font-family: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px clamp(16px, 4vw, 40px); }
.back { font: 400 12px/1 'IBM Plex Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); text-decoration: none; padding: 6px 0; }
.back:hover, .back:focus-visible { color: var(--phos); }

.intro { max-width: 760px; margin: 0 auto; padding: clamp(16px, 4vw, 40px) clamp(16px, 4vw, 40px) 0; text-align: center; }
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
h1 { font: 300 clamp(40px, 7vw, 72px)/1.05 'IBM Plex Sans', sans-serif; letter-spacing: -.02em; margin: 10px 0 18px; }
.lede { color: #aab3aa; font-size: clamp(15px, 1.6vw, 17px); }
.status { margin-top: 22px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.status .dot { margin: 0 .7em; color: var(--faint); }
.legend { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 11px; letter-spacing: .1em; color: var(--dim); }
.legend li::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.legend b { color: var(--bone); font-weight: 500; }
.collect {
  display: inline-block; margin-top: 18px; padding: 12px 18px; border: 1px solid #2b5f3a; color: var(--phos); text-decoration: none;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; background: rgba(95, 245, 138, .04);
  box-shadow: 0 0 18px rgba(95, 245, 138, .08); transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.collect:hover, .collect:focus-visible { background: rgba(95, 245, 138, .1); border-color: var(--phos); box-shadow: 0 0 26px rgba(95, 245, 138, .2); outline: none; }
.calm-toggle { margin-left: 12px; border: 1px solid var(--edge); background: transparent; color: var(--dim); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; cursor: pointer; vertical-align: 1px; }
.calm-toggle:hover, .calm-toggle:focus-visible { border-color: var(--phos); color: var(--phos); outline: none; }
.calm-toggle[aria-pressed="false"] { color: var(--faint); }
.calm-toggle[hidden] { display: none; }
.sound-toggle { margin-left: 6px; }
.sound-toggle[aria-pressed="true"] { color: var(--phos); border-color: #2b5f3a; }
/* ambiance off: no fog, no lantern, no glitch */
.calm .fog, .calm .lantern { display: none; }
.calm .collect:hover, .calm .back:hover, .calm .look-link:hover, .calm .cut-btn:hover, .calm .time-now:hover, .calm .time-play:hover { animation: none !important; }
.hint { margin-top: 10px; font-size: 11px; letter-spacing: .08em; color: var(--faint); }
[data-state="0"] { --c: var(--state-0); } [data-state="1"] { --c: var(--state-1); } [data-state="2"] { --c: var(--state-2); }
[data-state="3"] { --c: var(--state-3); } [data-state="4"] { --c: var(--state-4); } [data-state="5"] { --c: var(--state-5); }

/* ---------- the wall: a pile of 666 places in a wall of bones, the first at the bottom ---------- */
.vault { padding: clamp(20px, 4vw, 40px) clamp(10px, 3vw, 40px) clamp(30px, 6vw, 60px); }
.vault-frame { position: relative; max-width: 1180px; margin: 0 auto; }
.vault-frame::after { /* the dark at the edges of the light */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  box-shadow: inset 0 0 clamp(30px, 8vw, 120px) clamp(8px, 2.5vw, 40px) #000;
}
.wall-scroll { overflow: hidden; background: #000; }   /* nothing scrolls in here: past 100 pieces it is cut (see .cut) */
.vault-frame.is-cut::before { /* the cut: the pile goes on below, into the dark */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; z-index: 2; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, .92));
}
.cut { max-width: 1180px; margin: -22px auto 0; position: relative; z-index: 3; text-align: center; }
.cut[hidden] { display: none; }
.cut-btn { border: 1px solid #2b5f3a; background: rgba(3, 6, 4, .9); color: var(--phos); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 10px 16px; cursor: pointer; box-shadow: 0 0 18px rgba(95, 245, 138, .1); }
.cut-btn:hover, .cut-btn:focus-visible { border-color: var(--phos); background: rgba(95, 245, 138, .1); outline: none; }
.wall-scroll:focus-visible { outline: 1px solid var(--phos); }
.wall { position: relative; width: 100%; }
.wall .tile { position: absolute; left: 0; width: 100%; display: block; }
/* the rain, over the part of the wall in view; it lets every click through (no blend mode: it broke the scrolling wall, and costs phones) */
/* the fog (WebGL, drawn small and scaled up) and the lantern, over the crypt in view */
.fog { position: absolute; left: 0; top: 0; width: 100%; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 2s ease; }
.fog.on { opacity: 1; }
.lantern { position: absolute; left: 0; top: 0; width: 100%; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .6s ease;
  background: radial-gradient(circle 430px at var(--x, 50%) var(--y, 50%), rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, .12) 55%, rgba(0, 0, 0, .5) 100%); }
.vault-frame.lit .lantern { opacity: 1; }
/* links and buttons tear now and then while pointed at: a brief glitch, every couple of seconds */
@keyframes glitch-slow {   /* a tear as soon as it is pointed at, then quiet until the next cycle */
  0% { text-shadow: -3px 0 #ff2a6d, 3px 0 #05d9e8; transform: translate(2px, -1px); clip-path: none; }
  3% { text-shadow: 3px 0 #ff2a6d, -3px 0 #05d9e8; transform: translate(-2px, 1px); clip-path: inset(12% 0 48% 0); }
  6% { text-shadow: -2px 0 #ff2a6d, 2px 0 #05d9e8; transform: translate(1px, 0); clip-path: inset(55% 0 8% 0); }
  9% { text-shadow: 1px 0 #ff2a6d, -1px 0 #05d9e8; transform: none; clip-path: none; }
  12%, 100% { text-shadow: none; transform: none; clip-path: none; }
}
@media (hover: hover) {
  .collect:hover, .back:hover, .look-link:hover, .cut-btn:hover, .time-now:hover, .time-play:hover { animation: glitch-slow 2.4s steps(1, end) infinite; }
}
.fx { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; }
/* time: the scrubber and the chronicle, under the pile */
.time { max-width: 1180px; margin: 14px auto 0; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "play range" "meta meta"; gap: 8px 14px; align-items: center; }
.time[hidden] { display: none; }
.time-play { grid-area: play; width: 38px; height: 38px; border: 1px solid #2b5f3a; background: rgba(95, 245, 138, .05); color: var(--phos); font-size: 13px; cursor: pointer; }
.time-play:hover, .time-play:focus-visible { border-color: var(--phos); background: rgba(95, 245, 138, .12); outline: none; }
.time-range { grid-area: range; width: 100%; accent-color: #5ff58a; height: 22px; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none; }
.time-range::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, #1f3a27 0 40%, #5ff58a 40% calc(40% + 2px), #12241a calc(40% + 2px)); }
.time-range::-moz-range-track { height: 3px; background: linear-gradient(90deg, #1f3a27 0 40%, #5ff58a 40% calc(40% + 2px), #12241a calc(40% + 2px)); }
.time-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: #5ff58a; box-shadow: 0 0 10px #5ff58a; }
.time-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #5ff58a; box-shadow: 0 0 10px #5ff58a; }
.time-meta { grid-area: meta; display: flex; justify-content: center; align-items: center; gap: 14px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.time-now { border: 1px solid var(--edge); background: transparent; color: var(--bone); font: inherit; letter-spacing: .1em; padding: 5px 10px; cursor: pointer; }
.time-now:hover, .time-now:focus-visible { border-color: var(--phos); color: var(--phos); outline: none; }
.chronicle { max-width: 1180px; margin: 18px auto 0; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px 40px; font-size: 12px; color: #aab3aa; }
.chronicle h3 { font: 400 10px/1 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.chronicle b { color: var(--bone); font-weight: 500; }
.chronicle span { color: var(--dim); }
.chronicle p b { color: var(--phos); }
.chronicle ul { list-style: none; padding: 0; display: grid; gap: 5px; }
.chronicle li::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--c); box-shadow: 0 0 6px var(--c); }
@media (max-width: 760px) { .chronicle { grid-template-columns: 1fr; } }
.rain { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; opacity: .25; }
.skull {
  position: absolute; z-index: 1; border: 0; padding: 0; margin: 0; background: transparent; color: inherit;
  border-radius: 46% 46% 40% 40%; cursor: zoom-in; -webkit-tap-highlight-color: transparent;
}
.skull::after { /* a light on it, when pointed at */
  content: ''; position: absolute; inset: -12%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(95, 245, 138, .28), rgba(95, 245, 138, .08) 60%, transparent);
  mix-blend-mode: screen; opacity: 0; transition: opacity .25s ease;
}
.skull::before { /* its number and state */
  content: attr(data-label); position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -2px); white-space: nowrap;
  font: 500 10px/1 'IBM Plex Mono', monospace; letter-spacing: .08em; color: var(--c, var(--phos)); text-shadow: 0 0 6px #000, 0 0 2px #000;
  background: rgba(0, 0, 0, .7); padding: 4px 6px; opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.skull:hover::after, .skull:focus-visible::after, .skull:hover::before, .skull:focus-visible::before { opacity: 1; }
.skull:focus-visible { outline: 1px solid var(--c, var(--phos)); outline-offset: 2px; }
@media (max-width: 760px) {
  .skull::before { display: none; }
}

/* ---------- about the work, at the bottom ---------- */
.about-work { max-width: 720px; margin: 0 auto; padding: clamp(40px, 8vw, 90px) clamp(16px, 4vw, 40px) clamp(50px, 9vw, 110px); border-top: 1px solid var(--edge); }
.about-work h2 { font: 300 clamp(30px, 4.6vw, 44px)/1.1 'IBM Plex Sans', sans-serif; letter-spacing: -.01em; margin: 10px 0 26px; color: var(--bone); }
.about-work p:not(.kicker) { color: #aab3aa; font-size: clamp(15px, 1.5vw, 17px); line-height: 1.75; margin-top: 18px; }
.about-work h2 + p { color: var(--bone); }

/* ---------- looking closer ---------- */
.look {
  border: 1px solid var(--edge);
  background: #070807;
  color: var(--bone);
  padding: 0;
  margin: auto;   /* the reset above took the dialog's own centring away */
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}
.look::backdrop { background: rgba(0, 0, 0, .82); backdrop-filter: blur(3px); }
.look-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.look-fig { position: relative; background: #000; aspect-ratio: 4 / 5; overflow: hidden; }
.look-fig canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.look-fig iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .8s ease; }
.look-fig iframe.is-on { opacity: 1; pointer-events: auto; }
.look-live-tag { position: absolute; left: 10px; bottom: 10px; z-index: 2; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--phos); background: rgba(0, 0, 0, .7); padding: 4px 7px; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.look-live-tag.is-on { opacity: 1; }
.look-loading { position: absolute; left: 10px; bottom: 10px; z-index: 2; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); background: rgba(0, 0, 0, .7); padding: 4px 7px; opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.look-loading.is-on { opacity: 1; }
.look-loading::after { content: ''; display: inline-block; width: 1.6em; text-align: left; animation: oss-dots 1.2s steps(4, end) infinite; }
@keyframes oss-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.look-ov { /* scanlines and vignette, as the work has them */
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 46%, rgba(0,0,0,0) 45%, rgba(0,0,0,.78) 100%), repeating-linear-gradient(to bottom, rgba(0,0,0,.22) 0, rgba(0,0,0,.22) 1px, rgba(0,0,0,0) 1px, rgba(0,0,0,0) 3px);
}
.look-text { padding: clamp(20px, 3vw, 34px); display: flex; flex-direction: column; gap: 14px; }
.look-text h2 { font: 300 30px/1.1 'IBM Plex Sans', sans-serif; letter-spacing: -.01em; padding-right: 30px; }
.look-state { font-size: 13px; letter-spacing: .12em; }
#look-state { color: var(--c, var(--phos)); text-shadow: 0 0 10px var(--c, var(--phos)); margin-right: .8em; }
.look-note { color: var(--dim); font-size: 11px; }
.look-age { font-size: 12px; color: #aab3aa; letter-spacing: .05em; }
.look-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 12px; border-top: 1px solid var(--edge); padding-top: 14px; }
.look-facts dt { color: var(--faint); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.look-holder { grid-column: 1 / -1; }
.look-holder a { color: var(--phos); text-decoration: none; border-bottom: 1px solid rgba(95, 245, 138, .35); }
.look-holder a:hover, .look-holder a:focus-visible { border-bottom-color: var(--phos); }
.look-unknown { color: var(--dim); }
.look-traits { list-style: none; padding: 12px 0 0; border-top: 1px solid var(--edge); display: grid; gap: 4px; font-size: 11px; letter-spacing: .06em; color: #aab3aa; }
.look-traits span { display: inline-block; min-width: 92px; color: var(--faint); }
.look-link { margin-top: auto; display: inline-block; padding: 12px 14px; border: 1px solid #2b5f3a; color: var(--phos); text-decoration: none; font: 400 12px/1.3 'IBM Plex Mono', monospace; letter-spacing: .06em; text-transform: uppercase; }
.look-link:hover, .look-link:focus-visible { background: rgba(95, 245, 138, .08); border-color: var(--phos); }
.look-nav { display: flex; gap: 8px; }
.look-nav button, .look-close { background: transparent; border: 1px solid var(--edge); color: var(--bone); font: 400 16px/1 'IBM Plex Mono', monospace; padding: 9px 14px; cursor: pointer; }
.look-nav button:hover:not(:disabled), .look-close:hover { border-color: var(--phos); color: var(--phos); }
.look-nav button:disabled { opacity: .3; cursor: default; }
.look-close { position: absolute; top: 10px; right: 10px; padding: 6px 11px; font-size: 20px; background: rgba(7, 8, 7, .8); }
@media (max-width: 760px) {
  .look-inner { grid-template-columns: 1fr; }
  .look-fig { aspect-ratio: auto; height: min(60vh, calc((100vw - 24px) * 1.25)); }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
