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

:root {
  --black:       #000000;
  --black-soft:  #141414;
  --black-card:  #1c1c1c;
  --black-mid:   #222222;
  --white:       #FFFFFF;
  --white-dim:   #E0E0DE;
  --yellow:      #E6FF00;
  --blue:        #2979FF;
  --red:         #FF1744;
  --green:       #00E676;
  --purple:      #D500F9;
  --orange:      #FF6B00;
  --cyan:        #00E5FF;
  --pink:        #FF007F;
  --teal:        #1DE9B6;
  --indigo:      #651FFF;
  --lime:        #C6FF00;
  --gray-light:  #222222;
  --gray-mid:    #333333;
  --gray-border: #333333;
  --shadow:      0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.6);
  --shadow-hover:0 12px 32px rgba(0,0,0,0.5);
  --border:      1px solid rgba(255,255,255,0.08);
  --border-strong: 1px solid rgba(255,255,255,0.15);
  --font-mono:   'JetBrains Mono', monospace;
  --font-sans:   'Space Grotesk', sans-serif;
  --font-body:   'Outfit', sans-serif;
  --sidebar-w: 200px;
  --topbar-h:    60px;
  --dock-h:      72px;
  --transition:  0.2s ease-out;
  --transition-smooth: 0.2s ease-out;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #000000;
  font-family: var(--font-body);
  color: var(--white);
  line-height: 1.6;
}



/* ── Skip Link ───────────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 10000;
  background: var(--yellow);
  color: var(--black);
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 13px;
  padding: 10px 20px;
  border: 2px solid var(--black);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ── Focus styles ───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 3px;
}

/* ── Loading Screen ─────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  font-family: var(--font-sans);
  font-size: 80px;
  font-weight: 900;
  color: var(--yellow);
  letter-spacing: -4px;
  animation: loading-pulse 1.4s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.05); opacity: 0.85; }
}

.loading-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 8px;
  text-transform: uppercase;
}

.loading-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #555;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: blink-text 1s step-end infinite;
}

@keyframes blink-text {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.loading-bar-track {
  width: 220px;
  height: 3px;
  background: var(--gray-mid);
  overflow: hidden;
  border-radius: 2px;
}

.loading-bar-fill {
  height: 100%;
  width: 40%;
  background: var(--yellow);
  animation: loading-scan 1.3s ease-in-out infinite;
  border-radius: 2px;
}

@keyframes loading-scan {
  0%   { transform: translateX(-250%); }
  100% { transform: translateX(350%); }
}

/* ── Sidebar Hover Zone (focus mode) ────────────────────────── */
#sidebar-hover-zone {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  z-index: 158;
  cursor: pointer;
}

body.focus-mode #sidebar-hover-zone,
body.floating-mode #sidebar-hover-zone { display: block; }

/* ── Mobile overlay ─────────────────────────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 150;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

#sidebar-overlay.visible { opacity: 1; }

/* ── Mobile hamburger ───────────────────────────────────────── */
#sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 201;
  background: var(--black-card);
  border: var(--border);
  padding: 8px;
  border-radius: 8px;
  color: var(--white);
  cursor: pointer;
  box-shadow: var(--shadow);
}

#sidebar-toggle:hover { border-color: var(--yellow); }

.ham-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  transition: transform 0.2s, opacity 0.2s;
}

#sidebar-toggle.open .ham-line:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--yellow); }
#sidebar-toggle.open .ham-line:nth-child(2) { opacity: 0; }
#sidebar-toggle.open .ham-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--yellow); }

/* ── Layout ─────────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  left: 16px; top: 15vh;
  height: 70vh;
  width: var(--sidebar-w);
  /* Sidebar dark-mode brutalist explicit overrides */
  background: rgba(18, 18, 18, 0.95);
  color: var(--white);
  display: flex;
  flex-direction: column;
  border: 2px solid var(--white-dim);
  border-radius: 12px;
  box-shadow: 4px 4px 0px var(--yellow);
  overflow: hidden;
  z-index: 160;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus mode — sidebar hides, reveals on hover */
body.focus-mode #sidebar,
body.floating-mode #sidebar {
  transform: translateX(calc(-1 * var(--sidebar-w) - 32px));
  box-shadow: none;
}

body.focus-mode #sidebar.focus-revealed,
body.floating-mode #sidebar.focus-revealed {
  transform: translateX(0);
  box-shadow: 8px 8px 0px var(--yellow);
}

body.focus-mode #main,
body.floating-mode #main {
  margin-left: 0 !important;
  transition: margin-left 0.3s ease;
}

#main {
  margin-left: calc(var(--sidebar-w) + 32px);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  position: relative;
  z-index: 1;
}

/* ── Sidebar Header ─────────────────────────────────────────── */
#sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
  position: relative;
}

#sidebar-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(150,100,255,0.3) 40%, rgba(80,200,255,0.3) 70%, transparent 100%);
  pointer-events: none;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.logo-tag {
  background: var(--yellow);
  color: var(--black);
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 13px;
  padding: 5px 9px;
  border: 2px solid var(--black);
  letter-spacing: 1px;
  transform: rotate(-3deg);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.logo-tag:hover { transform: rotate(0deg); }

#sidebar-header h1 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

/* ── Progress Bar ───────────────────────────────────────────── */
#progress-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #666;
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
#progress-count { color: var(--yellow); font-weight: bold; }

#progress-bar-track {
  height: 4px;
  background: var(--gray-mid);
  border-radius: 2px;
  overflow: hidden;
}

#progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow) 0%, var(--lime) 100%);
  width: 0%;
  transition: width 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 2px;
}

/* ── Sidebar Tabs — Dynamic Drum Selector ───────────────────── */
#sidebar-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--black-soft);
  flex-shrink: 0;
  padding: 6px 0 8px;
  border-bottom: var(--border);
  overflow: hidden;
}

.sidebar-tab {
  width: 100%;
  background: transparent;
  border: none;
  color: #555;
  font-family: var(--font-sans);
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: left;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  will-change: transform, opacity, filter;
  transform-origin: left center;
  /* base state — overridden by JS via --dist */
  font-size: calc(10px - var(--dist, 0) * 0.6px);
  opacity:   calc(1   - var(--dist, 0) * 0.2);
  filter:    blur(calc(var(--dist, 0) * 0.4px));
  height:    calc(30px - var(--dist, 0) * 3px);
  transition: font-size 0.28s cubic-bezier(.4,0,.2,1),
              opacity   0.28s cubic-bezier(.4,0,.2,1),
              filter    0.28s cubic-bezier(.4,0,.2,1),
              height    0.28s cubic-bezier(.4,0,.2,1),
              color     0.18s ease-out;
}

.sidebar-tab::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s, transform 0.2s;
}

.sidebar-tab:hover {
  color: var(--white-dim);
  opacity: calc(1 - var(--dist, 0) * 0.1) !important;
  filter: blur(0) !important;
}

.sidebar-tab.active {
  color: var(--yellow);
  font-size: 11px !important;
  opacity: 1 !important;
  filter: blur(0) !important;
  height: 30px !important;
}

.sidebar-tab.active::before {
  opacity: 1;
  transform: scale(1);
  background: var(--yellow);
}

.sidebar-tab-pip {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s, transform 0.2s;
}
.sidebar-tab.active .sidebar-tab-pip {
  opacity: 1;
  transform: scale(1);
}

/* ── Navigation ─────────────────────────────────────────────── */
#module-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-mid) transparent;
}

#module-nav::-webkit-scrollbar { width: 4px; }
#module-nav::-webkit-scrollbar-track { background: transparent; }
#module-nav::-webkit-scrollbar-thumb { background: var(--gray-mid); border-radius: 2px; }

.module-group-header {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  color: #444;
  letter-spacing: 2px;
  padding: 14px 16px 6px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 4px;
}

#module-list, #project-list, #language-list, #code-list { list-style: none; }

#module-list li,
#project-list li,
#language-list li,
#code-list li {
  cursor: pointer;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: background var(--transition-smooth),
              border-color var(--transition-smooth),
              color var(--transition-smooth);
  user-select: none;
  color: #888;
}

#module-list li:hover,
#project-list li:hover,
#language-list li:hover,
#code-list li:hover { background: rgba(255,255,255,0.04); color: var(--white); }

#language-list li.active {
  background: rgba(0,229,255,0.06);
  border-left-color: var(--cyan);
  color: var(--cyan);
}

#module-list li.active {
  background: rgba(230,255,0,0.06);
  border-left-color: var(--yellow);
  color: var(--yellow);
}

#project-list li.active {
  background: rgba(255,107,0,0.06);
  border-left-color: var(--orange);
  color: var(--orange);
}

#code-list li.active {
  background: rgba(0,229,255,0.06);
  border-left-color: var(--cyan);
  color: var(--cyan);
}

.status-dot {
  width: 8px; height: 8px;
  border: 1.5px solid #444;
  border-radius: 0;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
  transform: rotate(45deg);
}

#module-list  li.completed .status-dot { background: var(--green); border-color: var(--green); }
#project-list li.completed .status-dot { background: var(--green); border-color: var(--green); }

.module-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #444;
  min-width: 24px;
}
.capstone-nav-num { color: #ff6b00 !important; }
body.light-mode .capstone-nav-num { color: #c44000 !important; }

.lang-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
  color: inherit;
}
.lang-nav-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
  flex-shrink: 0;
}
#language-list li:hover .lang-nav-icon,
#language-list li.active .lang-nav-icon { opacity: 1; }

.module-name { flex: 1; line-height: 1.3; }

/* ── Sidebar Footer ─────────────────────────────────────────── */
#sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.015);
  flex-shrink: 0;
}

