/* ==========================================
   NavDP Research Sandbox – Docs Site CSS
   ========================================== */

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

:root {
  --bg-primary: #080c14;
  --bg-secondary: #0d1424;
  --bg-card: #0f1a2e;
  --bg-card-hover: #152238;
  --bg-code: #060b12;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;

  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-hero: linear-gradient(135deg, #1e3a5f 0%, #2d1b69 50%, #0c1a3d 100%);
  --gradient-page-hero: linear-gradient(135deg, #0c1528 0%, #1a0d3d 50%, #0a1f40 100%);
  --gradient-card: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(139,92,246,0.08) 100%);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-link: #60a5fa;
  --text-code: #a5f3fc;

  --border-subtle: rgba(59, 130, 246, 0.12);
  --border-card: rgba(59, 130, 246, 0.18);
  --border-bright: rgba(59, 130, 246, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px var(--border-card);
  --shadow-glow: 0 0 40px rgba(59,130,246,0.15);

  --font-sans: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --nav-h: 68px;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);

  --bg-navbar: rgba(8, 12, 20, 0.8);
  --bg-navbar-scrolled: rgba(8, 12, 20, 0.95);
  --shadow-navbar: 0 4px 32px rgba(0,0,0,0.5);
  --bg-mobile-menu: rgba(8, 12, 20, 0.98);

  --bg-glass: rgba(255, 255, 255, 0.04);
  --text-white: #ffffff;
  --text-on-dark: #ffffff;
  --hero-orb-opacity: 0.18;
  --bg-card-featured: linear-gradient(135deg, #0f1a2e 0%, #160d2e 100%);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-code: #f1f5f9;

  --accent-blue: #2563eb;
  --accent-cyan: #0891b2;
  --accent-purple: #7c3aed;
  --accent-green: #059669;
  --accent-orange: #d97706;

  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-hero: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 50%, #eff6ff 100%);
  --gradient-page-hero: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 50%, #eff6ff 100%);
  --gradient-card: linear-gradient(135deg, rgba(37,99,235,0.04) 0%, rgba(124,58,237,0.04) 100%);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-link: #2563eb;
  --text-code: #0f172a;

  --border-subtle: rgba(37, 99, 235, 0.08);
  --border-card: rgba(37, 99, 235, 0.12);
  --border-bright: rgba(37, 99, 235, 0.3);

  --shadow-card: 0 4px 20px rgba(0,0,0,0.05), 0 0 0 1px var(--border-card);
  --shadow-glow: 0 0 30px rgba(37,99,235,0.08);

  --bg-navbar: rgba(248, 250, 252, 0.8);
  --bg-navbar-scrolled: rgba(248, 250, 252, 0.95);
  --shadow-navbar: 0 4px 20px rgba(0,0,0,0.05);
  --bg-mobile-menu: rgba(248, 250, 252, 0.98);

  --bg-glass: rgba(0, 0, 0, 0.03);
  --text-white: #0f172a;
  --text-on-dark: #ffffff;
  --hero-orb-opacity: 0.12;
  --bg-card-featured: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--accent-purple); }

/* ==========================================
   NAVIGATION
   ========================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: var(--bg-navbar);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition), box-shadow var(--transition);
}
.navbar.scrolled {
  background: var(--bg-navbar-scrolled);
  box-shadow: var(--shadow-navbar);
}
.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  flex: 1 0 0%;
}
.logo-icon { font-size: 1.4rem; }
.logo-accent { color: var(--accent-blue); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}
.nav-link {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
}
.nav-link.active { color: var(--accent-blue); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  background: var(--gradient-primary);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition);
  margin-left: 0.5rem;
}
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==========================================
   HERO
   ========================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--nav-h) 2rem 4rem;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: 0;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridPulse 8s ease-in-out infinite;
}
@keyframes gridPulse {
  0%,100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: orbFloat 12s ease-in-out infinite;
}
.hero-orb-1 { width: 600px; height: 600px; background: rgba(59,130,246,var(--hero-orb-opacity)); top: -150px; left: -100px; animation-delay: 0s; }
.hero-orb-2 { width: 400px; height: 400px; background: rgba(139,92,246,var(--hero-orb-opacity)); bottom: -100px; right: -50px; animation-delay: -4s; }
.hero-orb-3 { width: 300px; height: 300px; background: rgba(6,182,212,var(--hero-orb-opacity)); top: 50%; right: 20%; animation-delay: -8s; }
@keyframes orbFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(30px,-30px) scale(1.05); }
  66% { transform: translate(-20px,20px) scale(0.95); }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 860px;
  animation: fadeInUp 0.8s ease both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-cyan);
  letter-spacing: 0.04em;
  margin-bottom: 1.5rem;
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.hero-title-accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.hero-title-line { display: block; }

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 1.2rem auto 2.2rem;
  line-height: 1.8;
}
.hero-subtitle strong { color: var(--text-primary); }
.inline-link { color: var(--accent-cyan); border-bottom: 1px solid rgba(6,182,212,0.4); }
.inline-link:hover { color: var(--accent-blue); border-color: var(--accent-blue); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 2rem;
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
  gap: 0;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.8rem;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  white-space: nowrap;
}
.stat-div {
  width: 1px;
  height: 40px;
  background: var(--border-subtle);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  animation: scrollHint 3s ease-in-out infinite;
}
.scroll-arrow {
  width: 1px;
  height: 30px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
}
@keyframes scrollHint {
  0%,100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(8px); }
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(59,130,246,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59,130,246,0.45);
  color: #fff;
}
.btn-secondary {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border: 1px solid var(--border-card);
}
.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  transform: translateY(-2px);
}
.btn-ghost {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ==========================================
   SECTIONS
   ========================================== */
.section {
  padding: 6rem 2rem;
}
.section-dark {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.container {
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.section-badge {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
  letter-spacing: -0.02em;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* ==========================================
   CARDS
   ========================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity var(--transition);
}
.card:hover {
  border-color: var(--border-bright);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.card:hover::before { opacity: 1; }
.card-featured {
  border-color: rgba(139,92,246,0.3);
  background: var(--bg-card-featured);
}
.card-icon {
  font-size: 2.2rem;
  margin-bottom: 1.2rem;
}
.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
}
.card-desc strong { color: var(--text-primary); }
.card-desc code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent-cyan);
}
.card-link { color: var(--accent-blue); }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; position: relative; z-index: 1; }
.tag {
  padding: 0.25rem 0.7rem;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent-cyan);
}
.card-arrow {
  color: var(--accent-blue);
  font-size: 1.2rem;
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  transition: transform var(--transition);
}
.card:hover .card-arrow { transform: translateX(4px); }

