:root {
  --bg: #0d0d0c;
  --panel: #171715;
  --panel-hi: #22221f;
  --line: #2c2c28;
  --ink: #efece4;
  --dim: #8a867b;
  --flap: #121211;
  --signal: #ffb000;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --flapfont: "Barlow Condensed", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-tap-highlight-color: transparent; } /* no blue flash on every tap; buttons show their own pressed state */
html, body { height: 100%; background: #0b0a08; color: var(--ink); font-family: var(--mono); font-size: 13px; overflow: hidden; -webkit-font-smoothing: antialiased; font-kerning: normal; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
.led { width: 6px; height: 6px; border: 1px solid #6f6b61; display: inline-block; flex: none; transition: background .2s, border-color .2s; } /* a square pixel lamp, like the OS's own controls */
.hi .led, html.sound-on .snd .led { background: var(--signal); border-color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ============ the room ============ */
#scene { position: fixed; inset: 0; }
#scene canvas { display: block; width: 100%; height: 100%; touch-action: none; } /* drags are ours, not the page's */
html.pointer #scene { cursor: pointer; }

/* the loader is the C64's screen close up, drawn from two frames of the room's own opening shot (see index.html).
   The room takes over from exactly this picture with a cut, then pulls back out through the glass. */

/* the name is the page's heading for search and screen readers, not shown */
.who { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }
#loader { position: fixed; inset: 0; z-index: 50; background: #040504; transition: opacity .9s ease, visibility 0s .9s; }
#loader i { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .5s ease; } #loader i.on { opacity: 1; }
#dots b { position: absolute; border-radius: 50%; opacity: 0; transition: opacity .3s ease; background-image: image-set(url(assets/screen-lit-1200.webp) 1x, url(assets/screen-lit.webp) 2x);
  -webkit-mask: radial-gradient(closest-side, #000 62%, transparent 100%); mask: radial-gradient(closest-side, #000 62%, transparent 100%); }
#dots b.on { opacity: 1; }
#enter { z-index: 2; }
#loader img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
html.ready #loader { opacity: 0; visibility: hidden; }
html.cut #loader { transition: none; }
/* the splash's one line, written on the glass in the screen's own phosphor; the cursor blinks like the C64's */
#loader { cursor: pointer; }
.enter { position: absolute; left: 50%; translate: -50% -50%; font: 400 15px/1 VT323, var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  color: #cfeee0; text-shadow: 0 0 .35em rgba(190,255,225,.6), 0 0 1.2em rgba(160,255,210,.25); padding: .5em 0; cursor: pointer; }
.enter::after { content: '_'; margin-left: .45em; animation: blink 1.06s steps(1) infinite; }
.enter:disabled { cursor: progress; }
html.no-webgl .enter { display: none; }
/* while the logo builds: a line or two from the machine getting ready, in the screen's own phosphor */
.bootline { position: absolute; left: 0; right: 0; translate: 0 -50%; margin: 0; text-align: center; font: 400 15px/1 VT323, var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #9fc4b2; text-shadow: 0 0 .35em rgba(160,255,210,.35); transition: opacity .3s; pointer-events: none; }
.bootline::after { content: '…'; animation: blink 1.06s steps(1) infinite; }
.bootline.off { opacity: 0; } /* no room to enter: the splash is only the OS loading */
.enter { opacity: 0; transition: opacity .5s ease; } .enter.on { opacity: 1; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .enter::after { animation: none; } }

.hud { position: fixed; z-index: 10; display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #a29d91; opacity: 0; transition: opacity 1.2s ease 2.2s; }
html.ready .hud { opacity: 1; }
html.inside .hud { opacity: 0; transition-delay: 0s; transition-duration: .3s; pointer-events: none; }
.hud.tl { top: 24px; left: 28px; }
.hud.tl svg { height: 20px; width: auto; }
.hud.tr { top: 24px; right: 28px; }

.snd, .hi { text-decoration: none; display: flex; gap: 8px; align-items: center; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); cursor: pointer; }
.hud .key { height: 26px; padding: 0; } /* just the label and its key, no box */
.hud .key:active kbd { translate: 0 1px; }
.hud .key kbd { font: inherit; font-size: 10px; letter-spacing: 0; line-height: 14px; padding: 0 4px; border: 1px solid currentColor; opacity: .75; }
.hud .snd .st::before { content: "off"; } html.sound-on .hud .snd .st::before { content: "on"; color: var(--signal); }
.snd:hover, .hi:hover, .snd:focus-visible, .hi:focus-visible { color: var(--ink); outline: none; }
.hud.tr { gap: 22px; }

html.touched /* computer switch, while we decide */
.pcswitch { display: flex; border: 1px solid #3a3a34; border-radius: 3px; overflow: hidden; }
.pcswitch button { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; padding: 6px 9px; color: var(--dim); }
.pcswitch button[aria-pressed="true"] { background: var(--ink); color: #111; }
.hud.br { bottom: 22px; right: 28px; text-transform: none; letter-spacing: .02em; font-size: 11px; max-width: 360px; flex-direction: column; align-items: flex-end; transition-delay: 3.2s; }
.credits summary { cursor: pointer; list-style: none; letter-spacing: .14em; text-transform: uppercase; color: #6f6b61; }
.credits summary::-webkit-details-marker { display: none; }
/* the label stays put at the bottom and the panel opens above it; open, it reads Close */
.hud.br.credits { flex-direction: column-reverse; gap: 6px; }
.credits[open] summary { color: var(--ink); }
.credits[open] summary .lbl { display: none; }
.credits summary .cls { display: none; }
.credits[open] summary .cls { display: inline; }
.credits p:not(.legal) { order: 1; } /* bottom to top: the label, the legal line, then the credits */
.credits p { margin: 0; padding: 12px 14px; background: rgba(12,12,11,.92); border: 1px solid #2c2c28; border-radius: 4px; line-height: 1.55; color: #a29d91; }

/* embossed label tape, the site's one labelling voice */
.dymo {
  display: inline-block; background: linear-gradient(#232321, #121211); color: #f4f2ea; font: 500 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
  padding: 7px 10px 6px; border-radius: 2px; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0,0,0,.7), 0 -1px 0 rgba(255,255,255,.16);
  box-shadow: 0 2px 6px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
}
/* tooltips: a comic box with the note written in pen. Paper for things in the room, amber when it opens a link */
.note, [data-tip]::after {
  font: 400 17px/1.2 "Cedarville Cursive", "Segoe Script", cursive; letter-spacing: 0; text-transform: none; white-space: nowrap;
  color: #22357f; background: #f4efe2; border: 2.5px solid #0d0d0c; border-radius: 4px; box-shadow: 3px 3px 0 #0d0d0c; padding: 3px 10px 4px; border-width: 2px;
}
/* #nudge: the same note, shown now and then by itself to point out what can be done; it drifts in slowly */
.tagnote { position: fixed; z-index: 15; left: 0; top: 0; translate: -50% calc(-100% - 6px); rotate: -2deg; pointer-events: none; opacity: 0; transition: opacity .16s, translate .16s; }
.tagnote.on { opacity: 1; translate: -50% calc(-100% - 10px); } /* the tail's tip just meets the object */
.tagnote.link { background: #ffb000; color: #0d0d0c; }
/* the tail: an ink triangle with a paper one inside it */
.tagnote::before, .tagnote::after { content: ''; position: absolute; top: 100%; left: calc(50% - 8px); border: solid transparent; }
.tagnote::before { border-width: 13px 11px 0 3px; border-top-color: #0d0d0c; }
.tagnote::after { left: calc(50% - 5px); margin-top: -1px; border-width: 8px 6px 0 2px; border-top-color: #f4efe2; }
.tagnote.link::after { border-top-color: #ffb000; }
/* hung under the object when it's too near the top of the screen: the tail points up */
.tagnote.below { translate: -50% 6px; } .tagnote.below.on { translate: -50% 10px; }
.tagnote.below::before, .tagnote.below::after { top: auto; bottom: 100%; border-top-color: transparent; }
.tagnote.below::before { border-width: 0 3px 13px 11px; border-bottom-color: #0d0d0c; }
.tagnote.below::after { margin: 0 0 -1px; border-width: 0 2px 8px 6px; border-bottom-color: #f4efe2; }
#nudge { transition: opacity .7s, translate .7s; } #nudge.on { opacity: .94; }
#nudge.free::before, #nudge.free::after { display: none; } /* not pointing at anything */
.tagnote.below.link::after { border-bottom-color: #ffb000; }
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; top: calc(100% + 12px); right: 0; font-size: 15px; rotate: -2deg; opacity: 0; translate: 0 -4px; transition: opacity .16s, translate .16s; pointer-events: none; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; translate: 0 0; }
.hi[data-tip]::after { background: #ffb000; color: #0d0d0c; }
.credits summary[data-tip]::after { top: auto; bottom: calc(100% + 12px); }
@media (hover: none) { [data-tip]::after { display: none; } .hud .key kbd { display: none; } } /* no keyboard shortcuts to show on a touch screen */
#flash { position: fixed; inset: 0; background: #fffdf6; z-index: 40; opacity: 0; pointer-events: none; }

/* keyboard / screen-reader route to everything on the desk */
.a11y { position: fixed; z-index: 12; left: 28px; bottom: 24px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 520px; clip-path: inset(50%); }
.a11y:focus-within { clip-path: none; }
.a11y button, .a11y a { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; padding: 8px 10px; background: #161614; border: 1px solid #34342e; border-radius: 3px; }

@media (max-width: 900px) {
    .hud.br { top: 52px; bottom: auto; right: 22px; }
    .hud.br.credits { flex-direction: column; } .credits p:not(.legal) { order: 0; } /* hung from the top here, so it opens downward */
  .credits p { max-width: calc(100vw - 44px); }
}
.credits p.legal { padding: 8px 14px; }
.credits .legal a { color: var(--ink); text-underline-offset: 3px; }
.nojs { position: fixed; inset: auto 20px 40%; text-align: center; color: var(--dim); line-height: 1.7; }

.credits[open] summary[data-tip]::after { display: none; }

/* phones: the way back out of a close-up on the desk */
.whole-desk { position: fixed; z-index: 12; left: 50%; bottom: 28px; translate: -50% 12px; opacity: 0; pointer-events: none; padding: 10px 16px; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); background: rgba(13,13,12,.8); border: 1px solid #4a4840; transition: opacity .25s, translate .25s; }
html.zoomed:not(.inside) .whole-desk { opacity: 1; translate: -50% 0; pointer-events: auto; }
.desk-hint { position: fixed; z-index: 11; left: 0; right: 0; bottom: calc(26px + env(safe-area-inset-bottom)); text-align: center; font: 500 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #8a867b; opacity: 0; pointer-events: none; transition: opacity .6s 1.5s; }
@media (max-aspect-ratio: 9/10) { html.ready:not(.touched):not(.inside):not(.zoomed) .desk-hint { opacity: 1; } }
