/* ============================================================
   AI Engineering Mastery - Stylesheet
   Dark theme (default), light theme toggle, responsive
   Covers: index.html (site-header, hero, course-card, etc.)
           + week pages (header, concept-card, code-block, etc.)
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-hover: #1e1e32;
  --bg-card: #141420;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-glow-strong: rgba(99, 102, 241, 0.3);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #1e293b;
  --border-light: #334155;
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.08);
  --success-border: rgba(34, 197, 94, 0.25);
  --warning: #eab308;
  --warning-bg: rgba(234, 179, 8, 0.08);
  --warning-border: rgba(234, 179, 8, 0.25);
  --error: #ef4444;
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.08);
  --info-border: rgba(59, 130, 246, 0.25);
  --tip: #22c55e;
  --purple: #a78bfa;
  --purple-bg: rgba(167, 139, 250, 0.08);
  --purple-border: rgba(167, 139, 250, 0.25);
  --code-bg: #0d1117;
  --code-border: #21262d;
  --sidebar-width: 280px;
  --header-height: 64px;
  --content-max-width: 820px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* Light theme override */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-hover: #e2e8f0;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #cbd5e1;
  --code-bg: #f6f8fa;
  --code-border: #d0d7de;
  --info-bg: rgba(59, 130, 246, 0.06);
  --info-border: rgba(59, 130, 246, 0.2);
  --warning-bg: rgba(234, 179, 8, 0.06);
  --warning-border: rgba(234, 179, 8, 0.2);
  --success-bg: rgba(34, 197, 94, 0.06);
  --success-border: rgba(34, 197, 94, 0.2);
  --purple-bg: rgba(167, 139, 250, 0.06);
  --purple-border: rgba(167, 139, 250, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(167, 139, 250, 0.04), transparent);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.05), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(167, 139, 250, 0.03), transparent);
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  line-height: 1.3;
  font-weight: 700;
  margin-top: 2.25em;
  margin-bottom: 0.75em;
}
h1 {
  font-size: 2.5rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}
h2 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--accent), var(--purple), transparent) 1;
  margin-top: 2.5em;
}
h3 {
  font-size: 1.35rem;
  color: var(--accent-light);
}
h4 {
  font-size: 1.15rem;
  color: var(--text-primary);
}
h5 { font-size: 1.05rem; }
h6 { font-size: 0.95rem; color: var(--text-secondary); }

h1:first-child, h2:first-child, h3:first-child { margin-top: 0; }

p {
  margin-bottom: 1.35em;
  color: var(--text-secondary);
  line-height: 1.8;
}

strong { color: var(--text-primary); font-weight: 600; }
em { font-style: italic; }

ul, ol {
  margin-bottom: 1.35em;
  padding-left: 1.75em;
}
li {
  margin-bottom: 0.5em;
  color: var(--text-secondary);
  line-height: 1.75;
}
li::marker {
  color: var(--accent);
}

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

/* ============================================================
   HEADER - Index page (.site-header) + Week pages (.header)
   ============================================================ */

/* Shared header base for both .site-header AND .header */
.site-header,
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  transition: background var(--transition-base);
}

[data-theme="light"] .site-header,
[data-theme="light"] .header {
  background: rgba(248, 250, 252, 0.88);
}

/* Inner flex container: .header-inner (index) + .header-content (weeks) */
.header-inner,
.header-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo: .header-logo (index) + .logo (weeks) */
.header-logo,
.logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity var(--transition-fast);
}
.logo:hover {
  text-decoration: none;
  opacity: 0.85;
}
.header-logo .logo-icon {
  font-size: 1.5rem;
}
.header-logo span {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-nav a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.header-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  text-decoration: none;
}

/* Header Search */
.header-search {
  position: relative;
}
.header-search input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-size: 0.875rem;
  width: 240px;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}
.header-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  width: 320px;
}
.header-search input::placeholder {
  color: var(--text-muted);
}
.header-search .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}
.search-results.active { display: block; }
.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-hover); }
.search-result-item .result-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}
.search-result-item .result-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  width: 38px;
  height: 38px;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sidebar Toggle */
