@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}
.btn .material-symbols-outlined { font-size: 18px; }
.icon-only { padding: 8px; }
.icon-only .material-symbols-outlined { font-size: 22px; }

:root {
  color-scheme: dark;
  --bg: #0a0a0c;
  --bg-soft: #111114;
  --bg-card: #16161a;
  --bg-card-hover: #1c1c22;
  --bg-elevated: #1e1e24;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f2f2f5;
  --text-secondary: #b4b4bc;
  --muted: #7d7d85;
  --accent: #ffcc00;
  --accent-hover: #ffd633;
  --accent-dim: rgba(255, 204, 0, 0.12);
  --accent-text: #0a0a0c;
  --cyan: #5ac8fa;
  --cyan-dim: rgba(90, 200, 250, 0.1);
  --success: #30d158;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --max: 1120px;
  --prose-max: 68ch;
  --pad: clamp(16px, 4vw, 40px);
  --toc-w: 260px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.reading-mode #code-canvas,
body.reading-mode .scanlines,
body.reading-mode .hero-glow { display: none !important; }
body.reading-mode .prose { max-width: var(--prose-max); font-size: 17px; line-height: 1.7; }

#code-canvas { position: fixed; inset: 0; z-index: 0; opacity: 0.18; pointer-events: none; }
.scanlines {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px);
}
.hero-glow {
  position: fixed; top: -20%; left: 50%; transform: translateX(-50%);
  width: 80vw; height: 60vh; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse, rgba(255,204,0,0.06) 0%, transparent 70%);
}
.app { position: relative; z-index: 2; min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--cyan); text-decoration: none; transition: color 0.15s; }
a:hover { color: #7dd3fc; }
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 500;
  padding: 10px 18px; background: var(--accent); color: var(--accent-text); font-weight: 600; border-radius: 8px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ── Nav ── */
.nav-bar {
  width: 100%; border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner, .footer-inner, .section-inner, .hero-inner {
  max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 56px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.nav-right { display: flex; align-items: center; gap: 8px; position: relative; }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; font-weight: 500; }
.nav-links a {
  color: var(--text-secondary); padding: 8px 12px; border-radius: 8px; text-decoration: none;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.05); text-decoration: none; }
.icon-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-sm); padding: 8px 11px;
  cursor: pointer; font-size: 14px; font-family: inherit; line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong); }
.burger { display: none; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: clamp(56px, 10vw, 100px) 0 clamp(48px, 8vw, 80px);
  position: relative;
}
.resume-banner {
  max-width: 520px; margin: 0 auto 28px; padding: 0;
}
.resume-banner-inner {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 20px; background: var(--bg-card); border: 1px solid rgba(255,204,0,0.3);
  border-radius: var(--radius-md); box-shadow: var(--shadow-card);
}
.resume-icon { color: var(--accent); font-size: 32px !important; flex-shrink: 0; }
.resume-text { flex: 1; min-width: 0; }
.resume-text strong { display: block; font-size: 15px; margin-bottom: 2px; }
.resume-meta { font-size: 13px; color: var(--text-secondary); }
.btn-sm { padding: 10px 18px; font-size: 14px; }
.hero-logo img {
  width: 80px; height: 80px; object-fit: contain;
  filter: drop-shadow(0 0 32px rgba(255,204,0,0.15));
}
.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.25rem); font-weight: 700;
  letter-spacing: -0.035em; line-height: 1.1;
  margin: 20px 0 16px; color: var(--text);
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.hero .lead {
  font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-secondary);
  max-width: 560px; margin: 0 auto 32px; line-height: 1.6;
}
.hero .lead code {
  font-family: var(--font-mono); font-size: 0.9em;
  background: rgba(255,255,255,0.06); padding: 2px 7px; border-radius: 6px;
}

.stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 28px;
}
.stat {
  min-width: 96px; padding: 16px 20px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.stat strong { display: block; font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }

.progress-panel {
  max-width: 420px; margin: 0 auto 32px; padding: 20px 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); text-align: left;
}
.progress-panel .label { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.progress-panel .hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.progress-track {
  height: 8px; background: rgba(255,255,255,0.06); border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), #ffe066);
  width: 0%; transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 99px;
}

.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 12px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  text-decoration: none; color: inherit; transition: all 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: var(--accent-text); border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(255, 204, 0, 0.25);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-text); }
.btn-secondary {
  background: var(--bg-card); color: var(--text); border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-elevated); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.04); }

/* ── Sections ── */
.section { padding: clamp(56px, 8vw, 88px) 0; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section-head { text-align: center; margin-bottom: 40px; }
.section h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem); font-weight: 700;
  letter-spacing: -0.03em; margin: 0 0 12px; color: var(--text);
}
.section .sub {
  color: var(--text-secondary); max-width: 560px; margin: 0 auto;
  font-size: 1.05rem; line-height: 1.55;
}

