:root {
  --bg: #0b0b0f;
  --bg-deep: #050507;
  --panel: rgba(18, 24, 23, 0.9);
  --panel-strong: rgba(25, 33, 31, 0.94);
  --panel-soft: rgba(247, 241, 232, 0.05);
  --ink: #ffffff;
  --muted: #a0a0a0;
  --line: rgba(247, 241, 232, 0.12);
  --line-strong: rgba(247, 241, 232, 0.2);
  --accent: #d4a85a;
  --accent-soft: rgba(212, 168, 90, 0.18);
  --accent-2: #f3c977;
  --mint: #97e3c0;
  --mint-soft: rgba(151, 227, 192, 0.14);
  --danger: #ffb49e;
  --danger-soft: rgba(255, 180, 158, 0.18);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
  letter-spacing: 0 !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next Condensed", "Gill Sans", "Trebuchet MS", sans-serif;
  background: var(--bg);
}

a,
button,
input,
label {
  font: inherit;
}

button {
  color: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.mesh {
  display: none;
}

.halo {
  display: none;
}

.halo-left {
  top: -110px;
  left: -70px;
  width: 260px;
  height: 260px;
  background: rgba(242, 143, 96, 0.36);
}

.halo-right {
  right: -80px;
  bottom: -100px;
  width: 360px;
  height: 360px;
  background: rgba(151, 227, 192, 0.2);
}

.topbar,
.home-view,
.workspace-section,
.demo-section {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 0 12px;
  z-index: 8;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(212, 168, 90, 0.98), rgba(243, 201, 119, 0.96));
  color: #231510;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 14px 30px rgba(242, 143, 96, 0.24);
}

.brand-name {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-tag {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.main-nav button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.main-nav button:hover {
  background: rgba(212, 168, 90, 0.16);
  color: #ffffff;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

.auth-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-status {
  max-width: 220px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(212, 168, 90, 0.46);
  border-radius: 999px;
  background: rgba(212, 168, 90, 0.16);
  color: #ffffff;
  cursor: pointer;
}

.top-pill,
.selection-count,
.status-badge,
.history-count,
.history-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-pill {
  border: 1px solid rgba(212, 168, 90, 0.34);
  background: rgba(212, 168, 90, 0.12);
  color: #f8db9d;
}

.top-pill-soft {
  border-color: rgba(151, 227, 192, 0.22);
  background: rgba(151, 227, 192, 0.08);
  color: #c9f5e1;
}

.home-view {
  width: 100%;
  margin: 0;
}

.hero-section {
  position: relative;
  min-height: 92vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: 116px max(24px, calc((100vw - 1240px) / 2)) 54px;
  background: #050507;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% center;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.68) 44%, rgba(0, 0, 0, 0.18) 76%, transparent 100%),
    linear-gradient(180deg, rgba(5, 5, 7, 0.16), rgba(5, 5, 7, 0.92));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  display: grid;
  gap: 22px;
}

.hero-badge {
  width: fit-content;
  margin: 0;
  padding: 8px 13px;
  border: 1px solid rgba(212, 168, 90, 0.38);
  border-radius: 999px;
  background: rgba(212, 168, 90, 0.12);
  color: #f7dca0;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.hero-content h1 {
  max-width: 11.8ch;
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(3.25rem, 6vw, 6.8rem);
  line-height: 0.95;
}

.hero-content h1 span {
  color: var(--accent-2);
}

.hero-content .hero-copy {
  max-width: 34rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
}

.hero-cta {
  width: fit-content;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #d4a85a, #f3c977);
  color: #11100d;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(212, 168, 90, 0.24);
}

.stem-session-note {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(212, 168, 90, 0.22);
  border-radius: 16px;
  background: rgba(212, 168, 90, 0.08);
}

.stem-session-note span {
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.45;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-row span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
}

.demo-section,
.workspace-section {
  padding: 46px 0;
}

.demo-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}

.demo-intro h2 {
  max-width: 15ch;
  margin: 0;
}

.studio-demo-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: start;
}

.studio-upload,
.demo-visual {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
}

.studio-upload {
  position: sticky;
  top: 92px;
  margin-top: 0;
}

.demo-wave {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  padding: 0 18px;
  border-radius: 8px;
  background: #18c8d3;
}

.demo-wave span {
  flex: 1;
  min-width: 3px;
  height: 46%;
  border-radius: 999px;
  background: rgba(2, 71, 78, 0.5);
}

.demo-wave span:nth-child(3n) {
  height: 72%;
}

.demo-wave span:nth-child(4n) {
  height: 32%;
}

.original-wave {
  min-height: 84px;
  background: linear-gradient(90deg, #54575c, #777b80);
}

.demo-arrow {
  padding: 14px 0;
  color: var(--accent-2);
  text-align: center;
  font-size: 1.9rem;
}

.demo-tracks {
  display: grid;
  gap: 10px;
}

.demo-track {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.demo-track strong {
  padding-left: 8px;
}

.demo-track[data-track="drums"] .demo-wave {
  background: #0fd6de;
}

.demo-track[data-track="bass"] .demo-wave {
  background: #67e2df;
}

.demo-track[data-track="other"] .demo-wave {
  background: #9af0ed;
}

.workspace-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.decomposition-view {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  background: #030505;
}

.decomp-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 22px 12px;
  border-right: 1px solid rgba(247, 241, 232, 0.08);
  background: #0c0f10;
}

.decomp-logo,
.track-icon {
  display: grid;
  place-items: center;
}

.decomp-logo {
  width: 38px;
  height: 38px;
  margin: 0 auto 10px;
  border-radius: 12px;
  color: #080b0b;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.rail-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.rail-button span {
  width: 24px;
  display: inline-grid;
  place-items: center;
}

.rail-button strong {
  font-size: 0.9rem;
}

.rail-button:hover,
.rail-button.is-active {
  border-color: rgba(151, 227, 192, 0.2);
  background: rgba(151, 227, 192, 0.08);
  color: var(--ink);
}

.decomp-main {
  min-width: 0;
  padding: 36px 42px;
}

.decomp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
}

.studio-lobby {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.25fr);
  gap: 22px;
  align-items: start;
}

