:root {
  --ink: #0a0a09;
  --paper: #f2efe6;
  --dim: rgba(242, 239, 230, .62);
  --hair: rgba(242, 239, 230, .5);
  --hot: #ff5a1f;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "IBM Plex Sans Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --gut: clamp(16px, 2.4vw, 32px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); }
body { font: 400 15px/1.45 var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
a { color: inherit; }
:focus-visible { outline: 1.5px solid var(--hot); outline-offset: 3px; }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; background: var(--ink); transition: opacity .5s ease; }
#gl.cut { animation: cut .55s ease; }
@keyframes cut { 0% { opacity: 0; } 100% { opacity: 1; } }
body.booting #gl { opacity: 0; }

/* ------------------------------------------------------------ the instruments */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; font-family: var(--mono); }
#hud::before, #hud::after { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; }
#hud::before { top: 0; height: 120px; background: linear-gradient(rgba(0,0,0,.42), rgba(0,0,0,0)); }
#hud::after { bottom: 0; height: 220px; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.55)); }
#hud > * { position: absolute; z-index: 1; }
#hud a, #hud button { pointer-events: auto; }
.txt-sh, #slate, #here, #meter, #ctrl, #gauge { text-shadow: 0 1px 2px rgba(0,0,0,.55), 0 0 12px rgba(0,0,0,.25); }

#slate { top: var(--gut); left: var(--gut); right: var(--gut); display: flex; justify-content: space-between; align-items: baseline; }
#name { text-decoration: none; font: 500 11px/1 var(--mono); letter-spacing: .32em; text-transform: uppercase; }
#name span { border-bottom: 1px solid transparent; padding-bottom: 3px; }
#name:hover span { border-color: var(--paper); }
#top { display: flex; gap: 26px; font: 400 11px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; }
#top a, #top button { text-decoration: none; padding: 6px 0; }
#top a:hover, #top button:hover, #top button[aria-expanded="true"] { color: var(--hot); }

/* where you are */
#here { left: var(--gut); bottom: calc(var(--gut) + 62px); max-width: min(560px, 60vw); transition: opacity .35s ease; }
#here p { margin: 0; }
#here .n { font: 400 11px/1 var(--mono); letter-spacing: .18em; color: var(--hot); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
#here .n::after { content: ""; width: 44px; height: 1px; background: var(--hot); opacity: .8; }
#here .client { font: 400 11px/1.2 var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
#here h1 { font: 300 clamp(34px, 5.2vw, 76px)/.95 var(--sans); letter-spacing: -.02em; margin: 0 0 18px; text-wrap: balance; }
#openBtn { font: 500 11px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; padding: 11px 16px 10px; border: 1px solid var(--paper); background: rgba(10,10,9,.18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .2s, color .2s, opacity .3s; }
#openBtn:hover { background: var(--paper); color: var(--ink); text-shadow: none; }
#hud.moving #openBtn { opacity: .35; }

/* the doorway's label rides on the doorway */
#tags { inset: 0; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; width: 190px; opacity: 0; will-change: transform, opacity; font: 400 10.5px/1.25 var(--mono); }
.tag .lead { position: absolute; left: 0; top: 0; height: 1px; background: var(--paper); transform-origin: 0 50%; box-shadow: 0 0 2px rgba(0,0,0,.6); }
.tag .lead::after { content: ""; position: absolute; right: -3px; top: -2.5px; width: 6px; height: 6px; border-radius: 50%; background: var(--hot); }
.tag .box { display: none; }
.tag .tx { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 2px 0 0 6px; border-left: 1px solid var(--paper); text-shadow: 0 1px 2px rgba(0,0,0,.7), 0 0 10px rgba(0,0,0,.35); }
.tag.left .tx { text-align: right; padding: 2px 6px 0 0; border-left: 0; border-right: 1px solid var(--paper); }
.tag .c { letter-spacing: .2em; text-transform: uppercase; color: var(--dim); font-size: 9.5px; }
.tag .t { font: 400 15px/1.1 var(--sans); letter-spacing: .01em; }

/* the scale: a counter and a sliding log ruler */
#meter { right: var(--gut); bottom: var(--gut); display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: end; column-gap: 22px; row-gap: 6px; }
#ruler { grid-column: 1; grid-row: 1 / span 2; position: relative; width: clamp(220px, 26vw, 380px); height: 34px; }
#ruler::after { content: ""; position: absolute; left: 50%; top: -6px; bottom: 11px; width: 1px; background: var(--hot); }
#rulerCv { width: 100%; height: 100%; display: block; -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
#scale { grid-column: 2; grid-row: 1; font: 300 30px/1 var(--mono); letter-spacing: -.02em; white-space: nowrap; }
#scale .x { font-size: 22px; }
#scale sup { font-size: 15px; vertical-align: 12px; margin-left: 2px; font-variant-numeric: tabular-nums; display: inline-block; min-width: 4.2ch; }
#tc { grid-column: 2; grid-row: 2; font: 400 10px/1 var(--mono); letter-spacing: .2em; color: var(--dim); font-variant-numeric: tabular-nums; }
#hud.moving #tc { color: var(--hot); }

