:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --bg: #0f0f13;
  --bg-card: #1a1a24;
  --bg-hover: #22222e;
  --border: #2a2a3a;
  --text: #f1f1f5;
  --text-muted: #8888aa;
  --text-dim: #555570;
  --success: #22c55e;
  --font: 'Noto Sans KR', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,15,19,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}
.logo-icon { font-size: 1.3rem; }
.nav-links { display: flex; gap: 24px; }
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #0f0f13 0%, #1a1020 50%, #0f1a2a 100%);
  border-bottom: 1px solid var(--border);
  padding: 80px 24px;
}
.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 40px;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--mono);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}
.btn-start {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 14px 32px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, transform 0.1s;
}
.btn-start:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ── Curriculum Section ── */
.curriculum-section { padding: 60px 24px 80px; }
.container { max-width: 900px; margin: 0 auto; }
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.chapter-card:hover { border-color: var(--primary); }

.chapter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.chapter-header:hover { background: var(--bg-hover); }

.chapter-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.chapter-num {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 36px;
}
.chapter-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.chapter-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.chapter-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lesson-count {
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.chapter-arrow {
  color: var(--text-dim);
  font-size: 0.8rem;
  transition: transform 0.3s;
}
.chapter-arrow.open { transform: rotate(180deg); }

.lesson-list {
  border-top: 1px solid var(--border);
  display: none;
}
.lesson-list.open { display: block; }

.lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px 14px 40px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  gap: 16px;
}
.lesson-item:last-child { border-bottom: none; }
.lesson-item:hover { background: var(--bg-hover); }

.lesson-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}
.lesson-icon {
  color: var(--text-dim);
  font-size: 0.7rem;
  margin-top: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}
.lesson-item:hover .lesson-icon { color: var(--primary); }
.lesson-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2px;
}
.lesson-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.lesson-duration {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ── Lesson Page ── */
.lesson-layout {
  display: flex;
  height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
  width: 320px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.3s, transform 0.3s;
}
.sidebar.collapsed { width: 0; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.sidebar-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.sidebar-close:hover { background: var(--bg-hover); color: var(--text); }

.sidebar-progress {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s;
}
.progress-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.sidebar-list::-webkit-scrollbar { width: 4px; }
.sidebar-list::-webkit-scrollbar-track { background: transparent; }
.sidebar-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-chapter { padding: 8px 0; }
.sidebar-chapter-title {
  padding: 6px 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.sidebar-lesson {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 20px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}
.sidebar-lesson:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-lesson.active {
  background: rgba(99,102,241,0.12);
  color: var(--primary);
  font-weight: 500;
}
.sidebar-lesson-icon {
  flex-shrink: 0;
  font-size: 0.65rem;
  margin-top: 3px;
}

/* Lesson Main */
.lesson-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.lesson-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}
.menu-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.menu-btn:hover { background: var(--bg); color: var(--text); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
  overflow: hidden;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span:last-child {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-container { background: #000; }
.video-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  padding-top: 56.25%;
}
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lesson-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  width: 100%;
}
.lesson-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.lesson-chapter-badge, .lesson-duration-badge, .lesson-num-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
}
.lesson-chapter-badge { background: rgba(99,102,241,0.1); color: var(--primary); border-color: rgba(99,102,241,0.3); }
.lesson-duration-badge { color: var(--text-muted); }
.lesson-num-badge { color: var(--text-dim); }

.lesson-main-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}
.lesson-main-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 40px;
  line-height: 1.7;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
  max-width: 45%;
}
.nav-btn:hover { border-color: var(--primary); background: var(--bg-hover); }
.nav-next { margin-left: auto; text-align: right; }
.nav-arrow { font-size: 1.1rem; color: var(--primary); flex-shrink: 0; }
.nav-info { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.nav-name { font-size: 0.85rem; font-weight: 500; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    z-index: 50;
    transform: translateX(-100%);
    width: 300px !important;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 60px 0 0 0;
    background: rgba(0,0,0,0.6);
    z-index: 49;
  }
  .sidebar-overlay.active { display: block; }

  .hero-stats { gap: 16px; }
  .stat-num { font-size: 1.4rem; }

  .nav-btn { max-width: 48%; padding: 12px 14px; }
  .nav-name { display: none; }

  .chapter-header { padding: 16px; }
  .lesson-item { padding: 12px 16px 12px 28px; }
}
