/* ============================================================
   IPELENG TAU / THE TUNER
   Channel one tunes, channel two is the rack. Every value below
   comes from tokens.css; the only raw numbers are the geometry
   of drawn parts, the way rig.css does it.
   ============================================================ */

[hidden] { display: none !important; }

.wrap--rack { max-width: 44rem; }

.unit-top { padding: var(--s5) 0 var(--s5); }
@media (min-width: 48rem) { .unit-top { padding: var(--s7) 0 var(--s6); } }


/* ============================================================
   THE UNIT  /  a half rack tuner in cream tolex
   ( .rack is already the producer wing grid in rig.css, so this
     part is named for what it is )
   ============================================================ */

.tuner {
  position: relative;
  padding: var(--s4) calc(var(--s4) + 18px);
  border-radius: var(--r-cab);
  background-color: var(--tolex);
  background-image:
    repeating-linear-gradient(34deg,  rgba(255,252,242,.16) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-56deg, rgba(90,74,44,.11)    0 1px, transparent 1px 5px),
    radial-gradient(130% 80% at 50% -10%, var(--tolex-hi) 0%, var(--tolex) 46%, var(--tolex-shade) 100%);
  background-size: 5px 5px, 5px 5px, 100% 100%;
  box-shadow:
    inset 0 1px 0 rgba(255,252,242,.6),
    inset 0 -2px 6px rgba(90,74,44,.35),
    0 0 0 1px var(--tolex-edge),
    var(--sh-deep);
}
@media (min-width: 34rem) { .tuner { padding: var(--s5) calc(var(--s5) + 20px); } }

/* Rack ears: the flanges the unit is bolted into the rack by. */
.tuner__ear {
  position: absolute; top: 10px; bottom: 10px; width: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: var(--s3) 0;
  border-radius: 3px;
  background: linear-gradient(150deg, var(--cap-hi) 0%, var(--cap) 44%, var(--cap-lo) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 1px 3px rgba(0,0,0,.35);
}
.tuner__ear--l { left: 6px; }
.tuner__ear--r { right: 6px; }
@media (min-width: 34rem) { .tuner__ear { width: 20px; left: 8px; } .tuner__ear--r { left: auto; right: 8px; } }

.tuner__vent {
  display: block; position: absolute; left: 34px; right: 34px; bottom: 4px; height: 7px;
  border-radius: 2px;
}

.face { padding: var(--s4) var(--s4) var(--s5); }
@media (min-width: 34rem) { .face { padding: var(--s5) var(--s6) var(--s6); } }

.selector--tune { margin-bottom: var(--s4); }

.face__top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s4) var(--s5); }
.face__id { flex: 1 1 12rem; min-width: 0; }
.face__pwr { display: flex; align-items: flex-end; gap: var(--s5); flex: none; }

.badge--unit {
  font-size: clamp(1.45rem, 6.4vw, 2.6rem);
  letter-spacing: -0.022em;
}
.badge--unit + .legend { margin-top: var(--s1); }

.ctl { display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.ctl--grow { flex: 1 1 10rem; min-width: 0; align-items: stretch; }
.ctl--grow .legend { text-align: center; }


/* ---- POWER  /  a rocker, and the only thing that opens the mic --- */
.rocker {
  appearance: none; border: 0; cursor: pointer; position: relative;
  width: 78px; height: 44px; padding: 0; border-radius: 5px;
  background: linear-gradient(180deg, var(--chassis-lo) 0%, var(--chassis) 60%, var(--chassis-hi) 100%);
  box-shadow: inset 0 3px 7px rgba(0,0,0,.7), inset 0 -1px 0 rgba(255,250,240,.16), 0 1px 0 rgba(255,252,242,.5);
}
.rocker__paddle {
  position: absolute; top: 4px; left: 4px; width: 38px; height: 36px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--cap-hi) 0%, var(--cap) 52%, var(--cap-lo) 100%);
  box-shadow: var(--bevel-up), 0 2px 5px rgba(0,0,0,.55);
  transform: translateX(0);
  transition: transform var(--d-click) var(--e-switch);
}
.rocker[aria-checked="true"] .rocker__paddle { transform: translateX(32px); }
.rocker:active .rocker__paddle { box-shadow: var(--bevel-down), 0 1px 2px rgba(0,0,0,.5); }


/* ---- CHANNEL SELECTOR  /  two keys that depress -------------- */
.chan { display: flex; align-items: center; gap: var(--s4); margin: var(--s4) 0 var(--s5); }
.chan__keys, .keys { display: flex; gap: var(--s2); }