/* Curriculum path — Practicum-style */
.curriculum-path {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 32px;
}
.path-step {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-secondary);
}
.path-step .num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-dim);
  color: var(--accent); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.path-arrow { color: var(--muted); font-size: 18px !important; }

/* How it works — steps */
.steps-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
}
.step-card {
  position: relative; padding: 24px 20px; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.step-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.step-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.step-icon .material-symbols-outlined { color: var(--accent); font-size: 24px !important; }
.step-num {
  position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700;
  color: var(--muted); letter-spacing: 0.06em;
}
.step-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.step-card p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.step-card code {
  font-family: var(--font-mono); font-size: 0.9em;
  background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 4px;
}

/* FAQ */
.faq-list { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg-card); overflow: hidden;
}
.faq-item summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 16px 20px; font-weight: 600; font-size: 15px; color: var(--text); list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .material-symbols-outlined { color: var(--accent); font-size: 20px !important; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-item p {
  margin: 0; padding: 14px 20px 18px; font-size: 14px; color: var(--text-secondary); line-height: 1.55;
}

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px;
}
.feature {
  padding: 24px; border-radius: var(--radius-md); background: var(--bg-card);
  border: 1px solid var(--border); transition: border-color 0.2s, box-shadow 0.2s;
}
.feature:hover { border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature-icon .material-symbols-outlined { color: var(--accent); font-size: 22px !important; }
.feature h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.feature p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }

/* Tracks */
.tracks-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px;
}
.track-card {
  padding: 24px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--bg-card);
}
.track-card.featured { border-color: rgba(255,204,0,0.35); background: linear-gradient(180deg, rgba(255,204,0,0.06), var(--bg-card)); }
.track-card h3 { margin: 0 0 6px; font-size: 18px; }
.track-card .hours { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 12px; }
.track-card p { margin: 0; font-size: 14px; color: var(--text-secondary); }

