/* =========================================
   Capital Developments — Design System
   ========================================= */

:root {
  --bg: #0d0f14;
  --bg2: #141720;
  --bg3: #1a1d24;
  --fg: #f0f0f0;
  --fg-muted: #8a8f99;
  --accent: #F59E0B;
  --accent-dim: rgba(245,158,11,0.12);
  --accent-hover: #D97706;
  --green: #22c55e;
  --red: #ef4444;
  --border: rgba(255,255,255,0.07);
  --border-accent: rgba(245,158,11,0.25);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
h1, h2, h3, h4 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-muted); }

/* ---- Typography ---- */
.text-accent { color: var(--accent); }
.text-muted { color: var(--fg-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* ---- Layout ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.section-pad { padding: 100px 0; }
.section-pad-sm { padding: 60px 0; }

/* ---- Topbar ---- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: rgba(13,15,20,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  color: var(--fg);
}
.logo span { color: var(--accent); }
.badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  border: 1px solid var(--border-accent);
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-dim);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--fg);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-secondary:hover { border-color: var(--fg-muted); background: var(--bg2); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.btn-ghost:hover { color: var(--fg); background: var(--bg2); }

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 80px;
  padding: 140px 48px 80px;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}
.orb-1 { width: 500px; height: 500px; background: var(--accent); top: -100px; right: 0; }
.orb-2 { width: 300px; height: 300px; background: #818cf8; bottom: 0; left: 20%; }
.grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border-accent);
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--accent-dim);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: -2px;
  margin-bottom: 20px;
}
.hero h1 .accent { color: var(--accent); }
.hero-sub {
  font-size: 18px;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 480px;
}
.hero-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-note { font-size: 13px; color: var(--fg-muted); margin-top: 16px; }
.hero-note strong { color: var(--accent); }

.hero-visual { position: relative; z-index: 1; }
.hero-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.track-grid-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.track-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}
.track-chip:hover { border-color: var(--border-accent); }
.track-chip-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.track-chip-name { font-size: 13px; font-weight: 600; }
.track-chip-modules { font-size: 11px; color: var(--fg-muted); }
.track-chip-progress { font-size: 11px; font-weight: 600; }

/* ---- Stats Bar ---- */
.stats-bar {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat-num {
  font-family: 'Sora', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--fg);
  margin-bottom: 4px;
}
.stat-label { font-size: 13px; color: var(--fg-muted); }

/* ---- Tracks Section ---- */
.tracks-section { background: var(--bg); }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 {
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.section-header p { font-size: 17px; color: var(--fg-muted); max-width: 560px; margin: 0 auto; }

.tracks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.track-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.track-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.track-card-header { display: flex; align-items: flex-start; gap: 16px; }
.track-icon {
  width: 56px; height: 56px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 24px;
}
.track-info { flex: 1; }
.track-info h3 { font-size: 20px; margin-bottom: 4px; }
.track-info p { font-size: 14px; color: var(--fg-muted); line-height: 1.5; }
.track-level {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.level-beginner { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.level-intermediate { background: rgba(245,158,11,0.12); color: var(--accent); border: 1px solid var(--border-accent); }
.level-advanced { background: rgba(239,68,68,0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.track-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--fg-muted);
}
.track-meta svg { width: 14px; height: 14px; opacity: 0.7; }
.track-footer { display: flex; align-items: center; justify-content: space-between; }
.progress-bar-wrap {
  flex: 1;
  max-width: 120px;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.5s ease;
}
.progress-label { font-size: 12px; color: var(--fg-muted); }

/* ---- Module Detail Page ---- */
.page-header {
  padding: 120px 0 60px;
  background: var(--bg);
}
.page-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--fg-muted); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb svg { width: 12px; height: 12px; }
.page-header h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -1px; margin-bottom: 12px; }
.page-header p { font-size: 16px; color: var(--fg-muted); max-width: 600px; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 60px;
}
.module-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s;
}
.module-card:hover { border-color: var(--border-accent); }
.module-card-header { display: flex; align-items: center; justify-content: space-between; }
.module-num {
  font-family: 'Sora', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
}
.module-card h3 { font-size: 17px; margin-bottom: 4px; }
.module-card p { font-size: 13px; color: var(--fg-muted); line-height: 1.5; }
.lock-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lock-status.unlocked { background: rgba(34,197,94,0.12); color: var(--green); }
.lock-status.locked { background: var(--bg3); color: var(--fg-muted); border: 1px solid var(--border); }
.lessons-list { display: flex; flex-direction: column; gap: 8px; }
.lesson-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg3);
  font-size: 13px;
  transition: background 0.2s;
}
.lesson-item:hover { background: rgba(255,255,255,0.05); }
.lesson-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 10px; }
.lesson-icon.done { background: var(--green); color: #fff; }
.lesson-icon.locked { background: var(--bg); color: var(--fg-muted); }
.lesson-icon.available { background: var(--accent); color: #000; }
.lesson-name { flex: 1; }
.lesson-duration { font-size: 11px; color: var(--fg-muted); }

/* ---- CTA Section ---- */
.cta-section {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 80px 0;
  text-align: center;
}
.cta-section h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -1px; margin-bottom: 16px; }
.cta-section p { font-size: 17px; color: var(--fg-muted); margin-bottom: 32px; max-width: 480px; margin-left: auto; margin-right: auto; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---- Footer ---- */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-brand .logo { font-size: 16px; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; color: var(--fg-muted); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--fg-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--fg); }

/* ---- Notifications / Toasts ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg2);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  box-shadow: var(--shadow);
  z-index: 999;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .topbar { padding: 16px 24px; }
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; padding: 120px 24px 60px; gap: 40px; }
  .hero-visual { display: none; }
  .tracks-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section-pad { padding: 60px 0; }
  .footer-inner { flex-direction: column; gap: 24px; text-align: center; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-actions { flex-direction: column; width: 100%; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
}