.studio-lobby.hidden {
  display: none;
}

.studio-create-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.studio-create-panel h2 {
  margin: 0;
  font-family: inherit;
  font-size: 1.6rem;
  line-height: 1.1;
}

.studio-lobby .status-panel {
  padding: 22px;
  border-radius: 18px;
}

.track-heading {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.track-heading h2 {
  max-width: 72vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: inherit;
  font-size: 1.22rem;
  line-height: 1.2;
}

.track-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(247, 241, 232, 0.08);
  color: var(--muted);
  font-size: 1.35rem;
}

.back-button,
.studio-download {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(247, 241, 232, 0.04);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.studio-download {
  display: inline-flex;
  align-items: center;
}

.story-column,
.studio-column {
  display: grid;
  gap: 22px;
}

.hero-panel,
.workflow-panel,
.control-panel,
.status-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(26, 34, 32, 0.94), rgba(13, 18, 17, 0.96));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-panel,
.workflow-panel,
.control-panel,
.status-panel {
  padding: 30px;
}

.eyebrow,
.signal-label,
.section-label,
.status-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-weight: 600;
  line-height: 0.95;
}

h1 {
  margin-top: 14px;
  font-size: clamp(3rem, 5.3vw, 5.6rem);
  max-width: 10.4ch;
}

h2 {
  margin-top: 10px;
  font-size: clamp(2rem, 3vw, 3rem);
}

.hero-copy,
.panel-copy,
.section-copy,
.status-detail,
.promise-card p,
.workflow-step p {
  color: rgba(247, 241, 232, 0.84);
  line-height: 1.62;
}

