.zones { display: grid; gap: 3.25rem; }

.zone-name {
  margin: 0 0 1.1rem;
  color: var(--signal-ink);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.controls { margin: 0; display: grid; gap: 1.1rem 2.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.controls > div { min-width: 0; display: grid; gap: .3rem; }

.controls dd:has(.traces), .controls dd:has(.readout) { padding-bottom: .9rem; }

.controls dt { font-size: .95rem; font-weight: 700; letter-spacing: .06em; }

.controls dd { margin: 0; min-width: 0; max-width: 46rem; color: var(--ink-soft); font-size: .95rem; line-height: 1.45; }

@media (max-width: 720px) {
  .zones { gap: 2.5rem; }
  /* Buy the panels back some width at phone sizes. */
  .traces { gap: .9rem; }
  .trace figcaption { font-size: .75rem; letter-spacing: 0; }
}

.controls > div.span-both { grid-column: 1 / -1; }

/* Reference layout: name on the left, what it does on the right, so a
   reader scanning for one knob runs down a single column of names. Below
   66rem the pairs stack as before. */
@media (min-width: 66rem) {
  .zones { gap: 2.75rem; }
  .zones > div { padding-top: 1.5rem; border-top: 1px solid var(--line); }
  .zones > div:first-child { border-top: 0; padding-top: 0; }
  .zone-name { margin-bottom: 1.4rem; }
  .controls { gap: 1.6rem; }
  .controls > div {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: .3rem 3rem;
    align-items: start;
  }
  .controls dt { font-size: 1rem; padding-top: .1rem; }
  .controls dd, .traces { max-width: 46rem; }
}

.segmented {
  display: inline-flex;
  padding: 1px;
  border-radius: 999px;
  background: #faf8f2;
  box-shadow: inset 0 0 0 1px rgb(9 8 6 / .12);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
}

.seg {
  padding: .42rem .95rem;
  border-radius: 999px;
  color: rgb(23 20 16 / .71);
}

.seg.is-on { background: #16140f; color: #f3f0e8; }

/* The capsule ships as a labelled picture and stays one without scripts.
   controls.js upgrades it to a radiogroup and adds .rubber-on: the segs
   grow to touch height, the is-on paint moves to a shared ::before thumb
   the script drives through --rl/--rw, and the list underneath lights the
   row for the mode under the thumb. */
.segmented.rubber-on {
  position: relative;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}

.segmented.rubber-on[data-held] { cursor: grabbing; }

.segmented.rubber-on::before {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: var(--rl, 1px);
  width: var(--rw, 0);
  background: #16140f;
  border-radius: 999px;
}

.segmented.rubber-on .seg {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-block: .2rem;
  cursor: pointer;
  transition: color var(--duration-quick, 150ms) ease;
}

.segmented.rubber-on .seg.is-on { background: transparent; }

/* No ring on the capsule either, matching the home-page switch: the
   keyboard-focus indicator was traded away deliberately (2.4.7 fails on
   this control); selection reads on the thumb, arrows still select. */
.segmented.rubber-on .seg:focus-visible { outline: none; }

.modes { margin: 2rem 0 0; padding: 0; list-style: none; display: grid; gap: .7rem; }

.modes li { max-width: 34rem; }

.modes li.is-live b { color: var(--signal-ink); }

@media (forced-colors: active) {
  /* The dark pill is a background paint, which forced colours drops; the
     selection survives as the system selection pair, on the static is-on
     segment and on the script-driven thumb alike. */
  .seg.is-on { background: Highlight; color: HighlightText; }
  .segmented.rubber-on::before { background: Highlight; }
}

.modes b { display: inline-block; min-width: 4.4rem; color: var(--ink); font-weight: 700; letter-spacing: .06em; }

.mode-note { max-width: 34rem; }

/* One column: MODE and the two traces need the width, and a reference
   list reads straight down anyway. */
.controls { grid-template-columns: minmax(0, 1fr); }

/* Every paragraph inside a dd is reset here, so anything that needs its
   own spacing has to win at this specificity or it silently loses it.
   .trace-key lost exactly that way and sat flush against the figure
   captions; measured gap was 0 px. Add the override next to this rule,
   not next to the block it belongs to. */
.controls dd > p { margin: 0; max-width: 34rem; }

.controls dd > p.mode-intro { margin-bottom: 1.15rem; }

.controls dd > p.mode-note { margin-top: 2.25rem; }

.controls dd > p.trace-key { margin-top: 1.7rem; }

.traces {
  margin-top: 1.4rem;
  max-width: 46rem;
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trace { margin: 0; }

.trace svg { display: block; width: 100%; height: auto; overflow: visible; }

.t-target { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }

.t-sung { fill: none; stroke: rgb(23 20 16 / .26); stroke-width: 1.6; }

.t-out { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

.trace figcaption {
  margin-top: .7rem;
  letter-spacing: .02em;
  color: var(--ink-soft);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.trace-key { max-width: 34rem; font-size: .8rem; line-height: 1.5; color: rgb(23 20 16 / .6); }

/* Same reveal contract the home page uses: the observer adds js-reveal and
   motion-visible, and reduced motion never gets that far, so the drawn
   state below is what everyone else sees. */
html.js-reveal .trace.motion-reveal .t-out { stroke-dasharray: 420; stroke-dashoffset: 420; }

html.js-reveal .trace.motion-visible .t-out { animation: trace-draw 1400ms cubic-bezier(.22,.8,.28,1) both; }

@keyframes trace-draw { to { stroke-dashoffset: 0; } }

.f-harm { stroke: rgb(23 20 16 / .45); stroke-width: 1.4; }

.f-ghost { fill: none; stroke: rgb(23 20 16 / .3); stroke-width: 1.4; stroke-dasharray: 3 4; }

.f-floor { stroke: var(--line); stroke-width: 1; }

/* The dial's own readout row: SUNG, the detected note, the target note,
   TRUE. Weights follow the editor -- detected at 70%, target at full
   (editor_gpui/render.rs). */
.readout {
  margin-top: 1.4rem;
  display: inline-flex;
  align-items: baseline;
  gap: .55rem;
  padding: .7rem 1.1rem;
  border-radius: .3rem;
  background: #faf8f2;
  box-shadow: inset 0 0 0 1px rgb(9 8 6 / .1);
}

.r-label { font-size: .75rem; font-weight: 700; letter-spacing: .16em; color: rgb(23 20 16 / .85); }

.r-note { min-width: 1.9rem; text-align: center; font-size: 1.3rem; line-height: 1; }

.r-detected { color: rgb(23 20 16 / .7); }

.r-target { color: var(--ink); }

/* Which widget the control actually is: knob::element() for the five
   knobs, a segmented track for MODE and FORMANT. The readouts get no
   mark -- they are not controls, and the zone heading says so. */
.wid {
  width: .95em;
  height: .95em;
  margin-right: .55em;
  flex: none;
  fill: none;
  stroke: rgb(23 20 16 / .6);
  stroke-width: 1.25;
  stroke-linecap: round;
}

.wid-sw circle { fill: rgb(23 20 16 / .55); stroke: none; }

.controls dt { display: flex; align-items: center; letter-spacing: .01em; }

.legend {
  margin: 1.1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  color: rgb(23 20 16 / .6);
  font-size: .8rem;
}

.legend span { display: flex; align-items: center; }

.legend .wid { stroke: rgb(23 20 16 / .5); }

.back-link { margin: 0 0 var(--space-3); font-size: .85rem; }

/* The page's one navigation link gets the same 44px target the header's do. */
.back-link a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink-soft); text-decoration: none; }

.back-link a:hover, .back-link a:focus-visible { color: var(--ink); text-decoration: underline; }
