* {
  box-sizing: border-box;
}

:root {
  --ink: #171512;
  --readout-bg: rgba(20, 17, 13, 0.78);
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Courier New", Courier, monospace;
  background: #111412;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: auto;
}


.page {
  position: relative;
  width: min(1672px, 100vw, calc(100vh * 1.776833));
}

.instrument {
  position: relative;
  width: 100%;
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  user-select: none;
}

.instrument-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

/* Main dial: the knob image itself rotates, preserving the physical material. */
.dial-zone {
  position: absolute;
  left: 49.820574%;
  top: 51.328374%;
  width: 18.181818%;
  aspect-ratio: 1;
  z-index: 5;
  transform: translate(-50%, -50%);
}


.dial {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  z-index: 1;
  cursor: grab;
  touch-action: none;
  outline-offset: 7px;
}

.dial:active {
  cursor: grabbing;
}

.dial:focus-visible {
  outline: 3px solid rgba(255, 235, 190, 0.96);
}

.dial-face {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 1;
  background: url("assets/main-dial-face.png") center / 100% 100% no-repeat;
  transform: rotate(var(--dial-angle, 28deg));
  transform-origin: 50% 50%;
  transform-box: border-box;
  backface-visibility: hidden;
  pointer-events: none;
}

/* Small readout remains the only added visible text. */
.orientation-readout {
  position: absolute;
  left: 39.250000%;
  top: 72.450000%;
  width: 21.000000%;
  z-index: 7;
  padding: 5px 8px;
  border-radius: 3px;
  color: rgba(245, 235, 214, 0.96);
  background: var(--readout-bg);
  font-size: clamp(8px, 0.70vw, 12px);
  text-align: center;
  letter-spacing: 0.025em;
  pointer-events: none;
}

/* Rotary volume knob with a 270-degree physical sweep and hard stops.
   The centre matches the printed semicircular scale in radio-reference.png.
   The scale, MIN/MAX labels and fixed shadow remain in the background image. */
.volume-zone {
  position: absolute;
  left: 25.298660%;
  top: 79.300000%; /*top: 78.746015%;*/
  width: 5.263158%;
  aspect-ratio: 1;
  z-index: 6;
  transform: translate(-50%, -50%);
}



.volume-knob {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  z-index: 1;
  cursor: grab;
  touch-action: none;
  outline-offset: 5px;
}

.volume-knob:active {
  cursor: grabbing;
}

.volume-knob:focus-visible {
  outline: 2px solid rgba(255, 235, 190, 0.98);
}

.volume-face {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: url("assets/volume-dial-face.png") center / 100% 100% no-repeat;
  transform: rotate(var(--volume-angle, 59.4deg));
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  box-shadow: none;
  filter: none;
  pointer-events: none;
}

/* Live waveform precisely overlays the black display baked into the panel. */
.monitor-zone {
  position: absolute;
  left: 72.308612%;
  top: 24.760893%;
  width: 13.217703%;
  height: 12.858661%;
  z-index: 6;
  overflow: hidden;
  border-radius: 2px;
  background: #060809;
  pointer-events: none;
}

.soundscape-waveform {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.94;
}

.mobile-note {
  display: none;
  color: #eee4d4;
  text-align: center;
  line-height: 1.5;
  max-width: 760px;
  margin: 16px auto 0;
  font-size: 0.85rem;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 820px) {
  .mobile-note {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dial-face,
  .volume-face {
    transition: none;
  }
}
