/* academic.css (light) underneath; 417am.party's tokens on top: white, #111, Helvetica, one size, hairlines */
:root.light{--bg:#fff;--fg:#111;--text:#111;--text-strong:#111;--text-bright:#111;--text-muted:#8a8a8a;--mid:#8a8a8a;--rule:#e4e4e4;--link:#111;--accent:#111;--font-sans:"Helvetica Neue",Helvetica,Arial,sans-serif}
html,body{height:100%}
body{font-size:13px;line-height:1.4;background:var(--bg);color:var(--fg)}
h1,h2,h3{font-size:13px;font-weight:400;margin:0;line-height:1.4;letter-spacing:.04em;color:var(--fg)}
section,section:first-child{margin:0}
main{min-height:0}
p{margin:0}
.mid{color:var(--mid)}
a{color:var(--fg)}
button{background:none;border:0;padding:0;cursor:pointer;color:var(--fg);font:inherit}
button:disabled{cursor:default;color:var(--mid)}
@media (hover:hover){button:hover:not(:disabled),a:hover{background:var(--fg);color:var(--bg)}}
:focus-visible{outline:1px solid var(--fg);outline-offset:3px}
[hidden]{display:none!important}

.topbar{display:flex;align-items:baseline;gap:24px;height:44px;padding:13px 20px 0;border-bottom:1px solid var(--rule)}
.topbar a{text-decoration:none}
.night{margin-left:auto;color:var(--mid)}
.night[aria-pressed=true]{color:var(--fg)}

.layout{display:grid;grid-template-columns:220px minmax(0,1fr);height:calc(100svh - 44px)}
.rail{display:flex;flex-direction:column;gap:16px;padding:20px;border-right:1px solid var(--rule);min-height:0}
.room-list{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid var(--rule);border-left:1px solid var(--rule);overflow-y:auto}
.room{display:flex;flex-direction:column;align-items:flex-start;padding:6px 7px;border-right:1px solid var(--rule);border-bottom:1px solid var(--rule);text-align:left}
.room-seen{color:var(--mid);font-size:11px;font-variant-numeric:tabular-nums}
.room[aria-current]{background:var(--fg);color:var(--bg)}
.room[aria-current] .room-seen{color:var(--bg)}
.room.complete .room-number::after{content:' ●'}
#map{display:block;width:100%;height:auto;cursor:pointer;flex:none}
.checklist{text-align:left;margin-top:auto;align-self:flex-start}

.gallery{display:flex;flex-direction:column;min-width:0;min-height:0}
.viewport{position:relative;flex:1;min-height:320px;overflow:hidden;background:#f2f2f2;isolation:isolate}
.canvas-mount,.canvas-mount canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.canvas-mount{touch-action:none}
.canvas-mount canvas{cursor:grab;outline-offset:-2px}
.canvas-mount canvas.dragging{cursor:grabbing}
.canvas-mount canvas.over-print{cursor:zoom-in}
.scene-hud,.seen-hud,.reset,.scene-status,.tour-caption,.mobile-help{position:absolute;z-index:1;background:var(--bg);color:var(--fg);border:1px solid var(--fg)}
.scene-hud,.seen-hud{top:12px;padding:3px 7px;pointer-events:none;font-variant-numeric:tabular-nums}
.scene-hud{left:12px}
.seen-hud{right:48px;display:flex;gap:8px}
#seen-note{display:none}
.seen-hud.flash{background:var(--fg);color:var(--bg)}
.seen-hud.flash #seen-note{display:inline}
.reset{top:12px;right:12px;width:27px;height:27px;line-height:1}
.scene-status{top:50%;left:50%;transform:translate(-50%,-50%);padding:3px 7px}
.viewport:has(.scene-status[hidden]) .scene-status{display:none}
.tour-caption{bottom:12px;left:12px;max-width:calc(100% - 24px);display:flex;gap:10px;padding:3px 7px;pointer-events:none}
.tour-stop,#tour-medium{color:var(--mid)}
#tour-title{font-weight:400}
.tour-progress{position:absolute;z-index:1;inset:auto 0 0;height:2px;pointer-events:none}
.tour-progress span{display:block;height:100%;background:var(--fg);transform:scaleX(0);transform-origin:left}

.controls{display:flex;align-items:center;justify-content:space-between;gap:12px;height:40px;padding:0 20px;border-top:1px solid var(--rule)}
.mobile-help{display:none;bottom:12px;left:50%;transform:translateX(-50%);margin:0;padding:3px 7px;white-space:nowrap;pointer-events:none;transition:opacity .6s ease .2s}
.mobile-help.gone{opacity:0}
.gallery-actions{display:flex;gap:16px}
.end-tour,.tour-hold{color:var(--mid)}
.auto-tour.resting{color:var(--mid);pointer-events:none}
.flat-video{width:100%;background:#000}
.tour-hold{font-variant-numeric:tabular-nums;min-width:3ch}

dialog{position:fixed;inset:0;margin:auto;background:var(--bg);color:var(--fg);border:1px solid var(--fg);padding:0;max-width:calc(100% - 24px);max-height:calc(100% - 24px)}
dialog::backdrop{background:#ffffffe6}
.dialog-bar,.print-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px}
.dialog-bar h2{display:inline}
.close{width:27px;height:27px;border:1px solid var(--fg);line-height:1}
.inspect{width:min(1100px,100% - 24px)}
.print-stage{height:min(60svh,700px);background:#f2f2f2;position:relative;overflow:hidden;display:grid;place-items:center;touch-action:none;cursor:grab;border-top:1px solid var(--rule);border-bottom:1px solid var(--rule)}
.print-stage img{position:absolute;left:50%;top:50%;max-width:none;max-height:none;user-select:none}
.print-stage img.dither{image-rendering:pixelated}
#print-status{color:var(--mid);z-index:1;pointer-events:none}
.print-tools{display:flex;gap:6px}
.print-tools button,.print-tools a{border:1px solid var(--fg);padding:2px 8px;text-decoration:none}
.likeness{padding:10px 14px 0}
.likeness h3{margin-bottom:6px}
.near-list{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.near{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0;color:var(--mid);font-size:11px}
.near img{display:block;width:auto;max-width:100%;height:72px;object-fit:contain}
.near img.dither{image-rendering:pixelated}
button.near:hover:not(:disabled){background:none;color:var(--fg)}
.near.seen span::before{content:'● '}
.near span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.index{width:min(520px,100% - 24px);overflow:auto}
.index .dialog-bar{position:sticky;top:0;background:var(--bg);border-bottom:1px solid var(--rule)}
.index h3{color:var(--mid);padding:14px 14px 4px}
.index-piece{display:flex;justify-content:space-between;width:100%;text-align:left;padding:4px 14px;border-bottom:1px solid var(--rule)}
.index-piece small{color:var(--mid);font-size:13px}
@media (hover:hover){.index-piece:hover small{color:var(--bg)}}
.index-piece.seen::after{content:'●';order:-1;margin-right:-8px}

/* 4:17: the room goes dark */
/* after hours: OLED black, off-white ink, hairlines barely there; the art is the only bright thing */
:root.night-mode{--bg:#000;--fg:#ededed;--text:#ededed;--text-strong:#ededed;--text-bright:#fff;--text-muted:#767676;--mid:#767676;--rule:#1f1f1f;--link:#ededed;--accent:#ededed;color-scheme:dark}
.night-mode .viewport{background:#000}
.night-mode .print-stage{background:#050505}
.night-mode dialog::backdrop{background:#000000eb}
.night-mode .scene-hud,.night-mode .seen-hud,.night-mode .reset,.night-mode .tour-caption,.night-mode .mobile-help,.night-mode .close,.night-mode .print-tools button,.night-mode .print-tools a,.night-mode dialog{border-color:#5a5a5a}
.night-mode .room[aria-current]{background:#ededed;color:#000}
.topbar a,.topbar a:visited{color:var(--fg)}
body,.topbar,.rail,.controls,.room,.room-list,dialog{transition:background-color .6s ease,color .6s ease,border-color .6s ease}
@media (prefers-reduced-motion:reduce){body,.topbar,.rail,.controls,.room,.room-list,dialog{transition:none}}

.flat-mount{overflow:auto;touch-action:pan-y}
.flat-room{min-height:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:center;gap:32px;padding:56px 32px 24px}
.flat-room button{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.flat-room img{max-width:100%;max-height:30vh;object-fit:contain}
.flat-spotlight{grid-template-columns:1fr}.flat-spotlight img{max-height:55svh}
.flat-salon{grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}.flat-salon img{max-height:20svh}

@media (pointer:coarse){.desktop-help{display:none}.mobile-help{display:block}}
/* phones: the room fills the screen; one row of numbers above, one row of actions below */
@media (max-width:720px),(max-height:500px) and (pointer:coarse){
  html,body{overflow:hidden;overscroll-behavior:none}
  body{-webkit-tap-highlight-color:transparent}
  .topbar{height:calc(40px + env(safe-area-inset-top));padding:calc(11px + env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));gap:16px}
  .layout{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);height:calc(100dvh - 40px - env(safe-area-inset-top))}
  .rail{display:contents}
  #intro-text,#map{display:none}
  .room-list{grid-row:1;display:flex;overflow-x:auto;scrollbar-width:none;border-left:0;border-top:0;border-bottom:1px solid var(--rule);padding:0 max(0px,env(safe-area-inset-right)) 0 max(0px,env(safe-area-inset-left))}
  .room-list::-webkit-scrollbar{display:none}
  .room{flex:none;border-bottom:0;padding:5px 10px;min-width:44px}
  .gallery{grid-row:2;grid-column:1}
  .viewport{min-height:0}
  .room-list{grid-column:1}
  /* checklist sits in the action row, left; Next and Tour on the right */
  .checklist{grid-row:2;grid-column:1;align-self:end;justify-self:start;z-index:2;height:44px;margin:0 0 env(safe-area-inset-bottom) max(12px,env(safe-area-inset-left));padding:0}
  .controls{height:calc(44px + env(safe-area-inset-bottom));padding:0 max(12px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px,env(safe-area-inset-left));justify-content:flex-end}
  .gallery-actions{gap:20px}
  .gallery-actions button{height:44px}
  .scene-hud,.seen-hud,.reset{top:10px}
  .scene-hud{left:max(10px,env(safe-area-inset-left))}
  .reset{right:max(10px,env(safe-area-inset-right))}
  .tour-caption{left:10px;bottom:10px}
  .near-list{grid-template-columns:repeat(3,minmax(0,1fr))}
  .near img{height:56px}
  .print-stage{height:46svh}
  .inspect{width:100%;max-width:100%;max-height:100%;height:100%;margin:0;border:0;flex-direction:column}
  .inspect[open]{display:flex}
  .inspect .print-stage{flex:1;height:auto;min-height:0}
  .dialog-bar{padding-top:calc(10px + env(safe-area-inset-top))}
  .print-footer{padding-bottom:calc(10px + env(safe-area-inset-bottom));flex-wrap:wrap}
  .index{width:100%;max-width:100%;height:100%;max-height:100%;margin:0;border:0}
  .index .dialog-bar{padding-top:calc(10px + env(safe-area-inset-top))}
}
/* landscape phones: no room strip, the room gets the whole height */
@media (max-height:500px) and (pointer:coarse){
  .room-list{display:none}
  .layout{grid-template-rows:0 minmax(0,1fr)}
  .near img{height:44px}
  .likeness{display:none}
}