.key {
  appearance: none; border: 0; cursor: pointer;
  min-height: 44px; padding: var(--s2) var(--s5);
  border-radius: var(--r-panel);
  background: linear-gradient(180deg, var(--panel-hi) 0%, var(--panel) 55%, var(--panel-deep) 100%);
  color: var(--on-panel-soft);
  font-size: var(--t-legend);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 700;
  letter-spacing: var(--tr-legend); text-transform: uppercase;
  box-shadow: var(--bevel-up), 0 2px 4px rgba(90,74,44,.4);
  transition: transform var(--d-click) var(--e-switch), box-shadow var(--d-click) var(--e-switch), color var(--d-lamp) var(--e-out);
}
.key:active { transform: translateY(2px); }
.key.is-down {
  color: var(--on-panel);
  transform: translateY(2px);
  box-shadow: var(--bevel-down);
}
.key.is-down::after {
  content: ''; display: block; height: 2px; margin-top: 3px; border-radius: 1px;
  background: var(--badge-ink); opacity: .8;
}


/* ============================================================
   THE READOUT  /  the arc, the needle, the note
   ============================================================ */

.chn { position: relative; }

.readout {
  --R: 104px;      /* radius the lamp segments sit on */
  --py: 162px;     /* the needle pivot, measured from the top */
  position: relative;
  height: 190px;
  margin: 0 0 var(--s5);
  border-radius: var(--r-panel);
  background:
    radial-gradient(120% 90% at 50% 108%, rgba(36,31,23,.10) 0%, transparent 60%),
    linear-gradient(178deg, var(--panel-hi) 0%, var(--panel) 52%, var(--panel-deep) 100%);
  box-shadow: var(--bevel-down);
  overflow: hidden;
}
@media (min-width: 34rem) { .readout { --R: 150px; --py: 214px; height: 248px; } }

.arc, .needle { position: absolute; inset: 0; pointer-events: none; }

.seg {
  position: absolute; left: 50%; top: var(--py);
  width: 11px; height: 20px; margin: -10px 0 0 -5.5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #17140F 0%, #0A0806 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.9), 0 1px 0 rgba(255,252,242,.4);
  transform: rotate(calc((var(--i) - 10) * 5.8deg)) translateY(calc(var(--R) * -1));
}
@media (min-width: 34rem) { .seg { width: 13px; height: 26px; margin: -13px 0 0 -6.5px; } }

