:root {
  color-scheme: dark;
  --bg: #111210;
  --ink: #f4f0e8;
  --muted: #a8a394;
  --line: rgba(244, 240, 232, 0.14);
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --orange: #ff8a3d;
  --green: #5dd49a;
  --blue: #58a6ff;
  --rose: #ff6f91;
  --yellow: #ffd36a;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 138, 61, 0.16), transparent 30%),
    radial-gradient(circle at 90% 30%, rgba(88, 166, 255, 0.14), transparent 32%),
    linear-gradient(135deg, #12130f 0%, #18140f 46%, #0d1111 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  width: min(1480px, calc(100% - 44px));
  min-height: 68px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 18, 16, 0.78);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #111210;
  font-weight: 900;
  background: conic-gradient(from 20deg, var(--orange), var(--yellow), var(--green), var(--blue), var(--rose), var(--orange));
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.05;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.site-nav nav {
  display: flex;
  justify-content: center;
  gap: 22px;
  color: rgba(244, 240, 232, 0.72);
  font-size: 14px;
}

.site-nav nav a:hover {
  color: var(--ink);
}

.nav-cta {
  min-height: 38px;
  border: 1px solid rgba(93, 212, 154, 0.48);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(93, 212, 154, 0.1);
  font-weight: 800;
  white-space: nowrap;
}

.record-button.attention {
  animation: attentionPulse 780ms ease-in-out 2;
}

@keyframes attentionPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 28px 90px rgba(0, 0, 0, 0.44),
      inset 0 0 0 16px rgba(17, 18, 16, 0.76);
  }
  50% {
    transform: scale(1.06);
    box-shadow:
      0 28px 110px rgba(255, 211, 106, 0.34),
      inset 0 0 0 16px rgba(17, 18, 16, 0.68);
  }
}

.app-shell {
  width: min(1480px, 100%);
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  padding: 22px;
  scroll-margin-top: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.studio,
.side {
  min-width: 0;
}

.side {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.kicker {
  margin: 0 0 2px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 6vw, 78px);
  line-height: 0.9;
  letter-spacing: 0;
}

.headline-subtitle {
  margin-top: 10px;
  max-width: 520px;
  color: rgba(244, 240, 232, 0.72);
  font-size: 15px;
}

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

.icon-button,
.ghost-button,
.primary-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.ghost-button:focus-visible,
.primary-button:focus-visible,
.icon-button:focus-visible,
.scene:focus-visible,
.record-button:focus-visible,
.nav-cta:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

.icon-button {
  width: 48px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.ghost-button,
.primary-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.primary-button {
  width: 100%;
  background: linear-gradient(90deg, var(--orange), var(--rose));
  color: #160f0d;
  border-color: transparent;
}

.icon-button:hover,
.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

.capture-panel {
  position: relative;
  min-height: clamp(430px, 61vh, 720px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    #151615;
}

#waveCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.record-ring {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: end;
  padding: 40px 82px 110px;
  pointer-events: none;
}

.record-button {
  width: min(260px, 58vw);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: var(--ink);
  background:
    radial-gradient(circle at 45% 38%, rgba(255, 255, 255, 0.28), transparent 0 26%),
    conic-gradient(from 20deg, var(--orange), var(--yellow), var(--green), var(--blue), var(--rose), var(--orange));
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.44),
    inset 0 0 0 16px rgba(17, 18, 16, 0.76);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  pointer-events: auto;
  text-align: center;
  padding: 42px;
}

.record-button strong {
  max-width: 150px;
  font-size: 18px;
  line-height: 1.28;
}

#recordGlyph {
  color: #ff384d;
  font-size: 36px;
  line-height: 1;
}

.record-button.recording {
  animation: thump 900ms ease-in-out infinite;
}