.nav-btn {
  flex: 1;
  padding: 9px 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: transparent;
  border: var(--border-strong);
  color: var(--white-dim);
  cursor: pointer;
  text-transform: uppercase;
  transition: color var(--transition-smooth),
              border-color var(--transition-smooth),
              background var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

.nav-btn:hover { border-color: var(--yellow); color: var(--yellow); background: rgba(230,255,0,0.06); }

.focus-btn { width: auto; padding: 8px 14px; }
.focus-btn svg { width: 14px; height: 14px; }
body.focus-mode .focus-btn { color: var(--yellow); border-color: var(--yellow); background: rgba(230,255,0,0.08); }

/* ── Topbar ─────────────────────────────────────────────────── */
/* (topbar liquid glass styles are in the Dock section below) */

#breadcrumb {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #555;
}

#breadcrumb span.bc-current { color: var(--white); }

#topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.complete-btn {
  padding: 8px 20px;
  background: transparent;
  color: var(--white-dim);
  border: var(--border-strong);
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-transform: uppercase;
}

.complete-btn:hover { border-color: var(--yellow); color: var(--yellow); background: rgba(230,255,0,0.06); }
.complete-btn.done { background: var(--green); color: var(--black); border-color: var(--green); }
.complete-btn.done:hover { background: var(--lime); border-color: var(--lime); }

.hidden { display: none !important; }

/* ── Content Area ───────────────────────────────────────────── */
#content-area {
  flex: 1;
  overflow-y: auto;
  background: transparent;
  transition: opacity 0.18s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
  padding-bottom: calc(var(--dock-h) + 20px);
  position: relative;
  z-index: 1;
}

#content-area::-webkit-scrollbar       { width: 6px; }
#content-area::-webkit-scrollbar-track { background: transparent; }
#content-area::-webkit-scrollbar-thumb { background: var(--gray-mid); border-radius: 3px; }

/* ── Welcome Hero ────────────────────────────────────────────── */
#welcome-screen {
  min-height: 100%;
  padding-bottom: 32px;
}

#welcome-hero {
  padding: 0 48px 0;
  background: rgba(255,255,255,0.02);
  -webkit-
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}

#welcome-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(150,100,255,0.35) 20%,
    rgba(80,200,255,0.40) 50%,
    rgba(255,100,200,0.30) 80%,
    transparent 100%
  );
  pointer-events: none;
}

#greeting-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 0 0;
  gap: 24px;
}

#greeting-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#greeting-time {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--yellow);
}

#greeting-stats {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #444;
  letter-spacing: 0.5px;
}

/* Progress Ring */
#progress-ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

#progress-ring {
  width: 72px;
  height: 72px;
}

.ring-bg {
  fill: none;
  stroke: var(--gray-mid);
  stroke-width: 7;
}

.ring-fill {
  fill: none;
  stroke: var(--yellow);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#ring-pct {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

#ring-sub {
  font-family: var(--font-mono);
  font-size: 8px;
  color: #555;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Welcome Headline */
#hero-body {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

#welcome-headline {
  flex: 1;
  min-width: 0;
  padding: 28px 0 32px;
}

#hero-streak-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 28px 0 24px;
  gap: 10px;
  align-items: flex-start;
}

@media (max-width: 960px) {
  #hero-body { flex-direction: column; gap: 0; }
  #hero-streak-wrap { flex: none; width: 100%; padding-top: 0; }
}

.welcome-tag {
  display: inline-block;
  background: transparent;
  color: var(--yellow);
  border: 1px solid rgba(230,255,0,0.3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 4px 12px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

#welcome-title {
  font-family: var(--font-sans);
  font-size: 44px;
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 14px;
  color: var(--white);
}

#welcome-sub {
  font-size: 14px;
  color: #555;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

/* ── Welcome Tabs ────────────────────────────────────────────── */
#welcome-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 48px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.018);
  -webkit-
  position: sticky;
  top: 0;
  z-index: 10;
}

.welcome-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #444;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 14px 20px 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition-smooth), border-color var(--transition-smooth);
  margin-bottom: -2px;
}

.welcome-tab:hover { color: var(--white-dim); }

.welcome-tab.active {
  color: var(--white);
  border-bottom-color: var(--yellow);
}

.wtab-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--yellow);
  background: rgba(230,255,0,0.08);
  padding: 2px 6px;
  border-radius: 2px;
}

/* ── Welcome Panels ─────────────────────────────────────────── */
.welcome-panel {
  padding: 32px 48px;
}

/* ── Welcome Module Grid ─────────────────────────────────────── */
.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.welcome-module-card {
  border: 1px solid rgba(255,255,255,0.08);
  padding: 16px 18px 20px;
  cursor: pointer;
  /* Glass card */
  background: rgba(255,255,255,0.03);
  -webkit-
  transition: border-color var(--transition-smooth),
              transform var(--transition),
              background var(--transition-smooth),
              box-shadow var(--transition-smooth);
  position: relative;
  opacity: 0;
  animation: wmc-enter 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.09),
    0 4px 20px rgba(0,0,0,0.3);
}

@keyframes wmc-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-module-card:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.055);
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 8px 32px rgba(0,0,0,0.4);
}

.wmc-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.wmc-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: none;
}
.welcome-module-card:hover .wmc-icon { opacity: 1; }

.wmc-lang-desc {
  font-size: 10px;
  color: #666;
  margin-top: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
}

.wmc-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #444;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
  display: block;
}

.wmc-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.35;
  color: var(--white);
}

.wmc-status {
  position: absolute;
  top: 10px; right: 10px;
  width: 8px; height: 8px;
  border: 1.5px solid #333;
  background: transparent;
  transform: rotate(45deg);
  transition: background 0.2s, border-color 0.2s;
}

.wmc-status.done { background: var(--green); border-color: var(--green); }
.wmc-status.wip  { background: var(--yellow); border-color: var(--yellow); }

/* Color accent stripes per module */
.wmc-0  { border-top: 2px solid var(--blue);    }
.wmc-1  { border-top: 2px solid var(--orange);  }
.wmc-2  { border-top: 2px solid var(--purple);  }
.wmc-3  { border-top: 2px solid var(--green);   }
.wmc-4  { border-top: 2px solid var(--red);     }
.wmc-5  { border-top: 2px solid var(--yellow);  }
.wmc-6  { border-top: 2px solid var(--cyan);    }
.wmc-7  { border-top: 2px solid var(--orange);  }
.wmc-8  { border-top: 2px solid var(--purple);  }
.wmc-9  { border-top: 2px solid var(--cyan);    }
.wmc-10 { border-top: 2px solid var(--pink);    }
.wmc-11 { border-top: 2px solid var(--teal);    }
.wmc-12 { border-top: 2px solid var(--indigo);  }
.wmc-13 { border-top: 2px solid var(--lime);    }

.wpc-0  { border-top: 2px solid var(--blue);    }
.wpc-1  { border-top: 2px solid var(--orange);  }
.wpc-2  { border-top: 2px solid var(--purple);  }
.wpc-3  { border-top: 2px solid var(--green);   }
.wpc-4  { border-top: 2px solid var(--red);     }
.wpc-5  { border-top: 2px solid var(--yellow);  }
.wpc-6  { border-top: 2px solid var(--cyan);    }
.wpc-7  { border-top: 2px solid var(--orange);  }
.wpc-8  { border-top: 2px solid var(--purple);  }
.wpc-9  { border-top: 2px solid var(--cyan);    }
.wpc-10 { border-top: 2px solid var(--pink);    }
.wpc-11 { border-top: 2px solid var(--teal);    }
.wpc-12 { border-top: 2px solid var(--indigo);  }
.wpc-13 { border-top: 2px solid var(--lime);    }
.wpc-14 { border-top: 2px solid var(--blue);    }
.wpc-15 { border-top: 2px solid var(--orange);  }
.wpc-16 { border-top: 2px solid var(--purple);  }
.wpc-17 { border-top: 2px solid var(--green);   }
.wpc-18 { border-top: 2px solid var(--red);     }
.wpc-19 { border-top: 2px solid var(--yellow);  }
.wpc-20 { border-top: 2px solid var(--cyan);    }
.wpc-21 { border-top: 2px solid var(--pink);    }
.wpc-22 { border-top: 2px solid var(--teal);    }
.wpc-23 { border-top: 2px solid var(--indigo);  }
.wpc-24 { border-top: 2px solid var(--lime);    }
.wpc-25 { border-top: 2px solid var(--blue);    }
.wpc-26 { border-top: 2px solid var(--orange);  }
.wpc-27 { border-top: 2px solid var(--purple);  }
.wpc-28 { border-top: 2px solid var(--green);   }
.wpc-29 { border-top: 2px solid var(--red);     }
.wpc-30 { border-top: 2px solid var(--yellow);  }
.wpc-31 { border-top: 2px solid var(--cyan);    }
.wpc-32 { border-top: 2px solid var(--pink);    }
.wpc-33 { border-top: 2px solid var(--teal);    }
.wpc-34 { border-top: 2px solid var(--indigo);  }
.wpc-35 { border-top: 2px solid var(--lime);    }
.wpc-36 { border-top: 2px solid var(--blue);    }
.wpc-37 { border-top: 2px solid var(--orange);  }
.wpc-38 { border-top: 2px solid var(--purple);  }
.wpc-39 { border-top: 2px solid var(--green);   }
.wpc-40 { border-top: 2px solid var(--red);     }
.wpc-41 { border-top: 2px solid var(--yellow);  }

