:root {
  color-scheme: dark;
  --bg: #0a0d14;
  --bg-soft: #111621;
  --panel: rgba(20, 27, 40, 0.88);
  --panel-solid: #141b28;
  --text: #f4f7fb;
  --muted: #9aa8bb;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.34);
  --clip: #37e7d0;
  --clip-rgb: 55, 231, 208;
  --arranger: #ffae47;
  --arranger-rgb: 255, 174, 71;
  --performance: #ff55bd;
  --performance-rgb: 255, 85, 189;
  --focus: #9db7ff;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f7;
  --bg-soft: #e2e8f0;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --text: #141823;
  --muted: #5d6878;
  --line: rgba(20, 24, 35, 0.14);
  --shadow: 0 18px 50px rgba(58, 70, 90, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 10% 0%, rgba(var(--clip-rgb), 0.13), transparent 32rem),
    radial-gradient(circle at 90% 10%, rgba(var(--performance-rgb), 0.12), transparent 32rem),
    var(--bg);
  color: var(--text);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.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;
}
.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero {
  min-height: 440px;
  padding: clamp(2rem, 7vw, 6.5rem) max(1.25rem, calc((100vw - 1180px) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -45% 30%;
  height: 420px;
  background: conic-gradient(from 120deg, rgba(var(--clip-rgb), .18), rgba(var(--arranger-rgb), .14), rgba(var(--performance-rgb), .18), transparent 65%);
  filter: blur(55px);
  border-radius: 50%;
  pointer-events: none;
}
.hero__copy { position: relative; z-index: 1; }
.hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 7.2rem);
  line-height: 0.88;
  letter-spacing: -0.07em;
}
.hero h1 span {
  display: block;
  margin-top: 0.16em;
  font-size: 0.55em;
  letter-spacing: -0.045em;
  background: linear-gradient(90deg, var(--clip), var(--arranger), var(--performance));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__intro {
  max-width: 690px;
  margin: 1.6rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.7;
}
.hero__actions { display: flex; gap: 0.8rem; margin-top: 1.8rem; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: var(--panel);
  cursor: pointer;
  font-weight: 800;
}
.button--primary {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}
.button--quiet:hover { background: var(--panel-solid); }

.mini-deluge {
  width: min(100%, 490px);
  aspect-ratio: 1.48;
  justify-self: end;
  position: relative;
  z-index: 1;
  padding: 7%;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 28px;
  background: linear-gradient(145deg, #303746, #151a24 58%, #0b0e14);
  box-shadow: 0 34px 80px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.18);
  transform: perspective(900px) rotateY(-7deg) rotateX(3deg);
}
.mini-deluge__screen {
  position: absolute;
  width: 24%;
  height: 18%;
  right: 7%;
  top: 8%;
  border: 2px solid #404956;
  border-radius: 6px;
  background: #050807;
  box-shadow: inset 0 0 18px rgba(55,231,208,.12);
  color: var(--clip);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.mini-deluge__screen span { font-size: clamp(.45rem, 1vw, .75rem); letter-spacing: .2em; }
.mini-deluge__screen strong { font-size: clamp(.8rem, 2vw, 1.4rem); }
.mini-deluge__grid {
  width: 72%;
  height: 72%;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 2.2%;
}
.mini-grid-pad {
  border-radius: 18%;
  background: #171d27;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.13), 0 1px 2px rgba(0,0,0,.6);
}
.mini-grid-pad:nth-child(16n + 3),
.mini-grid-pad:nth-child(16n + 8) { background: rgba(var(--clip-rgb), .9); box-shadow: 0 0 12px rgba(var(--clip-rgb), .45); }
.mini-grid-pad:nth-child(16n + 6),
.mini-grid-pad:nth-child(16n + 12) { background: rgba(var(--arranger-rgb), .9); box-shadow: 0 0 12px rgba(var(--arranger-rgb), .45); }
.mini-grid-pad:nth-child(16n + 15) { background: rgba(var(--performance-rgb), .9); box-shadow: 0 0 12px rgba(var(--performance-rgb), .45); }
.mini-deluge__controls {
  position: absolute;
  right: 7%;
  bottom: 8%;
  width: 19%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14%;
}
.mini-knob {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #718092, #1e2530 48%, #090b10 51%);
  box-shadow: 0 4px 8px rgba(0,0,0,.5);
}
.mini-button {
  aspect-ratio: 1.7;
  border-radius: 5px;
  background: #202734;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

main {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
}
.filter-panel {
  position: relative;
  z-index: 2;
  margin-top: -24px;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.filter-panel__heading, .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}
.filter-panel h2, .section-heading h2, .legend h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}
.icon-button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 1.25rem;
}
.search {
  margin-top: 1.2rem;
  height: 54px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg-soft);
}
.search svg {
  width: 22px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
.search input::placeholder { color: var(--muted); }
.filter-row {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, .55fr) auto;
  gap: 1rem;
  align-items: end;
}
.chip-group { padding: 0; margin: 0; border: 0; }
.chip-group legend, .select-wrap > span {
  display: block;
  margin-bottom: .5rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.chip {
  min-height: 38px;
  margin: 0 .35rem .35rem 0;
  padding: 0 .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}
.chip.is-active { color: var(--text); background: var(--panel-solid); box-shadow: inset 0 0 0 1px currentColor; }
.chip--clip.is-active { color: var(--clip); }
.chip--arranger.is-active { color: var(--arranger); }
.chip--performance.is-active { color: var(--performance); }
.select-wrap select {
  width: 100%;
  min-height: 42px;
  padding: 0 2.2rem 0 .75rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--text);
}
.favourite-toggle {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .85rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.favourite-toggle input { accent-color: var(--arranger); }
.favourite-toggle span { color: var(--arranger); }
.result-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: .45rem;
  align-items: baseline;
  color: var(--muted);
}
.result-summary strong { color: var(--text); font-size: 1.2rem; }
.result-summary button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--focus);
  cursor: pointer;
  font-weight: 800;
}

