:root {
  --bg: #131219;
  --panel: #1b1a23;
  --panel-2: #23222e;
  --line: #302e3d;
  --text: #e9e7f1;
  --muted: #8e8aa6;
  --pin: #ff7a9c;
  --pon: #7ad7ff;
  --pan: #ffd479;
  --ok: #6bd6a0;
  --bad: #ff6b7d;
  --r: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.spacer { flex: 1; }
.muted { color: var(--muted); }

/* --------------------------------------------------------------- chrome */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 22px;
  background: rgba(19, 18, 25, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.mark { font-size: 17px; font-weight: 700; letter-spacing: .4px; }
.mark .a { color: var(--pin); }
.mark .b { color: var(--pon); }
.mark .c { color: var(--pan); }
.vol { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.vol input { width: 120px; }

footer {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 22px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}

kbd {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 0 5px; font: inherit; font-size: 11px;
}

/* ---------------------------------------------------------------- layout */

main { max-width: 980px; margin: 0 auto; padding: 0 22px; }

section {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}
section:last-of-type { border-bottom: none; }

h1 {
  font-size: clamp(30px, 5.2vw, 46px);
  line-height: 1.12;
  letter-spacing: -.5px;
  margin: 0 0 20px;
}
h2 { font-size: 19px; margin: 0 0 10px; letter-spacing: -.2px; }
h3 { font-size: 13px; margin: 0 0 6px; color: var(--pon); letter-spacing: .3px; }
section > p { max-width: 72ch; margin: 0 0 14px; color: #c6c2d8; }
.lead { font-size: 16.5px; max-width: 68ch; }
.hero { padding-top: 56px; }
.hint { font-size: 13px; color: var(--muted); max-width: 72ch; }

code {
  background: var(--panel-2); border-radius: 4px;
  padding: 1px 6px; font-family: ui-monospace, Consolas, monospace; font-size: .88em;
}

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.cols p { font-size: 13.5px; color: #b8b4cc; margin: 0; }

/* ----------------------------------------------------------------- stats */

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 11px 15px; min-width: 108px;
}
.stat b { display: block; font-size: 21px; line-height: 1.2; color: var(--pon); }
.stat span { font-size: 11.5px; color: var(--muted); }

/* -------------------------------------------------------------- controls */

.controls { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; margin: 18px 0 6px; }
.controls label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
label.check { cursor: pointer; }
.num { color: var(--pan); font-variant-numeric: tabular-nums; font-size: 12px; }

button, select, input[type=range] {
  font: inherit;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 13px;
}
input[type=range] { padding: 0; border: none; background: none; accent-color: var(--pon); cursor: pointer; }
select, button { cursor: pointer; }
button:hover, select:hover { border-color: var(--pon); }
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--pon); outline-offset: 2px;
}
button.primary { background: var(--pon); color: #07131b; border-color: var(--pon); font-weight: 600; }
button.stop { border-color: var(--bad); color: var(--bad); padding: 6px 11px; font-size: 13px; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* -------------------------------------------------------------- ensemble */

.track { display: flex; gap: 3px; height: 26px; align-items: flex-end; margin-top: 16px; overflow: hidden; }
.track span { flex: 1 1 0; min-width: 2px; max-width: 14px; height: 7px; border-radius: 2px; background: var(--panel-2); transition: background .09s, height .09s; }
.track span.hit { background: var(--pon); height: 24px; }

/* ----------------------------------------------------------------- nudge */

#axes { display: grid; grid-template-columns: 96px 1fr 52px; gap: 9px 14px; align-items: center; margin: 18px 0; }
#axes .ax { font-size: 13px; color: var(--muted); }
#axes .ax b { display: block; color: var(--text); font-weight: 500; }
#axes .val { text-align: right; color: var(--pan); font-variant-numeric: tabular-nums; font-size: 12.5px; }

.recipe { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.recipe-head { padding: 8px 14px; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.recipe pre {
  margin: 0; padding: 13px 14px; overflow-x: auto;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--pan);
}

/* ---------------------------------------------------------------- board */

.family { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 17px; margin-bottom: 12px; }
.family > header { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; }
.family h3 { color: var(--text); font-size: 15px; margin: 0; }
.family .tag { font-size: 11px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.family p { font-size: 13px; color: var(--muted); margin: 7px 0 12px; max-width: 74ch; }
.roles { display: flex; flex-wrap: wrap; gap: 9px; }
.role { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel-2); min-width: 132px; }
.role .rn { font-size: 12.5px; margin-bottom: 1px; }
.role .rs { font-size: 10.5px; color: var(--muted); margin-bottom: 7px; }
.role .takes { display: flex; gap: 4px; flex-wrap: wrap; }
.role .takes button { padding: 2px 9px; font-size: 12px; border-radius: 5px; }
.role .takes button.on { background: var(--pon); color: #07131b; border-color: var(--pon); }
details.src { margin-top: 12px; }
details.src summary { cursor: pointer; font-size: 12px; color: var(--muted); }
details.src summary:hover { color: var(--pon); }
details.src pre {
  margin: 9px 0 0; padding: 12px; background: var(--bg); border-radius: 7px;
  overflow-x: auto; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; color: #b8b4cc;
}

/* -------------------------------------------------------------- context */

.tiles { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; }
.tile {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 13px 20px; cursor: pointer; min-width: 116px; text-align: center;
  transition: transform .05s, border-color .1s;
}
.tile:hover { border-color: var(--pon); }
.tile:active { transform: translateY(1px); }
.meter { height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin-top: 14px; }
.meter i { display: block; height: 100%; width: 0; background: var(--pon); transition: width .05s linear; }
.log {
  margin-top: 14px; height: 116px; overflow-y: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px; color: var(--muted);
}
.log div { white-space: pre; }
.log .warn { color: var(--pan); }

@media (max-width: 620px) {
  #axes { grid-template-columns: 78px 1fr 44px; }
  .controls { gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
