/* ═══ fuga.art — Classical music open directory ═══ */
/* Dark-first, typographic, elegant. Ceiba music pattern. */

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --surface: #18181f;
  --surface2: #1f1f28;
  --text: #e8e6f0;
  --text2: #b8b4c4;
  --text3: #78748a;
  --border: rgba(168, 140, 220, 0.12);
  --border2: rgba(168, 140, 220, 0.06);
  --accent: #9b7dd4;
  --accent2: #b89ae0;
  --accent-bg: rgba(155, 125, 212, 0.08);
  --gold: #d4a843;
  --gold-bg: rgba(212, 168, 67, 0.1);
  --teal: #5bb5a2;
  --teal-bg: rgba(91, 181, 162, 0.1);
  --red: #d4616a;
  --green: #5bb57a;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-w: 1200px;
  --max-w-narrow: 800px;
}

[data-theme="light"] {
  --bg: #f5f3f8;
  --bg2: #ebe8f0;
  --surface: #ffffff;
  --surface2: #f8f6fc;
  --text: #1a1825;
  --text2: #4a4660;
  --text3: #7a7690;
  --border: rgba(100, 80, 140, 0.15);
  --border2: rgba(100, 80, 140, 0.08);
  --accent: #7b5bb0;
  --accent2: #6a4a9e;
  --accent-bg: rgba(123, 91, 176, 0.06);
  --gold: #b08830;
  --gold-bg: rgba(176, 136, 48, 0.08);
  --teal: #3a9080;
  --teal-bg: rgba(58, 144, 128, 0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent2); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Typography ── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; }
.subtitle { color: var(--text2); font-size: 1.05rem; margin-top: 0.3em; }

/* ── Layout ── */
.section { padding: 3rem 1.5rem; }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-narrow { max-width: var(--max-w-narrow); margin: 0 auto; }
.section-header { margin-bottom: 2rem; }
.section-header h2 { margin-bottom: 0.5rem; }

/* ── Top bar ── */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.top-bar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  white-space: nowrap;
}
.logo:hover { color: var(--accent); }
.logo-mark { font-size: 1.5rem; line-height: 1; }
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s;
}
.main-nav a:hover { color: var(--text); background: var(--accent-bg); }
.main-nav a.active { color: var(--accent); background: var(--accent-bg); }
.nav-more {
  background: none;
  border: none;
  color: var(--text3);
  padding: 0.4rem;
  border-radius: var(--radius);
  transition: all 0.15s;
}
.nav-more:hover { color: var(--text); background: var(--accent-bg); }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.nav-dropdown {
  display: none;
  position: absolute;
  right: 1.5rem;
  top: 56px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  min-width: 180px;
}
.nav-dropdown.open { display: block; }
.nav-dropdown a {
  display: block;
  padding: 0.5rem 0.8rem;
  color: var(--text2);
  font-size: 0.85rem;
  border-radius: var(--radius);
}
.nav-dropdown a:hover { background: var(--accent-bg); color: var(--text); }

/* ── Theme toggle ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }

/* ── Hero sections ── */
.hero {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  background: linear-gradient(180deg, var(--accent-bg) 0%, transparent 100%);
}
.hero-inner { max-width: var(--max-w-narrow); margin: 0 auto; }
.hero h1 { margin-bottom: 0.5rem; }
.hero .subtitle { margin-bottom: 2rem; }

.detail-hero {
  padding: 2.5rem 1.5rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.detail-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.detail-hero-portrait {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface2);
}
.detail-hero-info { flex: 1; }
.detail-hero-info h1 { margin-bottom: 0.25rem; }
.detail-hero-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.detail-hero-bio {
  margin-top: 1rem;
  color: var(--text2);
  line-height: 1.7;
  max-width: 600px;
}

/* ── Stats row ── */
.stats-row {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
  padding: 1rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text3);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Era timeline ── */
.era-timeline {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: none;
}
.era-timeline::-webkit-scrollbar { display: none; }
.era-card {
  flex-shrink: 0;
  padding: 0.8rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  min-width: 120px;
  transition: all 0.15s;
}
.era-card:hover { border-color: var(--accent); background: var(--accent-bg); transform: translateY(-2px); }
.era-card-name { font-family: var(--font-display); font-size: 0.9rem; font-weight: 600; color: var(--text); }
.era-card-years { font-size: 0.75rem; color: var(--text3); margin-top: 0.2rem; }
.era-card-count {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.3rem;
}

/* ── Filter pills ── */
.filter-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active, .pill--active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.pill--liked { border-color: var(--gold); color: var(--gold); }
.pill-count { font-size: 0.7rem; opacity: 0.7; }

