@font-face {
  font-family: "Poiret One";
  src: url("/assets/fonts/poiret-one.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #082e31;
  --text: #ffebbd;
  --muted: #c9d9cb;
  --amber: #f6cd82;
  --seam: #907b50;
  --page-bg: var(--ink);
  --paper: #123c3d;
  --text-primary: var(--text);
  --text-body: var(--muted);
  --text-muted: var(--muted);
  --link: var(--amber);
  --rule: var(--seam);
  --diagram-bg: #20484a;
  --gutter: clamp(1.25rem, 3.65vw, 4.5rem);
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font: 100% / 1.45 "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--ink);
}
* { box-sizing: border-box; }
body, h1, h2, p, ul { margin: 0; }
body { display: grid; grid-template-rows: auto minmax(12rem, 1fr) auto; min-height: 100dvh; }
button, a { font: inherit; color: inherit; }
button { cursor: pointer; }
a { text-underline-offset: .22em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.skip { position: absolute; z-index: 5; left: 1rem; top: -7rem; padding: .7rem; background: var(--ink); }
.skip:focus { top: .5rem; }
.window-bar, .pager { display: flex; align-items: center; }
body[data-listening-view] {
  padding-bottom: 0;
}
body[data-listening-view] > :not(audio, .listening-page) {
  display: none !important;
}
.listening-page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--ink);
}
main:focus, .skyline:focus, .room-interior:focus { outline: none; }
#office {
  display: grid;
  position: relative;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  min-width: 0;
  isolation: isolate;
}
.skyline, .room-interior { grid-area: 1 / 1; min-height: 0; min-width: 0; }
body[data-office-view="room"], body:not([data-office-view]):has(#room:target) {
  --skyline-display: none;
  --room-display: grid;
  --return-display: inline-flex;
  --skyline-min-height: 0;
}
.skyline { display: var(--skyline-display, block); overflow: hidden; position: relative; container-type: size; background: #062e32; }
.room-interior { display: var(--room-display, none); grid-template-rows: minmax(0, 1fr) auto; container: office / size; }
#office.approaching .skyline { display: block; z-index: 1; pointer-events: none; }
.site-footer .leave-office { display: var(--return-display, none); margin-right: auto; }
.city-plate {
  position: absolute;
  left: 50%; top: 16%;
  translate: -50% -16%;
  width: max(100cqw, calc(100cqh * 1487 / 1058));
  aspect-ratio: 1487 / 1058;
}
.city-plate picture, .city-plate picture img { display: block; width: 100%; height: 100%; }
/* The skyline includes the lit room. Each overlay contains just the unlit lamp
   in the left panes and the borrowed print behind the right-hand mullion. */
.window-details {
  --detail-art: url("/assets/after-hours/window-details.webp");
  position: absolute;
  left: 67.25%; top: 39.70%; width: 32.08%; height: 42.53%;
  pointer-events: none;
}
.window-details::before, .window-details::after {
  position: absolute; inset: 0;
  background: var(--detail-art) center / 100% 100% no-repeat;
}
#office:has(.scene.lamp-off) .window-details::before {
  content: ""; clip-path: inset(0 42% 0 0);
}
#office:has(.swapped-art:not([hidden])) .window-details::after {
  content: ""; clip-path: inset(0 0 0 58%);
}
.window-entry {
  position: absolute;
  left: 70.5%; top: 52%; width: 25%; height: 25.5%;
  cursor: zoom-in;
}
.window-entry::after {
  content: "";
  position: absolute; left: 50%; bottom: 9%;
  width: .5rem; height: .5rem;
  rotate: 45deg;
  border: 1px solid #ffe6ac; background: #66482f;
  box-shadow: 0 0 0 2px #342a2066, 0 0 .65rem #f6cd8255;
}
.window-entry:is(:hover, :focus-visible)::after {
  background: #ffdf99;
  box-shadow: 0 0 0 3px #573d2b99, 0 0 .85rem #ffe2a8;
}
.poster-copy {
  position: absolute;
  top: clamp(.85rem, 6cqh, 4rem);
  left: var(--gutter);
  color: #ffe2a8;
  pointer-events: none;
}
.poster-copy h1 {
  font: 400 clamp(2.5rem, min(8.2cqw, 16cqh), 10rem)/.94 "Poiret One", "Segoe UI", sans-serif;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  text-shadow: 0 2px 6px #082e31;
}
.poster-copy h1 span { display: block; }
.poster-copy p {
  margin: 1.1em 0 0 .2em;
  font-size: clamp(.82rem, 1.3cqw, 1.35rem);
  font-weight: 600;
  letter-spacing: .27em;
  text-transform: uppercase;
}
.approaching .poster-copy, .approaching .window-entry { visibility: hidden; }
@media (max-width: 500px), (max-aspect-ratio: 4/5) {
  #office { min-height: var(--skyline-min-height, 28rem); }
  .city-plate { left: auto; right: 0; top: 56%; translate: 0 -56%; width: max(100cqw, calc(100cqh * 940 / 1672)); aspect-ratio: 940 / 1672; }
  .window-details { left: 57.447%; top: 58.014%; width: 42.553%; height: 27.572%; --detail-art: url("/assets/after-hours/window-details-portrait.webp"); }
  .window-entry { left: 62%; top: 65%; width: 34%; height: 17.5%; }
  .poster-copy { top: max(1rem, 3cqh); width: calc(100% - 2 * var(--gutter)); }
  .poster-copy h1 { font-size: clamp(2rem, min(14.3cqw, 13cqh), 7rem); }
  .poster-copy p { margin: .55rem 0 .85rem; font-size: .79rem; letter-spacing: .22em; }
}
@media (min-width: 501px) and (min-aspect-ratio: 8/5) {
  .city-plate { left: auto; right: 0; top: 56%; translate: 0 -56%; width: max(100cqw, calc(100cqh * 1923 / 818)); aspect-ratio: 1923 / 818; }
  .window-details { left: 72.283%; top: 39.242%; width: 24.441%; height: 48.166%; --detail-art: url("/assets/after-hours/window-details-wide.webp"); }
  .window-entry { left: 75%; top: 53%; width: 17.5%; height: 28%; }
}
@media (min-width: 501px) and (max-height: 32rem) and (orientation: landscape) {
  .poster-copy { top: .5rem; }
  .poster-copy p { margin: .2rem 0 .4rem; }
  .city-plate { top: 70%; translate: 0 -70%; }
}
.panorama {
  position: relative;
  container-type: size;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: auto hidden;
  overscroll-behavior-x: contain;
  scrollbar-color: #b19965 var(--ink);
  scrollbar-width: thin;
}
.scene {
  position: relative;
  flex: none;
  width: max(100%, calc(100cqh * 1672 / 941));
  isolation: isolate;
}
.scene:has(.objects[hidden]) { width: min(100%, calc(100cqh * 1672 / 941)); margin-inline: auto; }
.room-guide { display: none; }
.scene .object::before, .object-hint::before {
  width: 8px;
  height: 8px;
  box-sizing: border-box;
  background: var(--amber);
  outline: 2px solid var(--ink);
  rotate: 45deg;
}
.scene .object::before {
  content: var(--room-marker, none);
  position: absolute;
  left: 50%;
  bottom: 4px;
  translate: -50% 0;
  pointer-events: none;
}
@media (hover: none) {
  .scene { --room-marker: ""; }
}
@container office (max-aspect-ratio: 5/4) {
  .scene { --room-marker: ""; }
  .room-guide {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .45rem 1.25rem;
    padding: .65rem var(--gutter) .75rem;
    border-top: 1px solid var(--seam);
  }
  .object-hint {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--muted);
    font-size: .875rem;
  }
  .object-hint::before { content: ""; flex: none; }
  .room-stops {
    display: flex;
    flex: 1 1 16rem;
    border: 1px solid var(--seam);
  }
  .room-stops button {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: .4rem .25rem;
    overflow-wrap: anywhere;
    border: 0;
    background: #163d40;
    font: 600 .875rem/1.3 var(--mono);
  }
  .room-stops button + button { border-left: 1px solid var(--seam); }
  .room-stops [aria-current="location"] { color: var(--ink); background: var(--amber); }
  .room-stops button:focus-visible { outline: 3px double currentColor; outline-offset: -5px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.room-art { display: block; width: 100%; height: auto; }
.dusk { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; filter: brightness(.9); pointer-events: none; transition: opacity .3s ease; }
.scene.lamp-off .dusk { opacity: 1; }
.scene-layer { position: absolute; pointer-events: none; }
.window-weather { left: 0; top: 0; width: 41.866%; height: auto; }
.screen-picture {
  left: 54.785%; top: 36.663%; width: 12.321%; height: 12.54%;
  object-fit: cover;
  clip-path: polygon(7% 2.5%, 99% 0, 100% 2%, 95.5% 98.5%, 94.5% 100%, 1% 94%, 0 92%);
}
.framed-picture {
  left: 82.356%; top: 14.772%; width: 14.474%; height: 20.298%;
  object-fit: cover;
  clip-path: polygon(0 13.6%, 100% 0, 100% 98.4%, 0 100%);
}
.lamp-off .framed-picture { filter: brightness(.82); }
.playing-sleeve { left: 88.6%; top: 66.6%; width: 7.25%; transform: rotate(9deg) skewY(-2deg); box-shadow: 2px 2px 2px #201912; }
.lamp-off .playing-sleeve { filter: brightness(.85); }
.object {
  position: absolute;
  translate: -50% -50%;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 2px solid transparent;
  touch-action: manipulation;
}
.cat { left: 14.4%; top: 51.8%; width: 8.4%; height: 7%; }
.window { left: 20%; top: 28%; width: 29%; height: 33%; }
.diary { left: 66.7%; top: 26.5%; width: 3.9%; height: 10%; }
.lamp { left: 46.25%; top: 43%; width: 10.5%; height: 17%; }
.computer { left: 61%; top: 43.4%; width: 13.5%; height: 14%; }
.book { left: 50%; top: 54%; width: 6.7%; height: 4.5%; }
.record { left: 89.5%; top: 49.4%; width: 15%; height: 15%; }
.dog { left: 50.8%; top: 75%; width: 12.3%; height: 9.8%; }
.drawers { left: 35.2%; top: 60%; width: 8.5%; height: 8.5%; }
.print { left: 89.7%; top: 25%; width: 16.6%; height: 23%; }
.crate { left: 92%; top: 73.5%; width: 11%; height: 13.5%; }
.object span {
  position: absolute;
  left: 50%;
  bottom: 100%;
  translate: -50% -4px;
  white-space: nowrap;
  padding: .24rem .48rem;
  border: 2px solid var(--amber);
  background: var(--ink);
  box-shadow: 2px 2px 0 #291b22;
  color: var(--amber);
  font: 600 .86rem / 1.35 var(--mono);
  pointer-events: none;
  opacity: 0;
}
.object:focus-visible { border-color: var(--amber); outline: none; }
.object:focus-visible span, .object.reacting span { opacity: 1; }
.object:is(.dog, .cat).reacting span {
  left: 64%; bottom: 89%;
  padding: .18rem .6rem .25rem;
  border: 0;
  border-radius: .65rem .65rem .65rem 0;
  background: #f7e6c5; color: #503846;
  font: italic 600 1rem/1.2 Georgia, serif;
}
@media (hover: hover) {
  .object:hover { border-color: var(--amber); }
  .object:is(.dog, .cat):hover:not(:focus-visible) { border-color: transparent; }
  .object:hover span { opacity: 1; }
}
.platter {
  /* The painted vinyl spans x=1422..1552 and y=462..487 in the 1672 × 941 room.
     Rotate a circle in its own plane before projecting it onto that ellipse. */
  position: absolute;
  left: 88.94%; top: 50.43%;
  translate: -50% -50%;
  width: 7.78%; aspect-ratio: 1;
  transform: scaleY(.194);
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  /* Leave the fixed tonearm, cartridge and their shadow above the grooves. */
  clip-path: polygon(0 0, 100% 0, 100% 8%, 82% 33%, 76% 42%, 70% 44%, 69% 57%, 72% 67%, 79% 58%, 85% 43%, 100% 27%, 100% 100%, 0 100%);
}
.platter::before, .platter::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  animation: vinyl-turn 1.8s linear infinite;
}
.platter::before {
  background: conic-gradient(from 18deg, transparent 3%, #adc4b63d 17%, transparent 29% 52%, #e2c79b40 67%, transparent 85%);
  mask-image: radial-gradient(circle closest-side, transparent 39%, black 40%),
    repeating-radial-gradient(circle closest-side, transparent 0 2%, black 3% 4%);
  mask-composite: intersect;
}
.platter::after {
  /* Two tiny printed marks turn on the paper label, clear of the spindle. */
  background: radial-gradient(ellipse 5.5% 1.5% at 50% 40%, #73502e 85%, transparent),
    radial-gradient(ellipse 2.8% 1.4% at 50% 60%, #987241 85%, transparent);
}
@keyframes vinyl-turn { to { transform: rotate(1turn); } }
.window-bar button, .pager button {
  min-height: 44px;
  padding: .25rem .1rem;
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: .24em;
}
.window-bar button:hover { color: var(--amber); }
.desk-window {
  width: min(33rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  margin: auto;
  color: var(--text);
  background: var(--ink);
  border: 2px solid #bc9b62;
  box-shadow: 6px 6px 0 #041d21;
}
.desk-window::backdrop { background: rgb(18 16 28 / 68%); }
.window-bar { justify-content: space-between; gap: 1rem; padding: 0 1.2rem; border-bottom: 1px solid var(--seam); font: .91rem var(--mono); }
.window-bar h2 { margin: 0; font: inherit; }
.window-body { padding: clamp(1.3rem, 3vw, 2rem); }
.window-body h2 { font-size: clamp(1.65rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -.025em; }
.file-list { padding: 0; margin-top: 1rem; list-style: none; }
.file-list li + li { border-top: 1px solid var(--seam); }
.file-list a { display: grid; gap: .18rem; padding: .85rem 0; text-decoration: none; }
.file-list strong { color: var(--amber); text-decoration: underline; text-underline-offset: .23em; }
.file-list span { color: var(--muted); }
.file-list a:hover strong { color: var(--text); }
.notebook .window-body { background: #f6e7c8; border-left: .55rem solid #ad5146; color: #392a31; }
.page-count { font: .82rem var(--mono); margin-bottom: .8rem; }
#note-copy { margin-top: .85rem; min-height: 4.4em; }
.pager { margin-top: 1.2rem; justify-content: space-between; gap: .5rem; border-top: 1px solid #b2917c; }
.pager button:focus-visible { outline-color: #812d29; }
.pager button[aria-disabled="true"] { opacity: .6; cursor: default; text-decoration: none; }
.drawer-window { width: min(45rem, calc(100% - 2rem)); }
.drawer-tray { position: relative; overflow: clip; }
.tray-art, .drawer-tray .object img { display: block; width: 100%; height: auto; }
.drawer-tray .object { display: grid; place-items: center; }
.drawer-tray .object img { pointer-events: none; filter: drop-shadow(2px 3px 2px rgb(18 13 26 / 72%)); }
.drawer-beetle { left: 22%; top: 64%; width: 17%; }
.drawer-beetle[data-state="wound"] img { rotate: -5deg; }
.drawer-beetle[data-state="running"] { animation: beetle-run 1.45s linear forwards; cursor: default; }
.drawer-beetle[data-state="running"] img { animation: beetle-step .16s steps(2, end) infinite; }
.drawer-beetle[data-state="spent"] { left: 88%; }
.drawer-beetle[data-state="spent"] img { rotate: -9deg; }
.drawer-scope { left: 67%; top: 34%; width: 35%; }
.drawer-tray .object span { bottom: auto; top: 100%; translate: -50% 2px; }
.drawer-tray .drawer-scope span { left: auto; right: 0; translate: 0 2px; }
.drawer-tray .drawer-beetle span { left: 0; bottom: 100%; top: auto; translate: 0 -2px; }
.drawer-tray .drawer-beetle[data-state="spent"] span { left: auto; right: 0; }
.drawer-tray .drawer-beetle[data-state="running"] span { opacity: 0; }
.drawer-caption { min-height: 4.6rem; padding: .75rem 1.2rem; }
@keyframes beetle-run {
  0% { left: 22%; top: 64%; }
  26% { left: 40%; top: 67%; }
  56% { left: 60%; top: 62%; }
  92% { left: 89%; top: 64%; }
  100% { left: 88%; top: 64%; }
}
@keyframes beetle-step {
  0%, 100% { rotate: -4deg; }
  50% { rotate: 4deg; }
}
.scope-window { width: min(27rem, calc(100% - 2rem)); }
.scope-body { display: grid; justify-items: center; gap: .85rem; padding: 1.15rem; }
.scope-lens {
  display: block;
  width: min(100%, 15rem, 46dvh);
  height: auto;
  border: .5rem ridge #bd8454;
  border-radius: 50%;
  background: #17101e;
  box-shadow: 0 0 0 2px #4a3033, 3px 5px 0 #041d21;
}
.scope-description { color: var(--muted); text-align: center; }
.crate-window { width: min(42rem, calc(100% - 2rem)); }
.crate-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(1rem, 3vw, 1.8rem); padding: clamp(1rem, 3vw, 1.7rem); align-items: center; }
.sleeve-face { position: relative; box-shadow: 3px 4px 0 #18141d; }
.cover-art { display: block; width: 100%; height: auto; }
.sleeve-back { position: absolute; inset: 0; padding: 8%; overflow: auto; background: #e9d6ae; color: #392a36; color-scheme: light; }
.back-title { display: block; padding-bottom: .35em; border-bottom: 2px solid #6e5347; font: italic 700 clamp(1.35rem, 3vw, 2rem)/1.1 Georgia, serif; }
.sleeve-back fieldset { padding: 0; margin: .85rem 0 0; border: 0; }
.sleeve-back legend { font: .76rem var(--mono); }
.sleeve-back label { display: flex; align-items: center; gap: .4rem; min-height: 42px; cursor: pointer; font: italic 1rem Georgia, serif; }
.sleeve-back input { margin: 0; accent-color: #714329; }
.sleeve-back input:focus-visible { outline-color: #793626; }
.sleeve-credit { margin-top: .65rem; font-size: .82rem; }
.sleeve-credit a:focus-visible { outline-color: #793626; }
.side-id { font: 700 .77rem var(--mono); }
.sleeve-controls { display: grid; justify-items: start; gap: .7rem; }
.album-title { margin: .25rem 0; font: 600 clamp(1.65rem, 3.3vw, 2.6rem)/1.06 Georgia, serif; }
.sleeve-position { font: .78rem var(--mono); color: var(--amber); }
.track-line { color: var(--muted); }
.flip-sleeve, .crate-pager button { min-height: 44px; padding: .3rem 0; color: var(--text); background: none; border: 0; text-decoration: underline; text-underline-offset: .23em; }
.put-record-on, .scope-turn { min-height: 44px; padding: .5rem .95rem; border: 1px solid var(--amber); color: var(--ink); background: var(--amber); font: 600 .91rem var(--mono); }
.scope-turn:focus-visible { outline-offset: 4px; }
.crate-pager { display: flex; justify-content: space-between; gap: .6rem; padding: .25rem 1.2rem; border-top: 1px solid var(--seam); }
@media (max-width: 490px) {
  .drawer-tray .drawer-scope span { width: max-content; max-width: 13rem; white-space: normal; text-align: center; }
  .crate-body { grid-template-columns: 1fr; gap: .8rem; }
  .sleeve-face { width: min(100%, 14rem); justify-self: center; }
  .sleeve-controls { grid-template-columns: 1fr auto; align-items: center; }
  .sleeve-controls > div { grid-column: 1 / -1; }
}
@container office (aspect-ratio > 5/4) {
  .panorama { justify-content: center; overflow: clip; }
  .scene { width: min(100%, calc(100cqh * 1672 / 941)); }
}
@media (max-width: 64rem) and (max-height: 32rem) and (orientation: landscape) {
  #office { min-height: min(16rem, calc(100vw * 940 / 1672)); }
  .panorama { justify-content: center; }
  .scene { width: min(100%, calc(100cqh * 1672 / 941)); }
}
@media (prefers-reduced-motion: reduce) {
  .platter { display: none; }
  .dusk { transition: none; }
  .drawer-beetle[data-state="running"], .drawer-beetle[data-state="running"] img { animation: none; }
}
