/* ============================================================
   Noir · Blac Sheep Ai — Overtone MVP
   Dark, cinematic, high-contrast design system
   ============================================================ */

:root {
  --bg: #050505;
  --bg-elevated: #0c0c0c;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --border: #2a2a2a;
  --border-subtle: #1f1f1f;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --accent: #d4a017;          /* refined gold */
  --accent-soft: rgba(212, 160, 23, 0.15);
  --accent-glow: rgba(212, 160, 23, 0.35);
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --radius-lg: 20px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}
.container.narrow { width: min(720px, 92vw); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  height: 100%;
  width: min(1120px, 92vw);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}
.logo-mark { color: var(--accent); font-size: 1.1rem; }
.logo-sub {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 0.15rem;
}
.nav-links {
  display: flex;
  gap: 1.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
}
.btn-primary:hover {
  background: #e0b02a;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--text-muted);
  background: var(--surface);
}
.btn-small {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 4rem) 0 5rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
  width: min(1120px, 92vw);
  margin-inline: auto;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}
.hero-tagline {
  font-size: 0.85rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.hero-visual {
  position: relative;
  height: 340px;
  display: grid;
  place-items: center;
}
.orbit {
  position: absolute;
  width: 280px;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: 50%;
  animation: spin 28s linear infinite;
}
.orbit-2 {
  width: 200px;
  height: 200px;
  border-color: var(--accent);
  opacity: 0.35;
  animation-duration: 18s;
  animation-direction: reverse;
}
.core {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2a2a2a, #0a0a0a);
  border: 1px solid var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Sections ---------- */
.section {
  padding: 5.5rem 0;
}
.section-header {
  margin-bottom: 2.75rem;
  max-width: 40rem;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}
.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

/* ---------- Analyze ---------- */
.analyze-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.capture-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2.5rem 1.75rem;
}

.mic-wrap {
  text-align: center;
}
.mic-btn {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all 0.25s ease;
  margin-inline: auto 0.5rem auto;
}
.mic-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.mic-btn.recording {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  animation: pulse-ring 1.4s ease infinite;
}
.mic-btn.analyzing {
  border-color: var(--accent);
  color: var(--accent);
}
.mic-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid transparent;
  pointer-events: none;
}
.mic-btn.recording .mic-ring {
  border-color: var(--danger);
  opacity: 0.5;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
  50% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
}
.mic-status {
  margin-top: 1.1rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.mic-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.or-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.file-drop {
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.file-drop:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.file-label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.file-types {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Progress log */
.progress-card {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.progress-header h3 {
  font-size: 0.95rem;
  font-weight: 500;
}
.badge {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
.badge.done {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.35);
}

.progress-log {
  flex: 1;
  overflow-y: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.65;
  padding-right: 0.5rem;
}
.log-line {
  padding: 0.2rem 0;
  color: var(--text-muted);
  animation: fadeIn 0.35s ease;
}
.log-line.muted { color: var(--text-dim); }
.log-line.active { color: var(--text); }
.log-line.success { color: var(--success); }
.log-line .ts {
  color: var(--text-dim);
  margin-right: 0.6rem;
  font-size: 0.72rem;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Results */
.results-panel { margin-top: 0.5rem; }
.results-panel.hidden { display: none; }
.results-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.results-top h3 { font-size: 1.05rem; font-weight: 500; }
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.result-item {
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1rem;
}
.result-item .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.result-item .value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.result-item .sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.genre-matches h4 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.genre-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.genre-tag {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(212, 160, 23, 0.3);
}

/* ---------- Generate / Overtone ---------- */
.overtone-panel {
  padding: 2rem;
}
.overtone-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}
.stat {
  text-align: center;
}
.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.overtone-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}
.control-group {
  flex: 1;
  min-width: 200px;
}
.control-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.control-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.temp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}
#tempValue {
  color: var(--accent);
  font-weight: 500;
}

.overtone-status {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.status-main {
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.status-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.overtone-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}
.overtone-note {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.overtone-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Genre Explorer ---------- */
.genre-explorer {
  padding: 1.5rem;
}
.genre-search-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
#genreSearch {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
#genreSearch:focus {
  border-color: var(--accent);
}
#genreSearch::placeholder { color: var(--text-dim); }
.genre-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.genre-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.35rem;
}
.genre-item {
  font-size: 0.85rem;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: default;
  transition: all 0.15s;
}
.genre-item:hover {
  border-color: var(--border);
  color: var(--text);
}
.genre-item .axes {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}
.genre-footnote {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ---------- About ---------- */
.about-section {
  text-align: center;
  padding-bottom: 4rem;
}
.about-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  margin-bottom: 1.5rem;
}
.about-copy {
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  font-size: 1.05rem;
}
.about-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 2rem 0 2.5rem;
}
.about-tags span {
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.closing {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.footer-note {
  font-size: 0.75rem;
  max-width: 40rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: calc(var(--nav-h) + 2.5rem);
    padding-bottom: 3.5rem;
  }
  .hero-visual { height: 220px; order: -1; }
  .orbit { width: 200px; height: 200px; }
  .orbit-2 { width: 140px; height: 140px; }
  .nav-links { display: none; }
  .analyze-grid { grid-template-columns: 1fr; }
  .overtone-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }
}
