/* ============================================================
   Learning Path — Shared Design System
   Dark, developer-focused, no build step. Loaded by every page.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: dark;

  --bg-0: #08090C;
  --bg-1: #101218;
  --bg-2: #171A23;
  --bg-3: #1F232F;

  --border-soft: rgba(255, 255, 255, 0.06);
  --border-mid:  rgba(255, 255, 255, 0.10);
  --border-hard: rgba(255, 255, 255, 0.18);

  --text-hi:  rgba(255, 255, 255, 0.94);
  --text-md:  rgba(255, 255, 255, 0.68);
  --text-lo:  rgba(255, 255, 255, 0.42);

  --accent-cyan:    #22D3EE;
  --accent-emerald: #10B981;
  --accent-amber:   #F59E0B;
  --accent-rose:    #F43F5E;
  --accent-violet:  #A855F7;
  --accent-indigo:  #6366F1;
  --accent-pink:    #EC4899;
  --accent-blue:    #3B82F6;
  --accent-teal:    #14B8A6;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 12px 48px rgba(0, 0, 0, 0.55);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular",
               Menlo, Consolas, monospace;

  --nav-h: 60px;
  --content-w: 1200px;
}

/* Category accent hues — used as CSS vars on individual cards */
.hue-blockchain    { --hue: var(--accent-violet); }
.hue-backend       { --hue: var(--accent-cyan); }
.hue-frontend      { --hue: var(--accent-pink); }
.hue-databases     { --hue: var(--accent-amber); }
.hue-devops        { --hue: var(--accent-emerald); }
.hue-languages     { --hue: var(--accent-indigo); }
.hue-algorithms    { --hue: var(--accent-blue); }
.hue-mobile        { --hue: var(--accent-teal); }
.hue-architecture  { --hue: var(--accent-rose); }
.hue-interview     { --hue: var(--accent-amber); }
/* New categories (added in Phase A) */
.hue-concurrency   { --hue: #FB923C; }  /* orange */
.hue-cybersecurity { --hue: #DC2626; }  /* crimson */
.hue-systemdesign  { --hue: #38BDF8; }  /* steel-blue */
.hue-observability { --hue: #84CC16; }  /* lime */
.hue-ai            { --hue: #D946EF; }  /* fuchsia */
.hue-testing       { --hue: #FACC15; }  /* yellow */
/* SDLC categories */
.hue-swarch        { --hue: #C084FC; }  /* lavender */
.hue-cs            { --hue: #94A3B8; }  /* slate */
.hue-release       { --hue: #34D399; }  /* mint */
.hue-maint         { --hue: #FBBF24; }  /* amber */
.hue-product       { --hue: #F87171; }  /* coral */
.hue-dataeng       { --hue: #67E8F9; }  /* light cyan */
.hue-perf          { --hue: #FB7185; }  /* rose */
.hue-webux         { --hue: #E879F9; }  /* orchid */
.hue-lead          { --hue: #A3E635; }  /* chartreuse */
.hue-compliance    { --hue: #818CF8; }  /* periwinkle */
.hue-default       { --hue: var(--accent-cyan); }

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

html {
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 800px at 90% -10%, rgba(168, 85, 247, 0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(34, 211, 238, 0.08), transparent 55%),
    var(--bg-0);
}

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

img, svg { max-width: 100%; display: block; }

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}

.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 32px; }

.row { display: flex; gap: 16px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

/* ---------- Global nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(16px) saturate(140%);
  background: color-mix(in oklab, var(--bg-0) 82%, transparent);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-hi);
}
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent-cyan), var(--accent-violet), var(--accent-pink), var(--accent-cyan));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a { color: var(--text-md); font-size: 14px; }
.nav-links a:hover { color: var(--text-hi); text-decoration: none; }

/* ---------- Hero / page header ---------- */
.hero {
  padding: 56px 0 32px;
}
.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid color-mix(in oklab, var(--accent-cyan) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent-cyan) 8%, transparent);
}
.hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero p {
  color: var(--text-md);
  font-size: 16px;
  max-width: 720px;
  margin: 0;
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  padding: 20px;
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--hue, var(--accent-cyan)), transparent);
  opacity: 0.7;
}
.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--hue, var(--accent-cyan)) 40%, var(--border-mid));
  box-shadow: var(--shadow-2), 0 0 0 1px color-mix(in oklab, var(--hue, var(--accent-cyan)) 25%, transparent);
}
.card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.card p {
  margin: 0;
  color: var(--text-md);
  font-size: 14px;
}
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card-link:hover { text-decoration: none; }

/* Non-clickable "coming soon" tiles */
.card.coming-soon {
  cursor: not-allowed;
  opacity: 0.7;
  filter: saturate(0.85);
}
.card.coming-soon:hover {
  transform: none;
  border-color: var(--border-soft);
  box-shadow: none;
}
.card.coming-soon::before {
  opacity: 0.35;
}
.card.coming-soon h3 {
  color: var(--text-md);
}

.card-meta {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-lo);
}
.card-meta .dot { color: var(--hue, var(--accent-cyan)); }

/* ---------- Progress bar ---------- */
.progress {
  position: relative;
  height: 6px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--hue, var(--accent-cyan)), color-mix(in oklab, var(--hue, var(--accent-cyan)) 60%, white));
  border-radius: 999px;
  transition: width 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-md);
}
.progress-inline .bar { width: 80px; height: 4px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  width: fit-content;
}
.tab {
  padding: 8px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-md);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: color 160ms ease, background 160ms ease;
}
.tab:hover { color: var(--text-hi); }
.tab[aria-selected="true"] {
  background: var(--bg-3);
  color: var(--text-hi);
  box-shadow: inset 0 0 0 1px var(--border-mid);
}

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-md);
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
}
.chip.done   { color: var(--accent-emerald); border-color: color-mix(in oklab, var(--accent-emerald) 40%, transparent); background: color-mix(in oklab, var(--accent-emerald) 10%, transparent); }
.chip.wip    { color: var(--accent-amber);   border-color: color-mix(in oklab, var(--accent-amber) 40%, transparent);   background: color-mix(in oklab, var(--accent-amber) 10%, transparent); }
.chip.todo   { color: var(--text-md); }
.chip.easy   { color: var(--accent-emerald); border-color: color-mix(in oklab, var(--accent-emerald) 40%, transparent); }
.chip.mid    { color: var(--accent-amber);   border-color: color-mix(in oklab, var(--accent-amber) 40%, transparent); }
.chip.hard   { color: var(--accent-rose);    border-color: color-mix(in oklab, var(--accent-rose) 40%, transparent); }

/* ---------- Module row (for topic dashboard) ---------- */
.module {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color 160ms ease, background 160ms ease;
  color: inherit;
  text-decoration: none;
}
.module:hover {
  border-color: color-mix(in oklab, var(--hue, var(--accent-cyan)) 40%, var(--border-mid));
  background: var(--bg-2);
  text-decoration: none;
}
.module-index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-lo);
  text-align: center;
}
.module-title { font-weight: 500; font-size: 15px; }
.module-sub   { color: var(--text-md); font-size: 13px; }
.module-check {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--border-hard);
  display: grid; place-items: center;
  transition: border-color 160ms ease, background 160ms ease;
  cursor: pointer;
  background: transparent;
  color: transparent;
}
.module-check[data-done="true"] {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #001;
}
.module-check[data-done="true"]::after { content: "✓"; font-weight: 800; }