@keyframes thump {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

.capture-copy {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 8px;
  max-width: 680px;
}

.capture-copy h2 {
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

.capture-copy p {
  max-width: 620px;
  color: rgba(244, 240, 232, 0.78);
  font-size: 16px;
  line-height: 1.7;
}

.flow-panel {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(160px, 0.55fr);
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
}

.flow-step {
  min-height: 74px;
  border: 1px solid rgba(244, 240, 232, 0.1);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-content: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.flow-step span {
  grid-row: 1 / 3;
  width: 32px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #111210;
  font-weight: 900;
  background: rgba(244, 240, 232, 0.72);
}

.flow-step strong {
  font-size: 14px;
}

.flow-step small {
  color: var(--muted);
  line-height: 1.4;
}

.flow-step.active {
  border-color: rgba(93, 212, 154, 0.48);
  background: rgba(93, 212, 154, 0.1);
}

.flow-step.active span {
  background: var(--green);
}

.compose-button {
  min-height: 74px;
}

.arrangement-status {
  grid-column: 1 / -1;
  color: rgba(244, 240, 232, 0.72);
  font-size: 13px;
  line-height: 1.6;
}

.controls-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(22px);
  padding: 16px;
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title span {
  font-weight: 850;
  font-size: 16px;
}

.panel-title small {
  color: var(--muted);
  font-size: 12px;
}

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

.scene {
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
  padding: 12px;
}

.scene span {
  display: block;
  margin-bottom: 8px;
  font-weight: 850;
  font-size: 18px;
}

.scene small {
  color: rgba(244, 240, 232, 0.68);
  line-height: 1.45;
}

.scene.active {
  border-color: rgba(255, 211, 106, 0.75);
  background: rgba(255, 211, 106, 0.13);
}

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

.slider-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: rgba(244, 240, 232, 0.78);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.clips-panel {
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.clip-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  padding-right: 3px;
}

.clip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.clip-orb {
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--green), var(--blue), var(--rose), var(--orange), var(--green));
}

.clip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.clip small {
  color: var(--muted);
}

.clip-remove {
  width: 34px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.clip-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.role-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.role-chip {
  min-height: 24px;
  border: 1px solid rgba(244, 240, 232, 0.12);
  border-radius: 999px;
  color: rgba(244, 240, 232, 0.68);
  background: rgba(255, 255, 255, 0.035);
  padding: 0 8px;
  font-size: 12px;
}

.role-chip.active {
  color: #111210;
  border-color: transparent;
  background: var(--green);
  font-weight: 850;
}

.empty-state {
  position: absolute;
  inset: 66px 16px 16px;
  border: 1px dashed rgba(244, 240, 232, 0.22);
  border-radius: 8px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state.hidden {
  display: none;
}

.recipe-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.recipe {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: rgba(244, 240, 232, 0.66);
  background: rgba(255, 255, 255, 0.045);
}

.recipe.on {
  color: var(--ink);
  border-color: rgba(93, 212, 154, 0.48);
  background: rgba(93, 212, 154, 0.11);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(17, 18, 16, 0.92);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.proof-band,
.site-section,
.site-footer {
  width: min(1480px, calc(100% - 44px));
  margin: 0 auto;
}

.proof-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.proof-band div {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.proof-band strong {
  font-size: 22px;
}

.proof-band span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.site-section {
  padding: 76px 0 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: clamp(28px, 4.4vw, 56px);
  line-height: 1.04;
}

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

.use-grid article,
.privacy-copy {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 22px;
}

.use-grid article span {
  color: var(--green);
  font-weight: 900;
  font-size: 13px;
}

.use-grid h3 {
  margin: 18px 0 8px;
  font-size: 24px;
}

.use-grid p,
.privacy-copy p {
  color: rgba(244, 240, 232, 0.72);
  line-height: 1.75;
}

.privacy-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: start;
}

.privacy-copy {
  display: grid;
  gap: 12px;
}

.site-footer {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.6fr);
    grid-template-rows: auto;
  }

  .flow-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compose-button {
    grid-column: 1 / -1;
  }

  .clip-list {
    max-height: 320px;
  }

  .proof-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .privacy-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-nav {
    width: calc(100% - 28px);
    grid-template-columns: 1fr auto;
  }

  .site-nav nav {
    display: none;
  }

  .app-shell {
    padding: 14px;
  }

  .topbar,
  .controls-grid,
  .side {
    grid-template-columns: 1fr;
  }

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

  .scene-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-panel {
    grid-template-columns: 1fr;
  }

  .compose-button {
    min-height: 50px;
  }

  .capture-panel {
    min-height: 560px;
  }

  .capture-copy {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .capture-copy p {
    font-size: 14px;
  }

  .record-button {
    width: min(220px, 72vw);
  }

  .record-ring {
    place-items: center;
    padding: 42px 16px 170px;
  }

  .proof-band,
  .site-section,
  .site-footer {
    width: calc(100% - 28px);
  }

  .proof-band,
  .use-grid {
    grid-template-columns: 1fr;
  }

  .site-section {
    padding-top: 54px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 430px) {
  .transport {
    width: 100%;
    display: grid;
    grid-template-columns: 48px 1fr 1fr;
  }

  .ghost-button {
    padding: 0 10px;
    font-size: 13px;
  }

  .scene-tabs {
    grid-template-columns: 1fr;
  }
}