/* ── Capstone Projects ──────────────────────────────────────────── */
.capstone-banner {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #ff6b00;
  padding: 18px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.capstone-sub {
  display: block;
  width: 100%;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 4px;
}
.capstone-fire {
  font-size: 18px;
  animation: fireFlicker 1.4s ease-in-out infinite alternate;
}
@keyframes fireFlicker {
  0%   { transform: scale(1)    rotate(-3deg); filter: brightness(1); }
  50%  { transform: scale(1.15) rotate(2deg);  filter: brightness(1.3); }
  100% { transform: scale(1.05) rotate(-1deg); filter: brightness(1.1); }
}
.capstone-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 8px;
}
.capstone-card {
  position: relative;
  background: linear-gradient(135deg, #1a0a00 0%, #0d0600 60%, #150800 100%);
  border: 2px solid #ff6b00;
  border-radius: 4px;
  padding: 28px 24px 24px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,107,0,0.15), 0 0 32px rgba(255,107,0,0.18), inset 0 1px 0 rgba(255,140,0,0.12);
  animation: capstonePulse 3s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.capstone-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 0 0 1px rgba(255,107,0,0.4), 0 0 60px rgba(255,107,0,0.35), 0 16px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,140,0,0.2);
}
@keyframes capstonePulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,107,0,0.15), 0 0 32px rgba(255,107,0,0.18), inset 0 1px 0 rgba(255,140,0,0.12); }
  50%       { box-shadow: 0 0 0 1px rgba(255,107,0,0.3),  0 0 48px rgba(255,107,0,0.28), inset 0 1px 0 rgba(255,140,0,0.18); }
}
.capstone-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,107,0,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.capstone-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ff6b00;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.capstone-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.capstone-desc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
  margin-bottom: 16px;
}
.capstone-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.capstone-divider::before,
.capstone-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* Light mode capstone overrides */
body.light-mode .capstone-card {
  background: linear-gradient(135deg, #fff4ee 0%, #fff0e8 60%, #fff4ee 100%);
  border-color: #d44a00;
  box-shadow: 4px 4px 0px #d44a00, 0 0 24px rgba(212,74,0,0.12);
  animation: none;
}
body.light-mode .capstone-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0px #d44a00, 0 0 40px rgba(212,74,0,0.2);
}
body.light-mode .capstone-tag  { color: #d44a00; }
body.light-mode .capstone-title { color: #111; }
body.light-mode .capstone-desc  { color: rgba(0,0,0,0.5); }
body.light-mode .capstone-banner { color: #c44000; }
body.light-mode .capstone-divider::before,
body.light-mode .capstone-divider::after { background: rgba(0,0,0,0.1); }

/* Difficulty badge */
.project-card { padding-bottom: 44px; }

.difficulty-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  position: absolute;
  bottom: 12px;
  left: 18px;
  border-radius: 2px;
}

.diff-beginner    { background: rgba(0,230,118,0.15);  color: var(--green);  border: 1px solid rgba(0,230,118,0.3);  }
.diff-starter     { background: rgba(0,230,118,0.15);  color: var(--green);  border: 1px solid rgba(0,230,118,0.3);  }
.diff-intermediate{ background: rgba(230,255,0,0.12);  color: var(--yellow); border: 1px solid rgba(230,255,0,0.3);  }
.diff-advanced    { background: rgba(255,107,0,0.12);  color: var(--orange); border: 1px solid rgba(255,107,0,0.3);  }
.diff-expert      { background: rgba(255,0,127,0.12);  color: var(--pink);   border: 1px solid rgba(255,0,127,0.3);  }

/* Sidebar difficulty dot (project list) */
.proj-diff-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 2px;
}
.proj-diff-dot.diff-beginner     { background: var(--green); }
.proj-diff-dot.diff-intermediate { background: var(--yellow); }
.proj-diff-dot.diff-advanced     { background: var(--orange); }
.proj-diff-dot.diff-expert       { background: var(--pink); }

/* Project type tag (GUIDED / THINKING) */
.proj-type-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 1px 5px;
  border-radius: 2px;
  vertical-align: middle;
}
.type-guided   { background: rgba(0,229,255,0.15); color: var(--cyan);   border: 1px solid rgba(0,229,255,0.3); }
.type-thinking { background: rgba(230,255,0,0.12); color: var(--yellow); border: 1px solid rgba(230,255,0,0.3); }

/* ── Language Cards ─────────────────────────────────────────── */
.language-card { padding-bottom: 44px; position: relative; }

.lang-badge {
  position: absolute;
  bottom: 14px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
}

.lang-c       { background: rgba(0,229,255,0.12);   color: var(--cyan);   border: 1px solid rgba(0,229,255,0.25); }
.lang-cpp     { background: rgba(101,31,255,0.12);  color: var(--indigo); border: 1px solid rgba(101,31,255,0.25); }
.lang-py      { background: rgba(230,255,0,0.12);   color: var(--yellow); border: 1px solid rgba(230,255,0,0.25); }
.lang-js      { background: rgba(255,107,0,0.12);   color: var(--orange); border: 1px solid rgba(255,107,0,0.25); }
.lang-webdev  { background: rgba(97,218,251,0.12);  color: #61DAFB;       border: 1px solid rgba(97,218,251,0.25); }
.lang-git     { background: rgba(240,80,50,0.12);   color: #F05032;       border: 1px solid rgba(240,80,50,0.25); }

body.light-mode .lang-c      { background: rgba(0,149,255,0.10); }
body.light-mode .lang-cpp    { background: rgba(101,31,255,0.08); }
body.light-mode .lang-py     { background: rgba(180,140,0,0.10); color: #8a7000; border-color: rgba(180,140,0,0.3); }
body.light-mode .lang-js     { background: rgba(200,80,0,0.08); }
body.light-mode .lang-webdev { background: rgba(0,140,170,0.10); color: #006880; border-color: rgba(0,140,170,0.3); }
body.light-mode .lang-git    { background: rgba(180,50,30,0.10); color: #b03010; border-color: rgba(180,50,30,0.3); }
body.light-mode .type-guided   { background: rgba(0,100,180,0.10); color: #006aad; border-color: rgba(0,100,180,0.25); }
body.light-mode .type-thinking { background: rgba(160,130,0,0.10); color: #8a7000; border-color: rgba(160,130,0,0.25); }

/* ── Code Panel — module-grouped ────────────────────────────── */
#code-by-module {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.code-module-section { }

.code-module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: var(--border);
}

.code-mod-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--black);
  background: var(--yellow);
  padding: 3px 8px;
  border-radius: 2px;
}

.code-mod-name {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.code-file-card {
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
  cursor: pointer;
  background: rgba(255,255,255,0.025);
  -webkit-
  transition: border-color var(--transition-smooth),
              background var(--transition-smooth),
              transform var(--transition),
              box-shadow var(--transition-smooth);
  opacity: 0;
  animation: wmc-enter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 2px 12px rgba(0,0,0,0.25);
}

.code-file-card:hover {
  border-color: rgba(0,229,255,0.4);
  background: rgba(0,229,255,0.04);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 6px 24px rgba(0,0,0,0.35);
}

.code-file-ext {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.code-file-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--white);
  word-break: break-all;
  line-height: 1.3;
}

/* ── Doc View ───────────────────────────────────────────────── */
#doc-view {
  padding: 40px 48px;
  display: flex;
  justify-content: center;
  min-height: 100%;
}

#doc-rendered {
  width: 100%;
  max-width: 860px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  color: #E8E8E8;

  /* Glass reading panel */
  background: rgba(255,255,255,0.025);
  -webkit-
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 48px 56px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 20px 60px rgba(0,0,0,0.4);
}

/* Prismatic top edge on the reading panel */
#doc-rendered::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(120,80,255,0.5) 20%,
    rgba(80,200,255,0.6) 40%,
    rgba(255,255,180,0.4) 60%,
    rgba(255,80,160,0.5) 80%,
    transparent 100%
  );
  border-radius: 4px 4px 0 0;
  pointer-events: none;
}

/* Focus mode — cleaner doc view */
body.focus-mode #doc-view {
  background: var(--black);
  padding: 48px;
}

body.focus-mode #doc-rendered {
  max-width: 1200px;
}

#doc-rendered h1 {
  font-family: var(--font-sans);
  font-size: 40px;
  font-weight: 900;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 20px;
  margin: 0 0 36px;
}

#doc-rendered h2 {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 900;
  color: var(--yellow);
  margin: 56px 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(230,255,0,0.15);
}

#doc-rendered h3 {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  border-left: 3px solid var(--cyan);
  padding-left: 14px;
  margin: 36px 0 14px;
}

#doc-rendered h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--lime);
  margin: 28px 0 10px;
}

#doc-rendered p { margin: 0 0 18px; }

#doc-rendered a {
  color: var(--yellow);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(230,255,0,0.3);
  transition: border-color var(--transition-smooth), color var(--transition-smooth);
}

#doc-rendered a:hover {
  color: var(--white);
  border-bottom-color: var(--white);
}

/* Code blocks */
#doc-rendered pre {
  background: #080808;
  border: var(--border);
  border-left: 3px solid var(--purple);
  padding: 0;
  margin: 24px 0;
  overflow-x: auto;
  border-radius: 2px;
  position: relative;
}

/* ── Copy code button ──────────────────────────────────────────────── */
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 10px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 2;
  line-height: 1.6;
}
.copy-btn:hover { background: rgba(255,255,255,0.15); color: #ccc; }
.copy-btn.copied { background: rgba(230,255,0,0.1); color: #E6FF00; border-color: rgba(230,255,0,0.3); }
body.light-mode .copy-btn { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.12); color: #999; }
body.light-mode .copy-btn:hover { background: rgba(0,0,0,0.1); color: #444; }
body.light-mode .copy-btn.copied { background: rgba(0,120,0,0.08); color: #006600; border-color: rgba(0,120,0,0.3); }

#doc-rendered pre code {
  display: block;
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  background: transparent;
  color: #E2E8F0;
}

#doc-rendered code:not(pre code) {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 2px;
}

/* Tables */
#doc-rendered table {
  border-collapse: collapse;
  width: 100%;
  margin: 28px 0;
  border: var(--border-strong);
  background: var(--black-card);
  border-radius: 2px;
  overflow: hidden;
}

#doc-rendered th {
  background: var(--black-mid);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

#doc-rendered td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-family: var(--font-body);
  font-size: 14px;
  color: #CCC;
}