/* ---------- Lesson page ---------- */
.lesson-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding: 40px 0 120px;
}
@media (max-width: 900px) {
  .lesson-shell { grid-template-columns: 1fr; }
  .toc { display: none; }
}
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 40px);
  overflow-y: auto;
  font-size: 13px;
  padding-right: 8px;
}
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 6px 0; }
.toc a { color: var(--text-md); }
.toc a:hover { color: var(--text-hi); text-decoration: none; }
.toc .toc-h3 { padding-left: 14px; font-size: 12px; }
.toc .toc-active { color: var(--accent-cyan); }

.prose {
  max-width: 780px;
  font-size: 15.5px;
  line-height: 1.68;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}
.prose h1 { font-size: 32px; margin-top: 0; }
.prose h2 { font-size: 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border-soft); }
.prose h3 { font-size: 19px; margin-top: 28px; }
.prose h4 { font-size: 16px; color: var(--text-md); margin-top: 20px; }
.prose p, .prose ul, .prose ol { margin: 12px 0; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent-cyan);
  background: color-mix(in oklab, var(--accent-cyan) 6%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-md);
}
.prose blockquote p { margin: 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
}
.prose th, .prose td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border-soft);
}
.prose th { background: var(--bg-2); font-weight: 600; }
.prose hr { border: none; border-top: 1px solid var(--border-soft); margin: 32px 0; }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--border-soft); }
.prose kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid var(--border-hard);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-2);
}

/* Code blocks — override Prism's default look */
.prose pre {
  background: #0B0D14 !important;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px !important;
  overflow-x: auto;
  position: relative;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 18px 0;
}
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: color-mix(in oklab, var(--accent-cyan) 60%, white);
}
.copy-btn {
  position: absolute;
  top: 8px; right: 8px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-md);
  background: var(--bg-3);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 160ms ease, color 160ms ease;
}
.prose pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text-hi); }
.copy-btn.copied { color: var(--accent-emerald); border-color: var(--accent-emerald); }

/* Collapsible sections (rendered from <details>) */
.prose details {
  margin: 14px 0;
  padding: 12px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.prose summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-hi);
}
.prose details[open] summary { margin-bottom: 8px; }

/* Mermaid diagram container */
.mermaid, div.mermaid {
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  margin: 18px 0;
  overflow-x: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-hi);
  background: var(--bg-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
  text-decoration: none;
}
.btn:hover { background: var(--bg-3); border-color: var(--border-hard); text-decoration: none; }
.btn.primary {
  background: var(--accent-cyan);
  color: #001018;
  border-color: transparent;
}
.btn.primary:hover { background: color-mix(in oklab, var(--accent-cyan) 85%, white); }
.btn.ghost { background: transparent; }

/* ---------- Footer ---------- */
.footer {
  padding: 40px 0;
  color: var(--text-lo);
  font-size: 13px;
  border-top: 1px solid var(--border-soft);
  margin-top: 60px;
}

/* ---------- Topic study guide (prerequisites, outcomes, resources) ---------- */
.guide-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text-md);
  font-size: 14px;
}
.guide-list li + li { margin-top: 6px; }

.resource {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: start;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.resource-type {
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}
.resource-title { font-weight: 500; font-size: 15px; color: var(--text-hi); }
a.resource-title { color: var(--accent-cyan); }

/* ---------- Utility ---------- */
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-md); }
.faded { color: var(--text-lo); }
.hidden { display: none !important; }
.text-center { text-align: center; }

.section-title {
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-lo);
  margin: 0 0 14px;
}

/* ---------- Motion respect ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