.sidebar-toggle {
  display: none;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.sidebar-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb .separator {
  color: var(--border-light);
  user-select: none;
}
.breadcrumb .current {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================================
   LAYOUT: Sidebar + Main
   ============================================================ */
.page-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* --- Sidebar (shared between index + week pages) --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 1.5rem 0;
  flex-shrink: 0;
  transition: transform var(--transition-base);
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.sidebar-section {
  margin-bottom: 1.5rem;
}
.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav { list-style: none; padding: 0; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
}
.sidebar-nav li a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.sidebar-nav li a.active {
  border-left-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
  font-weight: 600;
}
.sidebar-nav li a .nav-number {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 1.5rem;
}

/* TOC heading for sidebar on week pages */
.sidebar .toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 1.5rem;
  margin-bottom: 0.75rem;
}

.sidebar-progress {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 1rem;
}
.sidebar-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}
.sidebar-progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}
.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 2px;
  transition: width var(--transition-slow);
}

/* --- Main Content --- */
.main-content {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 2rem 2.5rem 4rem;
}

.content-wide {
  max-width: 1200px;
}

/* Content wrappers used in some week pages */
.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.content-section {
  margin-bottom: 3rem;
}

.section {
  margin-bottom: 2.5rem;
}

/* ============================================================
   HERO - Landing page (.hero) + Week pages (.hero-banner, .hero-section)
   ============================================================ */

/* Landing page hero */
.hero {
  text-align: center;
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-glow-strong) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff, var(--accent-light), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: none;
}
[data-theme="light"] .hero h1 {
  background: linear-gradient(135deg, #0f172a, var(--accent), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .subtitle,
.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
.hero .hero-badges {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1.05rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
  color: #fff;
  text-decoration: none;
}

/* --- Week Page Hero: .hero-banner, .hero-section --- */
.hero-banner,
.hero-section {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-banner::before,
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a78bfa, var(--accent-dark));
}
.hero-banner h1,
.hero-section h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0.5rem 0 0.75rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: none;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 1.25rem;
  line-height: 1.7;
}
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.week-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.duration {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Difficulty Badges */
.difficulty-badge,
.difficulty {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.difficulty-badge.beginner,
.difficulty.beginner {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.difficulty-badge.intermediate,
.difficulty.intermediate,
.difficulty-badge.beginner-intermediate,
.difficulty.beginner-intermediate {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.difficulty-badge.advanced,
.difficulty.advanced {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================================
   PHASE SECTIONS (Landing page)
   ============================================================ */
.phase-section {
  margin: 3rem 0;
}
.phase-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.phase-number {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}
.phase-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  border-bottom: none;
}

/* ============================================================
   COURSE CARDS GRID (Landing page)
   ============================================================ */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.course-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.course-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow), 0 8px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(-4px);
  text-decoration: none;
}
[data-theme="light"] .course-card:hover {
  box-shadow: var(--shadow-glow), 0 8px 25px rgba(0, 0, 0, 0.08);
}
.course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.course-card:hover::before { opacity: 1; }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.week-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
  line-height: 1.4;
  border-bottom: none;
}
.card-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ============================================================
   TAGS / BADGES (Landing page)
   ============================================================ */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-beginner {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.badge-intermediate {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.badge-advanced {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================================
   CONCEPT CARD (122 uses in week pages)
   The KEY content card for explanations
   ============================================================ */
.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.concept-card:hover {
  border-left-color: var(--accent-light);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-glow);
  transform: translateX(2px);
}
.concept-card h3,
.concept-card h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--accent-light);
  font-size: 1.1rem;
  border-bottom: none;
}
.concept-card p {
  margin-bottom: 0.85em;
  color: var(--text-secondary);
}
.concept-card p:last-child {
  margin-bottom: 0;
}
.concept-card ul,
.concept-card ol {
  margin-bottom: 0.85em;
}
.concept-card ul:last-child,
.concept-card ol:last-child {
  margin-bottom: 0;
}

/* ============================================================
   INFO BOX (50 uses) - Blue informational callout
   ============================================================ */
.info-box {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-left: 4px solid var(--info);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.35rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  transition: all var(--transition-base);
  position: relative;
}
.info-box:hover {
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}
.info-box strong {
  color: var(--info);
}
.info-box p:last-child,
.info-box ul:last-child,
.info-box ol:last-child {
  margin-bottom: 0;
}

/* ============================================================
   WARNING BOX (9 uses) - Amber warning callout
   ============================================================ */
.warning-box {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-left: 4px solid var(--warning);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.35rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  transition: all var(--transition-base);
}
.warning-box:hover {
  box-shadow: var(--shadow-sm);
}
.warning-box strong {
  color: var(--warning);
}
.warning-box p:last-child,
.warning-box ul:last-child {
  margin-bottom: 0;
}

/* ============================================================
   TIP BOX (2 uses) - Green tip callout
   ============================================================ */
.tip-box {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-left: 4px solid var(--success);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.35rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  transition: all var(--transition-base);
}
.tip-box:hover {
  box-shadow: var(--shadow-sm);
}
.tip-box strong {
  color: var(--success);
}
.tip-box p:last-child,
.tip-box ul:last-child {
  margin-bottom: 0;
}

/* ============================================================
   EXERCISE CARD (10 uses) - Purple/indigo hands-on feel
   ============================================================ */
.exercise-card {
  background: var(--purple-bg);
  border: 1px solid var(--purple-border);
  border-left: 4px solid var(--purple);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.35rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
  transition: all var(--transition-base);
  position: relative;
}
.exercise-card:hover {
  box-shadow: var(--shadow-sm);
}
.exercise-card strong {
  color: var(--purple);
}
.exercise-card h3,
.exercise-card h4 {
  margin-top: 0;
  margin-bottom: 0.65rem;
  color: var(--purple);
  font-size: 1.05rem;
  border-bottom: none;
}
.exercise-card p:last-child,
.exercise-card ul:last-child {
  margin-bottom: 0;
}

/* ============================================================
   PROJECT CARD (10 uses)
   ============================================================ */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--success);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.project-card:hover {
  box-shadow: var(--shadow-md);
}
.project-card h3,
.project-card h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--success);
  border-bottom: none;
}
.project-card p:last-child,
.project-card ul:last-child {
  margin-bottom: 0;
}