/* the index: a sounding line down the right edge, every arrival at its true depth */
#gauge { right: var(--gut); top: 84px; bottom: 132px; width: 230px; pointer-events: none; }
#gaugeIn { position: absolute; right: 0; top: 0; bottom: 0; width: 100%; }
#gaugeIn::before { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: var(--hair); }
#stations { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
#stations li { position: absolute; right: 0; top: 0; width: 100%; height: 0; }
#stations li::before { content: ""; position: absolute; right: 0; top: var(--y); width: 9px; height: 1px; background: var(--paper); }
#stations a { position: absolute; right: 16px; top: calc(var(--ly) - 7px); display: flex; gap: 8px; align-items: baseline; justify-content: flex-end; text-decoration: none; white-space: nowrap; font: 400 10px/14px var(--mono); letter-spacing: .06em; color: var(--dim); pointer-events: auto; opacity: 0; transform: translateX(6px); transition: opacity .25s ease, transform .25s ease, color .15s; }
#stations a b { font-weight: 400; color: rgba(242,239,230,.4); font-size: 9px; letter-spacing: .1em; }
#stations a span { font: 400 12px/14px var(--sans); letter-spacing: .02em; }
#stations a::after { content: ""; position: absolute; right: -16px; top: 7px; width: 14px; height: 1px; background: rgba(242,239,230,.25); transform-origin: 100% 0; }
#stations a:hover, #stations a:focus-visible { color: var(--paper); }
#stations a.on { color: var(--hot); opacity: 1 !important; transform: none; }
#stations a.on b { color: var(--hot); }
#gauge:hover #stations a, body.gauge-open #stations a, #stations a:focus-visible { opacity: 1; transform: none; }
#gauge { pointer-events: auto; }
#gauge::before { content: ""; position: absolute; right: -10px; top: -10px; bottom: -10px; width: 40px; }
#gauge::after { content: ""; position: fixed; top: 0; bottom: 0; right: 0; width: 340px; background: linear-gradient(90deg, rgba(10,10,9,0), rgba(10,10,9,.72) 55%); opacity: 0; transition: opacity .3s ease; pointer-events: none; z-index: -1; }
#gauge:hover::after, body.gauge-open #gauge::after { opacity: 1; }
#needle { position: absolute; right: -5px; top: -1px; width: 11px; height: 2px; background: var(--hot); will-change: transform; }
#needle::before { content: ""; position: absolute; right: 11px; top: -3px; border: 4px solid transparent; border-right-color: var(--hot); border-left: 0; }

#ctrl { left: var(--gut); bottom: var(--gut); display: flex; gap: 2px; font: 500 10px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; }
#ctrl button { padding: 10px 12px 9px; border: 1px solid rgba(242,239,230,.35); background: rgba(10,10,9,.15); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
#ctrl button:hover { border-color: var(--paper); }
#ctrl #playBtn { min-width: 64px; }
#ctrl button[aria-pressed="true"] { color: var(--hot); border-color: var(--hot); }

body.plate-open #here, body.plate-open #tags, body.plate-open #ctrl { opacity: 0; pointer-events: none; }
body.plate-open #here *, body.plate-open #ctrl * { pointer-events: none; }
body.plate-open #gauge { opacity: 0; pointer-events: none; }
body.plate-open #gauge * { pointer-events: none !important; }
body.plate-open #meter { opacity: .0; }
#here, #ctrl, #gauge, #meter { transition: opacity .35s ease; }

