/*
 * ================================================================
 * EDIT POINT 4 — VISUAL PALETTE
 * Sampled primary: #03ff00. It is expanded into light/deep shades and
 * paired with its magenta-violet complement plus a warm pink accent.
 * ================================================================
 */
:root {
  --font-geist-mono: "Courier New";
  --ink: #1d0c24;
  --lime: #03ff00;
  --lime-deep: #00a923;
  --lime-soft: #baffb8;
  --paper: #f1f7ed;
  --hot: #d900ff;
  --accent: #ff3d8d;
  --muted: #45c94c;
  --rule: 3px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 4px solid var(--hot);
  outline-offset: 4px;
}

.instrument {
  --signal-x: 50vw;
  --signal-y: 50vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--lime);
  border: 12px solid var(--lime);
  position: relative;
}

/* The pointer drags two score lines through the composition. */
.instrument::before,
.instrument::after {
  content: "";
  position: fixed;
  z-index: 10;
  pointer-events: none;
  background: var(--accent);
  mix-blend-mode: multiply;
  opacity: 0.22;
  transition: transform 80ms linear;
}

.instrument::before {
  inset: 0 auto 0 0;
  width: 2px;
  transform: translateX(var(--signal-x));
}

.instrument::after {
  inset: 0 0 auto;
  height: 2px;
  transform: translateY(var(--signal-y));
}

.topbar {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: clamp(24px, 5vw, 80px);
  align-items: center;
  padding: 14px clamp(20px, 2.5vw, 42px);
  border: var(--rule) solid var(--ink);
  border-bottom: 0;
  text-transform: uppercase;
}

.brand {
  width: max-content;
  color: var(--ink);
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(23px, 2.1vw, 34px);
  letter-spacing: -0.045em;
  text-decoration: none;
}

.brand span {
  display: inline-block;
  margin-left: 2px;
  padding: 4px 7px;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--font-geist-mono), monospace;
  font-size: 0.48em;
  letter-spacing: 0.08em;
  vertical-align: middle;
}

.system-label {
  margin: 0;
  font-family: var(--font-geist-mono), monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.tempo-readout {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-geist-mono), monospace;
  font-size: 11px;
  font-weight: 700;
}

.tempo-readout strong {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(29px, 3vw, 46px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero {
  min-height: min(62vh, 710px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 27vw);
  border: var(--rule) solid var(--ink);
}

.hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 4.5vw, 78px) clamp(20px, 3vw, 52px);
  overflow: hidden;
}

.eyebrow,
.score-index,
.transport-meta,
.tempo-control,
.track-name small,
footer {
  font-family: var(--font-geist-mono), monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 clamp(26px, 4vh, 48px);
  font-size: 11px;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 38px;
  height: 12px;
  margin-right: 12px;
  background: var(--hot);
  border: 2px solid var(--ink);
  vertical-align: -2px;
}

h1 {
  margin: 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(76px, 10.5vw, 176px);
  font-weight: 900;
  line-height: 0.76;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

h1 span {
  display: block;
  width: max-content;
  max-width: 100%;
  transform-origin: left center;
}

h1 span:last-child {
  margin-top: 0.08em;
  padding: 0.03em 0.1em 0.09em 0.03em;
  background: var(--ink);
  color: var(--lime);
  transform: translateX(clamp(10px, 4vw, 68px)) rotate(-1deg);
}

.subhead {
  margin: clamp(28px, 4vh, 46px) 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(19px, 1.65vw, 28px);
  font-weight: 700;
}

.transport {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 2.5vw, 40px);
  overflow: hidden;
  position: relative;
  background: var(--ink);
  color: var(--lime);
}

.transport::before,
.transport::after {
  content: "";
  position: absolute;
  background: var(--lime);
  opacity: 0.16;
}

.transport::before {
  width: 3px;
  height: 160%;
  left: 50%;
  top: -30%;
  transform: rotate(24deg);
}

.transport::after {
  width: 160%;
  height: 3px;
  left: -30%;
  top: 46%;
  transform: rotate(-18deg);
}

.transport-meta {
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 10px;
}

.play-button {
  z-index: 1;
  width: min(100%, 310px);
  aspect-ratio: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(22px, 2.7vw, 42px);
  border: 0;
  border-radius: 0;
  background: var(--lime);
  color: var(--ink);
  cursor: pointer;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(34px, 3.3vw, 58px);
  line-height: 0.84;
  letter-spacing: -0.035em;
  text-align: left;
  text-transform: uppercase;
  transition: transform 140ms ease, background 140ms ease;
}