/* ============================================================
   OBJECTIVE CARD + OBJECTIVES GRID (30 / 6 uses)
   ============================================================ */
.objectives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.objective-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.objective-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}
.objective-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.objective-card h3 {
  font-size: 1rem;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  border-bottom: none;
}
.objective-card p {
  font-size: 0.88rem;
  margin-bottom: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   COMPARISON TABLE (8 uses)
   ============================================================ */
.comparison-table {
  margin: 1.75rem 0;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.comparison-table table {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* ============================================================
   BLOCKQUOTES
   ============================================================ */
blockquote {
  margin: 1.75rem 0;
  padding: 1.15rem 1.35rem;
  background: var(--bg-secondary);
  border-left: 4px solid var(--info);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}
blockquote p:last-child { margin-bottom: 0; }
blockquote.info { border-left-color: var(--info); }
blockquote.warning { border-left-color: var(--warning); }
blockquote.tip { border-left-color: var(--tip); }
blockquote.error { border-left-color: var(--error); }

blockquote .callout-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
blockquote.info .callout-title { color: var(--info); }
blockquote.warning .callout-title { color: var(--warning); }
blockquote.tip .callout-title { color: var(--tip); }
blockquote.error .callout-title { color: var(--error); }

/* --- Concept Box (from index - keep) --- */
.concept-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.concept-box h4 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

/* ============================================================
   CODE BLOCKS
   Two patterns:
   1. Bare <pre><code> (week 1-8 style)
   2. .code-block > .code-header + <pre><code> (week 9+ style)
   ============================================================ */

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 0.2em 0.5em;
  border-radius: 5px;
  color: #e06c75;
  font-weight: 500;
  white-space: nowrap;
}
[data-theme="light"] code {
  color: #d63384;
  background: #f8f0f4;
  border-color: #f0dce5;
}

/* Pre blocks */
pre {
  margin: 1.75rem 0;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
[data-theme="light"] pre {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
pre code {
  display: block;
  padding: 1.35rem 1.5rem;
  border: none;
  background: none;
  color: #abb2bf;
  font-size: 0.85rem;
  line-height: 1.75;
  white-space: pre;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  tab-size: 4;
  letter-spacing: 0.01em;
}

/* .code-block wrapper (week 9+ style) */
.code-block {
  position: relative;
  margin: 1.75rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--code-border);
  background: var(--code-bg);
}
.code-block pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* .code-header: language label + copy btn */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--code-border);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.code-header::before {
  content: '';
  display: inline-flex;
  gap: 6px;
  margin-right: 8px;
}
.code-header .dot-red,
.code-header .dot-yellow,
.code-header .dot-green {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.code-header .dot-red { background: #ff5f57; }
.code-header .dot-yellow { background: #febc2e; }
.code-header .dot-green { background: #28c840; }

[data-theme="light"] .code-header {
  background: rgba(0, 0, 0, 0.03);
}

/* Copy button (inside .code-header or auto-generated) */
.copy-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  text-transform: none;
  letter-spacing: 0;
}
.copy-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.copy-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* Auto-generated wrapper for bare <pre> blocks */
.code-block-wrapper {
  position: relative;
}
.code-block-wrapper .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  z-index: 2;
}
.code-block-wrapper:hover .copy-btn,
.code-block-wrapper .copy-btn:focus {
  opacity: 1;
}
.code-block-wrapper .code-lang {
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  z-index: 2;
}

/* Syntax highlighting classes (One Dark Pro inspired) */
.keyword   { color: #c678dd; font-weight: 500; }
.string    { color: #98c379; }
.comment   { color: #7f848e; font-style: italic; }
.function  { color: #61afef; }
.number    { color: #d19a66; }
.operator  { color: #56b6c2; }
.class-name { color: #e5c07b; }
.decorator { color: #d19a66; }
.builtin   { color: #e06c75; }
.variable  { color: #e06c75; }
.punctuation { color: #abb2bf; }
.param     { color: #e06c75; font-style: italic; }

/* ============================================================
   MERMAID DIAGRAMS
   ============================================================ */
.mermaid-container {
  margin: 1.75rem 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-x: auto;
}
.mermaid-container .mermaid-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mermaid-container .mermaid-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.mermaid {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}
.mermaid svg {
  max-width: 100%;
  height: auto;
}
/* Override Mermaid defaults for dark theme */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node polygon {
  fill: var(--bg-tertiary) !important;
  stroke: var(--accent) !important;
}
.mermaid .nodeLabel,
.mermaid .label {
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
}
.mermaid .edgePath .path {
  stroke: var(--text-muted) !important;
}
.mermaid .edgeLabel {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
}
[data-theme="light"] .mermaid .node rect,
[data-theme="light"] .mermaid .node circle,
[data-theme="light"] .mermaid .node polygon {
  fill: var(--bg-tertiary) !important;
  stroke: var(--accent) !important;
}
[data-theme="light"] .mermaid .edgeLabel {
  background: var(--bg-secondary) !important;
}

/* ============================================================
   TABLES
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
thead {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
}
th {
  padding: 0.9rem 1.1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent-glow);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  line-height: 1.6;
}
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
[data-theme="light"] tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}
tr:hover td {
  background: var(--bg-hover);
  transition: background var(--transition-fast);
}

/* ============================================================
   FORMULA BOX / BLOCK / EXPLANATION (Math)
   ============================================================ */
.formula-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
  text-align: center;
}
.formula-box p {
  text-align: center;
}
.formula-box p:last-child {
  margin-bottom: 0;
}

.formula-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
  text-align: center;
}
.formula-block code {
  display: inline-block;
  font-size: 1.05rem;
  color: #e5c07b;
  background: none;
  border: none;
  padding: 0.5rem 0;
  font-weight: 500;
  line-height: 1.8;
}
.formula-block p {
  text-align: center;
}
.formula-block p:last-child {
  margin-bottom: 0;
}

.formula-explanation {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-style: italic;
  line-height: 1.6;
}

/* Inline math */
.math {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-size: 0.9em;
  color: #e5c07b;
  white-space: nowrap;
}
.math-block {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.75rem 0;
  font-size: 1.1rem;
  color: #e5c07b;
  overflow-x: auto;
  line-height: 2;
}

/* ============================================================
   COLLAPSIBLE SECTIONS
   ============================================================ */
.collapsible {
  margin: 1rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.collapsible-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
  font-weight: 600;
  color: var(--text-primary);
}
.collapsible-header:hover { background: var(--bg-hover); }
.collapsible-header .chevron {
  font-size: 0.75rem;
  transition: transform var(--transition-base);
  color: var(--text-muted);
}
.collapsible.open .collapsible-header .chevron {
  transform: rotate(90deg);
}
.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow) ease;
}
.collapsible.open .collapsible-content {
  max-height: 5000px;
}
.collapsible-body {
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  margin: 1.5rem 0;
}
.tab-list {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  gap: 0;
  overflow-x: auto;
}
.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel {
  display: none;
  padding: 1.25rem 0;
}
.tab-panel.active { display: block; }

/* ============================================================
   PROGRESS INDICATORS
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 4px;
  transition: width var(--transition-slow);
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.section-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.section-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.section-check label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.section-check input:checked + label {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ============================================================
   WEEK NAVIGATION (prev/next) at bottom of week pages
   .week-nav (index-style) + .week-nav-bottom (week page style)
   ============================================================ */
.week-nav,
.week-nav-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}
.week-nav a,
.week-nav-bottom a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  min-width: 180px;
}
.week-nav a:hover,
.week-nav-bottom a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}
.week-nav .nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.week-nav .nav-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.week-nav .next { text-align: right; margin-left: auto; }

/* Nav button (.nav-btn used inside .week-nav-bottom) */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}

/* ============================================================
   LEARNING PATH (Landing page)
   ============================================================ */
.learning-path {
  padding: 2rem 0;
}
.path-line {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 2rem;
}
.path-line::before {
  content: '';
  position: absolute;
  left: 0.9rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), #a78bfa, var(--accent-dark));
}
.path-node {
  position: relative;
  padding: 1rem 0 1rem 1.5rem;
}
.path-node::before {
  content: '';
  position: absolute;
  left: -1.45rem;
  top: 1.35rem;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent);
}
.path-node .path-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}
.path-node .path-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================================
   PREREQUISITES (Landing page)
   ============================================================ */
.prereq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.prereq-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.prereq-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.prereq-info h4 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  border-bottom: none;
}
.prereq-info p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem;
  text-align: center;
}
.footer-inner {
  max-width: 800px;
  margin: 0 auto;
}
.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.footer-brand span {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.site-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
  background: var(--accent-glow-strong);
  color: var(--text-primary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    z-index: 900;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(0, 0, 0, 0.5);
    z-index: 899;
    display: none;
  }
  .sidebar-overlay.active { display: block; }

  .main-content { padding: 1.5rem 1.25rem 3rem; }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  .hero h1 { font-size: 2.25rem; }
  .hero .subtitle { font-size: 1.05rem; }
  .hero-banner h1,
  .hero-section h1 { font-size: 1.75rem; }
  .course-grid { grid-template-columns: 1fr; }
  .objectives-grid { grid-template-columns: 1fr; }
  .header-search input { width: 160px; }
  .header-search input:focus { width: 200px; }
  .week-nav,
  .week-nav-bottom { flex-direction: column; }
  .week-nav a,
  .week-nav-bottom a,
  .nav-btn { min-width: unset; }
  .tab-list { gap: 0; }
  .tab-btn { padding: 0.6rem 0.8rem; font-size: 0.8rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }
  .concept-card { padding: 1.15rem 1.25rem; }
}

@media (max-width: 480px) {
  .hero { padding: 3rem 1rem 2.5rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero-badges { flex-direction: column; align-items: center; }
  .phase-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .header-search { display: none; }
  .prereq-grid { grid-template-columns: 1fr; }
  .hero-banner,
  .hero-section { padding: 1.5rem 1rem; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.concept-card,
.info-box,
.warning-box,
.tip-box,
.exercise-card,
.project-card,
.code-block,
.mermaid-container,
.formula-box,
.formula-block,
.comparison-table {
  animation: fadeInUp 0.4s ease both;
}

/* Stagger animation for grids */
.objectives-grid .objective-card:nth-child(1) { animation-delay: 0.05s; }
.objectives-grid .objective-card:nth-child(2) { animation-delay: 0.1s; }
.objectives-grid .objective-card:nth-child(3) { animation-delay: 0.15s; }
.objectives-grid .objective-card:nth-child(4) { animation-delay: 0.2s; }
.objectives-grid .objective-card:nth-child(5) { animation-delay: 0.25s; }
.objectives-grid .objective-card:nth-child(6) { animation-delay: 0.3s; }

/* Focus visible styles */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .header, .sidebar, .sidebar-toggle, .copy-btn, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .main-content { max-width: 100%; padding: 0; }
  pre { border: 1px solid #ccc; }
  .concept-card, .info-box, .warning-box, .tip-box, .exercise-card { border-left-width: 3px; }
}