/* ==========================================
   TASKS SECTION
   ========================================== */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.task-card {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
  min-width: 0;
}
.task-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.task-icon {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-icon-blue { background: rgba(59,130,246,0.12); color: var(--accent-blue); border: 1px solid rgba(59,130,246,0.2); }
.task-icon-green { background: rgba(16,185,129,0.12); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.2); }
.task-icon-purple { background: rgba(139,92,246,0.12); color: var(--accent-purple); border: 1px solid rgba(139,92,246,0.2); }
.task-content { min-width: 0; }
.task-content h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-primary); }
.task-content p { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.75rem; line-height: 1.6; }
.code-snippet {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: var(--accent-green);
  overflow-x: auto;
  white-space: nowrap;
}

/* ==========================================
   ARCHITECTURE DIAGRAM
   ========================================== */
.arch-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 780px;
  margin: 0 auto 2.5rem;
}
.arch-layer {
  width: 100%;
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  border: 1px solid var(--border-card);
}
.arch-layer-1 { background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(6,182,212,0.06) 100%); border-color: rgba(59,130,246,0.25); }
.arch-layer-2 { background: linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(59,130,246,0.06) 100%); border-color: rgba(139,92,246,0.3); }
.arch-layer-3 { background: linear-gradient(135deg, rgba(16,185,129,0.08) 0%, rgba(6,182,212,0.06) 100%); border-color: rgba(16,185,129,0.25); }
.arch-layer-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.arch-layer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.arch-block {
  padding: 0.5rem 1.1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}
.arch-block-accent {
  background: rgba(139,92,246,0.1);
  border-color: rgba(139,92,246,0.25);
  color: var(--accent-purple);
}
.arch-layer-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.arch-arrow-down {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.5rem 0;
}
.arch-cta { text-align: center; margin-top: 1rem; }

/* ==========================================
   BASELINES GRID
   ========================================== */
.baselines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
}
.baseline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
}
.baseline-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.baseline-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.baseline-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.baseline-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.baseline-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.65; margin-bottom: 1rem; }
.baseline-files { display: flex; flex-direction: column; gap: 0.4rem; }
.baseline-files code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

/* ==========================================
   QUICK START
   ========================================== */
.quickstart-steps {
  max-width: 820px;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.qs-step {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.qs-num {
  flex-shrink: 0;
  width: 40px; height: 40px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.2rem;
}
.qs-content { flex: 1; }
.qs-content h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.75rem; }
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--text-code);
  white-space: pre;
  line-height: 1.7;
}
.qs-cta { text-align: center; }

/* ==========================================
   RESEARCH LOG TIMELINE
   ========================================== */
.log-timeline {
  max-width: 820px;
  margin: 0 auto 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.log-timeline::before {
  content: '';
  position: absolute;
  left: 2.5rem;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-purple), var(--accent-green));
  opacity: 0.3;
}
.log-entry {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  position: relative;
}
.log-chapter {
  flex-shrink: 0;
  width: 52px; height: 52px;
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  position: relative;
  z-index: 1;
}
.log-body {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: all var(--transition);
}
.log-body:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-card);
}
.log-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.log-body p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.log-body p code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  color: var(--accent-orange);
}
.log-body p strong { color: var(--text-primary); }
.log-cta { text-align: center; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 2rem 1.5rem;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  display: flex;
  gap: 4rem;
  flex-wrap: wrap;
}
.footer-brand { flex: 1; min-width: 220px; }
.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.85rem;
}
.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent-blue); }
.footer-nav { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 0.6rem; }
.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.footer-col a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--accent-blue); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.8;
}
.footer-bottom strong { color: var(--text-secondary); }
.footer-cite { font-style: italic; margin-top: 0.3rem; }

