:root {
  --bg: #020604;
  --panel: rgba(4, 18, 12, 0.78);
  --panel-strong: rgba(7, 31, 21, 0.94);
  --line: rgba(79, 255, 155, 0.24);
  --line-hot: rgba(126, 255, 83, 0.78);
  --text: #eafff2;
  --muted: #8fb8a2;
  --green: #33ff99;
  --lime: #b8ff5f;
  --cyan: #6af7ff;
  --danger: #ff5277;
  --warning: #ffd35f;
  --shadow: 0 20px 62px rgba(0, 0, 0, 0.46);
  --radius: 22px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 16% 8%, rgba(51, 255, 153, 0.13), transparent 33%),
    radial-gradient(circle at 86% 4%, rgba(106, 247, 255, 0.10), transparent 32%),
    linear-gradient(135deg, #010302 0%, #06130d 46%, #020806 100%);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button { cursor: pointer; color: var(--text); border: 1px solid rgba(51,255,153,.26); }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid rgba(184,255,95,.42);
  outline-offset: 3px;
}
.hidden { display: none !important; }

.orbital-bg { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.orbital-bg span {
  position: absolute;
  width: 420px;
  aspect-ratio: 1;
  border: 1px solid rgba(51,255,153,.12);
  border-radius: 50%;
  filter: blur(.1px);
  opacity: .5;
}
.orbital-bg span:nth-child(1) { left: -180px; top: 140px; }
.orbital-bg span:nth-child(2) { right: -120px; top: 80px; width: 520px; border-color: rgba(106,247,255,.12); }
.orbital-bg span:nth-child(3) { left: 24%; bottom: -260px; width: 580px; border-color: rgba(184,255,95,.10); }
.orbital-bg span:nth-child(4) { right: 18%; bottom: 18%; width: 160px; border-color: rgba(51,255,153,.18); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(1540px, calc(100% - 1.2rem));
  margin: .6rem auto 0;
  padding: .65rem .7rem;
  border: 1px solid rgba(51,255,153,.19);
  border-radius: 999px;
  background: rgba(2, 10, 6, .76);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 42px rgba(0,0,0,.34);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; min-width: max-content; }
.brand-core {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #031008;
  font-weight: 1000;
  background: radial-gradient(circle, var(--lime), var(--green));
  box-shadow: 0 0 24px rgba(51,255,153,.36);
}
.brand strong { display: block; line-height: 1; letter-spacing: .03em; }
.brand small { display: block; margin-top: .18rem; color: var(--muted); font: 700 .72rem/1 var(--mono); }
.quick-nav { display: flex; align-items: center; justify-content: center; gap: .38rem; flex: 1; }
.quick-nav a {
  padding: .55rem .75rem;
  border-radius: 999px;
  color: #d8ffe8;
  background: rgba(51,255,153,.055);
  border: 1px solid rgba(51,255,153,.10);
  font: 800 .78rem/1 var(--mono);
}
.quick-nav a:hover { border-color: rgba(184,255,95,.45); color: var(--lime); }
.danger-btn {
  min-height: 42px;
  border-radius: 999px;
  padding: .58rem .85rem;
  color: #ffdce4;
  background: rgba(255,82,119,.12);
  border-color: rgba(255,82,119,.36);
  white-space: nowrap;
}

.app-shell {
  width: min(1540px, calc(100% - 1.2rem));
  margin: .8rem auto 1.4rem;
  display: grid;
  gap: .85rem;
}
.glass-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(140deg, rgba(51,255,153,.08), rgba(4,18,12,.48) 32%, rgba(2,8,5,.84)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
  overflow: hidden;
}
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(106,247,255,.05) 49% 50%, transparent 51% 100%),
    radial-gradient(circle at 14% 10%, rgba(184,255,95,.11), transparent 34%);
  opacity: .75;
}
.glass-panel > * { position: relative; z-index: 1; }