.shortcut-section { padding: 5rem 0 2rem; }
.section-heading p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  text-align: right;
}
.shortcut-grid {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.shortcut-card {
  --accent: var(--clip);
  --accent-rgb: var(--clip-rgb);
  min-height: 280px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), .08), transparent 42%),
    var(--panel);
  box-shadow: 0 8px 24px rgba(0,0,0,.13);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.shortcut-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--accent-rgb), .48);
  box-shadow: 0 16px 35px rgba(0,0,0,.2);
}
.shortcut-card[data-view="arranger"] { --accent: var(--arranger); --accent-rgb: var(--arranger-rgb); }
.shortcut-card[data-view="performance"] { --accent: var(--performance); --accent-rgb: var(--performance-rgb); }
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.view-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.view-badge::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
.star-button {
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
}
.star-button:hover, .star-button.is-favourite { color: var(--arranger); background: rgba(var(--arranger-rgb), .1); }
.shortcut-card h3 {
  margin: .85rem 0 .35rem;
  font-size: 1.25rem;
  line-height: 1.18;
  letter-spacing: -0.025em;
}
.workflow-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}
.gesture {
  margin: 1.15rem 0;
  min-height: 70px;
  display: flex;
  flex-wrap: wrap;
  gap: .42rem;
  align-items: center;
}
.gesture-token {
  min-width: 67px;
  min-height: 58px;
  padding: .48rem .58rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--accent-rgb), .42);
  border-bottom-width: 4px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), .09);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.gesture-token small {
  color: var(--accent);
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .12em;
}
.gesture-token b {
  margin-top: .18rem;
  font-size: .78rem;
  text-align: center;
}
.gesture-token[data-kind="encoder"] {
  min-width: 62px;
  border-radius: 999px;
  border-bottom-width: 1px;
  outline: 3px dotted rgba(var(--accent-rgb), .22);
  outline-offset: -6px;
}
.gesture-token[data-kind="pad"] {
  aspect-ratio: 1;
  min-width: 61px;
  padding: .35rem;
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 38%, rgba(var(--accent-rgb), .36), transparent 60%),
    rgba(var(--accent-rgb), .12);
}
.gesture-token[data-action="hold"] {
  box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), .25), 0 0 0 2px rgba(var(--accent-rgb), .08);
}
.gesture-joiner {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 900;
}
.card-description {
  margin: auto 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: .9rem;
}
.card-note {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-size: .77rem;
  line-height: 1.45;
}
.empty-state {
  margin-top: 1.6rem;
  padding: 3rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
}
.empty-state strong { color: var(--text); font-size: 1.15rem; }

