/* ============================================
   PackageQuest — Gamified Package Manager Tutorials
   Cyberpunk Terminal Aesthetic
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Background */
  --bg: #0D1117;
  --bg-surface: #161B22;
  --bg-card: #1C2128;
  --bg-elevated: #21262D;
  --bg-code: #0D1117;

  /* Text */
  --text: #E6EDF3;
  --text-muted: #8B949E;
  --text-faint: #484F58;

  /* Borders */
  --border: #30363D;
  --border-bright: #484F58;

  /* Accent */
  --accent: #00D4AA;
  --accent-dim: rgba(0, 212, 170, 0.15);
  --accent-glow: rgba(0, 212, 170, 0.3);

  /* Status */
  --green: #3FB950;
  --red: #F85149;
  --yellow: #D29922;
  --blue: #58A6FF;

  /* Spacing */
  --sidebar-w: 280px;
  --topbar-h: 56px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Type */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  color-scheme: dark;
}

/* Light theme */
[data-theme="light"] {
  --bg: #F6F8FA;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-elevated: #F6F8FA;
  --bg-code: #F6F8FA;
  --text: #1F2328;
  --text-muted: #656D76;
  --text-faint: #B1BAC4;
  --border: #D0D7DE;
  --border-bright: #B1BAC4;
  --accent: #0A8F74;
  --accent-dim: rgba(10, 143, 116, 0.1);
  --accent-glow: rgba(10, 143, 116, 0.2);
  --green: #1A7F37;
  --red: #CF222E;
  --yellow: #9A6700;
  --blue: #0969DA;
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Grid background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,212,170,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,170,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--accent);
  color: #000;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* --- Top Bar --- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  z-index: 100;
}
[data-theme="light"] .top-bar {
  background: rgba(246, 248, 250, 0.85);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.logo-text .accent { color: var(--accent); }

.xp-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.level-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  transition: all 0.3s ease;
}
.level-icon { font-size: 14px; }

.xp-bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.xp-bar {
  width: 120px;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #00FFD4);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px var(--accent-glow);
}
.xp-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  overflow: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  font-family: var(--font-mono);
  font-size: 18px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }

.trophy-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.trophy-item.earned {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.trophy-item.locked { opacity: 0.4; }
.trophy-icon { font-size: 28px; flex-shrink: 0; }
.trophy-info h4 {
  font-family: var(--font-mono);
  font-size: 14px;
  margin-bottom: 2px;
}
.trophy-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 16px var(--accent-glow);
  animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 2.7s forwards;
  pointer-events: auto;
  max-width: 320px;
}
.toast.achievement {
  border-color: var(--yellow);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 16px rgba(210,153,34,0.3);
}
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-10px); }
}

/* --- Confetti --- */
#confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.3s ease;
}
.sidebar-inner { padding: 16px; }

.sidebar-progress {
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.progress-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.progress-bar-wrap {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #00FFD4);
  border-radius: 3px;
  transition: width 0.6s ease;
}
.progress-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.nav-category { margin-bottom: 16px; }
.nav-cat-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding: 0 8px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.nav-list { list-style: none; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  border-radius: var(--radius);
  transition: all 0.15s;
  position: relative;
}
.nav-link:hover {
  color: var(--text);
  background: var(--accent-dim);
}
.nav-link.active {
  color: var(--text);
  background: var(--accent-dim);
  border-left: 2px solid var(--accent);
}
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pm-color);
  flex-shrink: 0;
}
.nav-progress-mini {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 45;
}

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* --- Hero --- */
.hero {
  padding: 80px 40px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-terminal {
  width: 100%;
  max-width: 600px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  text-align: left;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dot.red { background: #FF5F56; }
.terminal-dot.yellow { background: #FFBD2E; }
.terminal-dot.green { background: #27C93F; }
.terminal-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-left: auto;
}
.terminal-body { padding: 20px; }
.terminal-line {
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.8;
}
.terminal-line.output {
  color: var(--text-muted);
  padding-left: 20px;
}
.prompt { color: var(--accent); font-weight: 700; }
.cmd { color: var(--blue); }
.arg { color: var(--yellow); }
.flag { color: var(--green); }
.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
  color: var(--accent);
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 24px;
}
.hero-cta {
  display: inline-block;
  background: var(--accent);
  color: #0D1117;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 32px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 0 20px var(--accent-glow);
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.3);
}

/* --- Package Manager Sections --- */
.pm-section {
  padding: 40px 40px 20px;
  max-width: 960px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}
.pm-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.pm-icon-wrap { flex-shrink: 0; }
.pm-title {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.pm-version {
  font-size: 14px;
  color: var(--pm-color, var(--accent));
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  border: 1px solid var(--pm-color, var(--accent));
}
[data-theme="light"] .pm-version { background: rgba(0,0,0,0.05); }
.pm-tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}
.pm-progress-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pm-progress-bar {
  width: 100px;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.pm-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--pm-color, var(--accent));
  border-radius: 3px;
  transition: width 0.6s ease;
}
.pm-progress-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* --- Lessons --- */
.lesson {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.3s;
}
.lesson.completed {
  border-color: var(--green);
}
.lesson.completed .lesson-title::after {
  content: ' ✓';
  color: var(--green);
}
.lesson-title {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-num {
  font-size: 12px;
  color: var(--pm-color, var(--accent));
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}
.lesson-content { margin-bottom: 16px; }
.lesson-content p {
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.7;
}
.lesson-content strong { color: var(--text); }
.lesson-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
  border: 1px solid var(--border);
}
.lesson-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0,212,170,0.3);
  text-underline-offset: 2px;
}
.lesson-content a:hover { text-decoration-color: var(--accent); }
.lesson-content ul, .lesson-content ol {
  margin-bottom: 12px;
  padding-left: 20px;
}
.lesson-content li {
  margin-bottom: 6px;
  line-height: 1.6;
}