.seg__l {
  position: absolute; inset: 1px; border-radius: 2px;
  background: radial-gradient(circle at 50% 30%, var(--lamp-core) 0 22%, var(--lamp) 52%, #C25400 100%);
  box-shadow: var(--lamp-lit);
  opacity: 0; transform: scaleY(.5); transform-origin: center;
  will-change: opacity, transform;
}
.seg--mid { width: 13px; margin-left: -6.5px; }
@media (min-width: 34rem) { .seg--mid { width: 16px; margin-left: -8px; } }
.seg--mid .seg__l {
  background: radial-gradient(circle at 50% 30%, var(--lamp-core) 0 22%, var(--lamp) 52%, #C25400 100%);
}
.arc.is-tuned .seg--mid .seg__l {
  background: radial-gradient(circle at 50% 30%, var(--lamp-tuned-core) 0 22%, var(--lamp-tuned) 52%, #14713A 100%);
  box-shadow: var(--lamp-tuned-lit);
}

/* the stamped centre mark above the arc */
.detent {
  position: absolute; left: 50%; top: var(--py);
  width: 2px; height: 9px; margin-left: -1px; border-radius: 1px;
  background: var(--badge-ink); opacity: .55;
  transform: translateY(calc((var(--R) + 17px) * -1));
}

.needle__pin {
  position: absolute; left: 50%; top: var(--py);
  width: 4px; height: 24px; margin: 0 0 0 -2px;
  border-radius: 2px 2px 1px 1px;
  background: linear-gradient(180deg, var(--badge-ink) 0%, #4A4133 78%, rgba(74,65,51,.2) 100%);
  box-shadow: 0 0 0 1px rgba(255,252,242,.35);
  transform: translateY(calc((var(--R) - 20px) * -1));
}
@media (min-width: 34rem) {
  .needle__pin { height: 28px; transform: translateY(calc((var(--R) - 22px) * -1)); }
}
.needle { transform-origin: 50% var(--py); }

.arc__end {
  position: absolute; top: var(--s3);
  color: var(--on-panel-soft);
}
.arc__end--flat  { left: var(--s3); }
.arc__end--sharp { right: var(--s3); }

.note {
  position: absolute; left: 0; right: 0;
  top: calc(var(--py) - var(--R) * 0.55);
  display: flex; align-items: baseline; justify-content: center; gap: 2px;
  pointer-events: none;
}
.note__name {
  font-size: clamp(2.8rem, 14vw, 4.6rem);
  font-variation-settings: 'wdth' var(--w-ultra), 'wght' 800;
  letter-spacing: -0.03em; line-height: .9;
  color: var(--badge-ink);
  text-shadow: 0 1px 0 rgba(255,252,238,.85), 0 -1px 1px rgba(70,54,18,.25);
  font-variant-numeric: tabular-nums;
}
.note__oct {
  font-size: var(--t-body);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 700;
  color: var(--on-panel-soft);
}

.readout__status {
  position: absolute; left: var(--s4); right: var(--s4); bottom: var(--s3);
  text-align: center; color: var(--on-panel);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 700;
}
.readout__status[data-state="warn"] { color: var(--on-panel-soft); }


/* ============================================================
   STRING ROW
   ============================================================ */

.strings-wrap { align-items: stretch; }
.strings { display: flex; gap: var(--s2); }

.str {
  appearance: none; border: 0; cursor: pointer;
  flex: 1 1 0; min-width: 0; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: var(--s2) 0 var(--s2);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--chassis-hi) 0%, var(--chassis) 46%, var(--chassis-lo) 100%);
  box-shadow: var(--bevel-dark), 0 2px 0 rgba(60,48,26,.55), 0 4px 10px rgba(0,0,0,.35);
  color: var(--ink-soft);
  transition: transform var(--d-click) var(--e-switch), color var(--d-lamp) var(--e-out), box-shadow var(--d-click) var(--e-switch);
}
.str:active { transform: translateY(2px); box-shadow: inset 0 2px 5px rgba(0,0,0,.6); }
.str .jewel { width: 9px; height: 9px; }
.str__n {
  font-size: var(--t-body-sm);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 800;
  letter-spacing: .04em; line-height: 1.1;
}
.str__o {
  font-size: var(--t-legend-xs);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 600;
  letter-spacing: var(--tr-legend); color: var(--ink-faint); line-height: 1;
}
.str.is-target { color: var(--ink); }
.str.is-target .jewel {
  background:
    radial-gradient(circle at 36% 30%, var(--lamp-core) 0 20%, transparent 46%),
    radial-gradient(circle at 50% 55%, var(--lamp) 0 55%, #C25400 100%);
  box-shadow: var(--lamp-lit), inset 0 1px 2px rgba(0,0,0,.3);
}
.str.is-ok { color: var(--ink); }
.str.is-ok .jewel {
  background:
    radial-gradient(circle at 36% 30%, var(--lamp-tuned-core) 0 20%, transparent 46%),
    radial-gradient(circle at 50% 55%, var(--lamp-tuned) 0 55%, #14713A 100%);
  box-shadow: var(--lamp-tuned-lit), inset 0 1px 2px rgba(0,0,0,.3);
}
.str.is-pick { box-shadow: var(--bevel-dark), 0 0 0 1px var(--gold-mid), 0 3px 9px rgba(0,0,0,.4); }


/* ============================================================
   ROTARY SELECTORS  /  detented, not dropdown menus
   ============================================================ */

.face__row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s5); margin-top: var(--s5); }

.rotary { display: flex; align-items: center; gap: var(--s3); flex: 0 1 auto; }
.rotary__dial { position: relative; width: 76px; height: 76px; flex: none; display: grid; place-items: center; }
.rotary--sm .rotary__dial { width: 66px; height: 66px; }
.rotary__ticks { position: absolute; inset: 0; pointer-events: none; }
.tick {
  position: absolute; left: 50%; top: 50%;
  width: 2px; height: 7px; margin: -1px 0 0 -1px; border-radius: 1px;
  background: var(--on-panel-soft); opacity: .45;
  transform: rotate(var(--d)) translateY(-34px);
  transform-origin: 50% 1px;
}
.rotary--sm .tick { transform: rotate(var(--d)) translateY(-29px); }
.tick.is-on { opacity: 1; background: var(--badge-ink); height: 9px; }
.rotary__knob { width: 46px; height: 46px; }
.rotary--sm .rotary__knob { width: 40px; height: 40px; }
.rotary--sm .knob__pointer::after { top: 4px; height: 11px; }
.rotary__read { min-width: 0; }
.rotary__read .legend { color: var(--on-panel-soft); }
.rotary__val {
  margin: 1px 0 0;
  font-size: var(--t-body-sm);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 800;
  letter-spacing: .03em; text-transform: uppercase;
  color: var(--on-panel); line-height: 1.15;
}


/* ---- TRIM POT  /  small, tucked away, not a main control ----- */
.trim {
  display: flex; align-items: center; gap: var(--s3);
  margin-top: var(--s5); padding-top: var(--s4);
  border-top: 1px solid rgba(36,31,23,.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.trim__pot { position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: none; }
.knob--trim { width: 30px; height: 30px; }
.knob--trim::before { inset: 5px; }
.knob--trim .knob__pointer::after { top: 3px; height: 9px; width: 2px; margin-left: -1px; }
.trim .legend { color: var(--on-panel-soft); }

.face__hint { margin: var(--s4) 0 0; color: var(--on-panel-soft); }


/* ============================================================
   THE RACK  /  channel two, five units
   ============================================================ */

.tools { padding: 0 0 var(--s6); display: grid; gap: var(--s4); }
.tools .wrap { display: grid; gap: var(--s4); }

.tool {
  position: relative;
  padding: var(--s5) var(--s4) var(--s5) calc(var(--s4) + 12px);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--chassis-hi) 0%, var(--chassis) 7%, var(--chassis-lo) 100%);
  box-shadow: var(--bevel-dark), var(--sh-lift);
  border: 1px solid rgba(0,0,0,.55);
}
@media (min-width: 34rem) { .tool { padding: var(--s5) var(--s6) var(--s6); } }

.tool__ears { position: absolute; inset: 0; pointer-events: none; }
.tool__ears .screw { position: absolute; }
.tool__ears .screw:nth-child(1) { top: 10px; left: 9px; }
.tool__ears .screw:nth-child(2) { top: 10px; right: 9px; }
.tool__ears .screw:nth-child(3) { bottom: 10px; left: 9px; }
.tool__ears .screw:nth-child(4) { bottom: 10px; right: 9px; }

.tool__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); margin-bottom: var(--s5); }
.plate-h {
  margin: 0;
  font-size: var(--t-plate-sm);
  font-variation-settings: 'wdth' var(--w-exp), 'wght' 700;
  letter-spacing: var(--tr-plate); text-transform: uppercase; line-height: 1.04;
  color: var(--ink);
}
.tool__body { display: grid; gap: var(--s5); }
.tool__row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s5); }
.tool__row--end { align-items: flex-start; }