/* ------------------------------------------------------------ the plate: the real work, beside the frame it came from */
#plate { position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 62vw); z-index: 5; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: rgba(12, 12, 11, .965); border-left: 1px solid rgba(242,239,230,.14); transform: translateX(104%); transition: transform .45s cubic-bezier(.2,.7,.1,1); outline: none; }
#plate.on { transform: none; }
#plate .in { padding: 0 clamp(20px, 3.4vw, 48px) 80px; }
#plate .bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 18px 0 14px; margin-bottom: 18px; background: linear-gradient(rgba(12,12,11,.98) 70%, rgba(12,12,11,0)); font: 400 11px/1 var(--mono); letter-spacing: .24em; }
#plate .bar .n { color: var(--hot); }
#plate .close { font: 500 11px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; padding: 9px 12px; border: 1px solid rgba(242,239,230,.35); }
#plate .close:hover { border-color: var(--paper); }
#plate .head { padding: 10px 0 34px; border-bottom: 1px solid rgba(242,239,230,.14); margin-bottom: 34px; }
#plate .head .client { margin: 0 0 10px; font: 400 11px/1.2 var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--dim); }
#plate .head h2 { margin: 0 0 22px; font: 300 clamp(38px, 5vw, 64px)/.98 var(--sans); letter-spacing: -.02em; }
#plate .head .desc { margin: 0 0 22px; font: 400 18px/1.5 var(--sans); max-width: 38em; color: rgba(242,239,230,.9); }
#plate .head .role { margin: 0 0 14px; font: 400 12px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--hot); }
#plate .head .contact { display: flex; gap: 22px; flex-wrap: wrap; font: 400 13px/1.4 var(--mono); }
#plate .credits { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 22px; font: 400 12.5px/1.35 var(--sans); }
#plate .credits dt { font: 400 9.5px/1.2 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin-bottom: 2px; }
#plate .credits dd { margin: 0; }
#plate .sec { margin: 0 0 46px; }
#plate .sec h3 { margin: 0 0 8px; font: 500 11px/1.2 var(--mono); letter-spacing: .24em; text-transform: uppercase; }
#plate .sec .txt { margin: 0 0 18px; font: 400 15px/1.5 var(--sans); color: rgba(242,239,230,.78); max-width: 40em; }
#plate .films { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; }
#plate .films.one { grid-template-columns: 1fr; }
#plate .films.vertical { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
#plate .film { margin: 0; }
#plate .film .frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
#plate .films.vertical .frame { aspect-ratio: 9 / 16; }
#plate .film img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
#plate .film iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#plate .film .play { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-start; padding: 12px; }
#plate .film .play span { font: 500 10px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; padding: 9px 12px 8px; background: rgba(10,10,9,.72); border: 1px solid rgba(242,239,230,.55); transition: background .2s, color .2s; }
#plate .film .play:hover span { background: var(--paper); color: var(--ink); }
#plate .film figcaption { padding: 8px 0 0; font: 400 10.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
#plate .group { display: grid; gap: 12px; margin-top: 16px; }
#plate .group.n2 { grid-template-columns: 1fr 1fr; }
#plate .group.n3 { grid-template-columns: 1fr 1fr 1fr; }
#plate .shot { margin: 0; background: #000; }
#plate .shot img { width: 100%; height: auto; display: block; }
#plate .radio { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(242,239,230,.14); }
#plate .spot { display: grid; grid-template-columns: 34px 1fr auto; grid-template-rows: auto 18px; column-gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(242,239,230,.14); }
#plate .spot .pp { grid-row: 1 / span 2; width: 34px; height: 34px; border: 1px solid rgba(242,239,230,.55); border-radius: 50%; position: relative; }
#plate .spot .pp::after { content: ""; position: absolute; left: 13px; top: 10px; border: 7px solid transparent; border-left: 10px solid var(--paper); border-right: 0; }
#plate .spot.on .pp::after { left: 11px; top: 11px; width: 10px; height: 12px; border: 0; border-left: 3px solid var(--paper); border-right: 3px solid var(--paper); box-sizing: border-box; }
#plate .spot .t { font: 400 14px/1.3 var(--sans); }
#plate .spot .time { font: 400 11px/1 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }
#plate .spot .bar { grid-column: 2 / span 2; height: 18px; position: relative; cursor: pointer; padding: 0; margin: 0; background: none; position: relative; }
#plate .spot .bar::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 1px; background: rgba(242,239,230,.3); }
#plate .spot .bar i { position: absolute; left: 0; top: 7px; height: 3px; background: var(--hot); width: 0; }
#plate .pn { border-top: 1px solid rgba(242,239,230,.14); padding-top: 22px; }
#plate .pn a { display: flex; flex-direction: column; gap: 6px; text-decoration: none; }
#plate .pn small { font: 400 10px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--hot); }
#plate .pn span { font: 300 28px/1.05 var(--sans); }
#plate .pn a:hover span { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
#plate .xp { list-style: none; margin: 0; padding: 0; }
#plate .xp li { display: grid; grid-template-columns: 150px 1fr; gap: 4px 18px; padding: 14px 0; border-bottom: 1px solid rgba(242,239,230,.12); }
#plate .xp .d { font: 400 11px/1.4 var(--mono); letter-spacing: .1em; color: var(--dim); grid-row: 1 / span 2; }
#plate .xp .r { font: 500 15px/1.3 var(--sans); }
#plate .xp .x { font: 400 14px/1.45 var(--sans); color: rgba(242,239,230,.75); }

