@font-face {
  font-family: Inter;
  src: url('./assets/Inter.woff2') format('woff2');
  font-display: swap;
}
:root {
  color-scheme: dark;
  color: #fff0d4;
  background: #191b1b;
  font-family: Inter, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, summary { font: inherit; }
button, summary, input[type=range] { cursor: pointer; }
button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid #80ebed;
  outline-offset: 3px;
}
.experience {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 95%, #40403e, #202221 47%, #181a19 82%);
}
.showcase {
  width: min(100%, 134svh);
  aspect-ratio: 1.34;
  display: grid;
  grid-template-rows: 57fr 11.4fr 15.5fr 16.1fr;
  position: relative;
  container-type: inline-size;
  isolation: isolate;
}
/* Four continuous bands of the same studio plate keep the shelf, mouldings,
   enamel and grille registered while providing taller controls on phones. */
.cabinet-band {
  position: relative;
  min-height: 0;
  background-image: url('./assets/cabinet-studio.webp');
  background-repeat: no-repeat;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.dome { background-size: 100% 189.39394%; background-position: center top; }
.selector-deck { background-size: 100% 877.19298%; background-position: center 59.59368%; }
.fascia { background-size: 100% 645.16129%; background-position: center 75.97633%; }
.speaker { background-size: 100% 492.61084%; background-position: center bottom; }
.speaker {
  mask-image: linear-gradient(90deg,transparent,#000 4%,#000 96%,transparent),
              linear-gradient(#000 92%,transparent);
  mask-composite: intersect;
}
#viewport, .dome-glass {
  position: absolute;
  left: 12%; width: 76%; top: 4%; height: 92%;
  border-radius: 23% 23% 7% 7% / 47% 47% 8% 8%;
}
#viewport { display: block; touch-action: none; }
.dome-glass {
  pointer-events: none;
  background: linear-gradient(111deg, transparent 7%, #f9f7e806 19%, transparent 30% 72%, #ffffed06 86%, transparent 94%);
}
.model-status {
  position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%);
  padding: .55em 1em; border-radius: 2em; background: #202322df;
  font-size: 12px; text-align: center;
}
.song-rack {
  position: absolute; inset: 10% 15% 14%;
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr));
  align-items: stretch; gap: 1%;
}
.song-slot {
  position: relative; min-width: 0; border-radius: 5px; padding: 0;
  border: 2px solid #4a3c2c;
  color: #352b21;
  background: linear-gradient(#efe0c3 0%, #e8d6b5 16%, #dcc5a3 70%, #cfb48e 86%, #b49472);
  box-shadow: inset 0 1px 2px #fff4df, inset 0 -3px 1px #89745c, 0 2px 4px #100d0c;
}
.slot-label {
  height: 100%; display: flex; align-items: center; justify-content: center;
  gap: .47em; padding: 0 .25em;
}
.slot-label b {
  font: 650 clamp(9px,.95cqw,16px)/1 Inter, sans-serif;
  color: #76543b;
}
.slot-label em {
  font: italic 500 clamp(12px,1.44cqw,23px)/1.02 Georgia, serif;
}
.bulbs {
  display: block; position: absolute; inset: auto 18% 8%; height: 2px;
  border-radius: 4px; background: #73554044;
}
.song-slot.selected {
  background: linear-gradient(#fff0cf, #ffe6ae 37%, #efd19b 78%, #cda777);
}
.song-slot.selected .bulbs { background: #ffc267; box-shadow: 0 0 5px #f39639; }
.song-slot.selected .slot-label b::before {
  content: ''; display: inline-block; width: .47em; height: .47em;
  margin: 0 .32em .1em 0; border-radius: 50%;
  background: #cb5422; box-shadow: inset 0 1px 1px #ffdf90, 0 0 3px #ff9b44;
}
.song-slot:active { transform: translateY(1px); }
.front-face {
  position: absolute; inset: 15% 15% 13%;
  display: grid; grid-template-columns: minmax(0,1fr) auto;
  align-items: center; gap: 3%;
}
.title-block { min-width: 0; padding-left: 2%; }
.title-block h1 {
  font: italic 400 clamp(22px,3.6cqw,64px)/1.03 Georgia, serif;
  letter-spacing: -.045em; margin: 0;
  color: #f4dfaf; text-shadow: 0 1px 1px #341510, 0 -1px #fff2;
}
.title-block p {
  margin: .30em 0 0; color: #f0e4ce;
  font-size: clamp(10px,1.05cqw,16px); line-height: 1.18;
}
#sectionLabel:not(:empty) {
  display: block; font-size: clamp(9px,.8cqw,12px); color: #ffd995;
}
.transport { display: flex; align-items: center; gap: 1.5cqw; }
.play-button {
  display: grid; place-items: center;
  width: clamp(44px,4.15cqw,68px); aspect-ratio: 1; padding: 0;
  border: 2px solid #8a7a65; border-radius: 50%;
  background: radial-gradient(ellipse at 34% 25%,#fff4df,#c6baa5 51%,#847a68 76%,#433b31);
  box-shadow: 0 0 0 2px #392d23, inset 0 0 0 1px #fff2d9,0 3px 4px #140706;
  color: #382c22; font: 700 clamp(17px,1.7cqw,28px)/1 Arial,sans-serif;
}
.volume-shell {
  width: clamp(90px,12.5cqw,205px);
  display: grid; gap: 2px; padding: 4px 13px;
  background: linear-gradient(120deg,#3a2922,#221914 62%,#46352b);
  border: 1px solid #b99c70; border-radius: 18px;
  box-shadow: inset 0 2px 3px #170d0b, 0 1px 0 #d3aa7444;
}
.volume-shell label {
  text-align: center; font-size: clamp(9px,.75cqw,12px);
  color: #e6d7b8; letter-spacing: .07em;
}
.volume-shell input { width: 100%; height: 14px; margin: 0; accent-color: #d1af75; }
.front-face {grid-template-rows: minmax(0,1fr) auto; row-gap:0}
.timeline {grid-column:1/-1; display:flex; gap:.65em; align-items:center; padding:0 1%; color:#f4dfaf; font:clamp(10px,1cqw,14px)/1 system-ui; font-variant-numeric:tabular-nums}
.seek-track {position:relative; flex:1; min-width:0}
#seek {width:100%; margin:0; appearance:none; display:block; height:18px; background:transparent; cursor:pointer; --played:0%}
#seek::-webkit-slider-runnable-track {height:4px; border-radius:4px; background:linear-gradient(to right,#dfbb82 var(--played),#785047 var(--played))}
#seek:hover::-webkit-slider-runnable-track {height:6px}
#seek::-webkit-slider-thumb {appearance:none; width:12px; height:12px; margin-top:-4px; border-radius:50%; background:#fae1ac; opacity:0}
#seek:hover::-webkit-slider-thumb,#seek:focus-visible::-webkit-slider-thumb,#seek:active::-webkit-slider-thumb {opacity:1}
#seek:hover::-webkit-slider-thumb {margin-top:-3px}
#seek::-moz-range-track {height:4px; background:#785047}
#seek::-moz-range-progress {background:#dfbb82; height:4px}
#seekHint {position:absolute; bottom:100%; transform:translateX(-50%); padding:4px; background:#392020; color:#fff; border-radius:3px; pointer-events:none}
.cabinet-controls {
  position: fixed; right: max(10px,env(safe-area-inset-right)); top: max(10px,env(safe-area-inset-top)); z-index: 5;
  color: #ece4d5; font-size: 12px; line-height: 1.45;
}
.cabinet-controls summary {
  list-style: none; border: 1px solid #887960; border-radius: 20px;
  background: #242421ee; padding: 7px 14px; text-align: center;
}
.cabinet-controls summary::-webkit-details-marker { display: none; }
.cabinet-controls-content {
  position: absolute; right: 0; top: calc(100% + 5px);
  width: min(325px,90vw); max-height: 70svh; overflow: auto;
  border: 1px solid #887960; border-radius: 12px;
  padding: 14px; background: #242421fa; box-shadow: 0 8px 25px #0008;
}
.cabinet-controls-content p { margin: 11px 0 0; }
#broomTiming:not([hidden]) { display: block; margin-top: 12px; }
#broomTiming output { font-variant-numeric: tabular-nums; }
#broomDelay { display: block; width: 100%; margin: 6px 0; }
.view-buttons { display: flex; gap: 6px; }
.view-buttons button { padding: 7px 13px; border: 1px solid #726958; border-radius: 5px; background: #302e29; color: inherit; }
.view-buttons .active { color: #ffe0a6; border-color: #d7b67b; }
@media (max-width: 700px) and (orientation: portrait) {
  .experience { align-content: start; padding-top: max(62px,8svh); }
  .cabinet-controls { position: absolute; }
  .showcase {
    aspect-ratio: auto; width: 100%;
    grid-template-rows: clamp(220px,63vw,380px) 128px 110px clamp(68px,17vw,114px);
  }
  .song-rack { inset: 10% 15% 13%; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; }
  .slot-label { gap: 4px; }
  .slot-label em { font-size: clamp(11px,3.1vw,17px); }
  .bulbs { height: 1px; }
  .front-face { inset: 13% 14% 14%; gap: 6px; }
  .title-block { padding-left: 0; }
  .title-block h1 { font-size: clamp(18px,5vw,33px); }
  .title-block p { font-size: clamp(10px,2.5vw,14px); }
  .transport { gap: 5px; }
  .volume-shell { width: clamp(59px,16vw,92px); padding: 4px 7px; }
  .front-face {row-gap:0}
}
@media (max-height: 460px) and (orientation: landscape) {
  .experience { min-height: 460px; }
  .showcase { width: min(100%,690px); }
  .play-button { width: 36px; }
  .cabinet-controls { top: 4px; right: 4px; }
}

.cabinet-credits {
  position:fixed; top:max(10px,env(safe-area-inset-top)); left:max(10px,env(safe-area-inset-left)); z-index:5;
  border:1px solid #887960; border-radius:20px; padding:7px 16px; background:#242421ee;
  color:#f5e7c9; font:12px/1.45 Inter,Arial,sans-serif; text-decoration:none;
}
.cabinet-credits:hover {background:#4b3030}
.cabinet-credits:focus-visible {outline:3px solid #80ebed}