.metro__main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5); }
.knob--big { width: 68px; height: 68px; }
.knob--big::before { inset: 10px; }
.knob--big .knob__pointer::after { top: 7px; height: 18px; }

.metro__read {
  flex: 1 1 8rem; min-width: 0;
  padding: var(--s2) var(--s4);
  border-radius: 3px;
  background: linear-gradient(178deg, #EDE2C2 0%, #D2C39A 100%);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.4), inset 0 -1px 0 rgba(255,255,255,.5), 0 1px 0 rgba(255,255,255,.5);
}
.metro__read--wide { flex: 1 1 11rem; }
.metro__read .legend { color: var(--on-panel-soft); }
.digits {
  margin: 0;
  font-size: 2.1rem;
  font-variation-settings: 'wdth' var(--w-ultra), 'wght' 800;
  letter-spacing: -0.02em; line-height: 1;
  color: var(--badge-ink);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255,252,238,.7);
}
.digits--lg { font-size: 2.5rem; }

.pad {
  appearance: none; border: 0; cursor: pointer;
  min-height: 44px; min-width: 56px; padding: var(--s2) var(--s4);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--chassis-hi) 0%, var(--chassis) 46%, var(--chassis-lo) 100%);
  color: var(--ink);
  font-size: var(--t-legend);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 800;
  letter-spacing: var(--tr-legend); text-transform: uppercase;
  box-shadow: var(--bevel-dark), 0 2px 0 rgba(0,0,0,.5), 0 4px 10px rgba(0,0,0,.35);
  transition: transform var(--d-click) var(--e-switch), box-shadow var(--d-click) var(--e-switch);
}
.pad:active { transform: translateY(2px); box-shadow: inset 0 2px 5px rgba(0,0,0,.6); }

