:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #d8dbe0;
  background: #101115;
}

* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; color: inherit; }

.desk {
  max-width: 74rem;
  margin: 0 auto;
  padding: .85rem .9rem .6rem;
}

.monitor {
  position: relative;
  margin: 0 auto .85rem;
  width: min(100%, clamp(27rem, calc((100svh - 19rem) * 16 / 9), 57rem));
  padding: .42rem;
  background: #050509;
  border: 1px solid #3c4047;
  border-radius: .5rem;
  box-shadow: 0 .35rem 1rem #0007;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: black;
}

.screen-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #090a0cbd;
  font-size: .875rem;
}

.screen-status[hidden] { display: none; }

.view-only {
  display: grid;
  place-items: center;
  background: #000;
  min-height: 100vh;
}

.view-only .monitor {
  width: min(100vw, calc(100vh * 16 / 9));
  margin: 0;
  border: 0;
  padding: 0;
}

.rack-scroll { overflow-x: auto; }

.rack {
  min-width: 36rem;
  display: grid;
  gap: .3rem;
}

.unit {
  background: linear-gradient(#24272e, #191b20);
  border: 1px solid #3b3f47;
  border-radius: .36rem;
  padding: .32rem clamp(.4rem, 1.5vw, 1.1rem) .44rem;
}

.unit h2 {
  margin: 0 0 .25rem;
  color: #aeb3bd;
  font-size: .68rem;
  font-weight: 650;
  letter-spacing: .055em;
}

.midi-knobs {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  place-items: center;
}

.studio-controls {
  display: grid;
  grid-template-columns: clamp(2rem, 6.5vw, 4.3rem) 1fr clamp(2rem, 6.5vw, 4.3rem);
  gap: clamp(.3rem, 1vw, .7rem);
  align-items: center;
  justify-items: center;
}

.keys {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: clamp(.12rem, .3vw, .22rem);
  padding: clamp(.12rem, .3vw, .22rem);
  background: #08090b;
  border-radius: .27rem;
}

.key {
  display: grid;
  place-items: center;
  aspect-ratio: 144 / 112;
  min-width: 0;
  padding: 0 .1rem;
  overflow: hidden;
  border: 1px solid #fff2;
  border-radius: .22rem;
  box-shadow: inset 0 1px 0 #fff2;
  background: #24262a;
  font-size: clamp(.5rem, 1.02vw, .7rem);
  font-weight: 700;
  line-height: 1.06;
  text-align: center;
  white-space: pre-line;
}

.key:not(:disabled), .push:not(:disabled) { cursor: pointer; }
.key:active:not(:disabled), .push:active:not(:disabled) { filter: brightness(1.3); }
button:focus-visible { outline: 2px solid #f5b646; outline-offset: 2px; z-index: 1; }

.dial {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 3.7rem;
  aspect-ratio: 1;
  background: #0c0d10;
  border: 1px solid #353940;
  border-radius: 50%;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.midi .dial { max-width: 3.25rem; }

.led {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  transform: rotate(var(--angle));
  pointer-events: none;
}

.led::before {
  content: "";
  position: absolute;
  top: 1%;
  left: 45%;
  width: 10%;
  height: 6.5%;
  border-radius: 2px;
  background: var(--led, #252831);
}

.push {
  z-index: 1;
  width: 65%;
  height: 65%;
  padding: 0;
  border: 1px solid #52565e;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #363940, #202227);
  box-shadow: 0 .12rem .2rem #000;
  color: #d6d8df;
  font-size: .68rem;
  font-weight: 650;
  touch-action: none;
}

.studio .push::before {
  content: "";
  display: block;
  width: 18%;
  aspect-ratio: 1;
  margin: auto;
  border-radius: 50%;
  background: var(--centre, #30333a);
}

.midi .push[data-down] { background: #83591c; }

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .2rem 1rem;
  color: #aeb3bd;
  font-size: .75rem;
}

footer p { margin: .4rem 0 0; }
#controls-status { color: #f5b646; }

@media (max-width: 49rem) {
  .desk { padding-inline: .5rem; }
  .rack-scroll { scrollbar-width: thin; }
}