.play-button i {
  margin-top: 22px;
  font-family: Arial, sans-serif;
  font-size: 24px;
  font-style: normal;
}

.play-button:hover {
  transform: rotate(2deg) scale(1.02);
}

.play-button[aria-pressed="true"] {
  background: var(--accent);
  animation: button-hit 535.7ms steps(2) infinite;
}

.tempo-control {
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  font-size: 10px;
}

.tempo-control input {
  width: 100%;
  accent-color: var(--hot);
}

.score {
  background: var(--paper);
  border-inline: var(--rule) solid var(--ink);
  border-bottom: var(--rule) solid var(--ink);
}

.score-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: clamp(24px, 3vw, 44px);
  border-bottom: var(--rule) solid var(--ink);
}

.score-index {
  margin: 0 0 8px;
  font-size: 10px;
}

.score-help {
  margin: 16px 0 0;
  font-family: var(--font-geist-mono), monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(42px, 5vw, 76px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.reroute-button {
  min-height: 52px;
  padding: 13px 18px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--hot);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  font-family: var(--font-geist-mono), monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.reroute-button:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--ink);
}

.score-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
}

.all-toggle {
  min-height: 52px;
  padding: 13px 22px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--lime);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  font-family: var(--font-geist-mono), monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.step-count-button {
  min-height: 52px;
  padding: 13px 20px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--lime-soft);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  font-family: var(--font-geist-mono), monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.step-count-button:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--ink);
}

.all-toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--lime);
}

.all-toggle:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--ink);
}

.reroute-button:disabled,
.track-name:disabled,
.step:disabled,
.pitch-cell select:disabled {
  cursor: not-allowed;
}

.reroute-button:disabled {
  opacity: 0.4;
  box-shadow: none;
}

.mixer {
  display: grid;
  grid-template-columns: minmax(150px, 1.15fr) repeat(4, minmax(150px, 1fr));
  background: var(--ink);
  color: var(--lime);
  border-bottom: var(--rule) solid var(--ink);
}

.mixer-title,
.pan-control {
  min-height: 104px;
  padding: 18px;
  border-right: 1px solid var(--lime-deep);
}

.mixer-title {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-geist-mono), monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.mixer-title strong {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.pan-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  align-items: center;
  font-family: var(--font-geist-mono), monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pan-control:last-child {
  border-right: 0;
}

.pan-control input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--accent);
}

.pan-control output {
  color: var(--paper);
}

.sequencer {
  --step-count: 16;
  --step-cell-width: 56px;
  --steps-width: calc(var(--step-count) * var(--step-cell-width));
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.track,
.pitch-track {
  min-height: 108px;
  min-width: calc(220px + var(--steps-width));
  display: grid;
  grid-template-columns: clamp(168px, 20vw, 320px) minmax(var(--steps-width), 1fr);
}

.track + .track,
.pitch-track {
  border-top: var(--rule) solid var(--ink);
}

.track-name {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 18px clamp(14px, 2vw, 28px);
  border: 0;
  border-right: var(--rule) solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(13px, 1.2vw, 18px);
  font-weight: 900;
  appearance: none;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
}

button.track-name:hover:not(:disabled) {
  background: var(--lime-soft);
}

.track-name:disabled {
  cursor: not-allowed;
}

.track-name.is-mute {
  background: var(--accent);
}

.track-name.is-solo {
  background: var(--lime);
  box-shadow: inset -12px 0 var(--hot);
}

.track-name > span {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(22px, 2.4vw, 36px);
  letter-spacing: -0.02em;
  line-height: 0.92;
}

.pitch-track .track-name {
  cursor: default;
}

.pitch-track .track-name > span {
  font-size: clamp(17px, 1.8vw, 26px);
}

.track-mode {
  grid-column: 1 / -1;
  width: fit-content;
  margin-top: 7px;
  padding: 4px 7px;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--font-geist-mono), monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1;
}

.track.is-track-silent .steps {
  opacity: 0.38;
  transition: opacity 120ms ease;
}

.track.is-track-silent .track-name.is-play {
  background: #d8ded4;
}

.track-name small {
  max-width: 70px;
  color: #6c6572;
  font-size: 9px;
  text-align: right;
}