#doc-rendered tr:last-child td { border-bottom: none; }
#doc-rendered tr:hover td { background: rgba(255,255,255,0.03); color: var(--white); }

/* Blockquotes */
#doc-rendered blockquote {
  border-left: 3px solid var(--yellow);
  padding: 16px 20px;
  margin: 24px 0;
  background: rgba(230,255,0,0.03);
  font-style: italic;
  font-size: 15px;
  color: #AAA;
}

/* Lists */
#doc-rendered ul, #doc-rendered ol {
  padding-left: 24px;
  margin: 0 0 18px;
}

#doc-rendered li { margin-bottom: 6px; }
#doc-rendered li::marker { font-weight: 700; color: var(--yellow); }

/* HR */
#doc-rendered hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 44px 0;
}

/* Strong / em */
#doc-rendered strong { font-weight: 800; color: var(--white); }
#doc-rendered em { font-style: italic; color: #CCC; }

/* MathJax */
#doc-rendered .MathJax_Display,
#doc-rendered mjx-container[display="true"] {
  overflow-x: auto;
  padding: 12px 0;
}

/* Error box */
.error-box {
  border: 1px solid var(--red);
  padding: 24px;
  font-family: var(--font-sans);
  font-size: 15px;
  background: rgba(255,23,68,0.05);
  max-width: 600px;
  color: #EEE;
}

/* ── Topbar — liquid glass ───────────────────────────────────── */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--topbar-h);
  flex-shrink: 0;
  position: relative;
  z-index: 20;

  /* Glass transparency */
  background: rgba(12, 12, 12, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-border);
}



/* ── Prismatic border shimmer animation ──────────────────────── */
@keyframes glass-prism {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── macOS Liquid Glass Dock ─────────────────────────────────── */
#dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 26px;
  z-index: 500;
  white-space: nowrap;

  background: rgba(20, 20, 20, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--border);
  box-shadow: var(--shadow-lg);
}



.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  border-radius: 10px;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 1;
}

.dock-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-5px) scale(1.1);
}

.dock-item:active { transform: translateY(-2px) scale(1.04); }

.dock-item.active-dock {
  color: var(--yellow);
  background: rgba(230,255,0,0.10);
}

.dock-item.dock-danger { color: rgba(255,23,68,0.55); }
.dock-item.dock-danger:hover { color: var(--red); background: rgba(255,23,68,0.09); }

.dock-icon-wrap svg {
  width: 18px;
  height: 18px;
  display: block;
}

.dock-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(5,5,5,0.92);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.dock-item:hover .dock-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dock-sep {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.09);
  margin: 0 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.dock-made-with {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.5px;
  text-transform: lowercase;
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.18s ease, background 0.18s ease;
  position: relative;
  z-index: 1;
}

.dock-made-with:hover {
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.05);
}

.dock-byline {
  color: rgba(255,255,255,0.4);
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: color 0.18s ease;
}

.dock-made-with:hover .dock-byline { color: var(--yellow); }

.dock-heart {
  width: 10px;
  height: 10px;
  color: #FF3060;
  flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(255,48,96,0.5));
}

/* Focus mode — dock minimal */
body.focus-mode #dock {
  background: rgba(10, 10, 10, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ── Light Mode ─────────────────────────────────────────────── */
body.light-mode {
  --black:        #FFF5E1; /* Neobrutalist Cream */
  --black-soft:   #FFFFFF;
  --black-card:   #FFFFFF;
  --black-mid:    #FFE8F4;
  --white:        #000000;
  --white-dim:    #222222;
  --gray-light:   #E0E0DE;
  --gray-mid:     #CCCCCC;
  --gray-border:  #000000;
  --shadow:       4px 4px 0px #000000;
  --shadow-lg:    6px 6px 0px #000000;
  --shadow-hover: 4px 4px 0px #000000;
  --border:       3px solid #000000;
  --border-strong:3px solid #000000;
  background: #FFF5E1;
  color: #000000;
}



/* Topbar neobrutalism in light mode */
body.light-mode #topbar {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 3px solid #000;
  box-shadow: none;
}

/* Sidebar in light mode */
body.light-mode #sidebar {
  border: 3px solid #000000;
  box-shadow: 6px 6px 0px #000000;
  border-radius: 16px;
  background: #FFF5E1;
}

