@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Sora:wght@300;400;600;700&display=swap');

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

:root {
  --bg: #0a0d12;
  --surface: #111520;
  --surface2: #181d2e;
  --accent: #00e5c0;
  --accent2: #7c6fff;
  --accent3: #ff6b6b;
  --accent-amber: #ffc947;
  --text: #e8eaf0;
  --muted: #6b7a99;
  --border: rgba(255,255,255,0.07);
  --mono: 'Space Mono', monospace;
  --sans: 'Sora', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ── NAV ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,13,18,0.96);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.logo-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #00e5c0, #7c6fff);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-link {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }

.lang-switcher {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lang-btn {
  font-size: 11px;
  font-family: var(--mono);
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.2s;
}
.lang-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.lang-btn.active {
  background: rgba(0,229,192,0.1);
  color: var(--accent);
  border-color: rgba(0,229,192,0.3);
}

/* ── HERO ── */
.hero {
  padding: 64px 32px 48px;
  position: relative;
  overflow: hidden;
}

.hero-inner { position: relative; z-index: 1; max-width: 600px; }

.bg-grid {
  position: absolute; top: 0; right: 0;
  width: 50%; height: 100%; opacity: 0.03;
  background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.bg-glow {
  position: absolute; top: -80px; right: 60px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(0,229,192,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}

.hero-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 18px;
}

.hero-sub {
  font-size: 15px;
  color: var(--muted);
  font-weight: 300;
  max-width: 480px;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.btn-primary {
  background: var(--accent);
  color: #0a0d12;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 6px;
  display: inline-block;
  font-family: var(--sans);
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-outline {
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 11px 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: inline-block;
  transition: border-color 0.2s;
}
.btn-outline:hover { border-color: rgba(255,255,255,0.25); }

.lang-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.2s;
}
.pill:hover { color: var(--text); }
.pill.active {
  border-color: rgba(124,111,255,0.5);
  color: var(--accent2);
  background: rgba(124,111,255,0.08);
}

/* ── STATS BAR ── */
.stats-bar {
  display: flex;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.stat {
  flex: 1;
  padding: 18px 20px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.stat:last-child { border-right: none; }

.stat-num {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  display: block;
}

/* ── SECTION ── */
.section {
  padding: 0 32px 48px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.see-all {
  font-size: 12px;
  color: var(--accent);
  font-family: var(--mono);
}

/* ── MODULE CARDS ── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: block;
  transition: border-color 0.2s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.module-card:hover {
  border-color: rgba(0,229,192,0.3);
  transform: translateY(-2px);
}
.module-card.featured {
  border-color: rgba(0,229,192,0.2);
  background: linear-gradient(135deg, rgba(0,229,192,0.04), var(--surface));
}

.mod-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}
.mod-icon.teal  { background: rgba(0,229,192,0.12); }
.mod-icon.purple { background: rgba(124,111,255,0.12); }
.mod-icon.red   { background: rgba(255,107,107,0.12); }

.mod-title { font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.mod-desc  { font-size: 12px; color: var(--muted); line-height: 1.6; }

.mod-tag {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-family: var(--mono);
  background: rgba(0,229,192,0.1);
  color: var(--accent);
  padding: 2px 8px; border-radius: 3px;
}

.mod-lessons {
  font-size: 11px; color: var(--muted);
  margin-top: 12px; font-family: var(--mono);
}

.dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}

/* ── CODE BLOCK ── */
.code-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 24px;
  margin: 0 32px 40px;
  overflow-x: auto;
}

.code-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.code-dots { display: flex; gap: 6px; }
.dot-r { width: 10px; height: 10px; border-radius: 50%; background: #ff6b6b; }
.dot-y { width: 10px; height: 10px; border-radius: 50%; background: #ffc947; }
.dot-g { width: 10px; height: 10px; border-radius: 50%; background: #00e5c0; }
.code-lang { font-size: 11px; color: var(--muted); font-family: var(--mono); }

pre {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  white-space: pre;
}

.kw  { color: var(--accent2); }
.fn  { color: var(--accent); }
.str { color: #ff9f7f; }
.cm  { color: #3a4a60; }

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  padding: 48px 32px 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.page-badge {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 12px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}

.page-intro {
  font-size: 15px;
  color: var(--muted);
  font-weight: 300;
  max-width: 540px;
}

/* ── LESSON LIST ── */
.lesson-list { display: flex; flex-direction: column; gap: 2px; }

.lesson-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
}
.lesson-item:hover {
  border-color: rgba(0,229,192,0.25);
  background: rgba(0,229,192,0.02);
}

.lesson-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
  width: 28px;
}

.lesson-body { flex: 1; }
.lesson-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.lesson-desc  { font-size: 12px; color: var(--muted); }

.lesson-tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(124,111,255,0.1);
  color: var(--accent2);
  flex-shrink: 0;
}

/* ── ARCH DIAGRAM ── */
.arch-diagram {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}

.arch-title {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 20px;
}

.arch-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.arch-box {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  flex: 1;
  border: 1px solid transparent;
}
.arch-box span { display: block; font-size: 10px; font-family: var(--mono); font-weight: 400; margin-top: 3px; }

.arch-box.teal   { background: rgba(0,229,192,0.1);  border-color: rgba(0,229,192,0.2);  color: var(--accent); }
.arch-box.purple { background: rgba(124,111,255,0.1); border-color: rgba(124,111,255,0.2); color: var(--accent2); }
.arch-box.amber  { background: rgba(255,201,71,0.1);  border-color: rgba(255,201,71,0.2);  color: var(--accent-amber); }
.arch-box.red    { background: rgba(255,107,107,0.1); border-color: rgba(255,107,107,0.2); color: var(--accent3); }

.arch-arrow { color: var(--muted); font-size: 18px; flex-shrink: 0; }
.arch-spacer { flex: 1; }

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 18px 32px;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy { font-size: 11px; color: var(--muted); font-family: var(--mono); }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--accent);
  font-family: var(--mono);
}

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .nav { padding: 12px 16px; }
  .nav-links { display: none; }
  .hero { padding: 40px 16px 32px; }
  .hero-title { font-size: 28px; }
  .stats-bar { flex-wrap: wrap; }
  .stat { min-width: 50%; border-right: none; border-bottom: 1px solid var(--border); }
  .section { padding: 0 16px 32px; }
  .code-block { margin: 0 16px 32px; }
  .page-hero { padding: 32px 16px 24px; }
  .arch-row { flex-direction: column; }
  .arch-arrow { transform: rotate(90deg); }
  .lang-switcher { display: none; }
}