.cover-stage {
  display: grid;
  min-height: clamp(280px, 30vw, 430px);
  isolation: isolate;
}
.cover-stage picture, .cover-stage img { grid-area: 1 / 1; width: 100%; height: 100%; }
.cover-stage img { display: block; object-fit: cover; object-position: center 48%; filter: saturate(1.06) contrast(1.02); }
.cover-stage::after {
  content: "";
  grid-area: 1 / 1;
  z-index: 1;
  background: linear-gradient(90deg, rgba(1,7,4,.86) 0%, rgba(1,7,4,.64) 34%, rgba(1,7,4,.20) 72%, rgba(1,7,4,.05) 100%);
}
.cover-overlay {
  grid-area: 1 / 1;
  z-index: 2;
  align-self: center;
  display: grid;
  gap: .72rem;
  width: min(700px, 70%);
  padding: clamp(1.1rem, 3vw, 2.4rem);
}
.eyebrow {
  margin: 0;
  color: var(--cyan);
  font: 900 .76rem/1.25 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: .15rem;
  font-size: clamp(2.5rem, 7vw, 7.2rem);
  line-height: .86;
  letter-spacing: -.05em;
  text-transform: uppercase;
  color: var(--lime);
  text-shadow: 0 0 35px rgba(184,255,95,.24);
}
h2 { margin-bottom: .65rem; font-size: clamp(1.05rem, 1.55vw, 1.45rem); line-height: 1.1; }
.cover-overlay p:not(.eyebrow), .hero-copy { color: #d6ffe5; max-width: 62ch; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.primary-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .72rem 1rem;
  border-radius: 999px;
  font-weight: 950;
  letter-spacing: .02em;
  border: 1px solid rgba(184,255,95,.44);
}
.primary-btn {
  color: #031008;
  background: linear-gradient(135deg, var(--lime), var(--green));
  box-shadow: 0 0 28px rgba(51,255,153,.28);
}
.ghost-btn { color: var(--text); background: rgba(51,255,153,.075); }
.primary-btn:hover, .ghost-btn:hover, .micro-btn:hover, .transport-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.small { min-height: 38px; padding: .55rem .75rem; font-size: .88rem; }

.command-deck {
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) minmax(280px, .8fr) minmax(230px, .55fr);
  gap: .85rem;
  align-items: stretch;
  padding: .95rem;
}
.command-copy { padding: .4rem .2rem; }
.hero-title-secondary { margin-bottom: .45rem; }
.jarvis-display {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .52rem;
  padding: .75rem;
  border-radius: 18px;
  background: rgba(1, 7, 4, .8);
  border: 1px solid rgba(51,255,153,.20);
  font-family: var(--mono);
}
.display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .68rem .75rem;
  border-radius: 14px;
  background: rgba(51,255,153,.055);
  border: 1px solid rgba(51,255,153,.12);
}
.display-row span { color: var(--muted); font-size: .8rem; }
.display-row strong { color: var(--lime); text-align: right; font-size: .85rem; }
.quick-help {
  display: grid;
  align-content: center;
  gap: .42rem;
  padding: .9rem;
  border-radius: 18px;
  border: 1px solid rgba(106,247,255,.20);
  background: rgba(106,247,255,.055);
  color: #d9fff9;
  font-family: var(--mono);
}
.quick-help strong { color: var(--cyan); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.quick-help span { color: var(--muted); font-size: .82rem; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(250px, .85fr) minmax(300px, 1fr) minmax(260px, .85fr) minmax(340px, 1.25fr);
  gap: .85rem;
}
.module, .controller-surface, .keyboard-panel, .recorder-panel { padding: .95rem; }
.compact-module, .wheels-module, .transport-module, .smart-module { min-height: 0; }
.button-grid { display: grid; gap: .5rem; margin-top: .6rem; }
.button-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.button-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fit-row { align-self: end; }
.micro-btn {
  min-height: 40px;
  padding: .52rem .58rem;
  border-radius: 14px;
  background: rgba(51,255,153,.075);
}
.micro-btn.active, .transport-btn.active, .primary-btn.active {
  color: #031008;
  background: linear-gradient(135deg, var(--lime), var(--green));
  border-color: rgba(184,255,95,.72);
  box-shadow: 0 0 22px rgba(51,255,153,.25);
}
.select-row, .midi-select, .fader-label, .smart-grid label {
  display: grid;
  gap: .35rem;
  margin-top: .58rem;
  color: var(--muted);
  font-size: .86rem;
}
.select-row output, .fader-label output { color: var(--lime); font-family: var(--mono); justify-self: end; }
input[type="range"] { width: 100%; accent-color: var(--green); }
select, .mini-select {
  width: 100%;
  color: var(--text);
  border: 1px solid rgba(51,255,153,.25);
  border-radius: 14px;
  background: #05130d;
  padding: .62rem .68rem;
  outline: none;
}
select:focus { border-color: var(--line-hot); box-shadow: 0 0 0 3px rgba(51,255,153,.12); }

.wheel-wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: .58rem; height: 138px; align-items: end; }
.wheel-label { display: grid; place-items: center; gap: .42rem; color: var(--muted); font-size: .8rem; height: 100%; }
.vertical { writing-mode: bt-lr; -webkit-appearance: slider-vertical; appearance: slider-vertical; width: 42px; height: 92px; }
.transport-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; margin-top: .62rem; }
.transport-btn { border-radius: 15px; font-size: 1.15rem; padding: .5rem .25rem; background: rgba(51,255,153,.08); }
.transport-btn.record { border-color: rgba(255,82,119,.45); color: #ff8ba3; }

.section-heading { display: flex; align-items: start; justify-content: space-between; gap: .8rem; margin-bottom: .8rem; }
.compact-heading { margin-bottom: .45rem; }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid rgba(184,255,95,.42);
  color: var(--lime);
  background: rgba(184,255,95,.08);
  border-radius: 999px;
  padding: .42rem .62rem;
  font: 850 .69rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.chip.muted { border-color: rgba(143,184,162,.26); color: var(--muted); background: rgba(143,184,162,.05); }
.smart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .58rem; }
.smart-grid label { margin-top: 0; }