.stomp--tool { width: 100%; padding: var(--s2) var(--s4) var(--s2) var(--s2); gap: var(--s3); }
.stomp--tool .stomp__plate { width: 40px; height: 40px; display: grid; place-items: center; }
.stomp--tool .stomp__now { font-size: var(--t-body-sm); }
.stomp--quiet .stomp__plate {
  background: radial-gradient(circle at 38% 28%, #F2ECDC 0%, #CFC7B2 40%, #8E876F 74%, #35322C 100%);
}

.beats { display: flex; gap: var(--s3); align-items: center; min-height: 20px; }
.beats .jewel { transition: none; }
.beats .jewel--down { width: 20px; height: 20px; }


/* ---- DIAGRAMS  /  drawn hardware, in the site's materials ---- */

.diagram {
  padding: var(--s4);
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(90,74,44,.05) 0 3px, transparent 3px 7px),
    linear-gradient(178deg, var(--panel-hi) 0%, var(--panel) 48%, var(--panel-deep) 100%);
  box-shadow: var(--bevel-down);
}
.diagram--neck { overflow-x: auto; overscroll-behavior-x: contain; }

.fbd { display: grid; gap: var(--s2); width: min(100%, 188px); margin: 0 auto; }
.fbd__name {
  margin: 0; font-size: var(--t-lead);
  font-variation-settings: 'wdth' var(--w-norm), 'wght' 800;
  letter-spacing: -0.01em; color: var(--on-panel); line-height: 1;
}
#scale-name { color: var(--ink); font-size: var(--t-body); }
.fbd__marks { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: var(--s1); }
.fbd__mark {
  display: flex; align-items: center; justify-content: center; height: 14px;
  font-size: var(--t-legend);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 500;
  color: var(--ink-faint); line-height: 1;
}
.fbd__mark--o {
  width: 10px; height: 10px; margin: 0 auto; border-radius: 50%;
  border: 1.6px solid var(--on-panel); font-size: 0;
}
.fbd__neck { position: relative; aspect-ratio: 0.8; }
@media (min-width: 34rem) { .fbd { width: 212px; } }
.fbd__base {
  position: absolute; left: 1px; transform: translateY(-50%);
  font-size: var(--t-legend-xs);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 800;
  color: var(--on-panel); line-height: 1;
}
.fbd__nut {
  position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: 1px;
  background: var(--on-panel);
}
.fbd__line { position: absolute; background: var(--ink-dim); opacity: .5; }
.fbd__line--f { right: 0; height: 1px; }
.fbd__line--top { opacity: 1; height: 1.5px; background: var(--on-panel); }
.fbd__line--s { top: 0; bottom: 0; width: 1px; }
.fbd__dot {
  position: absolute; width: 19px; height: 19px; margin: -9.5px 0 0 -9.5px;
  border-radius: 50%;
  background: var(--on-panel);
  display: grid; place-items: center;
  font-size: 8.5px;
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 800;
  letter-spacing: 0; color: var(--panel-hi);
}
.fbd__barre {
  position: absolute; height: 18px; margin-top: -9px; border-radius: 9px;
  background: var(--on-panel);
}
.fbd__pos {
  font-size: var(--t-legend-xs);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 700;
  letter-spacing: var(--tr-legend); text-transform: uppercase;
  color: var(--on-panel-soft); margin: 0;
}

.neck { position: relative; min-width: 34rem; }
.neck__rows { position: relative; }
/* .fbd__line--f is a fret line in the single chord diagram, where its
   left edge is set inline per fret. Reused here for the neck's string
   lines, it needs its own left edge or it has no width to show. */
.neck .fbd__line--f { left: 0; }
.neck__fnum {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  margin-top: var(--s2);
}
.neck__fnum span {
  text-align: center;
  font-size: var(--t-legend-xs);
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 600;
  color: var(--on-panel-soft);
}
.neck__dot {
  position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--on-panel);
  display: grid; place-items: center;
  font-size: 8.5px;
  font-variation-settings: 'wdth' var(--w-cond), 'wght' 800;
  color: var(--panel-hi);
  transition: transform var(--d-click) var(--e-switch), box-shadow var(--d-lamp) var(--e-out);
}
.neck__dot--root {
  background: var(--gold);
  color: #2A2008;
  width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 4px;
}
/* the degree currently sounding during Ascend / Descend. Amber
   means live everywhere else on the rig, so it means live here too,
   even standing on the gold root dot. */
.neck__dot.is-playing {
  background: radial-gradient(circle at 36% 30%, var(--lamp-core) 0 30%, var(--lamp) 65%, #C25400 100%);
  color: var(--panel-hi);
  box-shadow: var(--lamp-lit);
  transform: scale(1.18);
}


/* ============================================================
   THE PLATE
   ============================================================ */

.unit--tight { padding-bottom: var(--s6); }
.spec .soon__list li { align-items: flex-start; }
.spec .soon__list .dot { margin-top: .55em; }