/* Info Card */
.info-card {
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.info-card h4 {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 8px;
}
.info-card ul { padding-left: 16px; }
.info-card li {
  font-size: 14px;
  color: var(--text);
}

/* --- Code Blocks --- */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 12px 0;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.copy-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.copy-btn.copied {
  color: var(--green);
  border-color: var(--green);
}
.code-block pre {
  padding: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  background: none;
  padding: 0;
  border: none;
}
/* Syntax coloring classes */
.code-block .kw { color: var(--blue); }
.code-block .str { color: var(--green); }
.code-block .cm { color: var(--text-faint); }
.code-block .fn { color: var(--yellow); }

/* --- Command Grid --- */
.cmd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.cmd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.cmd-card h4 {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--pm-color, var(--accent));
  margin-bottom: 6px;
}
.cmd-card h4 code {
  color: inherit;
  background: none;
  padding: 0;
  border: none;
  font-size: inherit;
}
.cmd-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* --- Concept Grid --- */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.concept-card h4 {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text);
  margin-bottom: 8px;
}
.concept-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Tips --- */
.tips-list { display: flex; flex-direction: column; gap: 8px; }
.tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.tip-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.tip div { font-size: 14px; line-height: 1.6; color: var(--text-muted); }
.tip strong { color: var(--text); }
.tip code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* --- Mark Complete Button --- */
.mark-complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.mark-complete-btn:hover {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 16px var(--accent-glow);
}
.mark-complete-btn.done {
  background: rgba(63, 185, 80, 0.1);
  color: var(--green);
  border-color: var(--green);
  cursor: default;
  pointer-events: none;
}

/* --- Quiz --- */
.quiz-container { margin-bottom: 8px; }
.quiz-question {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.quiz-question h4 {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
}
.quiz-question .q-num {
  color: var(--pm-color, var(--accent));
  font-weight: 700;
}
.quiz-options { display: flex; flex-direction: column; gap: 6px; }
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.quiz-option:hover:not(.selected):not(.disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.quiz-option.correct {
  border-color: var(--green);
  background: rgba(63,185,80,0.15);
  color: var(--green);
}
.quiz-option.incorrect {
  border-color: var(--red);
  background: rgba(248,81,73,0.1);
  color: var(--red);
}
.quiz-option.show-correct {
  border-color: var(--green);
  background: rgba(63,185,80,0.1);
}
.quiz-option.disabled {
  cursor: default;
  opacity: 0.8;
}

.quiz-result {
  text-align: center;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 12px;
}
.quiz-result h4 {
  font-family: var(--font-mono);
  font-size: 18px;
  margin-bottom: 8px;
}
.quiz-result .score {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
}
.quiz-result .score-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.quiz-result .xp-earned {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  margin-top: 8px;
}

/* --- Comparison Tables --- */
.comparison-section { max-width: 1000px; }
.comparison-title { margin-bottom: 20px; }
.sub-comparison-title {
  font-family: var(--font-mono);
  font-size: 20px;
  margin: 32px 0 16px;
  color: var(--text);
}
.table-wrap {
  overflow-x: auto;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.comparison-table th,
.comparison-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.comparison-table th {
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.comparison-table td {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}
.comparison-table td:first-child {
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
}
.comparison-table td strong { color: var(--accent); }
.comparison-table td code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-code);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:hover td { background: var(--accent-dim); }

/* --- Footer --- */
.site-footer {
  padding: 40px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* --- XP Popup --- */
.xp-popup {
  position: fixed;
  pointer-events: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
  z-index: 250;
  animation: xpFloat 1.2s ease-out forwards;
}
@keyframes xpFloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.2); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 60;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: block; }
  .main-content { margin-left: 0; }
  .xp-bar { width: 80px; }
  .hero { padding: 60px 20px 40px; }
  .pm-section { padding: 24px 16px 12px; }
  .cmd-grid { grid-template-columns: 1fr; }
  .concept-grid { grid-template-columns: 1fr; }
  .pm-header { flex-direction: column; align-items: flex-start; }
  .pm-progress-wrap { margin-left: 0; }
  .lesson { padding: 16px; }
}

@media (max-width: 480px) {
  .xp-bar-container { display: none; }
  .hero-terminal { font-size: 13px; }
  .pm-title { font-size: 22px; }
  .lesson-title { font-size: 16px; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