.steps {
  display: grid;
  grid-template-columns: repeat(var(--step-count), minmax(var(--step-cell-width), 1fr));
}

.step {
  min-width: 0;
  min-height: 108px;
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  border-right: 1px solid #7d7482;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 90ms linear, transform 90ms linear;
}

.step:last-child {
  border-right: 0;
}

.step::before {
  content: "";
  width: clamp(11px, 1.15vw, 18px);
  aspect-ratio: 1;
  background: var(--ink);
  transition: transform 90ms linear, width 90ms linear;
}

.step span {
  position: absolute;
  right: 6px;
  bottom: 5px;
  font-family: var(--font-geist-mono), monospace;
  font-size: 8px;
}

.step:hover {
  background: var(--lime-soft);
}

.step:disabled:hover {
  background: transparent;
}

.step.is-on {
  background: var(--lime);
}

.step.is-on::before {
  width: clamp(22px, 2.5vw, 40px);
  background: var(--hot);
  border: 2px solid var(--ink);
  transform: rotate(45deg);
}

.step.is-open {
  background: var(--lime-deep);
}

.step.is-open::before {
  background: var(--accent);
  transform: rotate(0deg);
}

.hat-state,
.bass-step-note {
  position: absolute;
  z-index: 1;
  color: var(--paper);
  font-family: var(--font-geist-mono), monospace;
  font-size: 9px;
  pointer-events: none;
}

.bass-step-note {
  color: var(--ink);
  transform: translateY(-24px);
}

.step.is-current {
  box-shadow: inset 0 -8px 0 var(--ink);
}

.step.is-current::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: var(--accent);
}

.pitch-selects {
  display: grid;
  grid-template-columns: repeat(var(--step-count), minmax(var(--step-cell-width), 1fr));
}

.pitch-cell {
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 10px 4px;
  border-right: 1px solid #7d7482;
  background: var(--lime-soft);
}

.pitch-cell:last-child {
  border-right: 0;
}

.pitch-cell select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-geist-mono), monospace;
  font-size: 9px;
  font-weight: 800;
}

.sequencer.is-all-off .track-name,
.sequencer.is-all-off .step,
.sequencer.is-all-off .pitch-cell {
  opacity: 0.42;
}

.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;
}

footer {
  min-height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(20px, 2.5vw, 42px);
  background: var(--accent);
  border: var(--rule) solid var(--ink);
  border-top: 0;
  font-size: 10px;
}

@keyframes button-hit {
  50% {
    transform: rotate(-2deg) scale(0.975);
  }
}

@media (max-width: 880px) {
  .instrument {
    border-width: 7px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .system-label {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 520px;
  }

  .transport {
    min-height: 410px;
  }

  .play-button {
    width: min(75vw, 300px);
  }

  .mixer {
    grid-template-columns: repeat(2, 1fr);
  }

  .mixer-title {
    grid-column: 1 / -1;
    min-height: 72px;
  }

  .pan-control:nth-child(3),
  .pan-control:nth-child(5) {
    border-right: 0;
  }

  .track,
  .pitch-track {
    min-width: calc(150px + var(--steps-width));
    grid-template-columns: 150px minmax(var(--steps-width), 1fr);
  }

  .track-name {
    padding-inline: 12px;
  }
}

@media (max-width: 600px) {
  .instrument::before,
  .instrument::after {
    display: none;
  }

  .topbar {
    padding-inline: 15px;
  }

  h1 {
    font-size: clamp(60px, 19.5vw, 94px);
  }

  h1 span:last-child {
    transform: translateX(7px) rotate(-1deg);
  }

  .hero-copy {
    min-height: 460px;
    padding-inline: 16px;
  }

  .score-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .score-actions,
  .score-actions > button {
    width: 100%;
  }

  .mixer {
    grid-template-columns: 1fr;
  }

  .mixer-title,
  .pan-control {
    min-height: 74px;
    border-right: 0;
    border-bottom: 1px solid var(--lime-deep);
  }

  .track,
  .pitch-track {
    min-height: 104px;
    min-width: calc(116px + var(--steps-width));
    grid-template-columns: 116px minmax(var(--steps-width), 1fr);
  }

  .track-name {
    min-height: 104px;
    padding: 10px;
    border-right: var(--rule) solid var(--ink);
    grid-template-columns: 1fr;
    align-content: center;
  }

  .track-name small,
  .track-mode {
    grid-column: 1;
    text-align: left;
  }

  .step {
    min-height: 104px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