/* ------------------------------------------------------------ no WebGL: the frames in a column */
#still { display: none; }
body.nogl { overflow: auto; }
body.nogl #gl, body.nogl #meter, body.nogl #ctrl, body.nogl #tags, body.nogl #here { display: none; }
body.nogl #hud { position: fixed; pointer-events: none; }
body.nogl #still { display: block; padding: 70px 0 40px; }
body.nogl #still figure { margin: 0 0 6px; position: relative; }
body.nogl #still img { width: 100%; height: auto; display: block; }
body.nogl #still figcaption { position: absolute; left: var(--gut); bottom: var(--gut); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
body.nogl #still .c { font: 400 11px/1 var(--mono); letter-spacing: .24em; }
body.nogl #still b { font: 300 32px/1 var(--sans); }
body.nogl #still button { font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; padding: 10px 14px; border: 1px solid var(--paper); background: rgba(0,0,0,.3); }
body.nogl #gauge { display: none; }

/* ------------------------------------------------------------ phone */
@media (max-width: 699px), (max-height: 520px) and (max-width: 940px) {
  :root { --gut: 16px; }
  #hud::after { height: 260px; }
  #top { gap: 18px; }
  #here { bottom: calc(var(--gut) + 84px); max-width: calc(100vw - 72px); }
  #here h1 { font-size: clamp(32px, 9.6vw, 44px); margin-bottom: 14px; }
  #here .n { margin-bottom: 10px; }
  #meter { left: var(--gut); right: var(--gut); bottom: calc(var(--gut) + 42px); grid-template-columns: 1fr auto; column-gap: 14px; }
  #ruler { width: 100%; height: 30px; }
  #scale { font-size: 22px; }
  #scale .x { font-size: 16px; }
  #scale sup { font-size: 12px; vertical-align: 9px; }
  #ctrl { left: var(--gut); right: var(--gut); bottom: var(--gut); }
  #ctrl button { flex: 1; padding: 11px 0 10px; }
  #gauge { top: 64px; bottom: 300px; width: 30px; right: 8px; }
  #gauge #stations a { display: none; }
  body.gauge-open #gauge { position: fixed; inset: 0; width: auto; right: 0; top: 0; bottom: 0; z-index: 4; background: rgba(10,10,9,.94); pointer-events: auto; }
  body.gauge-open #gaugeIn { right: 22px; top: 70px; bottom: 30px; width: calc(100% - 44px); }
  body.gauge-open #gauge #stations a { display: flex; opacity: 1; transform: none; right: 22px; font-size: 11px; line-height: 26px; top: calc(var(--ly) - 13px); }
  body.gauge-open #stations a span { font-size: 17px; line-height: 26px; }
  body.gauge-open #stations a b { font-size: 10px; }
  body.gauge-open #stations a::after { top: 13px; right: -22px; width: 20px; }
  body.gauge-open #needle { right: -5px; }
  body.gauge-open #top { position: relative; z-index: 6; }
  #plate { width: 100vw; border-left: 0; }
  #plate .films { grid-template-columns: 1fr; }
  #plate .films.vertical { grid-template-columns: 1fr 1fr; }
  #plate .group.n3 { grid-template-columns: 1fr 1fr; }
  #plate .xp li { grid-template-columns: 1fr; }
  #plate .xp .d { grid-row: auto; }
}
body.gauge-open #slate { z-index: 6; }
@media (prefers-reduced-motion: reduce) {
  #plate, .tag, #stations a, #gl { transition: none !important; animation: none !important; }
}

/* phones: the viewfinder. Picture window under the name; the instruments in the margin below */
body.finder #gl { top: var(--pic-top); height: var(--pic-h); bottom: auto; }
body.finder #tags { top: var(--pic-top); height: var(--pic-h); bottom: auto; }
body.finder #hud::before, body.finder #hud::after { display: none; }
body.finder #here { top: calc(var(--pic-top) + var(--pic-h) + 20px); bottom: auto; max-width: calc(100vw - 32px); }
body.finder #here h1 { font-size: clamp(30px, 8.6vw, 40px); }
body.finder #slate { top: 18px; }
body.finder #gauge { display: none; }
body.finder.gauge-open #gauge { display: block; }
body.finder #here, body.finder #meter, body.finder #ctrl, body.finder #slate { text-shadow: none; }
body.finder::after { content: ""; position: fixed; left: 0; right: 0; top: calc(var(--pic-top) + var(--pic-h)); height: 1px; background: rgba(242,239,230,.22); z-index: 3; pointer-events: none; }
body.finder::before { content: ""; position: fixed; left: 0; right: 0; top: calc(var(--pic-top) - 1px); height: 1px; background: rgba(242,239,230,.22); z-index: 3; pointer-events: none; }
body.finder { touch-action: none; }
