:root {
  --ink: #f4f2ee;
  --dim: rgba(240, 236, 228, 0.66);
  --faint: rgba(240, 236, 228, 0.38);
  --line: rgba(240, 236, 228, 0.16);
  --thin: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --pad: max(18px, env(safe-area-inset-left));
  --top: max(16px, env(safe-area-inset-top));
  --bot: max(16px, env(safe-area-inset-bottom));
  --slow: cubic-bezier(.45, 0, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); overflow: hidden; }
body { font: 300 15px/1.55 var(--thin); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 1px solid rgba(255, 255, 255, .55); outline-offset: 4px; }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
#veil { position: fixed; inset: 0; background: #000; pointer-events: none; transition: opacity 2.6s ease; }
#veil.off { opacity: 0; }

/* ---- corners: the credit and the version switch ---- */
#credit { position: fixed; left: var(--pad); top: var(--top); z-index: 5; pointer-events: none; }
#credit h1 {
  margin: 0; font: 300 11px/1.4 var(--thin); letter-spacing: .24em; text-transform: uppercase; color: var(--dim);
  text-shadow: 0 0 12px rgba(0, 0, 0, .9);
}
#credit .person { color: var(--faint); }
#ver {
  position: fixed; right: var(--pad); top: var(--top); z-index: 5; font: 300 11px/1.4 var(--thin);
  letter-spacing: .2em; color: var(--faint);
}
#ver a { text-decoration: none; color: var(--faint); padding: 8px 2px; transition: color .4s; }
#ver a:hover, #ver a:focus-visible { color: var(--ink); }
#ver [aria-current] { color: var(--ink); }
@media (max-width: 560px) {
  #credit h1 { font-size: 9.5px; letter-spacing: .2em; max-width: 64vw; }
  #credit .dot { display: none; }
  #credit .person { display: block; }
}

/* ---- hotspots over the gear ---- */
#room { position: fixed; inset: 0; pointer-events: none; }
#hots { position: absolute; inset: 0; }
.hot {
  position: absolute; left: 0; top: 0; display: block; pointer-events: auto; border-radius: 10px;
  transition: opacity .6s;
}
.hot span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hot:focus-visible { outline: none; } /* the glow, a soft ring and the tape label show focus */
#panel:focus-visible, #crate:focus-visible { outline: none; }
.hot.pad { border-radius: 4px; }
body.open .hot:not(.pad), body.browse .hot { pointer-events: none; visibility: hidden; }
body:not(.open-line) .hot.pad { pointer-events: none; }            /* still reachable with Tab, after the MPC */
body.open:not(.open-line) .hot.pad { visibility: hidden; }
.hot:focus-visible { box-shadow: 0 0 0 1px rgba(255, 236, 210, .32), 0 0 28px 4px rgba(255, 210, 160, .16); }

/* the little label: a strip of tape with the name written on it */
#tag {
  position: fixed; left: 0; top: 0; margin: 0; padding: 5px 11px 4px; pointer-events: none; white-space: nowrap;
  font: 300 13px/1.2 var(--thin); letter-spacing: .06em; color: #f6f1e7;
  background: rgba(14, 12, 10, .62); border-top: 1px solid rgba(255, 245, 225, .18); border-bottom: 1px solid rgba(255, 245, 225, .08);
  transform: translate(-50%, -100%) rotate(-2.2deg); opacity: 0; transition: opacity .5s ease;
  text-shadow: 0 0 8px rgba(255, 220, 170, .35); backdrop-filter: blur(2px);
}
#tag.on { opacity: 1; }
#tag small { display: block; font: 400 9px/1.3 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }

#hint {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bot) + 38px); margin: 0; text-align: center; pointer-events: none;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--faint); opacity: 0; transition: opacity 1.6s ease;
}
#hint.on { opacity: 1; }
body.open #hint, body.browse #hint { opacity: 0; }

/* ---- the project panel, fading in over the photo ---- */
#panel {
  position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; max-height: 58vh; max-height: 58dvh; overflow-y: auto;
  padding: 26px var(--pad) calc(var(--bot) + 10px);
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,.78) 34px, rgba(0,0,0,.9) 100%);
  opacity: 0; transform: translateY(14px); transition: opacity 1.1s ease, transform 1.4s var(--slow);
  overscroll-behavior: contain; scrollbar-width: none;
}
#panel.in { opacity: 1; transform: none; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  #panel {
    left: auto; top: 0; width: min(440px, 36vw); max-height: none; display: flex; flex-direction: column; justify-content: center;
    padding: 70px 46px 60px 40px; transform: translateX(16px);
    background: linear-gradient(to right, rgba(0,0,0,0) 0, rgba(0,0,0,.72) 46px, rgba(0,0,0,.86) 100%);
  }
}
.kicker { margin: 0 0 8px; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--faint); font-weight: 400; }
#p-name { margin: 0; font: 200 clamp(30px, 8.4vw, 50px)/1.05 var(--thin); letter-spacing: .03em; color: #fff; }
#p-pitch { margin: 12px 0 14px; font-size: 16px; color: var(--ink); }
#p-facts { list-style: none; margin: 0 0 14px; padding: 0; }
#p-facts li { position: relative; padding: 6px 0 6px 18px; color: var(--dim); font-size: 14px; border-top: 1px solid var(--line); }
#p-facts li::before { content: "–"; position: absolute; left: 0; color: var(--faint); }
#p-tags { margin: 0 0 12px; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); }
#p-pads, #p-links { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
#p-pads:empty { display: none; }
#p-links a, #p-pads a, #p-back, #crate-back {
  text-decoration: none; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.28); transition: border-color .4s, color .4s;
}
#p-links a { font-size: 16px; letter-spacing: .04em; }
#p-links a::after { content: " ↗"; color: var(--faint); }
#p-links a:hover, #p-pads a:hover, #p-back:hover, #crate-back:hover { border-color: #fff; }
#p-pads a { font-size: 14px; color: var(--dim); }
#p-pads a::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; background: var(--pad-c, #fff); box-shadow: 0 0 10px var(--pad-c, #fff); vertical-align: 1px; }
#p-links .soon { font-size: 14px; color: var(--faint); }
#p-back, #crate-back { display: inline-block; margin-top: 10px; font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--faint); border-color: transparent; }

