/* DJ Learning Site — Dark theme (course model) */
:root {
  --bg: #0d0d0f;
  --bg2: #151519;
  --bg3: #1e1e24;
  --border: #2a2a35;
  --accent: #7c6dfa;
  --accent2: #a78bfa;
  --text: #e2e2e8;
  --text-muted: #8888a0;
  --text-dim: #5a5a70;
  --success: #34d399;
  --warn: #fbbf24;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Nav */
.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent2);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* Main */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

/* Footer */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.site-footer a { color: var(--text-muted); }

/* Hero */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 2rem;
}
.hero-tag {
  display: inline-block;
  background: var(--bg3);
  color: var(--accent2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero h1 span { color: var(--accent2); }
.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Progress bar (shared) */
.progress-bar {
  height: 10px;
  background: var(--bg3);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
  transition: width 0.5s ease;
}
.progress-bar.sm { height: 6px; }

/* Overall progress panel on index */
.overall-progress {
  max-width: 600px;
  margin: 0 auto 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.overall-progress .label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.overall-progress .label .pct {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent2);
}

/* CTA */
.cta-row {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: var(--accent2); transform: translateY(-1px); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--accent); background: var(--bg3); }

/* Stage grid (index) */
.stages-section h2 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.stage-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.stage-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.stage-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.stage-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}
.stage-card .milestone {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.stage-card .stage-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.stage-card .stage-foot .done { color: var(--success); font-weight: 600; }
.stage-card .progress-bar { flex: 1; }

/* Stage page header */
.page-header { margin-bottom: 2rem; }
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.page-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}
.page-header .milestone {
  color: var(--text-muted);
  max-width: 720px;
}
.stage-progress {
  max-width: 720px;
  margin: 1.25rem 0 0;
}
.stage-progress .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Unit list (stage page) */
.unit-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.unit-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: border-color 0.2s, transform 0.12s;
}
.unit-card:hover { border-color: var(--accent); transform: translateX(2px); }
.unit-card .check {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: transparent;
  margin-top: 2px;
  transition: all 0.2s;
}
.unit-card.is-done { border-color: rgba(52,211,153,0.4); }
.unit-card.is-done .check {
  background: var(--success);
  border-color: var(--success);
  color: #0d0d0f;
}
.unit-card .body { flex: 1; min-width: 0; }
.unit-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 0.3rem;
}
.unit-card .obj {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.unit-card .meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
.badge.required { background: rgba(124,109,250,0.15); color: var(--accent2); }
.badge.optional { background: var(--bg3); color: var(--text-dim); }

/* Lesson page */
.lesson-page h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}
.lesson-page .obj {
  color: var(--text-muted);
  max-width: 720px;
  font-size: 1.02rem;
  margin-bottom: 1rem;
}
.lesson-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Videos */
.videos-section { margin-bottom: 2rem; }
.videos-section h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: var(--bg3);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* Article body */
.article-body {
  max-width: 720px;
  padding-top: 0.5rem;
}
.article-body h1, .article-body h2 {
  color: #fff;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}
.article-body h1 { font-size: 1.6rem; }
.article-body h2 {
  font-size: 1.3rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.article-body h3 { font-size: 1.12rem; color: var(--text); margin: 1.5rem 0 0.5rem; }
.article-body h4, .article-body h5, .article-body h6 {
  font-size: 1rem; color: var(--text-muted); margin: 1rem 0 0.4rem;
}
.article-body p { margin-bottom: 1rem; color: var(--text); }
.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.article-body li { margin-bottom: 0.35rem; }
.article-body a { color: var(--accent2); }
.article-body strong { color: #fff; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: var(--bg3);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.article-body blockquote p { color: var(--text-muted); margin-bottom: 0; }
.article-body code {
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
  color: var(--accent2);
}
.article-body pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.article-body pre code { background: none; padding: 0; font-size: 0.875rem; color: var(--text); }
.article-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
/* Checkbox task lists */
.article-body ul.task-list { list-style: none; padding-left: 0.25rem; }
.article-body ul.task-list li.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.article-body ul.task-list input[type="checkbox"] {
  margin-top: 0.45rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}

/* Mark-complete control */
.complete-control {
  max-width: 720px;
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.complete-control .btn.is-done {
  background: var(--success);
  color: #0d0d0f;
}
.complete-control .status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Prev / next nav */
.lesson-nav {
  max-width: 720px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}
.lesson-nav a {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s;
  min-width: 0;
}
.lesson-nav a:hover { border-color: var(--accent); }
.lesson-nav a.next { text-align: right; }
.lesson-nav .dir { font-size: 0.75rem; color: var(--text-dim); display: block; margin-bottom: 0.2rem; }
.lesson-nav .ttl { font-size: 0.9rem; color: #fff; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-nav .spacer { flex: 1; }

@media (max-width: 640px) {
  .site-nav { gap: 0.75rem; overflow-x: auto; }
  .nav-links { gap: 0.75rem; flex-wrap: nowrap; }
  .stage-grid { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 0.5rem 1.5rem; }
}