.legend {
  margin: 3rem 0 5rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.legend__items {
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .8rem;
}
.legend__items > div {
  min-height: 118px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  text-align: center;
}
.legend__items p { margin: .7rem 0 0; color: var(--muted); font-size: .78rem; }
.demo-token {
  min-width: 72px;
  min-height: 54px;
  padding: .4rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--clip-rgb), .55);
  border-bottom-width: 4px;
  border-radius: 9px;
  background: rgba(var(--clip-rgb), .1);
}
.demo-token small { color: var(--clip); font-size: .54rem; font-weight: 900; letter-spacing: .1em; }
.demo-token b { margin-top: .15rem; font-size: .72rem; }
.demo-token--hold { box-shadow: 0 0 0 2px rgba(var(--clip-rgb), .13); }
.demo-token--encoder { border-radius: 999px; border-bottom-width: 1px; outline: 3px dotted rgba(var(--clip-rgb), .2); outline-offset: -6px; }
.demo-token--pad { aspect-ratio: 1; min-width: 54px; }
.joiner { color: var(--arranger); font-size: 1.8rem; font-weight: 900; }

footer {
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: .82rem;
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .mini-deluge { justify-self: center; width: min(85vw, 520px); }
  .shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .chip-group { grid-column: 1 / -1; }
  .legend__items { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 650px) {
  .hero { padding-top: 3rem; }
  .hero h1 { font-size: clamp(3rem, 16vw, 5rem); }
  .mini-deluge { width: 100%; transform: none; }
  main { width: min(100% - 1.25rem, 1180px); }
  .filter-row, .shortcut-grid { grid-template-columns: 1fr; }
  .filter-panel__heading, .section-heading { align-items: flex-start; }
  .section-heading { flex-direction: column; }
  .section-heading p { text-align: left; }
  .legend__items { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  :root, :root[data-theme="light"] {
    --bg: #fff; --panel: #fff; --panel-solid: #fff; --text: #111; --muted: #555; --line: #bbb;
  }
  body { background: #fff; }
  .hero { min-height: 0; padding: 1rem 0 1.4rem; grid-template-columns: 1fr; }
  .hero h1 { font-size: 3rem; }
  .hero__intro { max-width: none; }
  .hero__actions, .mini-deluge, .filter-panel, .star-button, footer { display: none !important; }
  main { width: 100%; }
  .shortcut-section { padding: 0; }
  .section-heading p { display: none; }
  .shortcut-grid { grid-template-columns: repeat(2, 1fr); gap: .55rem; }
  .shortcut-card {
    min-height: 0;
    break-inside: avoid;
    box-shadow: none;
    padding: .75rem;
  }
  .shortcut-card h3 { font-size: 1rem; }
  .gesture { margin: .65rem 0; min-height: 0; }
  .gesture-token { min-height: 45px; min-width: 55px; }
  .legend { margin: 1rem 0 0; break-inside: avoid; }
  .legend__items { grid-template-columns: repeat(6, 1fr); }
}