/* ---- the crate: flip through the records ---- */
#crate {
  position: fixed; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--top) + 40px) var(--pad) calc(var(--bot) + 20px);
  background: radial-gradient(ellipse at 50% 60%, rgba(0,0,0,.55), rgba(0,0,0,.9));
  opacity: 0; transition: opacity 1.1s ease;
}
#crate.in { opacity: 1; }
#crate-title { position: absolute; top: calc(var(--top) + 34px); left: 0; right: 0; text-align: center; }
#records {
  position: relative; list-style: none; margin: 0; padding: 0; width: min(78vw, 46vh, 420px); aspect-ratio: 1;
  perspective: 1300px; perspective-origin: 50% 0%; transform-style: preserve-3d; touch-action: pan-y;
}
.rec {
  position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 50% 100%;
  transition: transform 1.2s var(--slow), opacity 1s ease, filter 1s ease; cursor: pointer;
}
.sleeve { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 1.3s var(--slow); }
.rec.turned .sleeve { transform: rotateY(180deg); }
.disc {
  position: absolute; top: 3%; left: 3%; width: 94%; height: 94%; border-radius: 50%;
  background: radial-gradient(circle, #050505 0 2%, transparent 2.2%), radial-gradient(circle, var(--label) 0 17%, transparent 17.4%),
    repeating-radial-gradient(circle, #0b0b0b 0 1px, #151515 1.5px 2.5px), #0b0b0b;
  background-size: 100% 100%, 100% 100%, 100% 100%; box-shadow: 0 10px 40px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.05);
  transform: translateX(0) rotate(0); transition: transform 1.6s var(--slow) .25s, opacity .6s; opacity: 0;
}
.disc::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0 10%, rgba(255,255,255,.09) 14%, transparent 20% 60%, rgba(255,255,255,.07) 64%, transparent 70%); }
.rec[aria-current="true"] .disc { opacity: 1; transform: translateX(34%) rotate(40deg); }
.rec[aria-current="true"].turned .disc { transform: translateX(0) rotate(0); opacity: 0; transition-delay: 0s; }
.side {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
  background: #0b0b0b; box-shadow: 0 30px 60px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.06);
}
.front img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85) contrast(1.05); }
.front::after { /* worn cardboard and ring wear */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0 40%, rgba(255,255,255,.07) 41% 42%, transparent 43%),
              linear-gradient(135deg, rgba(255,255,255,.08), transparent 40%, rgba(0,0,0,.35));
  mix-blend-mode: screen;
}
.front h3 {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 40px 18px 14px;
  font: 300 20px/1.15 var(--thin); letter-spacing: .05em; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.82), transparent);
}
.front h3 small { display: block; font: 400 9px/1.6 var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--faint); }
.front.type { display: flex; align-items: center; justify-content: center; background: #050505; }
.front.type .blocks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 58%; opacity: .9; }
.front.type .blocks i { aspect-ratio: 1; border: 1px solid rgba(255,255,255,.35); }
.front.type .blocks i:nth-child(3n) { background: rgba(255,255,255,.12); }
.front.type .blocks i:nth-child(7n+2) { background: rgba(140,220,255,.35); border-color: rgba(140,220,255,.6); }
#records { margin-right: 18%; }
@media (max-width: 560px) { #records { margin-right: 14%; } }
.back {
  transform: rotateY(180deg); padding: 18px 18px 14px; overflow-y: auto; background: #0d0c0a;
  font-size: 12.5px; line-height: 1.5; color: var(--dim); scrollbar-width: none;
}
.back h4 { margin: 0 0 6px; font: 300 17px/1.2 var(--thin); color: #fff; letter-spacing: .03em; }
.back .lbl { margin: 10px 0 2px; font: 400 9px/1.4 var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--faint); }
.back p { margin: 0 0 4px; }
.back ol { margin: 0; padding-left: 18px; }
.back li { margin: 2px 0; }
.back a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.3); margin-right: 14px; }
#crate-hint { margin: 30px 0 0; font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--faint); text-align: center; }
#crate-back { margin-top: 12px; }