body.light-mode #sidebar-header { background: transparent; }
body.light-mode #sidebar-footer { background: transparent; border-top-color: rgba(0,0,0,0.08); }
body.light-mode #sidebar-tabs   { background: transparent; border-bottom-color: rgba(0,0,0,0.08); }
body.light-mode .sidebar-tab    { color: #aaa; }
body.light-mode .sidebar-tab:hover { color: #333; }
body.light-mode .sidebar-tab.active { color: #111; }
body.light-mode .sidebar-tab.active::before { background: #111; }

body.light-mode #module-list li,
body.light-mode #project-list li,
body.light-mode #language-list li,
body.light-mode #code-list li { color: #666; background: #EBEBEA; }
body.light-mode #module-list li:hover,
body.light-mode #project-list li:hover,
body.light-mode #language-list li:hover,
body.light-mode #code-list li:hover { background: rgba(0,0,0,0.05); color: #111; }

body.light-mode #module-list li.active   { background: rgba(0,0,0,0.06); color: #111; border-left-color: #111; }
body.light-mode .module-group-header     { color: #999; border-bottom-color: rgba(0,0,0,0.06); }

/* Content area */
body.light-mode #content-area   { background: #F5F5F3; }
body.light-mode #welcome-hero   { background: #F5F5F3; border-bottom-color: rgba(0,0,0,0.08); }
body.light-mode #welcome-tabs   { background: #F5F5F3; border-bottom-color: rgba(0,0,0,0.08); }
body.light-mode .welcome-tab    { color: #999; }
body.light-mode .welcome-tab.active { color: #111; border-bottom-color: #111; }
body.light-mode .wtab-num       { color: #333; background: rgba(0,0,0,0.06); }

body.light-mode .welcome-module-card { background: #EEEEED; border-color: rgba(0,0,0,0.10); }
body.light-mode .welcome-module-card:hover { background: #E4E4E2; border-color: rgba(0,0,0,0.20); }
body.light-mode .wmc-title       { color: #111; }
body.light-mode .wmc-num         { color: #888; }
body.light-mode .wmc-lang-desc   { color: #999; }
body.light-mode .wmc-icon        { opacity: 0.5; }
body.light-mode .welcome-module-card:hover .wmc-icon { opacity: 0.8; }

body.light-mode .code-module-header { border-bottom-color: rgba(0,0,0,0.08); }
body.light-mode .code-mod-name      { color: #888; }
body.light-mode .code-file-card     { background: #EEEEED; border-color: rgba(0,0,0,0.10); }
body.light-mode .code-file-card:hover { background: #E4E4E2; }
body.light-mode .code-file-name     { color: #222; }

/* Doc view in light mode */
body.light-mode #doc-view        { background: #F5F5F3; }
body.light-mode #doc-rendered    { color: #222; }
body.light-mode #doc-rendered h1 { color: #111; border-bottom-color: rgba(0,0,0,0.1); }
body.light-mode #doc-rendered h2 { color: #111; background: none; border-bottom-color: rgba(0,0,0,0.12); }
body.light-mode #doc-rendered h3 { color: #111; }
body.light-mode #doc-rendered h4 { color: #444; }
body.light-mode #doc-rendered p  { color: #333; }
body.light-mode #doc-rendered a  { color: #0066CC; border-bottom-color: rgba(0,102,204,0.3); }
body.light-mode #doc-rendered a:hover { color: #004499; }
body.light-mode #doc-rendered strong { color: #111; }
body.light-mode #doc-rendered em     { color: #444; }
body.light-mode #doc-rendered blockquote { background: rgba(0,0,0,0.03); border-left-color: #888; color: #555; }
body.light-mode #doc-rendered hr     { border-top-color: rgba(0,0,0,0.1); }
body.light-mode #doc-rendered li::marker { color: #333; }

/* Code blocks stay dark even in light mode — better readability */
body.light-mode #doc-rendered pre {
  background: #1a1b26;
  border-color: rgba(0,0,0,0.15);
}
body.light-mode #doc-rendered pre code { color: #E2E8F0; }
body.light-mode #doc-rendered code:not(pre code) {
  background: rgba(0,0,0,0.07);
  border-color: rgba(0,0,0,0.12);
  color: #0055AA;
}

/* Tables in light mode */
body.light-mode #doc-rendered table { background: #EEEEED; border-color: rgba(0,0,0,0.12); }
body.light-mode #doc-rendered th    { background: #D8D8D6; color: #111; border-bottom-color: rgba(0,0,0,0.15); }
body.light-mode #doc-rendered td    { color: #333; border-bottom-color: rgba(0,0,0,0.06); }
body.light-mode #doc-rendered tr:hover td { background: rgba(0,0,0,0.03); color: #111; }

/* ── Capstone interactive callout boxes ──────────────────────────────────── */
#doc-rendered .callout {
  border-left: 3px solid;
  padding: 11px 15px;
  margin: 18px 0;
  border-radius: 0 7px 7px 0;
  font-size: 0.93em;
  line-height: 1.65;
}
#doc-rendered .callout b:first-child {
  display: block;
  margin-bottom: 5px;
  font-size: 0.78em;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.85;
}
#doc-rendered .callout p { margin: 4px 0; color: inherit; }
#doc-rendered .callout code:not(pre code) { font-size: 0.88em; }
#doc-rendered .callout-info  { border-color: var(--yellow); background: rgba(230,255,0,0.05); color: #d4e06a; }
#doc-rendered .callout-tip   { border-color: #00e5ff;       background: rgba(0,229,255,0.05); color: #7de8f5; }
#doc-rendered .callout-warn  { border-color: #ffaa00;       background: rgba(255,170,0,0.05); color: #e0b860; }
#doc-rendered .callout-step  { border-color: #a855f7;       background: rgba(168,85,247,0.06); color: #c084fc; }

/* ── Collapsible <details> sections ──────────────────────────────────────── */
#doc-rendered details {
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
}
#doc-rendered details summary {
  padding: 10px 16px;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92em;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
}
#doc-rendered details summary::-webkit-details-marker { display: none; }
#doc-rendered details summary::before {
  content: '▶';
  font-size: 0.7em;
  color: var(--yellow);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
#doc-rendered details[open] summary::before { transform: rotate(90deg); }
#doc-rendered details[open] { padding-bottom: 8px; }
#doc-rendered details > *:not(summary) { margin-left: 12px; margin-right: 12px; }
#doc-rendered details > pre { margin: 8px 12px; }

/* Light mode callout + details overrides */
body.light-mode #doc-rendered .callout-info  { background: rgba(140,120,0,0.07); color: #4a3d00; border-color: #a08000; }
body.light-mode #doc-rendered .callout-tip   { background: rgba(0,150,180,0.07); color: #00526a; border-color: #0090b0; }
body.light-mode #doc-rendered .callout-warn  { background: rgba(200,100,0,0.08); color: #6a3000; border-color: #c06000; }
body.light-mode #doc-rendered .callout-step  { background: rgba(100,40,160,0.07); color: #4a1880; border-color: #7030c0; }
body.light-mode #doc-rendered details { border-color: rgba(0,0,0,0.15); }
body.light-mode #doc-rendered details summary { background: rgba(0,0,0,0.03); color: #111; }

/* Dock neobrutalism in light mode */
body.light-mode #dock {
  background: rgba(244, 244, 240, 0.65);
  border: 3px solid #000;
  box-shadow: 6px 6px 0px #000;
  border-radius: 20px;
}

body.light-mode .dock-item         { color: rgba(0,0,0,0.45); }
body.light-mode .dock-item:hover   { color: rgba(0,0,0,0.85); background: rgba(0,0,0,0.05); }
body.light-mode .dock-item.dock-danger { color: rgba(220,30,30,0.5); }
body.light-mode .dock-item.dock-danger:hover { color: #CC2222; background: rgba(220,30,30,0.06); }
body.light-mode .dock-sep          { background: rgba(0,0,0,0.10); }
body.light-mode .dock-made-with    { color: rgba(0,0,0,0.3); }
body.light-mode .dock-made-with:hover { color: rgba(0,0,0,0.6); background: rgba(0,0,0,0.04); }
body.light-mode .dock-byline       { color: rgba(0,0,0,0.45); }
body.light-mode .dock-made-with:hover .dock-byline { color: #111; }
body.light-mode .dock-label {
  background: rgba(240,240,240,0.96);
  color: #111;
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Greeting bar in light mode */
body.light-mode #greeting-time  { color: #111; }
body.light-mode #greeting-stats { color: #888; }
body.light-mode #ring-pct       { color: #111; }
body.light-mode .ring-bg        { stroke: #DDD; }
body.light-mode .ring-fill      { stroke: #333; }

/* Loading screen already dark — leave it */
/* Search modal */
body.light-mode .search-container { background: #EEEEED; border-color: rgba(0,0,0,0.15); }
body.light-mode #search-input { background: #F5F5F3; color: #111; border-color: rgba(0,0,0,0.15); }
body.light-mode #search-input:focus { border-color: #111; }
body.light-mode #search-results li { color: #555; border-bottom-color: rgba(0,0,0,0.06); }
body.light-mode #search-results li:hover, body.light-mode #search-results li.selected { background: rgba(0,0,0,0.05); color: #111; }
body.light-mode .sr-type { color: #444; background: rgba(0,0,0,0.07); }

/* Notes panel */
body.light-mode #notes-panel      { background: #EEEEED; border-left-color: rgba(0,0,0,0.12); }
body.light-mode .notes-header     { background: #E4E4E2; border-bottom-color: rgba(0,0,0,0.08); }
body.light-mode .notes-header h3  { color: #333; }
body.light-mode #close-notes      { color: #888; }
body.light-mode #close-notes:hover{ color: #111; }
body.light-mode #notes-content    { background: #F5F5F3; color: #222; }

/* Nav buttons */
body.light-mode .nav-btn         { color: #666; border-color: rgba(0,0,0,0.18); }
body.light-mode .nav-btn:hover   { color: #111; border-color: #111; background: rgba(0,0,0,0.04); }
body.light-mode .complete-btn    { color: #555; border-color: rgba(0,0,0,0.18); }
body.light-mode .complete-btn:hover { color: #111; border-color: #111; background: rgba(0,0,0,0.04); }
body.light-mode #breadcrumb      { color: #888; }

/* Welcome tag */
body.light-mode .welcome-tag { color: #444; border-color: rgba(0,0,0,0.2); }
body.light-mode #welcome-title { color: #111; }
body.light-mode #welcome-sub   { color: #888; }

/* Sidebar overlay in light mode */
body.light-mode #sidebar-overlay { background: rgba(200,200,200,0.5); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }

  #sidebar {
    width: 280px;
    transform: translateX(-284px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
  }

  #sidebar.mobile-open { transform: translateX(0); }

  #sidebar-overlay { display: block; }
  #sidebar-toggle  { display: flex; }
  #main            { margin-left: 0; }

  .welcome-grid { grid-template-columns: repeat(2, 1fr); }

  #welcome-hero { padding: 0 24px; }
  .welcome-panel { padding: 24px; }
  #welcome-tabs { padding: 0 24px; }

  #welcome-title { font-size: 30px; }

  #doc-view { padding: 24px 20px; }
  #doc-rendered h1 { font-size: 28px; }
  #doc-rendered h2 { font-size: 18px; }

  #topbar { padding: 0 16px; }
  #topbar-actions { gap: 8px; }
  .focus-btn span:last-child { display: none; }
}

@media (max-width: 540px) {
  .welcome-grid { grid-template-columns: 1fr; }
  #welcome-title { font-size: 26px; }
  #dock { bottom: 8px; padding: 6px 8px; }
  .dock-item { padding: 6px 8px; }
}

/* ── Search & Notes ─────────────────────────────────────────── */
#search-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
}

#search-modal.hidden { display: none; }

.search-container {
  width: 90%;
  max-width: 580px;
  background: #0d0d0d;
  border: var(--border-strong);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

#search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--font-mono);
  background: var(--black);
  color: var(--white);
  border: var(--border);
  outline: none;
  border-radius: 4px;
}

#search-input:focus { border-color: var(--yellow); }

#search-results {
  list-style: none;
  margin-top: 8px;
  max-height: 50vh;
  overflow-y: auto;
}

#search-results li {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #AAA;
  border-radius: 4px;
  transition: background var(--transition-smooth), color var(--transition-smooth);
}

#search-results li:hover,
#search-results li.selected {
  background: rgba(255,255,255,0.06);
  color: var(--white);
}

.sr-type {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--yellow);
  background: rgba(230,255,0,0.08);
  padding: 2px 6px;
  border-radius: 2px;
}

/* Notes Panel */
#notes-panel {
  position: fixed;
  right: 0; top: 0;
  width: 340px;
  height: 100vh;
  background: #090909;
  border-left: var(--border-strong);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(100%);
}

#notes-panel:not(.hidden) { transform: translateX(0); }

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: var(--border);
  background: var(--black);
}

.notes-header h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--yellow);
}

#close-notes {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.15s;
}

#close-notes:hover { color: var(--white); }

#notes-content {
  flex: 1;
  background: var(--black);
  color: #DDD;
  padding: 20px;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  resize: none;
  line-height: 1.7;
}

/* --- Strict Light Mode Neobrutalism Overrides --- */
body.light-mode .welcome-module-card,
body.light-mode .code-file-card {
  background: #ffffff;
  border: 3px solid #000000;
  box-shadow: 4px 4px 0px #000000;
  border-radius: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
body.light-mode .code-file-ext { color: #005F7A; }
body.light-mode .code-file-name { color: #111111; }

body.light-mode .welcome-module-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0px #000000;
  background: #FF90E8;
}

body.light-mode .code-file-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0px #000000;
  background: #90FFF0;
}

body.light-mode #sidebar {
  border: 3px solid #000000;
  box-shadow: 6px 6px 0px #000000;
  border-radius: 16px;
  background: #E0E7FF;
}

body.light-mode .nav-btn,
body.light-mode .complete-btn,
body.light-mode .focus-btn {
  border: 3px solid #000000;
  box-shadow: 4px 4px 0px #000000;
  border-radius: 12px;
  background: #ffffff;
  color: #000000;
  font-weight: bold;
}
body.light-mode .nav-btn:hover,
body.light-mode .complete-btn:hover,
body.light-mode .focus-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #000000;
  background: #E6FF00;
}

body.light-mode #dock {
  border-radius: 20px;
  border: 3px solid #000000;
  box-shadow: 6px 6px 0px #000000;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.light-mode .dock-item.active-dock {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.85);
  border: 2px solid rgba(0,0,0,0.18);
  border-radius: 10px;
}

body.light-mode .dock-item:hover {
  background: rgba(0,0,0,0.07);
  color: rgba(0,0,0,0.85);
  border: 2px solid transparent;
}


@keyframes macDockJump {
  0% { transform: translateY(0); }
  25% { transform: translateY(-25px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}

.dock-item.dock-jump {
  animation: macDockJump 1s cubic-bezier(0.28, 0.84, 0.42, 1) 1s;
  animation-fill-mode: both;
}

.dock-item.dock-reveal-label .dock-label {
  opacity: 1 !important;
  transform: translateY(-8px) scale(1) !important;
  pointer-events: auto !important;
}

.sidebar-pin-btn {
  background: transparent;
  color: #888;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.sidebar-pin-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #FFF;
}
body.light-mode .sidebar-pin-btn:hover {
  background: rgba(0,0,0,0.05);
  color: #000;
}


body.light-mode.focus-mode #sidebar.focus-revealed,
body.light-mode.floating-mode #sidebar.focus-revealed {
  box-shadow: 6px 6px 0px #000000;
}

/* ── Code Playground Modal ──────────────────────────────────── */
#playground-modal {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: stretch;
  justify-content: center;
}
#playground-modal.hidden { display: none; }

#playground-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  overflow: hidden;
}

/* ── Playground Top Bar ─────────────────────────────────────── */
#playground-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 48px;
  background: #111111;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

#playground-lang-group {
  display: flex;
  gap: 4px;
}

.pg-lang-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #666;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
  text-transform: uppercase;
}
.pg-lang-btn:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}
.pg-lang-btn.active {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}

#playground-filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #555;
  margin-left: 4px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#playground-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#pg-run-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 16px;
  background: var(--yellow);
  color: #000;
  border: none;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
}
#pg-run-btn:hover {
  background: #fff;
}
#pg-run-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pg-close-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  background: transparent;
  color: #666;
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
}
#pg-close-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ── Playground Body ────────────────────────────────────────── */
#playground-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

#playground-editor-wrap {
  position: relative;
  flex: 0 0 60%;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

#playground-loading-runtime {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--yellow);
  letter-spacing: 0.05em;
}
#playground-loading-runtime.hidden { display: none; }

#monaco-container {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ── Console Panel ──────────────────────────────────────────── */
#playground-console-wrap {
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
  background: #000;
  overflow: hidden;
}

#playground-console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #111;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #555;
  text-transform: uppercase;
  flex-shrink: 0;
}

