/* Neutral chrome, colour reserved for state only -- green means sounding. */
:root {
  --ink: #1a1a1a; --paper: #f4f3f1; --panel: #fff; --rule: #dcd9d4;
  --muted: #736e68; --track: #cfcbc4; --live: #2e7d32;
}
* { box-sizing: border-box; }
body {
  margin: 0 auto; padding: 0 0 1rem; max-width: 46rem;
  background: var(--paper); color: var(--ink);
  font: 13px/1.4 "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
button, input, select, output { font: inherit; color: inherit; }

.transport {
  display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem;
  background: var(--panel); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 2;
}
.transport .run {
  width: 2rem; height: 1.6rem; line-height: 1; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 3px; background: var(--paper);
}
.transport .run:hover { border-color: var(--ink); }
.lamp { width: .5rem; height: .5rem; border-radius: 50%; background: var(--track); flex: none; }

/* ---- first run ---- */
/* Sits under the transport, pointing at the button it names, and is removed
   for good the first time playback starts -- a hint you have already acted on
   is clutter. */
#firstrun {
  margin: 0; padding: .5rem .6rem;
  background: #fdf3e3; border-bottom: 1px solid #e6d3ae; color: #7a4f00;
}
#firstrun b { font-style: normal; }
.lamp.on { background: var(--live); }
.meta { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meta.grow { overflow: hidden; text-overflow: ellipsis; }

main { padding: 0 .5rem; }
h1 { font-size: 1.1rem; font-weight: 600; margin: .8rem 0 .2rem; }
.tagline { margin: 0 0 .6rem; color: var(--muted); }
.section { margin: 1rem 0 .3rem; font-weight: 600; }
.hint { font-weight: 400; color: var(--muted); }

.rows { background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; }
.param {
  display: grid; grid-template-columns: 8.6rem 1fr 4.2rem;
  align-items: center; gap: .5rem; padding: .18rem .5rem; min-height: 1.6rem;
}
.param + .param { border-top: 1px solid var(--rule); }
/* The line that says what is being played: two menus read together, then the
   octave the lead sits in. The menus split the free width evenly, and the
   octave keeps the value column every other row uses. */
.param.keys { grid-template-columns: 8.6rem 1fr 1fr 2.8rem auto 2.6rem; }
.param .sub { text-align: right; }
.param label { color: var(--muted); }
.param output { text-align: right; font-variant-numeric: tabular-nums; }
select, input[type=text] {
  height: 1.5rem; background: var(--panel);
  border: 1px solid var(--rule); border-radius: 3px;
}
.link { background: none; border: 0; color: var(--muted); cursor: pointer; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: .9rem; width: 100%; background: none; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: var(--track); border-radius: 2px; }
input[type=range]::-moz-range-track { height: 3px; background: var(--track); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: .7rem; height: .7rem;
  margin-top: -.2rem; border-radius: 50%; background: var(--ink);
}
input[type=range]::-moz-range-thumb {
  width: .7rem; height: .7rem; border: 0; border-radius: 50%; background: var(--ink);
}

.note { color: var(--muted); min-height: 1.1em; margin: .5rem 0 .2rem; }
pre {
  margin: 0; padding: .4rem .5rem; background: var(--panel);
  border: 1px solid var(--rule); border-radius: 4px;
  color: var(--muted); font-size: 11px; line-height: 1.45;
  overflow-x: auto; white-space: pre;
}
footer { padding: .6rem .5rem; color: var(--muted); font-size: 11px; }

/* ---- tabs ---- */
.tabs { display: flex; gap: .25rem; margin: 1rem 0 .4rem; }
.tab {
  padding: .25rem .7rem; cursor: pointer; color: var(--muted);
  background: none; border: 1px solid transparent; border-radius: 3px 3px 0 0;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
p.hint { margin: .4rem 0 0; color: var(--muted); font-size: 11px; }
.param.edited label { color: #b26a00; }

/* ---- stepper ---- */
/* Two nudges rather than a menu. The value sits in the output column with every
   other value, so the eye finds all of them in the same place. */
.stepper { display: flex; gap: .3rem; }
.stepper button {
  width: 1.5rem; height: 1.5rem; padding: 0; cursor: pointer; line-height: 1;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 3px;
  color: var(--ink); font-size: .95rem;
}
.stepper button:disabled { opacity: .3; cursor: default; }

/* ---- drone slots ---- */
/* The checkbox rides inside the label so the whole word is a hit target, and
   a slot that is off dims its interval rather than hiding it -- the setting is
   still there, it just is not sounding. */
.param[data-drone] label {
  display: flex; align-items: center; gap: .4rem; cursor: pointer;
}
.param[data-drone] label input { margin: 0; cursor: pointer; }
.param[data-drone].off .stepper { opacity: .35; }
.param[data-drone].off output { color: var(--track); }

/* ---- commit ---- */
.commit { display: flex; align-items: center; gap: .4rem; padding: .5rem 0 0; }
.commit button {
  height: 1.7rem; padding: 0 .7rem; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 3px; background: var(--panel);
}
.commit .go { border-color: var(--ink); font-weight: 600; }
.commit button:disabled { opacity: .4; cursor: default; }
.status { color: var(--muted); font-variant-numeric: tabular-nums; }
.status.pending { color: var(--edit, #b26a00); }

/* ---- mixer ---- */
/* A strip per instrument: its level, and how much of it reaches each effect.
   The head row names the columns once, so a strip is three numbers rather than
   three labels repeated five times. */
.mixer { background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; }
.mixhead, .mixrow {
  display: grid; grid-template-columns: 5.5rem repeat(3, 1fr 2.6rem);
  align-items: center; gap: .5rem; padding: .18rem .5rem; min-height: 1.6rem;
}
.mixhead {
  padding-top: .3rem; padding-bottom: .3rem; color: var(--muted);
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
}
.mixhead span + span { grid-column: span 2; }
.mixrow + .mixrow { border-top: 1px solid var(--rule); }
.mixname { color: var(--muted); }
/* The sum of the strips above it, so it shares their columns and its slider
   sits in the level column where a level belongs. */
.mixer.master { margin-top: .35rem; }
.mixrow output { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- expert fold ---- */
/* The controls that shape the tune itself. They are the deepest thing here and
   the least often wanted, so they start closed. */
.expert { margin-top: .35rem; }
.expert > summary {
  cursor: pointer; color: var(--muted); padding: .3rem .1rem; list-style: none;
}
.expert > summary::-webkit-details-marker { display: none; }
.expert > summary::before { content: "\25B8"; margin-right: .35rem; }
.expert[open] > summary::before { content: "\25BE"; }
.expert > summary:hover { color: var(--ink); }

/* Labels the grid does not need to show but a screen reader does. */
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

:where(button, input, select, summary):focus-visible {
  outline: 2px solid var(--ink); outline-offset: 1px;
}