/* Phase filters */
.phase-filters {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 24px;
}
.phase-chip {
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.phase-chip:hover { border-color: var(--border-strong); color: var(--text); }
.phase-chip.active {
  background: var(--accent-dim); border-color: rgba(255,204,0,0.4); color: var(--accent);
}

/* Week cards — course module style */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; padding: 0; border-radius: var(--radius-md);
  background: var(--bg-card); border: 1px solid var(--border);
  text-decoration: none; color: inherit; position: relative; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-card);
}
.card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-hover);
  border-color: var(--border-strong); text-decoration: none; color: inherit;
}
.card.done { border-color: rgba(48, 209, 88, 0.35); }
.card.done::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--success);
}
.card-top {
  padding: 16px 18px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.card-num {
  font-size: 28px; font-weight: 700; color: rgba(255,255,255,0.08); line-height: 1;
  letter-spacing: -0.04em;
}
.card-phase {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
}
.phase-setup { background: rgba(125,125,133,0.2); color: var(--muted); }
.phase-markup { background: rgba(90,200,250,0.15); color: var(--cyan); }
.phase-js { background: rgba(255,204,0,0.15); color: var(--accent); }
.phase-fe { background: rgba(100,210,255,0.15); color: #64d2ff; }
.phase-be { background: rgba(48,209,88,0.12); color: var(--success); }
.phase-ship { background: rgba(191,90,242,0.12); color: #bf5af2; }
.card-body { padding: 0 18px 16px; flex: 1; }
.card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.card-footer {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
}
.card-project { color: var(--text-secondary); font-weight: 500; }
.card-duration { font-weight: 500; }
.done-badge {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(48,209,88,0.15); color: var(--success);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.done-badge .material-symbols-outlined { font-size: 18px !important; }
.done-badge:hover { background: rgba(48,209,88,0.25); }
.card.hidden-by-filter { display: none; }

.examples-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.example-card {
  display: block; padding: 24px; border-radius: var(--radius-md); background: var(--bg-card);
  border: 1px solid var(--border); text-align: center; transition: border-color 0.2s, transform 0.2s;
  text-decoration: none; color: inherit;
}
.example-card:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; color: inherit; }
.example-card .tag { font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; }
.example-card h4 { margin: 8px 0 4px; font-size: 16px; }
.example-card small { color: var(--muted); font-size: 12px; }

.community {
  text-align: center; padding: 48px var(--pad); border-radius: var(--radius-lg);
  margin: 0 auto 56px; max-width: calc(var(--max) + var(--pad));
  background: var(--bg-card); border: 1px solid var(--border);
}
.community h2 { margin-bottom: 12px; }
.community p { color: var(--text-secondary); max-width: 480px; margin: 0 auto 24px; font-size: 15px; }

.footer-bar { width: 100%; border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: auto; }
.footer-inner { padding: 32px var(--pad) 40px; text-align: center; color: var(--muted); font-size: 13px; }
.footer-inner p { margin: 0 0 8px; }
.footer-inner a { color: var(--text-secondary); }

/* ── Doc / lesson view (Practicum lesson layout) ── */
.page-header {
  padding: 20px var(--pad); border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.page-header-inner { max-width: calc(var(--max) + var(--toc-w)); margin: 0 auto; }
.back-link {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px;
}
.back-link:hover { color: var(--accent); text-decoration: none; }
.back-link .material-symbols-outlined { font-size: 18px !important; }

/* Lesson next module bar */
.lesson-next {
  position: sticky; bottom: 0; z-index: 50;
  border-top: 1px solid var(--border); background: rgba(10,10,12,0.92);
  backdrop-filter: blur(12px); padding: 14px var(--pad);
}
.lesson-next-inner {
  max-width: calc(var(--max) + var(--toc-w)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.lesson-next-label {
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--text-secondary);
}
.lesson-next-label .material-symbols-outlined { color: var(--accent); }

.page-header h1 {
  margin: 0; font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.25;
}
.page-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.doc-layout {
  display: grid; grid-template-columns: var(--toc-w) 1fr;
  gap: 0; max-width: calc(var(--max) + var(--toc-w) + 32px);
  margin: 0 auto; padding: 0 var(--pad) 80px;
}
.doc-toc {
  position: sticky; top: 68px; align-self: start;
  padding: 28px 20px 28px 0; max-height: calc(100vh - 80px); overflow-y: auto;
}
.doc-toc h4 {
  margin: 0 0 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.doc-toc a {
  display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  padding: 7px 12px; margin: 0 -12px; border-radius: 8px; text-decoration: none;
  border-left: 2px solid transparent;
}
.doc-toc a:hover { color: var(--text); background: rgba(255,255,255,0.04); text-decoration: none; }
.doc-toc a.active {
  color: var(--accent); background: var(--accent-dim); border-left-color: var(--accent);
}

.prose-wrap { padding: 32px 0 32px 36px; min-width: 0; }
.prose { font-size: 15px; line-height: 1.7; max-width: 100%; }

.prose h1 { font-size: 1.6rem; margin: 0 0 1em; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.prose h2 {
  font-size: 1.2rem; margin: 2.2em 0 0.6em; padding-top: 0.8em;
  border-top: 1px solid var(--border); scroll-margin-top: 88px;
  font-weight: 600; color: var(--text);
}
.prose h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.prose h3 {
  font-size: 1rem; margin: 1.4em 0 0.5em; font-weight: 600; color: var(--cyan);
}
.prose p, .prose li { color: var(--text-secondary); }
.prose strong { color: var(--text); font-weight: 600; }

.prose blockquote {
  margin: 1.2em 0; padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary); font-size: 14px; line-height: 1.55;
}
.prose blockquote p { margin: 0; }

.prose code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: rgba(255,255,255,0.07); padding: 2px 7px; border-radius: 5px; color: #e8e8ed;
}
.prose pre {
  background: #0d0d10; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 18px; overflow-x: auto; margin: 1.2em 0;
}
.prose pre code { background: none; padding: 0; font-size: 13px; line-height: 1.5; }

.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 14px; border-radius: var(--radius-sm); overflow: hidden; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.prose th { background: var(--bg-elevated); color: var(--text); font-weight: 600; }
.prose td { color: var(--text-secondary); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.35em; }
.prose li.task { list-style: none; margin-left: -1.3em; }
.prose li.task input { margin-right: 8px; accent-color: var(--accent); }

.prose details {
  margin: 1.2em 0; padding: 0; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card); overflow: hidden;
}
.prose summary {
  cursor: pointer; font-weight: 600; color: var(--text);
  padding: 14px 18px; list-style: none;
}
.prose summary::-webkit-details-marker { display: none; }
.prose details[open] summary { border-bottom: 1px solid var(--border); }
.prose details > :not(summary) { padding: 0 18px 14px; }

.prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

.day-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border);
}

/* Search */
.search-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 20px 20px;
}
.search-overlay.open { display: flex; }
.search-box {
  width: min(560px, 100%); background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-hover);
}
.search-box input {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-size: 16px; font-family: inherit;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-results { max-height: 360px; overflow-y: auto; margin-top: 12px; }
.search-results a {
  display: block; padding: 12px 14px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none;
}
.search-results a:hover { background: rgba(255,255,255,0.05); text-decoration: none; }
.search-results .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

.loading {
  color: var(--muted); padding: 64px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.loading::before {
  content: ''; width: 28px; height: 28px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-toc {
    position: relative; top: 0; max-height: none;
    padding: 20px 0; border-bottom: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  }
  .doc-toc h4 { width: 100%; margin-bottom: 8px; }
  .doc-toc a { padding: 6px 10px; margin: 0; font-size: 12px; }
  .prose-wrap { padding: 24px 0; }
}

@media (max-width: 640px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--bg-elevated);
    padding: 12px var(--pad) 16px; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-card);
  }
  .nav-links.open { display: flex; }
  .burger { display: inline-flex; }
  .path-arrow { display: none; }
  .curriculum-path { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  #code-canvas, .scanlines, .hero-glow { display: none; }
  .btn:hover, .card:hover { transform: none; }
  .loading::before { animation: none; }
}