#playground-console-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#pg-status {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #444;
  transition: color 0.2s;
}
#pg-status.running { color: var(--yellow); }
#pg-status.done    { color: var(--green); }
#pg-status.error   { color: var(--red); }

#pg-clear-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  background: transparent;
  color: #444;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
  text-transform: uppercase;
}
#pg-clear-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: #aaa;
}

#playground-console {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: #c8c8c8;
  scrollbar-width: thin;
  scrollbar-color: #333 #000;
}
#playground-console::-webkit-scrollbar { width: 6px; }
#playground-console::-webkit-scrollbar-track { background: #000; }
#playground-console::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.pg-out-line { color: #c8c8c8; white-space: pre-wrap; word-break: break-all; }
.pg-err-line { color: var(--red); white-space: pre-wrap; word-break: break-all; }
.pg-info-line { color: #555; font-style: italic; }

/* ── "Run in Playground" topbar button ──────────────────────── */
#btn-run-playground {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ── Light mode overrides ────────────────────────────────────── */
body.light-mode #playground-inner {
  background: #f5f5f5;
}
body.light-mode #playground-topbar,
body.light-mode #playground-console-header {
  background: #eeeeee;
  border-color: rgba(0,0,0,0.1);
}
body.light-mode .pg-lang-btn {
  color: #555;
  border-color: rgba(0,0,0,0.2);
}
body.light-mode .pg-lang-btn:hover {
  border-color: #000;
  color: #000;
}
body.light-mode .pg-lang-btn.active {
  background: #000;
  color: var(--yellow);
  border-color: #000;
}
body.light-mode #pg-close-btn { color: #555; border-color: rgba(0,0,0,0.15); }
body.light-mode #pg-close-btn:hover { border-color: var(--red); color: var(--red); }
body.light-mode #playground-console-wrap { background: #1a1a1a; }
body.light-mode #playground-editor-wrap { border-color: rgba(0,0,0,0.12); }


/* ── Study Heatmap ───────────────────────────────────────────── */
#hero-streak-wrap {
  position: relative;
}

#study-heatmap-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 8px;
}

body.light-mode #study-heatmap-label {
  color: rgba(0,0,0,0.35);
}

#streak-hero-count {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
#streak-hero-fire {
  font-size: 28px;
  line-height: 1;
  animation: fireFlicker 1.4s ease-in-out infinite alternate;
}
#streak-hero-num {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 900;
  color: var(--yellow);
  line-height: 1;
  letter-spacing: -3px;
  min-width: 2ch;
}
#streak-hero-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#streak-hero-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}
#streak-hero-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.5px;
}
body.light-mode #streak-hero-num  { color: #111; }
body.light-mode #streak-hero-unit { color: rgba(0,0,0,0.55); }
body.light-mode #streak-hero-sub  { color: rgba(0,0,0,0.35); }

#study-heatmap {
  display: grid;
  grid-auto-flow: column;
  width: fit-content;
}

.heatmap-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  cursor: default;
  transition: transform 0.1s ease;
}

.heatmap-cell:hover {
  transform: scale(1.4);
  z-index: 2;
  position: relative;
}

.heatmap-cell[data-count="0"] { background: var(--bg-2, rgba(255,255,255,0.06)); }
.heatmap-cell[data-count="1"] { background: rgba(230,255,0,0.25); }
.heatmap-cell[data-count="2"] { background: rgba(230,255,0,0.55); }
.heatmap-cell[data-count="5plus"] { background: #E6FF00; }

body.light-mode .heatmap-cell[data-count="0"] { background: rgba(0,0,0,0.07); }

#study-heatmap-tooltip {
  position: fixed;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 9000;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.1s ease;
}

#study-heatmap-tooltip.visible {
  opacity: 1;
}

body.light-mode #study-heatmap-tooltip {
  background: rgba(0,0,0,0.8);
  color: #fff;
}


/* ── Streak Dock Item ────────────────────────────────────────── */
#dock-streak .dock-icon-wrap svg {
  color: #E6FF00;
}

#dock-streak .dock-icon-wrap svg path:first-child {
  stroke: #E6FF00;
}

#dock-streak[data-streak="0"] .dock-icon-wrap svg {
  color: rgba(255,255,255,0.3);
  stroke: rgba(255,255,255,0.3);
}

body.light-mode #dock-streak[data-streak="0"] .dock-icon-wrap svg {
  color: rgba(0,0,0,0.25);
}

body.light-mode #dock-streak .dock-icon-wrap svg {
  color: #b8cc00;
}

/* ── Dependency Graph ──────────────────────────────────────── */
#graph-panel {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
}

#dep-graph {
  width: 100%;
  flex: 1;
  min-height: 480px;
  display: block;
}

.dep-graph-link {
  stroke: rgba(255,255,255,0.18);
  stroke-width: 1.5px;
  fill: none;
}

body.light-mode .dep-graph-link {
  stroke: rgba(0,0,0,0.2);
}

.dep-graph-node circle {
  stroke: #E6FF00;
  stroke-width: 2px;
  fill: #1c1c1c;
  cursor: pointer;
  transition: filter 0.15s;
}

body.light-mode .dep-graph-node circle {
  fill: #ffffff;
}

.dep-graph-node.completed circle {
  fill: #E6FF00;
  stroke: #E6FF00;
}

.dep-graph-node:hover circle {
  filter: brightness(1.3);
}

.dep-graph-node text {
  fill: rgba(255,255,255,0.65);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
}

.dep-graph-node.completed text.node-tag {
  fill: #000000;
}

body.light-mode .dep-graph-node text {
  fill: rgba(0,0,0,0.55);
}

body.light-mode .dep-graph-node.completed text.node-tag {
  fill: #000000;
}

.dep-graph-node text.node-label {
  font-size: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  fill: rgba(255,255,255,0.45);
}

body.light-mode .dep-graph-node text.node-label {
  fill: rgba(0,0,0,0.45);
}

.dep-graph-node.completed text.node-label {
  fill: rgba(0,0,0,0.6);
}