.hero-copy {
  max-width: 60ch;
  margin: 18px 0 0;
  font-size: 1.03rem;
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.promise-card,
.signal-card,
.workflow-step,
.selection-summary,
.result-card,
.history-item {
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.promise-card {
  padding: 18px;
  border-radius: 20px;
}

.promise-count,
.workflow-index {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--accent-2);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.promise-card strong,
.workflow-step strong,
.stem-title,
.signal-card strong,
.result-copy strong,
.history-main strong,
.selection-summary strong {
  display: block;
  font-size: 1.12rem;
}

.promise-card p,
.workflow-step p {
  margin: 8px 0 0;
  font-size: 0.94rem;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.signal-card {
  padding: 18px;
  border-radius: 20px;
}

.signal-card strong {
  margin-top: 8px;
}

.signal-meta {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.workflow-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.workflow-step {
  padding: 18px;
  border-radius: 20px;
}

.upload-form {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.dropzone {
  display: grid;
  gap: 10px;
  padding: 26px;
  border-radius: 24px;
  border: 1px dashed rgba(242, 202, 107, 0.4);
  background:
    linear-gradient(135deg, rgba(242, 143, 96, 0.12), transparent 55%),
    rgba(247, 241, 232, 0.04);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.is-dragging {
  transform: translateY(-2px);
  border-color: rgba(242, 202, 107, 0.78);
  background:
    linear-gradient(135deg, rgba(242, 143, 96, 0.2), transparent 55%),
    rgba(247, 241, 232, 0.06);
}

.dropzone input {
  display: none;
}

.dropzone-kicker {
  color: var(--accent-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.86rem;
}

.dropzone-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.selection-header,
.status-top,
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.selection-count,
.history-count {
  border: 1px solid var(--line);
  background: rgba(247, 241, 232, 0.06);
  color: var(--ink);
}

.stem-grid {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stem-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.stem-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stem-copy {
  display: block;
  min-height: 112px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(247, 241, 232, 0.03);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease,
    box-shadow 180ms ease;
}

.stem-card:hover .stem-copy {
  transform: translateY(-2px);
  border-color: rgba(242, 202, 107, 0.48);
}

.stem-card.is-selected .stem-copy {
  border-color: rgba(242, 143, 96, 0.84);
  background:
    linear-gradient(135deg, rgba(242, 143, 96, 0.2), transparent 65%),
    rgba(247, 241, 232, 0.06);
  box-shadow: inset 0 0 0 1px rgba(242, 143, 96, 0.24);
}

.stem-hint {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.selection-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
}

.selection-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-content: flex-start;
}

.selection-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(242, 143, 96, 0.14);
  border: 1px solid rgba(242, 143, 96, 0.28);
  color: #ffd2bd;
}

.selection-chip-muted {
  color: var(--muted);
  background: rgba(247, 241, 232, 0.05);
  border-color: var(--line);
}

.submit-button,
.download-link,
.history-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
}

.submit-button {
  min-height: 58px;
  padding: 0 24px;
  border: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: #261811;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 36px rgba(242, 143, 96, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.status-panel {
  display: grid;
  gap: 20px;
}

.status-badge {
  border: 1px solid var(--line);
  background: rgba(247, 241, 232, 0.06);
  color: var(--ink);
}

.status-badge[data-tone="working"] {
  border-color: rgba(242, 202, 107, 0.3);
  background: rgba(242, 202, 107, 0.12);
  color: #ffe7a9;
}

.status-badge[data-tone="success"] {
  border-color: rgba(151, 227, 192, 0.32);
  background: var(--mint-soft);
  color: #cff8e5;
}

.status-badge[data-tone="error"] {
  border-color: rgba(255, 180, 158, 0.32);
  background: var(--danger-soft);
  color: #ffd3c6;
}

.status-detail[data-tone="error"] {
  color: var(--danger);
}

.progress-wrap {
  display: grid;
  gap: 14px;
}

.progress-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(247, 241, 232, 0.08);
  border: 1px solid rgba(247, 241, 232, 0.1);
}

.progress-fill {
  width: 6%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 220ms ease, background 220ms ease;
}

.progress-fill[data-tone="success"] {
  background: linear-gradient(90deg, #7adcb0, var(--mint));
}

.progress-fill[data-tone="error"] {
  background: linear-gradient(90deg, #ff9f86, var(--danger));
}

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

.progress-step {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(247, 241, 232, 0.03);
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.progress-step.is-done,
.progress-step.is-ready {
  color: var(--ink);
  border-color: rgba(242, 202, 107, 0.34);
  background: rgba(242, 202, 107, 0.12);
}

.progress-step.is-current {
  color: #261811;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.progress-step.is-failed {
  color: var(--danger);
  border-color: rgba(255, 180, 158, 0.34);
  background: var(--danger-soft);
}

.result-card,
.history-panel {
  padding: 20px;
  border-radius: 24px;
}

.result-card {
  display: grid;
  gap: 16px;
}

.download-link {
  min-height: 52px;
  width: 100%;
  color: #d8f9ea;
  border: 1px solid rgba(151, 227, 192, 0.34);
  background: rgba(151, 227, 192, 0.12);
}

.preview-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(247, 241, 232, 0.04);
}

.preview-panel.is-loading::after {
  content: "Preparing private preview...";
  color: var(--muted);
  font-size: 0.92rem;
}

.preview-player {
  width: 100%;
  min-height: 44px;
  accent-color: var(--accent);
}

.mixer-panel {
  display: grid;
  gap: 18px;
}

.mixer-track {
  display: flex;
  align-items: stretch;
  gap: 18px;
}

.mixer-play,
.mixer-mute,
.mixer-solo {
  min-height: 36px;
  border: 1px solid rgba(151, 227, 192, 0.28);
  border-radius: 8px;
  background: rgba(151, 227, 192, 0.1);
  color: #d8f9ea;
  cursor: pointer;
}

.mixer-play {
  min-width: 92px;
  padding: 0 18px;
  border-radius: 999px;
}

.mixer-play:disabled {
  cursor: wait;
  opacity: 0.72;
}

.mixer-seek,
.mixer-volume {
  width: 100%;
  accent-color: var(--accent);
}

.studio-transport {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-left: 220px;
}

.timeline-ruler {
  height: 42px;
  margin-left: 220px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(247, 241, 232, 0.22) 0 2px,
      transparent 2px 12px
    );
  opacity: 0.65;
}

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

.mixer-notice {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  margin-left: 220px;
  padding: 18px;
  border: 1px solid rgba(247, 241, 232, 0.12);
  border-radius: 12px;
  background: rgba(247, 241, 232, 0.04);
  color: var(--ink);
}

.mixer-notice p {
  margin: 0;
  color: var(--muted);
}

.mixer-track {
  min-height: 70px;
  --track-volume: 1;
  --track-volume-percent: 100%;
}

.mixer-track-control {
  width: 202px;
  display: grid;
  gap: 8px;
  align-content: center;
}

.track-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mixer-track-main {
  flex: 1;
  min-width: 0;
  display: grid;
  align-items: stretch;
}

.mixer-mute,
.mixer-solo {
  width: 28px;
  min-height: 24px;
  padding: 0;
  font-size: 0.78rem;
}

.mixer-mute.is-muted,
.mixer-solo.is-solo {
  border-color: rgba(255, 180, 158, 0.34);
  background: var(--danger-soft);
  color: #ffd3c6;
}

.mixer-wave {
  position: relative;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  padding: 0 16px;
  border-radius: 8px;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.18) 0,
      rgba(255, 255, 255, 0.18) var(--track-volume-percent),
      rgba(32, 205, 216, 0.38) var(--track-volume-percent),
      rgba(32, 205, 216, 0.38) 100%
    ),
    #20cdd8;
}

.mixer-wave::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-110%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  pointer-events: none;
}

.mixer-panel.is-playing .mixer-wave::after {
  animation: mixer-sweep 1.35s linear infinite;
}

.mixer-wave span {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 2px;
  height: 18%;
  border-radius: 999px;
  background: rgba(2, 82, 88, 0.42);
  opacity: 0.9;
  transition: height 80ms linear, opacity 120ms ease;
}

@keyframes mixer-sweep {
  to {
    transform: translateX(110%);
  }
}

.mixer-volume {
  max-width: 150px;
}

.history-panel {
  border: 1px solid var(--line);
  background: rgba(247, 241, 232, 0.03);
}

.history-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
}

.history-main p {
  margin: 6px 0 0;
  color: var(--muted);
}

.history-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.history-badge[data-tone="working"] {
  border: 1px solid rgba(242, 202, 107, 0.3);
  background: rgba(242, 202, 107, 0.12);
  color: #ffe7a9;
}

.history-badge[data-tone="success"] {
  border: 1px solid rgba(151, 227, 192, 0.3);
  background: var(--mint-soft);
  color: #cff8e5;
}

.history-badge[data-tone="error"] {
  border: 1px solid rgba(255, 180, 158, 0.3);
  background: var(--danger-soft);
  color: #ffd3c6;
}

.history-link {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(151, 227, 192, 0.25);
  background: rgba(151, 227, 192, 0.08);
  color: #d8f9ea;
}

.history-button {
  cursor: pointer;
}

.history-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.history-link-danger {
  border-color: rgba(255, 180, 158, 0.32);
  background: var(--danger-soft);
  color: #ffd3c6;
}

.history-link-muted {
  border-color: var(--line);
  background: rgba(247, 241, 232, 0.05);
  color: var(--muted);
}

.history-empty {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.hidden,
.preview-panel.hidden,
.mixer-panel.hidden,
.decomposition-view.hidden {
  display: none;
}

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

@media (max-width: 1080px) {
  .hero-section {
    min-height: auto;
    padding-top: 118px;
  }

  .hero-content {
    width: min(620px, 100%);
  }
}

@media (max-width: 760px) {
  .topbar,
  .workspace-section,
  .demo-section,
  .decomp-main {
    width: min(100vw - 24px, 100%);
  }

  .topbar {
    position: relative;
    inset: auto;
    left: auto;
    transform: none;
    padding: 14px 0;
  }

  .topbar,
  .selection-header,
  .status-top,
  .history-header,
  .selection-summary {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar-actions,
  .auth-control {
    justify-content: flex-start;
  }

  .main-nav {
    width: 100%;
    border-radius: 18px;
  }

  .auth-status {
    text-align: left;
  }

  .hero-panel,
  .workflow-panel,
  .control-panel,
  .status-panel {
    padding: 22px;
    border-radius: 24px;
  }

  .stem-grid,
  .progress-steps {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: auto;
    padding: 28px 12px 40px;
  }

  .hero-image {
    opacity: 0.72;
    object-position: 68% center;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.62)),
      linear-gradient(180deg, rgba(5, 5, 7, 0.08), rgba(5, 5, 7, 0.94));
  }

  .hero-content h1 {
    max-width: 10ch;
    font-size: clamp(3rem, 14vw, 4.6rem);
  }

  .studio-demo-grid {
    grid-template-columns: 1fr;
  }

  .studio-lobby {
    grid-template-columns: 1fr;
  }

  .studio-upload {
    position: static;
    padding: 14px;
    border-radius: 18px;
  }

  .demo-intro,
  .demo-track {
    grid-template-columns: 1fr;
    display: grid;
  }

  .demo-track {
    gap: 10px;
  }

  .history-item,
  .history-side {
    align-items: flex-start;
  }

  .history-item,
  .mixer-track {
    flex-direction: column;
    align-items: stretch;
  }

  .mixer-volume {
    max-width: none;
  }

  .decomposition-view {
    grid-template-columns: 1fr;
  }

  .decomp-rail {
    position: sticky;
    top: 0;
    z-index: 3;
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(247, 241, 232, 0.08);
  }

  .decomp-main {
    padding: 22px 12px;
  }

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

  .track-heading h2 {
    max-width: calc(100vw - 48px);
  }

  .studio-transport,
  .timeline-ruler,
  .mixer-notice {
    margin-left: 0;
    grid-template-columns: 1fr;
  }

  .mixer-track-control {
    width: 100%;
  }
}
