:root {
  color-scheme: dark;
  --ink: #070909;
  --canvas: #0c0f10;
  --panel: #131719;
  --panel-high: #1b2022;
  --line: #343b3d;
  --line-soft: #262c2e;
  --paper: #f1f3ec;
  --muted: #8a9290;
  --acid: #c8ff3d;
  --acid-soft: #9fc82f;
  --record: #ff5f56;
  --shadow: 0 26px 80px rgb(0 0 0 / 45%);
  --mono: "SFMono-Regular", "Roboto Mono", "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--ink); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--paper);
  background:
    linear-gradient(90deg, rgb(255 255 255 / 1.5%) 1px, transparent 1px) 0 0 / 48px 48px,
    #080a0b;
  font-family: var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

button { color: inherit; }

button, input[type="range"] { touch-action: manipulation; }

button:focus-visible,
input:focus-visible,
.sequence-viewport:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}

.instrument {
  width: min(1540px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  border: 1px solid #454d4f;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 2.5%), transparent 25%),
    var(--canvas);
  box-shadow: var(--shadow), inset 0 1px rgb(255 255 255 / 8%);
}

.top-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 116px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: #0d1011;
}

.brand-lockup { display: grid; gap: 4px; }

.tool-switcher {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.tool-switcher a {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font: 750 0.58rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-decoration: none;
}

.tool-switcher a:hover,
.tool-switcher a:focus-visible {
  border-color: var(--acid);
  color: var(--paper);
}

.tool-switcher a:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 3px;
}

.tool-switcher a[aria-current="page"] {
  border-color: var(--acid-soft);
  color: var(--ink);
  background: var(--acid);
}

.eyebrow,
.block-label {
  margin: 0;
  color: var(--muted);
  font: 700 0.67rem/1 var(--mono);
  letter-spacing: 0.18em;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4.4rem);
  font-weight: 850;
  line-height: 0.9;
  letter-spacing: -0.075em;
}

h1 span { color: var(--acid); font-weight: 350; }

h2 {
  margin: 5px 0 0;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  letter-spacing: -0.03em;
}

.system-cluster { display: flex; align-items: center; gap: 22px; }

.system-status {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 204px;
  padding: 11px 13px;
  border-left: 1px solid var(--line);
}

.system-status small,
.sequence-footer small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font: 650 0.61rem/1 var(--mono);
  letter-spacing: 0.12em;
}

.system-status strong,
.sequence-footer strong {
  font: 700 0.72rem/1.1 var(--mono);
  letter-spacing: 0.03em;
}

.status-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #68706f;
  box-shadow: 0 0 0 5px rgb(255 255 255 / 3%);
}

.system-status.is-ready .status-led {
  background: var(--acid);
  box-shadow: 0 0 15px var(--acid), 0 0 0 5px rgb(200 255 61 / 8%);
}

.master-meter { display: flex; align-items: end; gap: 3px; height: 40px; }

.master-meter i {
  width: 4px;
  height: calc(9px + var(--meter-index, 0) * 1px);
  border-radius: 1px;
  background: #2d3434;
  transition: background 60ms linear, box-shadow 60ms linear;
}

.master-meter i:nth-child(n+7) { height: 24px; }
.master-meter i:nth-child(n+11) { height: 34px; }
.master-meter i.is-on { background: var(--acid); box-shadow: 0 0 6px rgb(200 255 61 / 70%); }
.master-meter i.is-on:nth-child(n+12) { background: var(--record); box-shadow: 0 0 6px rgb(255 95 86 / 70%); }

input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--acid-soft), #3b4342);
}

input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: #4a5352; }

input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -7px;
  appearance: none;
  border: 2px solid #0d1011;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px #66706e;
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 2px solid #0d1011;
  border-radius: 50%;
  background: var(--paper);
}

kbd { font-family: var(--mono); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
