:root {
  color-scheme: dark;
  --bg: #050504;
  --panel: rgba(17, 18, 14, .94);
  --line: rgba(218, 206, 169, .2);
  --text: #f1ead5;
  --muted: #a7a28e;
  --green: #93d79b;
  --amber: #efbf6a;
  --red: #ff6d5d;
  --blue: #7fb8ff;
  --pad: rgba(38, 38, 30, .92);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(147, 215, 155, .1), transparent 25%),
    radial-gradient(circle at 82% 18%, rgba(239, 191, 106, .1), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

a { color: inherit; }

.drum-header,
.drum-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 48px);
  background: rgba(5, 5, 4, .88);
  border-bottom: 1px solid var(--line);
}

.drum-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  color: var(--muted);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--green);
  color: var(--green);
}

.brand strong,
.brand small,
p span,
h2 span,
h2 small { display: block; }

.brand small,
.kicker,
.drum-nav {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
}

.drum-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.drum-nav a { text-decoration: none; }

main { padding: clamp(28px, 8vw, 92px) clamp(14px, 4vw, 48px); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.hero > *,
.machine-layout > *,
.notes-panel > *,
.panel {
  min-width: 0;
}

h1 {
  margin: 6px 0 14px;
  font-size: clamp(40px, 7.2vw, 82px);
  line-height: .95;
}

h2 { margin: 0; font-size: clamp(20px, 3vw, 28px); }
p { line-height: 1.75; }

.status-card,
.panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(22, 23, 18, .95), rgba(7, 8, 6, .96));
  border-radius: 8px;
  box-shadow: inset 0 0 34px rgba(147, 215, 155, .05);
}

.status-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  color: var(--muted);
}

.status-card span + span {
  border-top: 1px dashed rgba(241, 234, 213, .14);
  padding-top: 12px;
}

.machine-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 380px);
  gap: 18px;
}

.panel { padding: 20px; }
.panel-head { margin-bottom: 16px; }

.transport,
.button-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

button {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(241, 234, 213, .22);
  background: rgba(38, 38, 30, .9);
  color: var(--text);
  font: inherit;
  border-radius: 6px;
  cursor: pointer;
}

button.primary {
  background: var(--green);
  color: #071007;
  font-weight: 900;
}

button.is-hot,
.step.is-on { background: rgba(239, 191, 106, .92); color: #130d05; }
button.is-playing { border-color: var(--green); box-shadow: 0 0 0 1px rgba(147, 215, 155, .36); }

.tempo-row,
.loop-row,
.knob-stack label {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.tempo-row { margin: 18px 0 12px; }
.loop-row {
  grid-template-columns: 92px minmax(112px, 150px) minmax(0, 1fr);
  margin: 0 0 18px;
}

.bar-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.bar-buttons button {
  min-height: 38px;
  font-size: 12px;
}

.wide-select,
.loop-row select {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(241, 234, 213, .22);
  background: rgba(10, 11, 9, .92);
  color: var(--text);
  font: inherit;
  border-radius: 6px;
  padding: 0 12px;
}

.knob-stack { display: grid; gap: 16px; }
input[type="range"] { width: 100%; }

.sequencer {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.track-row {
  display: grid;
  grid-template-columns: 82px repeat(16, minmax(28px, 1fr));
  gap: 6px;
  align-items: center;
  min-width: 720px;
}

.track-name {
  color: var(--muted);
  font-size: 12px;
}

.step {
  aspect-ratio: 1;
  min-height: 30px;
  border: 1px solid rgba(241, 234, 213, .16);
  background: rgba(10, 11, 9, .92);
  border-radius: 5px;
}

.step.is-current {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.pad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pad {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 86px;
  padding: 12px;
  border-color: rgba(147, 215, 155, .2);
  background: var(--pad);
  text-align: left;
}

.pad b { font-size: 18px; }
.pad small { color: var(--muted); margin-top: 8px; }
.pad.is-hit { transform: translateY(1px); background: rgba(147, 215, 155, .2); }
.pad.is-selected { border-color: var(--amber); box-shadow: inset 0 0 0 1px rgba(239, 191, 106, .35); }

.tune-head {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
}

.tune-head strong { color: var(--amber); }
.tune-head small,
.hint {
  color: var(--muted);
  line-height: 1.6;
}

.hint {
  display: block;
  margin-top: 12px;
  font-size: 12px;
}

.part-mixer {
  display: grid;
  gap: 10px;
}

.part-fader {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.part-fader b {
  color: var(--text);
  text-align: right;
}

.control-stack {
  display: grid;
  gap: 14px;
  align-content: start;
}

.notes-panel {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 24px;
  margin-top: 28px;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
}

.notes-panel small { color: var(--muted); margin-top: 6px; }

@media (max-width: 860px) {
  .drum-header,
  .hero,
  .machine-layout,
  .notes-panel { grid-template-columns: 1fr; }

  .drum-header {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: clamp(36px, 13vw, 58px);
    overflow-wrap: anywhere;
  }

  .transport,
  .button-grid,
  .pad-grid { grid-template-columns: 1fr 1fr; }

  .tempo-row,
  .knob-stack label { grid-template-columns: 72px minmax(0, 1fr) 38px; }

  .loop-row { grid-template-columns: 72px minmax(96px, 130px) minmax(0, 1fr); }
}

@media (max-width: 460px) {
  .transport,
  .button-grid { grid-template-columns: 1fr; }

  .loop-row { grid-template-columns: 1fr; }
  .bar-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
