:root {
  color-scheme: dark;
  --bg: #0d1611;
  --surface: #17241c;
  --surface-raised: #1d2d22;
  --surface-soft: #203126;
  --border: #3c5645;
  --text: #f3f7f2;
  --muted: #bacdc0;
  --green: #a8efbc;
  --green-strong: #b9f5ca;
  --purple: #b9b5ff;
  --danger: #ffb6b0;
  --ring: #d1ffc8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 280px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
button, input, audio { font: inherit; }
button, a, input[type="file"] { touch-action: manipulation; }
a { color: inherit; }
button, .btn, .side-link { cursor: pointer; }
button:disabled, .btn.disabled { cursor: not-allowed; }
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}
[hidden] { display: none !important; }
.skip-link {
  position: absolute;
  top: -80px;
  left: 12px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--green);
  color: var(--bg);
  font-weight: 700;
}
.skip-link:focus { top: 12px; }
.site-shell {
  width: min(100% - 32px, 1140px);
  margin-inline: auto;
}
.site-header { border-bottom: 1px solid #2a3b30; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 650;
  white-space: nowrap;
}
.brand strong { color: var(--green); }
.brand-mark { width: 38px; height: 38px; color: var(--green); }
.header-note { color: var(--muted); font-size: 13px; }

.hero {
  display: grid;
  align-items: center;
  gap: 28px;
  padding-block: 48px 42px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 15px;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .14em;
}
.eyebrow-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px #a8efbc24;
}
h1, h2, p { overflow-wrap: anywhere; }
h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.45rem, 8vw, 4.6rem);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -.052em;
  text-wrap: balance;
}
h1 em { color: var(--green); font-style: normal; }
.hero-lead {
  max-width: 590px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.17rem);
  line-height: 1.6;
}
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 25px;
}
.hero-facts span {
  padding: 6px 11px;
  border: 1px solid #45634e;
  border-radius: 999px;
  color: #d7e9da;
  background: #1a2920;
  font-size: 13px;
  font-weight: 550;
}
.hero-art { display: none; }
.hero-art svg { display: block; width: 100%; height: auto; }
.art-caption {
  display: block;
  margin-top: 8px;
  color: #a0b5a5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  text-align: center;
}

.tool-layout { display: grid; gap: 20px; align-items: start; }
.tool-main { min-width: 0; }
.step, .side-card {
  min-width: 0;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 16px 38px #00000015;
}
.step { padding: 21px; }
.step-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 20px;
}
.step-number, .track-index {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #54705a;
  border-radius: 10px;
  background: #27402d;
  color: var(--green);
  font-weight: 750;
}
.step-number { width: 36px; height: 36px; font-size: 12px; letter-spacing: .06em; }
.step h2, .side-card h2 {
  margin: 0;
  font-size: clamp(1.16rem, 3vw, 1.38rem);
  line-height: 1.3;
  letter-spacing: -.02em;
}
.step-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.source-controls { display: grid; gap: 16px; align-items: center; }
.upload-control {
  min-width: 0;
  padding: 16px;
  border: 1px dashed #70967a;
  border-radius: 14px;
  background: #1a2b20;
}
.upload-control label { display: block; margin-bottom: 10px; font-weight: 680; }
.upload-control input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  max-width: 100%;
  color: var(--text);
  font-size: 14px;
}
input[type="file"]::file-selector-button {
  min-height: 44px;
  margin-right: 12px;
  padding: 9px 14px;
  border: 0;
  border-radius: 9px;
  background: var(--green);
  color: #102018;
  font: inherit;
  font-weight: 720;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--green-strong); }
.upload-control p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.or-label { color: var(--muted); font-size: 13px; text-align: center; }
button, .btn, .side-link {
  min-height: 48px;
  border-radius: 10px;
  font-weight: 720;
  text-decoration: none;
}
button {
  border: 1px solid transparent;
  padding: 11px 18px;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.record-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--green);
  color: #112019;
}
.record-button:hover:not(:disabled) { background: var(--green-strong); }
.record-button:disabled { opacity: .55; }
.record-symbol {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #b53837;
}
.record-button.is-recording { background: var(--danger); }
.record-button.is-recording .record-symbol { border-radius: 2px; }
.secondary-button {
  border-color: #63806b;
  background: #2b3e31;
  color: var(--text);
}
.secondary-button:hover:not(:disabled) { background: #36503d; }
.secondary-button:disabled { opacity: .48; }
.status {
  min-height: 44px;
  margin-top: 17px;
  padding: 11px 13px;
  border: 1px solid #4a6653;
  border-radius: 10px;
  background: var(--surface-soft);
  color: #e0eee2;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.row { display: grid; gap: 12px; }
.col {
  min-width: 0;
  padding: 15px;
  border: 1px solid #415d49;
  border-radius: 14px;
  background: var(--surface-raised);
}
.track-label { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.track-label strong { min-width: 0; font-size: 14px; }
.track-index { width: 27px; height: 27px; border-radius: 8px; font-size: 12px; }
.reversed-index { border-color: #6d69a0; background: #353452; color: #d8d6ff; }
.attempt-index { border-color: #a87966; background: #4a322b; color: #ffccba; }
audio { display: block; width: 100%; max-width: 100%; }
.download-step .step-head { margin-bottom: 15px; }
.result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.quality-note { margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 100%;
  padding: 11px 18px;
  background: var(--green);
  color: #102018;
  line-height: 1.4;
  text-align: center;
}
.btn:hover:not(.disabled) { background: var(--green-strong); }
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn.disabled { background: #344239; color: #d0ddd2; opacity: .72; pointer-events: none; }
.side-card { padding: 24px; }
.side-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 17px;
  border: 1px solid #736fb6;
  border-radius: 14px;
  background: #36345c;
  color: var(--purple);
}
.side-icon svg { width: 28px; height: 28px; }
.side-eyebrow {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .14em;
}
.side-card p:not(.side-eyebrow) { margin: 13px 0 19px; color: var(--muted); font-size: 14px; }
.side-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 10px 13px;
  border: 1px solid #7973bd;
  color: #e2e0ff;
  background: #343352;
}
.side-link:hover { background: #44416b; }
.side-link span { font-size: 20px; line-height: 1; }
.singing-step { margin-top: 8px; border-color: #686493; scroll-margin-top: 24px; }
.singing-number { border-color: #807bc4; background: #3d3a60; color: var(--purple); }
.headphone-tip {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #a28659;
  border-radius: 10px;
  background: #382e20;
  color: #ffe7b8;
  font-size: 14px;
}
.sing-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.sing-controls .record-button { width: auto; }
.singing-tracks { margin-top: 18px; }
.secondary-download { width: 100%; margin-top: 13px; }
.site-footer { margin-top: 52px; border-top: 1px solid #2a3b30; }
.site-footer .site-shell {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-block: 26px;
  color: #acbfaf;
  font-size: 13px;
}
.site-footer span:first-child { color: var(--text); font-weight: 700; }

@media (min-width: 680px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(210px, .72fr); }
  .hero-art { display: block; }
  .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-controls { grid-template-columns: minmax(0, 1fr) auto minmax(150px, .42fr); }
  .singing-tracks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr) 292px; }
}
@media (max-width: 420px) {
  .site-shell { width: min(100% - 24px, 1140px); }
  .header-note { display: none; }
  .hero { padding-block: 38px 34px; }
  .step { padding: 16px; }
  .upload-control { padding: 13px; }
  .btn, .sing-controls > button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button { transition: none; }
}
