/* ─── Barry Harris Lessons — dark jazz theme ───────────────────────────────
 * Palette (matches the chord-diagram SVGs):
 *   bg:        #1a1a2e   deep midnight
 *   panel:     #222244   raised surface
 *   accent:    #e94560   warm red (chord-tone dots, headings, highlights)
 *   accent-2:  #f0a500   amber (passing-tone dots, secondary accents)
 *   text:      #e8e8f0   primary text
 *   muted:     #a0a0b0   secondary text
 *   line:      #3a3a5e   fretboard fret lines / dividers
 *   string:    #5a5a8e   fretboard strings / borders
 * ────────────────────────────────────────────────────────────────────────── */

:root {
  --bg:        #1a1a2e;
  --bg-soft:   #1f1f3a;
  --panel:     #222244;
  --panel-2:   #2a2a52;
  --accent:    #e94560;
  --accent-2:  #f0a500;
  --text:      #e8e8f0;
  --muted:     #a0a0b0;
  --line:      #3a3a5e;
  --string:    #5a5a8e;
  --shadow:    0 6px 24px rgba(0, 0, 0, 0.35);
  --radius:    10px;
  --serif:     "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:      "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse at top left, rgba(233, 69, 96, 0.06), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(90, 90, 142, 0.10), transparent 60%),
    var(--bg);
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.content {
  padding: 48px 56px 80px;
  max-width: 900px;
  overflow-y: auto;
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .content { padding: 28px 22px 60px; }
}

/* ─── Sidebar: brand ─────────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1;
  color: var(--accent);
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* ─── Sidebar: lesson nav ────────────────────────────────────────────────── */
.lesson-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  padding: 8px 4px;
}

.lesson-link {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lesson-link:hover {
  background: var(--panel);
  border-color: var(--line);
}

.lesson-link.active {
  background: var(--panel);
  border-color: var(--accent);
  color: #fff;
}

.lesson-link .ll-num {
  display: block;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.lesson-link.active .ll-num { color: var(--accent-2); }

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

.sidebar-footer p { margin: 0 0 4px; }
.sidebar-footer .muted { color: var(--muted); opacity: 0.7; }

/* ─── Splash screen ──────────────────────────────────────────────────────── */
.splash {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow);
}

.splash h2 {
  font-family: var(--serif);
  font-size: 30px;
  margin: 0 0 12px;
  color: var(--accent);
}

.splash p { color: var(--muted); margin: 0 0 20px; }

.splash-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.splash-list li {
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

.splash-list strong { color: var(--accent); margin-right: 6px; }

/* ─── Lesson content ─────────────────────────────────────────────────────── */
.lesson-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.lesson-eyebrow {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}

.lesson-title {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 12px;
  color: #fff;
}

.lesson-summary {
  font-size: 17px;
  color: var(--muted);
  margin: 0;
  max-width: 70ch;
}

/* Objectives + key concepts: two-column card row */
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0 36px;
}

@media (max-width: 700px) {
  .meta-grid { grid-template-columns: 1fr; }
}

.meta-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.meta-card h3 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
}

.meta-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.meta-card li { margin-bottom: 6px; }
.meta-card li:last-child { margin-bottom: 0; }

/* Sections */
.section {
  margin-bottom: 40px;
}

.section-heading {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 12px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading::before {
  content: "";
  width: 4px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
}

.section-content {
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
  max-width: 72ch;
  margin: 0 0 20px;
}

/* Chord diagram grid */
.chord-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 20px 0 24px;
}

.chord-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s, transform 0.15s;
}

.chord-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.chord-card svg {
  display: block;
  width: 180px;
  height: auto;
}

.chord-card-name {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.4px;
  text-transform: lowercase;
}

/* Example callout — looks like a music staff snippet */
.example {
  background: linear-gradient(180deg, #181830 0%, #14142a 100%);
  border: 1px solid var(--string);
  border-left: 3px solid var(--accent-2);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  overflow-x: auto;
}

.example-label {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 6px;
}

/* Key knowledge box — the takeaway summary */
.key-knowledge {
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-top: 24px;
  box-shadow: var(--shadow);
}

.key-knowledge h3 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-knowledge h3::before {
  content: "♪";
  color: var(--accent-2);
  font-size: 22px;
}

.key-knowledge ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

.key-knowledge li { margin-bottom: 8px; }
.key-knowledge li:last-child { margin-bottom: 0; }

.key-knowledge li::marker { color: var(--accent); }

/* Loading / error states */
.state {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

.state.error { color: var(--accent); }

/* Subtle fade-in when switching lessons */
@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lesson-body { animation: fadein 0.25s ease; }