:root {
  --yellow: #f0b41c;
  --menuwidth: calc(100vw - 40px);
  --gap: 16px;
  --btn: calc((var(--menuwidth) - var(--gap) * 3) / 4);
}
* { box-sizing: border-box; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #000; color: #fff;
  font: 500 14px/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif; cursor: default; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

#pano { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#pano.hot { cursor: pointer; }

/* YouTube monitor: a 640x360 box warped onto the screen with matrix3d */
#tv { position: fixed; left: 0; top: 0; width: 640px; height: 360px; transform-origin: 0 0; pointer-events: none; display: none; background: #000; }
#tv iframe { width: 100%; height: 100%; border: 0; display: block; }
#tv.live { pointer-events: auto; }

/* ---------- menu ---------- */
#nav { position: fixed; top: 0; left: 20px; width: var(--menuwidth); z-index: 5; overflow-x: auto; scrollbar-width: none; transition: opacity .4s; }
#nav::-webkit-scrollbar { display: none; }
#nav-track { display: flex; gap: var(--gap); width: max-content; }
.menu-button { flex: 0 0 var(--btn); height: 60px; padding: 14px 0 0; background: none; border: 0; text-align: left;
  font-size: 16px; font-weight: 700; text-transform: uppercase; text-shadow: 1px 1px 1px rgba(64, 64, 64, .6); position: relative; }
.menu-button .line { display: block; height: 1px; margin-top: 9px; background: #fff; box-shadow: 1px 1px 1px rgba(64, 64, 64, .5); }
.menu-button .close { position: absolute; right: 0; top: 14px; opacity: 0; transition: opacity .25s; }
.menu-button.active .close { opacity: 1; }
.menu-button:hover .line, .menu-button.active .line { height: 2px; margin-top: 8px; }
body.intro-open #nav, body.intro-open #mute { opacity: 0; pointer-events: none; }

/* ---------- panel ---------- */
#panel { position: fixed; left: 20px; top: 80px; width: var(--btn); max-width: 330px; min-width: 240px; height: 80vh; max-height: 800px;
  background: rgba(121, 121, 121, .1); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  z-index: 5; overflow: hidden; transition: height .4s ease-out, opacity .4s ease-out; }
#panel.closed { height: 0; opacity: 0; pointer-events: none; }
#panel .inner { position: absolute; inset: 0; padding: 53px 15px 15px; overflow: auto; display: flex; flex-direction: column; scrollbar-width: none; }
#back { position: absolute; top: 12px; left: 15px; z-index: 2; padding: 6px 9px; border: 1px solid #fff; border-radius: 4px;
  background: rgba(0, 0, 0, .25); font-weight: 700; font-size: 11px; line-height: 1; letter-spacing: .04em; }
#back:hover, #modal-close:hover { background: #fff; color: #222; }
.item { margin-bottom: 30px; }
.item img { width: 100%; display: block; margin-bottom: 6px; }
.item .title { font-weight: 700; font-size: 14px; text-transform: uppercase; margin-bottom: 3px; overflow-wrap: anywhere; }
.item .sub { font-size: 12px; opacity: .8; margin-bottom: 5px; }
.item .text { font-size: 12px; overflow-wrap: anywhere; }
.item .links, #modal .links { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; }
.item .links a, #modal .links a { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 5px 8px; border: 1px solid #fff; border-radius: 4px; }
.item .links a:hover, #modal .links a:hover { background: #fff; color: #222; }
.empty { font-size: 12px; opacity: .8; }

/* ---------- sound ---------- */
#mute { position: fixed; right: 20px; bottom: 20px; z-index: 5; width: 44px; height: 44px; padding: 10px; background: none; border: 0;
  filter: drop-shadow(1px 1px 1px rgba(64, 64, 64, .6)); transition: opacity .4s; }
#mute .off { display: none; }
#mute[aria-pressed="true"] .on { display: none; }
#mute[aria-pressed="true"] .off { display: inline; }

/* ---------- loading / intro ---------- */
#intro { position: fixed; inset: 0; z-index: 20; background: #fff; color: #111; display: grid; place-items: center;
  text-align: center; padding: 20px; transition: opacity .4s; }
#intro.gone { opacity: 0; pointer-events: none; }
/* both messages share the one centred cell and cross-fade */
.loading-text, .complete-text { grid-area: 1 / 1; font-weight: 700; font-size: 12px; line-height: 1.5; transition: opacity .5s; }
.complete-text { opacity: 0; font-weight: 500; pointer-events: none; position: relative; z-index: 1; }
#intro:not(.loading) .loading-text { opacity: 0; pointer-events: none; }   /* otherwise it sits over the button and eats the click */
#intro:not(.loading) .complete-text { opacity: 1; pointer-events: auto; transition-delay: .5s; }
#intro.gone .complete-text { pointer-events: none; }   /* otherwise the faded intro text leaves a dead patch in the middle of the room */
#enter { margin-top: 10px; padding: 6px 8px; background: none; border: 1.5px solid #111; border-radius: 4px; color: #111; font-weight: 700; font-size: 12px; }
#enter:hover { background: #111; color: #fff; }