/* ==========================================
   PAGE HERO (inner pages)
   ========================================== */
.page-hero {
  padding: calc(var(--nav-h) + 4rem) 2rem 3.5rem;
  background: var(--gradient-page-hero);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(59,130,246,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(59,130,246,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}
.page-hero-content {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
}
.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.page-hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.75;
}
.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.page-breadcrumb a { color: var(--accent-blue); }
.page-breadcrumb span { color: var(--text-muted); }

/* ==========================================
   CONTENT SECTIONS (inner pages)
   ========================================== */
.content-section {
  padding: 4rem 2rem;
}
.content-section.alt { background: var(--bg-secondary); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.content-container {
  max-width: 900px;
  margin: 0 auto;
}
.content-container h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-top: 1rem;
  letter-spacing: -0.01em;
}
.content-container h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2rem 0 0.75rem;
}
.content-container h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin: 1.5rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.82rem;
}
.content-container p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}
.content-container p strong { color: var(--text-primary); }
.content-container ul, .content-container ol {
  color: var(--text-secondary);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.content-container li { line-height: 1.7; }
.content-container li strong { color: var(--text-primary); }
.content-container code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent-cyan);
}
.content-container pre {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
.content-container pre code {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-code);
  line-height: 1.7;
}
.divider { height: 1px; background: var(--border-subtle); margin: 2.5rem 0; }

/* ==========================================
   TABLE
   ========================================== */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.875rem;
}
.doc-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: rgba(59,130,246,0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-card);
}
.doc-table td {
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.6;
  vertical-align: top;
}
.doc-table td:first-child { color: var(--text-primary); font-weight: 500; }
.doc-table td code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent-cyan);
  border: 1px solid var(--border-subtle);
}
.doc-table tr:hover td { background: rgba(59,130,246,0.03); }

/* ==========================================
   CALLOUT BOXES
   ========================================== */
.callout {
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.7;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.callout-icon { flex-shrink: 0; font-size: 1.2rem; margin-top: 0.05rem; }
.callout-content { color: var(--text-secondary); }
.callout-content strong { color: var(--text-primary); display: block; margin-bottom: 0.25rem; }
.callout-info { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); }
.callout-warn { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); }
.callout-success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
.callout-danger { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); }

/* ==========================================
   FILE TREE
   ========================================== */
.file-tree {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.8;
  margin: 1.25rem 0;
  overflow-x: auto;
  white-space: pre;
}
.file-tree .dir { color: var(--accent-blue); font-weight: 600; }
.file-tree .file { color: var(--text-secondary); }
.file-tree .comment { color: var(--text-muted); }

/* ==========================================
   CHAPTER CARDS (LeKiwi log)
   ========================================== */
.chapter-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.chapter-card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-card);
}
.chapter-card-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  cursor: pointer;
}
.chapter-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  color: var(--accent-cyan);
  white-space: nowrap;
}
.chapter-card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
.chapter-status {
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
}
.status-fixed { background: rgba(16,185,129,0.1); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.2); }
.status-open { background: rgba(245,158,11,0.1); color: var(--accent-orange); border: 1px solid rgba(245,158,11,0.2); }
.chapter-card-body {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
}
.chapter-card-body p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.75; margin-bottom: 0.75rem; }
.chapter-card-body strong { color: var(--text-primary); }
.chapter-card-body code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-code);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  color: var(--accent-orange);
  border: 1px solid var(--border-subtle);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg-mobile-menu);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
  }
  .hero-stats { gap: 1rem; }
  .stat-div { display: none; }
  .stat { padding: 0 1rem; }
  .footer-container { flex-direction: column; gap: 2rem; }
  .arch-diagram { padding: 0 1rem; }
  .log-timeline::before { left: 1.7rem; }
}
@media (max-width: 640px) {
  .section { padding: 4rem 1.25rem; }
  .hero { padding: var(--nav-h) 1.25rem 3rem; }
  .qs-step { flex-direction: column; gap: 1rem; }
  .task-card { flex-direction: column; }
}

/* ==========================================
   TOOL CARDS (research_tools page)
   ========================================== */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
}
.tool-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.tool-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.tool-name {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-cyan);
}
.tool-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.65; }

/* Force Monospace Font and proper code-wrapping */
pre, code, kbd, samp, .file-tree, .code-snippet, .tool-name {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.code-snippet {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
}

/* --- Theme Toggle & Navbar Actions --- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 0 0%;
  justify-content: flex-end;
}
.theme-toggle-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 1.05rem;
  padding: 0;
}
.theme-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  margin-top: -1px; /* Optical adjustment for emoji baseline alignment */
}
.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  transform: scale(1.08);
}
@media (max-width: 900px) {
  .nav-logo, .nav-actions {
    flex: none;
  }
}