.dep-graph-tooltip {
  position: fixed;
  background: #0d0d0d;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: #ccc;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 9999;
  max-width: 240px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  line-height: 1.5;
}
.dgt-header { font-weight: 700; color: #fff; margin-bottom: 4px; display: flex; align-items: baseline; gap: 6px; }
.dgt-id { font-family: 'JetBrains Mono', monospace; font-size: 10px; background: rgba(230,255,0,0.12); color: #E6FF00; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.dgt-desc { color: #888; font-size: 11px; margin-bottom: 4px; }
.dgt-prereq { color: #666; font-size: 10px; font-family: 'JetBrains Mono', monospace; margin-bottom: 4px; }
.dgt-status { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: #555; }
.dgt-status.done { color: #5a9e5a; }
body.light-mode .dep-graph-tooltip { background: #fff; border-color: rgba(0,0,0,0.12); color: #333; box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
body.light-mode .dgt-id { background: rgba(0,0,0,0.06); color: #4a3d00; }
body.light-mode .dgt-header { color: #111; }
body.light-mode .dgt-desc { color: #666; }

/* Language guide nodes — cyan */
.dep-graph-node--lang circle {
  stroke: #00E5FF;
  fill: #041a1f;
}
body.light-mode .dep-graph-node--lang circle { fill: #e8faff; }
.dep-graph-node--lang text { fill: rgba(0,229,255,0.9) !important; }
body.light-mode .dep-graph-node--lang text { fill: #006080 !important; }

/* Capstone nodes — fire orange, pulsing */
.dep-graph-node--capstone circle {
  stroke: #FF6B00;
  fill: #1a0900;
  animation: capstonePulse 3s ease-in-out infinite;
}
body.light-mode .dep-graph-node--capstone circle { fill: #fff4ee; }
.dep-graph-node--capstone text { fill: #FF6B00 !important; }
body.light-mode .dep-graph-node--capstone text { fill: #c44000 !important; }

/* Link variants */
.dep-graph-link--lang     { stroke: rgba(0,229,255,0.3); stroke-dasharray: 4 3; }
.dep-graph-link--capstone { stroke: rgba(255,107,0,0.4); stroke-dasharray: 5 3; stroke-width: 1.8px; }
body.light-mode .dep-graph-link--lang     { stroke: rgba(0,140,170,0.35); }
body.light-mode .dep-graph-link--capstone { stroke: rgba(200,80,0,0.4); }

.dep-graph-arrow {
  fill: rgba(255,255,255,0.22);
}

body.light-mode .dep-graph-arrow {
  fill: rgba(0,0,0,0.25);
}

/* Completed node ring in dep graph */
.dep-node-done-ring {
  fill: none;
  stroke: rgba(100,220,100,0.5);
  stroke-width: 2;
  stroke-dasharray: 4,3;
}

/* Graph legend */
#dep-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 10px 16px;
  font-size: 11px;
  color: #666;
  font-family: 'Space Grotesk', sans-serif;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
}
.dgl-item { display: flex; align-items: center; gap: 5px; }
.dgl-drag { margin-left: auto; font-size: 10px; color: #444; font-family: 'JetBrains Mono', monospace; }
body.light-mode #dep-graph-legend { border-top-color: rgba(0,0,0,0.08); color: #888; }
body.light-mode .dgl-drag { color: #aaa; }

body.light-mode .logo-tag { color: #000000; }

/* ── Dock Badge (due-card count) ─────────────────────────────── */
.dock-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--yellow);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}
.dock-badge.hidden { display: none; }

/* ── Spaced Repetition Modal ─────────────────────────────────── */
#sr-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#sr-modal.hidden { display: none; }

.sr-container {
  width: 92%;
  max-width: 600px;
  background: #0d0d0d;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 28px 32px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 90vh;
  overflow-y: auto;
}

.sr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sr-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sr-title-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--yellow);
  background: rgba(230,255,0,0.08);
  border: 1px solid rgba(230,255,0,0.2);
  padding: 3px 10px;
}

.sr-queue-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.5px;
}

.sr-close-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.sr-close-btn:hover { color: var(--white); background: rgba(255,255,255,0.08); }

.sr-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sr-card-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

.sr-source-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--yellow);
  background: rgba(230,255,0,0.07);
  border: 1px solid rgba(230,255,0,0.15);
  padding: 2px 8px;
  letter-spacing: 1px;
}

.sr-card {
  background: #141414;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 3px;
  padding: 28px 28px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sr-question {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.5;
}

.sr-answer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 1.65;
}
.sr-answer p { margin: 0 0 10px; }
.sr-answer p:last-child { margin-bottom: 0; }
.sr-answer strong { color: #fff; font-weight: 700; }
.sr-answer code { font-family: var(--font-mono); font-size: 12px; background: rgba(255,255,255,0.1); padding: 1px 5px; border-radius: 3px; }
.sr-answer.hidden { display: none; }

.sr-show-btn-wrap {
  display: flex;
  justify-content: center;
}

.sr-show-btn {
  background: rgba(230,255,0,0.10);
  border: 2px solid var(--yellow);
  color: var(--yellow);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 11px 28px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sr-show-btn:hover { background: var(--yellow); color: var(--black); }
.sr-show-btn kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.55);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15);
}
.sr-show-btn:hover kbd { background: rgba(0,0,0,0.18); color: rgba(0,0,0,0.5); border-color: rgba(0,0,0,0.2); }

.sr-rating-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.sr-rating-row.hidden { display: none; }

.sr-rate-btn {
  flex: 1;
  min-width: 90px;
  padding: 10px 12px;
  border-radius: 2px;
  border: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.14s, opacity 0.14s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sr-rate-btn:hover { transform: translateY(-2px); }
.sr-rate-btn:active { transform: translateY(0); }
.sr-rate-btn kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.25);
  background: rgba(0,0,0,0.2);
}
.sr-easy { background: #00E676; color: #000; border-color: #00E676; }
.sr-good { background: var(--yellow); color: #000; border-color: var(--yellow); }
.sr-hard { background: #FF6B00; color: #000; border-color: #FF6B00; }
.sr-miss { background: #FF1744; color: #fff; border-color: #FF1744; }

.sr-empty {
  text-align: center;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.sr-empty.hidden { display: none; }

.sr-empty-icon {
  font-size: 44px;
  line-height: 1;
  color: var(--yellow);
  margin-bottom: 4px;
}
.sr-empty-title {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
}
.sr-empty-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

.sr-done {
  text-align: center;
  padding: 32px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.sr-done.hidden { display: none; }

.sr-done-stats {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  margin: 4px 0 8px;
}

/* ── Interview Simulator Modal ───────────────────────────────── */
#interview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.96);
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
}
#interview-modal.hidden { display: none; }

.iv-container {
  width: 92%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}

.iv-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 36px;
  background: #0d0d0d;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.9);
  position: relative;
}
.iv-screen.hidden { display: none; }

.iv-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
}

.iv-setup-logo {
  color: var(--yellow);
  opacity: 0.85;
}

.iv-setup-title {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 900;
  color: var(--white);
  text-align: center;
}

.iv-setup-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  text-align: center;
  max-width: 380px;
  line-height: 1.6;
}

.iv-count-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.iv-count-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.5px;
}

.iv-count-options {
  display: flex;
  gap: 8px;
}

.iv-count-btn {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  width: 46px;
  height: 46px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.iv-count-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.iv-count-btn.active { border-color: var(--yellow); color: var(--black); background: var(--yellow); }

.iv-start-btn {
  background: var(--yellow);
  border: 2px solid var(--yellow);
  color: var(--black);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 13px 36px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.iv-start-btn:hover { background: #d4ea00; transform: translateY(-1px); }
.iv-start-btn kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0,0,0,0.18);
  color: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.15);
}

/* IV question screen */
.iv-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.iv-q-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}

.iv-timer-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.iv-timer-bar-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.iv-timer-bar {
  height: 100%;
  background: var(--yellow);
  width: 100%;
  transition: width 1s linear, background 0.4s;
  border-radius: 2px;
}
.iv-timer-bar.danger { background: var(--red); }

.iv-timer-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--yellow);
  min-width: 24px;
  text-align: right;
}
.iv-timer-num.danger { color: var(--red); }

.iv-source-tag {
  align-self: flex-start;
}

.iv-question-text {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.5;
  width: 100%;
}

.iv-answer-reveal {
  width: 100%;
  background: #141414;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 2px;
  padding: 18px 20px;
}
.iv-answer-reveal.hidden { display: none; }

.iv-answer-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 8px;
}

.iv-answer-text {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 1.65;
}
.iv-answer-text p { margin: 0 0 10px; }
.iv-answer-text p:last-child { margin-bottom: 0; }
.iv-answer-text strong { color: #fff; font-weight: 700; }
.iv-answer-text code { font-family: var(--font-mono); font-size: 12px; background: rgba(255,255,255,0.1); padding: 1px 5px; border-radius: 3px; }

/* IV summary */
.iv-summary-icon {
  color: var(--green);
  background: rgba(0,230,118,0.1);
  border: 2px solid rgba(0,230,118,0.2);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iv-score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.iv-score-cell {
  background: #141414;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 3px;
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.iv-score-num {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 900;
}

.iv-score-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

.iv-score-cell.easy .iv-score-num { color: #00E676; }
.iv-score-cell.hard .iv-score-num { color: #FF6B00; }
.iv-score-cell.miss .iv-score-num { color: #FF1744; }

/* Light mode overrides — Neo-brutalism palette */
body.light-mode #sr-modal,
body.light-mode #interview-modal { background: rgba(0,0,0,0.6); }

body.light-mode .sr-container,
body.light-mode .iv-screen {
  background: #FFF5E1;
  border: 3px solid #000;
  box-shadow: 6px 6px 0px #000;
}

body.light-mode .sr-card,
body.light-mode .iv-answer-reveal {
  background: #fff;
  border: 2px solid #000;
  box-shadow: 3px 3px 0px #000;
}

body.light-mode .iv-score-cell {
  background: #fff;
  border: 2px solid #000;
  box-shadow: 3px 3px 0px #000;
}

body.light-mode .sr-question,
body.light-mode .iv-question-text,
body.light-mode .iv-setup-title,
body.light-mode .sr-empty-title { color: #000; }

body.light-mode .sr-answer,
body.light-mode .iv-answer-text { color: rgba(0,0,0,0.75); }

body.light-mode .sr-answer p,
body.light-mode .iv-answer-text p { color: rgba(0,0,0,0.75); }

body.light-mode .sr-answer strong,
body.light-mode .iv-answer-text strong { color: #000; }

body.light-mode .sr-answer code,
body.light-mode .iv-answer-text code {
  background: rgba(0,0,0,0.07);
  color: #000;
  border: 1px solid rgba(0,0,0,0.12);
}

body.light-mode .sr-queue-label,
body.light-mode .sr-card-counter,
body.light-mode .iv-q-counter,
body.light-mode .sr-empty-sub,
body.light-mode .iv-setup-sub { color: rgba(0,0,0,0.45); }

body.light-mode .sr-close-btn { color: rgba(0,0,0,0.5); border: 1px solid transparent; }
body.light-mode .sr-close-btn:hover { color: #000; background: rgba(0,0,0,0.08); border-color: #000; }

body.light-mode .sr-title-tag {
  color: #111;
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.18);
}
body.light-mode .sr-source-tag {
  color: #333;
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.18);
}
body.light-mode .sr-show-btn {
  background: #111;
  border: 2px solid #111;
  color: #FFF5E1;
  box-shadow: 3px 3px 0px rgba(0,0,0,0.3);
}
body.light-mode .sr-show-btn:hover { background: #000; box-shadow: 4px 4px 0px rgba(0,0,0,0.35); }
body.light-mode .sr-show-btn kbd {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.2);
}

body.light-mode .iv-count-btn {
  border: 2px solid #000;
  color: rgba(0,0,0,0.6);
  background: transparent;
}
body.light-mode .iv-count-btn:hover { color: #000; box-shadow: 2px 2px 0px #000; }
body.light-mode .iv-count-btn.active { border-color: #000; color: #000; background: var(--yellow); box-shadow: 3px 3px 0px #000; }

body.light-mode .iv-timer-bar-track { background: rgba(0,0,0,0.1); }

body.light-mode .sr-answer { border-top: 1px solid rgba(0,0,0,0.15); }
body.light-mode .sr-good { background: #5a7a00; color: #fff; border-color: #5a7a00; }

body.light-mode .dock-badge {
  background: #111;
  color: #fff;
  border: none;
}

body.light-mode .iv-start-btn {
  background: var(--yellow);
  border: 3px solid #000;
  color: #000;
  box-shadow: 4px 4px 0px #000;
}
body.light-mode .iv-start-btn:hover { background: #000; color: var(--yellow); box-shadow: none; }

body.light-mode .sr-done-stats,
body.light-mode .iv-summary-sub { color: rgba(0,0,0,0.6); }

body.light-mode .sr-done-title,
body.light-mode .iv-summary-title { color: #000; }

/* ── Inline MCQ Checkpoints ─────────────────────────────────────── */
.checkpoint-block {
  margin: 28px 0;
  border: 2px solid rgba(230,255,0,0.2);
  border-radius: 6px;
  padding: 20px 24px;
  background: rgba(230,255,0,0.03);
}

.cp-header {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cp-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--yellow);
  text-transform: uppercase;
  background: rgba(230,255,0,0.1);
  border: 1px solid rgba(230,255,0,0.2);
  padding: 2px 8px;
  display: inline-block;
  width: fit-content;
}

.cp-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  display: block;
  margin-top: 10px;
  line-height: 1.45;
}

.cp-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.cp-option {
  text-align: left;
  padding: 10px 14px;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  background: transparent;
  color: rgba(255,255,255,0.65);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cp-option:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.3);
  color: #fff;
  background: rgba(255,255,255,0.04);
}

.cp-option:disabled { cursor: default; }

.cp-option .cp-letter {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--yellow);
  min-width: 18px;
  font-weight: 700;
  flex-shrink: 0;
  padding-top: 1px;
}

.cp-option.correct {
  border-color: #00E676;
  background: rgba(0,230,118,0.08);
  color: #00E676;
}

.cp-option.wrong {
  border-color: #FF1744;
  background: rgba(255,23,68,0.08);
  color: #FF1744;
}

.cp-done {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: #00E676;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Light mode overrides */
body.light-mode .checkpoint-block {
  border-color: rgba(0,0,0,0.15);
  background: rgba(0,0,0,0.02);
}

body.light-mode .cp-title { color: #000; }

body.light-mode .cp-option {
  border-color: rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.6);
}

body.light-mode .cp-option:hover:not(:disabled) {
  border-color: rgba(0,0,0,0.35);
  color: #000;
  background: rgba(0,0,0,0.03);
}

body.light-mode .cp-option .cp-letter { color: #000; }

/* ── Table of Contents Panel ────────────────────────────────── */
#toc-panel {
  position: fixed;
  top: 80px;
  right: 16px;
  width: 200px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 16px;
  z-index: 400;
  transition: opacity 0.2s;
  font-family: var(--font-mono);
}

#toc-panel.hidden { display: none; }

#toc-header {
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.25);
  margin-bottom: 10px;
  text-transform: uppercase;
}

#toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#toc-list li {
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  padding: 4px 6px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#toc-list li:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.05);
}

#toc-list li.toc-active {
  color: var(--yellow);
  background: rgba(230,255,0,0.07);
}

#toc-list li.toc-h3 {
  padding-left: 16px;
  font-size: 10px;
}

@media (max-width: 1200px) {
  #toc-panel { display: none; }
}

/* Light mode — ToC panel */
body.light-mode #toc-panel {
  background: rgba(255,245,225,0.92);
  border-color: rgba(0,0,0,0.1);
}

body.light-mode #toc-header { color: rgba(0,0,0,0.25); }

body.light-mode #toc-list li { color: rgba(0,0,0,0.4); }

body.light-mode #toc-list li:hover {
  color: rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.04);
}

body.light-mode #toc-list li.toc-active {
  color: #000;
  background: rgba(0,0,0,0.06);
}

/* ── Concept Visualizers ────────────────────────────────────── */
.viz-wrap {
  margin: 24px 0 32px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.viz-title {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  align-self: flex-start;
}

.viz-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.viz-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 14px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: transparent;
  color: rgba(255,255,255,0.6);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.viz-btn:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.viz-btn.active {
  background: rgba(230,255,0,0.1);
  border-color: var(--yellow);
  color: var(--yellow);
}

.viz-info {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

/* Light mode overrides */
body.light-mode .viz-wrap {
  background: rgba(0,0,0,0.02);
  border-color: rgba(0,0,0,0.1);
}

body.light-mode .viz-title {
  color: rgba(0,0,0,0.3);
}

body.light-mode .viz-info {
  color: rgba(0,0,0,0.4);
}

body.light-mode .viz-btn {
  border-color: rgba(0,0,0,0.2);
  color: rgba(0,0,0,0.5);
}

body.light-mode .viz-btn:hover,
body.light-mode .viz-btn.active {
  border-color: #000;
  color: #000;
  background: rgba(0,0,0,0.05);
}

/* ── Reading time + scroll progress ──────────────────────────────── */
.reading-time-badge {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  color: #555;
  padding: 3px 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  white-space: nowrap;
  align-self: center;
}
.reading-time-badge.hidden { display: none; }
body.light-mode .reading-time-badge { color: #999; border-color: rgba(0,0,0,0.1); }
#read-progress-bar {
  height: 2px;
  background: transparent;
  width: 100%;
  flex-shrink: 0;
}
#read-progress-fill {
  height: 2px;
  width: 0%;
  background: var(--yellow);
  transition: width 0.08s linear;
}
body.light-mode #read-progress-fill { background: #b8a000; }

/* ── Project filter bar ───────────────────────────────────────────── */
.project-filter-bar {
  display: flex;
  gap: 8px;
  padding: 0 4px 16px;
  flex-wrap: wrap;
}
.proj-filter-btn {
  padding: 5px 16px;
  font-size: 11px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}
.proj-filter-btn:hover { border-color: rgba(255,255,255,0.25); color: #aaa; }
.proj-filter-btn.active { background: var(--yellow); border-color: var(--yellow); color: #000; font-weight: 700; }
body.light-mode .proj-filter-btn { border-color: rgba(0,0,0,0.15); color: #888; }
body.light-mode .proj-filter-btn:hover { border-color: rgba(0,0,0,0.3); color: #444; }
body.light-mode .proj-filter-btn.active { background: #b8a000; border-color: #b8a000; color: #fff; }

/* ── Related modules panel ────────────────────────────────────────── */
.related-panel {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.related-heading {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 12px;
}
.related-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: rgba(255,255,255,0.02);
}
.related-card:hover { border-color: rgba(230,255,0,0.3); background: rgba(230,255,0,0.03); }
.related-card:focus { outline: 2px solid var(--yellow); outline-offset: 2px; }
.related-card.done { border-color: rgba(100,180,100,0.2); }
.related-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--yellow);
  opacity: 0.6;
  flex-shrink: 0;
}
.related-title { font-size: 13px; font-weight: 600; color: #ccc; flex: 1; }
.related-done { font-size: 11px; color: #5a9e5a; }
body.light-mode .related-panel { border-top-color: rgba(0,0,0,0.08); }
body.light-mode .related-heading { color: #aaa; }
body.light-mode .related-card { border-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.02); }
body.light-mode .related-card:hover { border-color: rgba(180,140,0,0.4); background: rgba(180,140,0,0.03); }
body.light-mode .related-title { color: #333; }
body.light-mode .related-num { color: #b8a000; }

/* ── Explain-this popup ───────────────────────────────────────────── */
.explain-popup {
  position: absolute;
  z-index: 9998;
  background: #111;
  border: 1.5px solid rgba(230,255,0,0.25);
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 300px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  line-height: 1.6;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.explain-popup.hidden { display: none; }
.ep-term {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
  font-weight: 700;
}
.ep-def { color: #aaa; font-size: 12px; }
body.light-mode .explain-popup { background: #fff; border-color: rgba(140,110,0,0.3); box-shadow: 0 4px 24px rgba(0,0,0,0.12); }
body.light-mode .ep-term { color: #7a6000; }
body.light-mode .ep-def { color: #555; }