/* ---- small toggles, bottom right ---- */
#toggles { position: fixed; right: var(--pad); bottom: var(--bot); margin: 0; z-index: 5; display: flex; gap: 18px; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; }
#toggles a { color: var(--faint); text-decoration: none; padding: 8px 0; transition: color .4s; }
#toggles a:hover, #toggles a[aria-pressed="true"] { color: var(--ink); }
body.open #toggles, body.browse #toggles { opacity: .5; }
@media (max-width: 899px), (max-aspect-ratio: 1/1) { body.open #toggles { display: none; } }
@media (max-width: 560px) { #crate-title .long { display: none; } #records { width: min(70vw, 46vh, 420px); } }

/* no-script list */
.plain { position: relative; z-index: 6; padding: 80px var(--pad); max-width: 640px; }
.plain a { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  #panel, #panel.in { transform: none; }
  .rec, .sleeve { transition-duration: .01s; }
}

/* ---- keyboard: skip link, shortcut overlay, live region ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; left: var(--pad); top: var(--top); z-index: 20; padding: 8px 12px; background: #000; color: #fff;
  font: 400 11px/1.2 var(--mono); letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  border: 1px solid rgba(255,255,255,.4); transform: translateY(-200%); transition: transform .3s;
}
.skip:focus { transform: none; }
#keys { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.72); padding: var(--pad); }
#keys .keys-card { max-width: 520px; width: 100%; max-height: 86vh; overflow-y: auto; padding: 26px 28px 18px; background: rgba(10,9,8,.92); border: 1px solid var(--line); }
#keys h2 { margin: 0 0 14px; font: 400 10px/1.4 var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--faint); }
#keys dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 0; font-size: 14px; }
#keys dt { font: 400 12px/1.6 var(--mono); color: #fff; white-space: nowrap; }
#keys dd { margin: 0; color: var(--dim); }
#keys .keys-foot { margin: 16px 0 0; font: 400 10px/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
#keys .keys-foot a { color: var(--ink); }
#toggles a:focus-visible, #ver a:focus-visible, #p-links a:focus-visible, #p-pads a:focus-visible, #p-back:focus-visible, #crate-back:focus-visible, .back a:focus-visible {
  outline: 1px solid rgba(255,255,255,.6); outline-offset: 4px;
}
.rec[aria-current="true"] .sleeve:focus-within, #records:focus-visible .rec[aria-current="true"] .side { box-shadow: 0 0 0 1px rgba(255,255,255,.45), 0 30px 60px rgba(0,0,0,.7); }

/* GitHub and LinkedIn, quietly under the credit (wide screens; on phones they live in the About panel) */
#social { position: fixed; left: var(--pad); top: calc(var(--top) + 20px); z-index: 5; margin: 0; font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); }
#social a { color: var(--faint); text-decoration: none; padding: 6px 0; transition: color .4s; }
#social a:hover, #social a:focus-visible { color: var(--ink); }
#social a:focus-visible { outline: 1px solid rgba(255,255,255,.6); outline-offset: 4px; }
@media (max-width: 899px) { #social { display: none; } }
body.open #social, body.browse #social { opacity: .4; }
/* ---- the song: controls, and the room stepping back during the opening shots ---- */
body.song-intro .hot:not([href="#cassette"]) { visibility: hidden; pointer-events: none; }
body.song-intro #hint, body.song-intro #tag { opacity: 0; }
#song-ui {
  position: fixed; left: var(--pad); bottom: var(--bot); z-index: 5; margin: 0; max-width: min(520px, calc(100vw - 2 * var(--pad) - 150px));
  opacity: 0; transform: translateY(8px); transition: opacity 1.2s ease, transform 1.4s var(--slow);
}
#song-ui.in { opacity: 1; transform: none; }
#song-ui p { margin: 0; }
#song-ui .now { font: 300 13px/1.35 var(--thin); color: var(--ink); text-shadow: 0 0 10px #000; }
#song-ui .now .a { display: block; font-size: 11px; letter-spacing: .08em; color: var(--dim); }
#song-ui .ctl { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--faint); }
#song-ui .ctl a { color: var(--dim); text-decoration: none; padding: 6px 0; }
#song-ui .ctl a:hover, #song-ui .ctl a:focus-visible { color: #fff; }
#song-ui .ctl a:focus-visible, #song-ui input:focus-visible { outline: 1px solid rgba(255,255,255,.6); outline-offset: 4px; }
#song-ui label { display: inline-flex; align-items: center; gap: 8px; }
#song-ui input[type=range] { width: 84px; accent-color: #e9e2d6; height: 2px; }
@media (max-width: 560px) {
  #song-ui { max-width: calc(100vw - 2 * var(--pad)); bottom: calc(var(--bot) + 30px); }
}
body.open #song-ui { opacity: .25; }
body.song-on .hot[href="#cassette"]:focus-visible { box-shadow: none; }
