/* ==========================================================================
   bay — four benches, one engine
   ========================================================================== */

.bay-head {
  padding-bottom: 22px;
}

.bay-head .doc-head__title {
  font-size: clamp(44px, 7vw, 86px);
}

.bay-head__note {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 9px;
}

.bay-head__note::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--sig);
}

.bay-head__note.is-off::before {
  background: var(--hot);
}

.bay {
  padding-top: 26px;
}

.bench {
  background: var(--plate);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  position: relative;
}

.bench::before,
.bench::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--line);
  border-style: solid;
  pointer-events: none;
}

.bench::before {
  top: 5px;
  left: 5px;
  border-width: 1px 0 0 1px;
}

.bench::after {
  bottom: 5px;
  right: 5px;
  border-width: 0 1px 1px 0;
}

.bench__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 16px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--plate-2);
}

.bench__no {
  font-family: "Big Shoulders Display", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--hot);
  border: 1px solid var(--line);
  padding: 2px 6px;
  line-height: 1;
  background: var(--plate);
}

.bench__t {
  font-size: 26px;
  line-height: 1;
}

.bench__sub {
  font-size: 12px;
  color: var(--dim);
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: 0.04em;
}

.bench__live {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hot);
}

.bench__body {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
}

.bench__ctl {
  padding: 16px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.knob {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  align-items: baseline;
}

.knob__l {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.knob__v {
  font-size: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.knob input[type="range"] {
  grid-column: 1 / -1;
}

.knob__hint {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--faint);
  border-top: 1px dotted var(--line);
  padding-top: 10px;
  margin-top: 2px;
}

.knob--select select {
  grid-column: 1 / -1;
  width: 100%;
  background: var(--plate-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  padding: 6px 8px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.knob--select select:focus {
  outline: none;
  border-color: var(--hot);
}

/* --- the range itself --------------------------------------------------- */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: ew-resize;
  margin: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border: 1px solid var(--line);
  background-color: var(--plate-3);
  background-image: repeating-linear-gradient(
    90deg,
    color-mix(in oklab, var(--ink) 22%, transparent) 0 1px,
    transparent 1px 12px
  );
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 9px;
  height: 18px;
  margin-top: -7px;
  background: var(--hot);
  border: 1px solid color-mix(in oklab, var(--hot) 60%, #000);
  box-shadow: 0 0 0 1px #ffffff40 inset;
}

input[type="range"]:active::-webkit-slider-thumb {
  background: var(--ink);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border: 1px solid var(--line);
  background: var(--plate-3);
}

input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 18px;
  border-radius: 0;
  background: var(--hot);
  border: 1px solid color-mix(in oklab, var(--hot) 60%, #000);
}

/* --- stage -------------------------------------------------------------- */

.stage {
  padding: 12px 14px 8px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.stage__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
}

.stage__key {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.key {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
}

.key--hot {
  background: var(--hot);
}

.key--sig {
  background: var(--sig);
}

.key--ink {
  background: var(--ink);
}

.key--dash {
  background: transparent;
  border-top: 1px dashed var(--dim);
  height: 0;
  width: 10px;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 236px;
  flex: 1;
}

.stage__x {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--faint);
  letter-spacing: 0.06em;
  padding-top: 4px;
}

.lanes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.lane {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  height: 68px;
}

.lane__n {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: right;
}

.lane canvas {
  display: block;
  width: 100%;
  height: 60px;
}

/* --- readouts ----------------------------------------------------------- */

.bench__out {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--plate-2);
  flex-wrap: wrap;
}

.read {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 76px;
}

.read__n {
  font-size: 21px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.read__n.hot {
  color: var(--hot);
}

.read__l {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.bench__say {
  margin-left: auto;
  max-width: 46ch;
  font-size: 12px;
  line-height: 1.55;
  color: var(--dim);
  border-left: 2px solid var(--line);
  padding-left: 12px;
}

.bay__foot {
  max-width: 72ch;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--faint);
  padding-block: 10px 40px;
}

.bay__foot a {
  color: var(--dim);
  border-bottom: 1px solid var(--line);
}

.bay__foot a:hover {
  color: var(--hot);
  border-color: var(--hot);
}

@media (width <= 1080px) {
  .bench__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .bench__ctl {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
  }

  .knob__hint {
    grid-column: 1 / -1;
  }
}

@media (width <= 860px) {
  .bench__head {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .bench__sub {
    display: none;
  }

  .bench__t {
    font-size: 22px;
  }

  .bench__ctl {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage canvas {
    height: 190px;
  }

  .lane {
    grid-template-columns: 54px minmax(0, 1fr);
    height: 62px;
  }

  .lane canvas {
    height: 56px;
  }

  .bench__out {
    gap: 14px 20px;
  }

  .read__n {
    font-size: 18px;
  }

  .bench__say {
    margin-left: 0;
    max-width: none;
    border-left: 0;
    padding-left: 0;
    border-top: 1px dotted var(--line);
    padding-top: 10px;
  }

  .stage__key {
    display: none;
  }
}