.studio-board {
  display: grid;
  grid-template-columns: minmax(620px, 1.55fr) minmax(360px, .9fr);
  gap: .85rem;
}
.knob-bank { display: grid; grid-template-columns: repeat(8, minmax(70px, 1fr)); gap: .52rem; }
.knob-card {
  display: grid;
  justify-items: center;
  gap: .42rem;
  min-height: 126px;
  padding: .62rem .42rem;
  border-radius: 16px;
  border: 1px solid rgba(51,255,153,.16);
  background: rgba(1, 8, 5, .54);
}
.knob {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(51,255,153,.36);
  background:
    conic-gradient(from -135deg, var(--green) 0deg, var(--lime) calc((var(--value, 64) / 127) * 270deg), rgba(51,255,153,.10) 0deg 270deg, transparent 270deg),
    radial-gradient(circle at 50% 50%, #0d261a 0 46%, #02100a 47%);
  box-shadow: inset 0 0 20px rgba(0,0,0,.65), 0 0 16px rgba(51,255,153,.1);
  touch-action: none;
  user-select: none;
}
.knob::after {
  content: "";
  width: 4px;
  height: 22px;
  border-radius: 99px;
  background: var(--lime);
  transform-origin: 50% 30px;
  transform: rotate(calc(-135deg + (var(--value, 64) / 127) * 270deg)) translateY(-16px);
  box-shadow: 0 0 10px var(--lime);
}
.knob-name { font-weight: 900; color: #dffff0; text-align: center; font-size: .78rem; }
.knob-val { font: 800 .72rem/1 var(--mono); color: var(--lime); }
.fader-strip { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(220px, .85fr) auto; align-items: end; gap: .75rem; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid rgba(51,255,153,.12); }

.pad-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.pad {
  position: relative;
  min-height: 82px;
  border: 1px solid rgba(51,255,153,.28);
  border-radius: 17px;
  background:
    radial-gradient(circle at 30% 20%, rgba(184,255,95,.16), transparent 40%),
    rgba(2, 11, 7, .74);
  overflow: hidden;
  box-shadow: inset 0 0 24px rgba(51,255,153,.04);
  touch-action: manipulation;
}
.pad strong, .pad span { position: relative; z-index: 1; display: block; }
.pad strong { margin: .65rem .65rem 0; color: #f0fff5; font-size: .82rem; }
.pad span { margin: .22rem .65rem; color: var(--muted); font-family: var(--mono); font-size: .72rem; }
.pad::after {
  content: "";
  position: absolute;
  inset: auto -15% -42% -15%;
  height: 70%;
  border-radius: 50%;
  background: rgba(51,255,153,.10);
  filter: blur(16px);
  transition: opacity .12s ease, transform .12s ease;
}
.pad.active, .pad:active { border-color: var(--lime); box-shadow: 0 0 28px rgba(51,255,153,.28), inset 0 0 22px rgba(184,255,95,.11); }
.pad.active::after, .pad:active::after { transform: translateY(-14px); opacity: 1; }

.keyboard-panel { scroll-margin-top: 92px; }
.keyboard-scroll { width: 100%; overflow-x: auto; padding: .3rem .2rem .72rem; scrollbar-color: var(--green) rgba(51,255,153,.08); }
.keyboard {
  position: relative;
  min-width: 980px;
  height: clamp(210px, 22vw, 258px);
  padding: 0 .2rem;
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(1,7,4,.82);
  border: 1px solid rgba(51,255,153,.18);
  box-shadow: inset 0 0 40px rgba(0,0,0,.52);
}
.key {
  position: relative;
  border: 0;
  border-radius: 0 0 13px 13px;
  transition: transform .08s ease, filter .08s ease, box-shadow .08s ease;
  touch-action: none;
  user-select: none;
}
.key.white {
  flex: 1 0 0;
  min-width: 62px;
  height: 100%;
  color: #02100a;
  background: linear-gradient(#f9fff7, #cde8d8 76%, #a5c6b4);
  border-left: 1px solid rgba(0,0,0,.12);
  border-right: 1px solid rgba(0,0,0,.12);
  box-shadow: inset 0 -12px 24px rgba(0,0,0,.18);
}
.key.black {
  position: absolute;
  z-index: 4;
  width: 38px;
  height: 62%;
  top: 0;
  transform: translateX(-50%);
  color: var(--lime);
  background: linear-gradient(#0d2419, #030806 78%);
  border: 1px solid rgba(51,255,153,.30);
  box-shadow: 0 13px 23px rgba(0,0,0,.58), inset 0 -10px 18px rgba(51,255,153,.05);
}
.key.active.white { transform: translateY(5px); filter: brightness(.86); box-shadow: inset 0 0 30px rgba(51,255,153,.32); }
.key.active.black { transform: translateX(-50%) translateY(4px); filter: brightness(1.35); box-shadow: 0 0 25px rgba(51,255,153,.5), inset 0 0 20px rgba(51,255,153,.18); }
.key-label {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: grid;
  gap: .18rem;
  text-align: center;
  font-family: var(--mono);
  pointer-events: none;
}
.key.black .key-label { bottom: 10px; font-size: .7rem; }
.key-label small { color: inherit; opacity: .65; }
.key.scale-out { opacity: .68; }
.hint { margin: .25rem 0 0; color: var(--muted); font-family: var(--mono); font-size: .8rem; }

.recorder-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.event-log {
  min-height: 122px;
  max-height: 260px;
  overflow: auto;
  margin: .75rem 0 0;
  padding: .82rem;
  border: 1px solid rgba(51,255,153,.16);
  border-radius: 16px;
  background: rgba(0,0,0,.42);
  color: #caffe0;
  font: 500 .8rem/1.5 var(--mono);
  white-space: pre-wrap;
}
.footer {
  width: min(1540px, calc(100% - 1.2rem));
  margin: 0 auto 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .76rem;
}
.footer a { color: var(--lime); border-bottom: 1px solid rgba(184,255,95,.32); }
.footer a:hover, .footer a:focus-visible { color: #fff; outline: none; border-color: var(--lime); }

@media (max-width: 1340px) {
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-board { grid-template-columns: 1fr; }
  .knob-bank { grid-template-columns: repeat(4, minmax(95px, 1fr)); }
  .pad-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; border-radius: 24px; }
  .quick-nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .1rem; }
  .danger-btn { margin-left: auto; }
  .command-deck { grid-template-columns: 1fr; }
  .jarvis-display { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cover-overlay { width: min(680px, 88%); }
  .fader-strip { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell, .topbar, .footer { width: calc(100% - .8rem); }
  .cover-stage { min-height: 420px; }
  .cover-stage img { object-position: 62% center; }
  .cover-stage::after { background: linear-gradient(0deg, rgba(1,7,4,.93) 0%, rgba(1,7,4,.72) 42%, rgba(1,7,4,.18) 100%); }
  .cover-overlay { align-self: end; width: 100%; }
  .overview-grid, .smart-grid { grid-template-columns: 1fr; }
  .knob-bank { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .pad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .keyboard { min-width: 900px; height: 228px; }
  .footer { flex-direction: column; }
  .section-heading { flex-direction: column; }
  h1 { font-size: clamp(2.4rem, 14vw, 4rem); }
}

@media (max-width: 520px) {
  .brand { width: 100%; }
  .danger-btn { width: 100%; }
  .hero-actions, .recorder-actions { display: grid; grid-template-columns: 1fr; }
  .jarvis-display { grid-template-columns: 1fr; }
  .cover-stage { min-height: 460px; }
  .cover-overlay { padding: 1rem; }
  .wheel-wrap { height: 136px; }
  .keyboard { min-width: 840px; height: 218px; }
  .key.white { min-width: 56px; }
  .key.black { width: 34px; }
}
