/* Visual language matched to harniciuksonic.com and its Mix & Master /
   Mastering Engine tool pages: near-black navy background, Inter, rose/blue
   pill buttons, pill badges, soft-bordered panel cards. Kept as a single
   plain CSS file (no build step) to match the rest of this app. */

:root {
  --bg: #020617;
  --panel: #0b1120;
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-border-hover: rgba(255, 255, 255, 0.24);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent-rose: #d8bbc3;
  --btn-rose: #e8445a;
  --btn-rose-hover: #f0596d;
  --btn-blue: #2563eb;
  --btn-blue-hover: #3b76f0;
  --danger-bg: #3a2a12;
  --danger-text: #ffcf8b;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

a { color: inherit; }

.beta-banner {
  background: linear-gradient(90deg, rgba(232, 68, 90, 0.14), rgba(37, 99, 235, 0.14));
  border-bottom: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.65rem 1.5rem;
  text-align: center;
}
.beta-banner a { color: var(--accent-rose); text-decoration: underline; }

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.75rem;
}
.back-link:hover { color: var(--text); }

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.badge {
  display: inline-block;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.badge-live {
  border-color: rgba(232, 68, 90, 0.4);
  background: rgba(232, 68, 90, 0.12);
  color: #f3b9c2;
  margin: 0;
  white-space: nowrap;
}

.hero h1 {
  font-size: 3.4rem;
  font-weight: 900;
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 0.85rem;
}

.panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.panel-sub { color: var(--muted); margin: 0; font-size: 0.9rem; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  border: 2px dashed var(--panel-border);
  border-radius: 16px;
  padding: 2.75rem 1.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--btn-rose);
  background: rgba(232, 68, 90, 0.05);
}
.dropzone-title { font-weight: 700; font-size: 1.05rem; }
.dropzone-sub { color: var(--muted); font-size: 0.85rem; }

button, .btn {
  font-family: inherit;
  border: none;
  border-radius: 13px;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-primary { background: var(--btn-rose); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--btn-rose-hover); }

.btn-secondary { background: var(--btn-blue); color: white; }
.btn-secondary:hover:not(:disabled) { background: var(--btn-blue-hover); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--panel-border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--panel-border-hover); }

button:disabled {
  background: #1e2534;
  color: #5b6478;
  cursor: not-allowed;
}

#upload-form { display: flex; flex-direction: column; gap: 1rem; }
#upload-form .btn { align-self: flex-start; }

#upload-status {
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin: 0;
  max-height: 4.5em;
  overflow-y: auto;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--btn-rose), var(--accent-rose));
  transition: width 0.3s ease;
}

/* Used while a stage doesn't report a real percentage (normalizing,
   analyzing) -- a sliding segment instead of a static/stuck-looking bar. */
.progress-fill.indeterminate {
  width: 30% !important;
  animation: progress-slide 1.1s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { margin-left: -30%; }
  100% { margin-left: 100%; }
}

.privacy-note {
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--panel-border);
  padding-top: 1rem;
  margin: 1rem 0 0;
}

#track-info {
  display: flex;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

#transport { display: flex; gap: 0.75rem; margin-bottom: 1.4rem; }

.stem-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 0.85rem;
}

.stem-row .stem-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stem-row .stem-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  text-transform: capitalize;
  font-size: 1.05rem;
}

.stem-row .stem-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.stem-row .controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
}

.stem-row .controls label { display: flex; align-items: center; gap: 0.35rem; }

.stem-row .controls .btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.stem-row .isolate-btn.active {
  background: var(--btn-rose);
  color: white;
  border-color: var(--btn-rose);
}

.stem-row .render-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.stem-row .waveform {
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 0.5rem;
}

.stem-row .advanced {
  margin-top: 0.5rem;
}

.stem-row .advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  list-style: none;
}
.stem-row .advanced summary::-webkit-details-marker { display: none; }
.stem-row .advanced summary::before {
  content: "\25B8 ";
}
.stem-row .advanced[open] summary::before {
  content: "\25BE ";
}

.stem-row .advanced-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--panel-border);
}

.stem-row .advanced-controls label { display: flex; align-items: center; gap: 0.35rem; }

.warning {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-top: 0.65rem;
  font-size: 0.85rem;
}

#export-section {
  margin-top: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--panel-border);
  padding-top: 1.4rem;
}

#export-section label { color: var(--muted); font-size: 0.9rem; }

#export-format {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-family: inherit;
}

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2.5rem;
}
footer a { color: var(--accent-rose); text-decoration: underline; }

@media (max-width: 600px) {
  .hero h1 { font-size: 2.3rem; }
  .panel { padding: 1.25rem; }
  .panel-header { flex-direction: column; }
  #export-section { flex-direction: column; align-items: flex-start; }
}