/* ── Card grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-grid--2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.15s;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.card-portrait {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface2);
  margin-bottom: 0.75rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.card-subtitle { font-size: 0.85rem; color: var(--text2); }
.card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  align-items: center;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid transparent;
}
.badge--era { background: var(--gold-bg); color: var(--gold); }
.badge--instrument { background: var(--teal-bg); color: var(--teal); }
.badge--tier { background: var(--accent-bg); color: var(--accent); }
.badge--free { background: rgba(91, 181, 122, 0.12); color: var(--green); }
.badge--paid { background: rgba(212, 97, 106, 0.12); color: var(--red); }
.badge--rising {
  background: var(--gold-bg);
  color: var(--gold);
  border-color: var(--gold);
}
.badge--virtuoso {
  background: var(--accent-bg);
  color: var(--accent);
}
.badge--type { background: var(--surface2); color: var(--text2); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  transition: all 0.15s;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent2); }
.btn--secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost { background: transparent; color: var(--text2); padding: 0.4rem 0.8rem; }
.btn--ghost:hover { color: var(--accent); background: var(--accent-bg); }
.btn--danger { background: rgba(212, 97, 106, 0.12); color: var(--red); border: 1px solid transparent; }
.btn--danger:hover { border-color: var(--red); }
.btn--gold { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold); }
.btn--gold:hover { background: var(--gold); color: var(--bg); }
.btn--sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn--round { border-radius: 50%; width: 48px; height: 48px; padding: 0; }
.btn--round-lg { border-radius: 50%; width: 64px; height: 64px; padding: 0; font-size: 1.2rem; }

/* ── Forms ── */
.form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.8rem; color: var(--text3); font-weight: 500; }
.form-input {
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-select {
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
}

/* ── Search ── */
.search-box {
  position: relative;
  max-width: 400px;
  margin-bottom: 1.5rem;
}
.search-box input {
  width: 100%;
  padding: 0.6rem 0.8rem 0.6rem 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box svg {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
}

/* ── Lists ── */
.item-list { display: flex; flex-direction: column; gap: 0.5rem; }
.item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  transition: all 0.15s;
}
.item-row:hover { border-color: var(--border); }
.item-row-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text3);
  min-width: 2rem;
  text-align: right;
}
.item-row-content { flex: 1; }
.item-row-title { font-weight: 500; color: var(--text); font-size: 0.9rem; }
.item-row-sub { font-size: 0.8rem; color: var(--text3); }
.item-row-actions { display: flex; gap: 0.4rem; }

/* ── Discover ── */
.discover-stage {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.discover-portrait {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--border);
  background: var(--surface2);
}
.discover-work {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.discover-composer { color: var(--text2); margin-bottom: 1rem; }
.discover-embed {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
  background: var(--surface);
}
.discover-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
}
.discover-progress {
  font-size: 0.85rem;
  color: var(--text3);
  margin-top: 1.5rem;
}
.discover-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}
.discover-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ── Graph ── */
.graph-container {
  width: 100%;
  height: calc(100vh - 56px);
  background: var(--bg);
}
.graph-container svg { width: 100%; height: 100%; }
.graph-controls {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 10;
}
.graph-legend {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text3);
  z-index: 10;
}
.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.graph-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border2);
  font-size: 0.88rem;
}
.data-table tr:hover td { background: var(--accent-bg); }

/* ── Empty states ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text3);
}
.empty-state svg { margin: 0 auto 1rem; opacity: 0.4; }
.empty-state p { font-size: 0.95rem; margin-bottom: 1rem; }

/* ── Profile ── */
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
}
.profile-stat { font-size: 0.85rem; color: var(--text2); }
.profile-stat strong { color: var(--text); font-weight: 600; }

/* ── Footer ── */
.main-content { flex: 1; }
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.footer-brand {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text2);
  margin-bottom: 0.5rem;
}
.footer-links { display: flex; justify-content: center; gap: 1rem; margin-bottom: 0.5rem; }
.footer-links a { font-size: 0.8rem; color: var(--text3); }
.footer-links a:hover { color: var(--accent); }
.footer-meta { font-size: 0.75rem; color: var(--text3); }
.footer-meta a { color: var(--text3); }
.footer-meta a:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .top-bar-inner { padding: 0 1rem; gap: 0.75rem; }
  .main-nav a { padding: 0.35rem 0.5rem; font-size: 0.8rem; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .section { padding: 2rem 1rem; }
  .detail-hero-inner { flex-direction: column; align-items: center; text-align: center; }
  .detail-hero-portrait { width: 120px; height: 120px; }
  .detail-hero-meta { justify-content: center; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .card { padding: 1rem; }
  .stats-row { gap: 0.5rem; }
  .stat-value { font-size: 1.5rem; }
  .discover-portrait { width: 140px; height: 140px; }
  .discover-actions { gap: 1rem; }
  .btn--round-lg { width: 52px; height: 52px; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 0.5rem; }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
  .main-nav { gap: 0.15rem; }
  .main-nav a { font-size: 0.75rem; padding: 0.3rem 0.4rem; }
  .form-row { flex-direction: column; }
}

/* ── Utility ── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text3); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