/* Everything below scales with the window. Four menu items across, like the reference, until they'd get cramped. */
.menu-button { font-size: clamp(12px, 0.55vw + 9px, 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel { width: clamp(240px, var(--btn), 330px); height: min(80vh, 800px, 100dvh - 100px); }
@media (max-width: 760px) {
  :root { --btn: calc((var(--menuwidth) - var(--gap) * 2) / 3); }
}
/* phones held sideways: short screen, keep the menu on top but slimmer */
@media (max-width: 1024px) and (max-height: 500px) {
  .menu-button { height: 40px; padding-top: 8px; font-size: 12px; }
  .menu-button .line { margin-top: 5px; }
  .menu-button .close { top: 8px; }
  #panel { top: 50px; height: calc(100vh - 70px); height: calc(100dvh - 70px); width: 260px; }
}
/* phones upright: menu moves to the thumb, panel becomes a bottom sheet */
@media (max-width: 570px) {
  :root { --menuwidth: calc(100vw - 20px); --gap: 10px; --safe: env(safe-area-inset-bottom, 0px); }
  #nav { top: auto; bottom: 0; left: 10px; padding-bottom: var(--safe); }
  .menu-button { font-size: 12px; text-align: center; height: 54px; padding-top: 16px; }
  .menu-button .close { display: none; }
  #panel { top: auto; bottom: calc(62px + var(--safe)); left: 10px; width: calc(100% - 20px); max-width: none; min-width: 0; height: 42vh; height: 42dvh; max-height: none; }
  #mute { top: calc(4px + env(safe-area-inset-top, 0px)); bottom: auto; right: 4px; }   /* the menu has the bottom edge, so sound goes up top */
  .item { margin-bottom: 22px; }
}
/* touch screens: comfortable tap targets */
@media (hover: none) {
  #back { padding: 11px 12px; }
  .item .links a, #modal .links a { padding: 8px 11px; }
}
}
@media (prefers-reduced-motion: reduce) { #panel, #intro { transition: none; } }

/* ---------- panel extras: group headings, tech line, clickable cards, popup ---------- */
.heading { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin: 4px 0 14px; padding-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, .45); }
.item { margin-bottom: 22px; }
.item .tech, #modal .tech { font-size: 11px; opacity: .8; margin-top: 6px; }
.item .tech b, #modal .tech b { font-weight: 700; }
.item.star .title::before { content: "\2605  "; }
.item.star { padding: 10px; border: 1px solid rgba(255, 255, 255, .7); border-radius: 4px; }
button.item { display: block; width: 100%; padding: 0; background: none; border: 0; text-align: left; }
/* row: true sections: cards side by side, scrolled sideways, in a strip along the bottom */
#panel.row .inner { flex-direction: row; gap: 14px; overflow-y: hidden; }
#panel.row .item { flex: 0 0 auto; width: auto; height: 100%; margin: 0; }
#panel.row .item img { width: 100%; height: calc(100% - 116px); object-fit: cover; }   /* leaves room for a caption underneath */
#panel.row .item img:only-child { width: auto; height: 100%; margin: 0; }   /* a bare picture keeps its own shape */
#panel.row .item .ph { height: calc(100% - 116px); aspect-ratio: auto; }
#panel.row .item:has(.title) { width: 300px; display: flex; flex-direction: column; }   /* flex: a button would otherwise centre its contents vertically */
#panel.row .item:has(.title) > * { flex: 0 0 auto; }
#panel.row .item .more { align-self: flex-start; }   /* captioned cards share one width so their pictures line up */
@media (min-width: 571px) { #panel.row { top: auto; bottom: 20px; right: 70px; width: auto; max-width: none; height: min(46vh, 420px); } }
button.item .more { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 5px 8px; border: 1px solid #fff; border-radius: 4px; }
button.item:hover .more { background: #fff; color: #222; }
.ph { display: grid; place-items: center; aspect-ratio: 16 / 10; margin-bottom: 6px; background: rgba(255, 255, 255, .14); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .55); transition: opacity .25s; }
#modal.closed { opacity: 0; pointer-events: none; }
#modal .card { position: relative; width: min(460px, 100%); max-height: min(80vh, 100dvh - 40px); overflow: auto; padding: 46px 20px 20px;
  background: rgba(44, 46, 58, .94); border-radius: 6px; scrollbar-width: none; }
#modal .card::-webkit-scrollbar { display: none; }   /* still scrolls, just without the bar, like the panel */
#modal img { width: 100%; display: block; margin-bottom: 12px; }
/* zoom: true items open as large as the window allows */
#modal.art .card { width: auto; max-width: 100%; max-height: calc(100dvh - 40px); }
#modal.art img { width: auto; max-width: 100%; max-height: calc(100dvh - 110px); margin: 0 auto 12px; }
#modal.art img:last-child { margin-bottom: 0; }
#modal .title { font-weight: 700; font-size: 16px; text-transform: uppercase; }
#modal .sub { font-size: 12px; opacity: .8; margin: 4px 0 12px; }
#modal .text { font-size: 13px; line-height: 1.55; }
#modal-close { position: absolute; top: 9px; right: 10px; z-index: 1; width: 28px; height: 28px; padding: 0 0 2px; border: 1px solid #fff; border-radius: 50%; background: rgba(0, 0, 0, .25); font-size: 18px; line-height: 1; }
@media (hover: none) { #modal-close { width: 36px; height: 36px; } }
