@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  --bg: #090D12;
  --bg-deep: #05070A;
  --surface: #0E131B;
  --surface-raised: #151D28;
  --surface-subtle: #121924;
  --surface-border: #1F2937;
  --primary: #4EDEA3;
  --primary-hover: #38c78c;
  --primary-dim: rgba(78, 222, 163, 0.12);
  --primary-glow: rgba(78, 222, 163, 0.25);
  --secondary: #4CD7F6;
  --secondary-dim: rgba(76, 215, 246, 0.12);
  --warning: #F59E0B;
  --warning-dim: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --text: #F3F4F6;
  --text-muted: #8692A6;
  --text-subtle: #64748B;
  --line: #1F2937;
  --line-light: #2D3748;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html.theme-normal {
  --bg: #F8FAFC;
  --bg-deep: #F1F5F9;
  --surface: #FFFFFF;
  --surface-raised: #F8FAFC;
  --surface-subtle: #F1F5F9;
  --surface-border: #E2E8F0;
  --primary: #059669;
  --primary-hover: #047857;
  --primary-dim: rgba(5, 150, 105, 0.1);
  --primary-glow: rgba(5, 150, 105, 0.2);
  --secondary: #0284C7;
  --secondary-dim: rgba(2, 132, 199, 0.1);
  --warning: #D97706;
  --warning-dim: rgba(217, 119, 6, 0.1);
  --danger: #DC2626;
  --text: #0F172A;
  --text-muted: #475569;
  --text-subtle: #64748B;
  --line: #E2E8F0;
  --line-light: #CBD5E1;
  color-scheme: light;
}

html.theme-normal body {
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(5, 150, 105, 0.04) 0%, transparent 60%),
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

html.theme-normal .header {
  background: rgba(255, 255, 255, 0.94);
}

html.theme-normal .mobile-drawer {
  background: rgba(255, 255, 255, 0.98);
}

html.theme-normal .button {
  color: #FFFFFF;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(78, 222, 163, 0.05) 0%, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

/* ========================================================================= */
/* Header & Navigation                                                       */
/* ========================================================================= */
.header {
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 13, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text);
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--surface-raised);
  border: 1px solid rgba(78, 222, 163, 0.3);
  border-radius: 6px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 0 12px var(--primary-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text span:first-child {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-text b {
  font-size: 0.85rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 500;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.nav a.active {
  color: var(--primary);
  background: var(--primary-dim);
  border: 1px solid rgba(78, 222, 163, 0.3);
}

.nav .btn-portfolio {
  color: var(--secondary);
  border: 1px solid rgba(76, 215, 246, 0.3);
  background: var(--secondary-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  margin-left: 0.5rem;
}

.nav .btn-portfolio:hover {
  background: rgba(76, 215, 246, 0.2);
  color: #fff;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 0.4rem;
  cursor: pointer;
  place-items: center;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 13, 18, 0.98);
  backdrop-filter: blur(16px);
  z-index: 49;
  padding: 1.5rem;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
}

.mobile-drawer.open {
  display: block;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-drawer-nav a {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.mobile-drawer-nav a:hover,
.mobile-drawer-nav a.active {
  background: var(--surface-raised);
  color: var(--primary);
  border-color: rgba(78, 222, 163, 0.25);
}

/* ========================================================================= */
/* Landing / Index Styles                                                    */
/* ========================================================================= */
.cover {
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary);
  letter-spacing: 0.15em;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cover h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.cover h1 span.gradient {
  background: linear-gradient(135deg, #F3F4F6 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.motto {
  font-family: var(--font-mono);
  font-style: italic;
  color: var(--secondary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2.5rem 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.75rem;
  min-width: 160px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat:hover {
  border-color: rgba(78, 222, 163, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.stat h3 {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.stat p {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.badge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.thm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-subtle);
  border: 1px solid rgba(78, 222, 163, 0.3);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary);
}

/* ========================================================================= */
/* Search System                                                             */
/* ========================================================================= */
.search-container {
  max-width: 640px;
  margin: 1.5rem auto 3rem;
  position: relative;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box .search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 3rem;
  border-radius: 10px;
  border: 1px solid var(--line-light);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background: var(--surface-raised);
  border: 1px solid var(--line-light);
  border-radius: 10px;
  max-height: 420px;
  overflow-y: auto;
  z-index: 40;
  display: none;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.search-results.active {
  display: block;
}

.search-item {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  display: block;
  transition: background 0.15s ease;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: rgba(78, 222, 163, 0.08);
}

.search-item-title {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.search-item-mod {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--secondary);
}

.search-item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.search-group-header {
  padding: 0.5rem 1.25rem 0.35rem;
  background: var(--surface-raised);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========================================================================= */
/* Module Grid & Cards                                                       */
/* ========================================================================= */
.modules-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card:hover {
  border-color: rgba(78, 222, 163, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 0.05em;
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-existing {
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid rgba(78, 222, 163, 0.3);
}

.badge-thm {
  background: var(--secondary-dim);
  color: var(--secondary);
  border: 1px solid rgba(76, 215, 246, 0.3);
}

.badge-project {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-progress {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-foundation {
  background: rgba(76, 215, 246, 0.15);
  color: #4CD7F6;
  border: 1px solid rgba(76, 215, 246, 0.4);
}

.badge-beginner {
  background: rgba(78, 222, 163, 0.15);
  color: #4EDEA3;
  border: 1px solid rgba(78, 222, 163, 0.4);
}

.badge-intermediate {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-advanced {
  background: rgba(244, 63, 94, 0.15);
  color: #F43F5E;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.badge-reference {
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.card-footer .cta {
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: gap 0.15s ease;
}

.card:hover .cta {
  gap: 0.5rem;
}

/* ========================================================================= */
/* Documentation / Chapter Layout                                            */
/* ========================================================================= */
.docs-layout {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 240px;
  gap: 2rem;
  padding: 2rem 1.5rem 6rem;
  flex-grow: 1;
  min-width: 0;
  overflow-x: hidden;
}

/* Left Sidebar: Catalog & TOC */
.sidebar {
  position: sticky;
  top: 92px;
  height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 1rem;
  border-right: 1px solid var(--line);
  font-size: 0.85rem;
}

.sidebar-heading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--primary);
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 2rem;
}

.sidebar-nav a {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
}

.sidebar-nav a:hover {
  color: var(--text);
  background: var(--surface-raised);
}

.sidebar-nav a.active {
  color: var(--primary);
  background: var(--primary-dim);
  font-weight: 600;
  border-left: 2px solid var(--primary);
  border-radius: 0 6px 6px 0;
}

.sidebar-nav .nav-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-subtle);
}

.sidebar-nav a.active .nav-num {
  color: var(--primary);
}

/* Right Sidebar: In This Chapter TOC */
.toc-sidebar {
  position: sticky;
  top: 92px;
  height: max-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding-left: 1.25rem;
  font-size: 0.825rem;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc-nav a {
  color: var(--text-muted);
  line-height: 1.4;
  padding: 0.2rem 0;
  transition: color 0.15s ease;
}

.toc-nav a:hover,
.toc-nav a.active {
  color: var(--primary);
}

/* Center Article Content */
.article {
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.article-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
}

.article h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
  margin: 0.5rem 0 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.origin-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.article h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
  scroll-margin-top: 90px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.75rem 0 0.75rem;
  scroll-margin-top: 90px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article p {
  color: #D1D5DB;
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article ul, .article ol {
  color: #D1D5DB;
  font-size: 0.95rem;
  line-height: 1.75;
  margin: 1rem 0 1.5rem 1.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.article li {
  margin-bottom: 0.5rem;
}

.article strong {
  color: var(--text);
  font-weight: 600;
}

.article code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-raised);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--secondary);
  word-break: break-word;
  overflow-wrap: break-word;
}

.article table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.article th, .article td {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  text-align: left;
}

.article th {
  background: var(--surface-raised);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.article td {
  background: var(--surface);
  font-size: 0.85rem;
}

.article pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ========================================================================= */
/* Command & Code Blocks                                                     */
/* ========================================================================= */
.command {
  position: relative;
  background: #06090D;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  margin: 1.25rem 0 1.5rem;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.command-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-subtle);
}

.command pre {
  padding: 1rem 4.5rem 1rem 1.25rem;
  margin: 0;
  overflow-x: auto;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #E2E8F0;
  -webkit-overflow-scrolling: touch;
}

.copy {
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
  background: var(--surface-raised);
  border: 1px solid var(--line-light);
  color: var(--text-muted);
  border-radius: 5px;
  padding: 0.3rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  z-index: 10;
}

.copy:hover {
  background: var(--surface-subtle);
  color: var(--primary);
  border-color: rgba(78, 222, 163, 0.4);
}

.copy.copied {
  background: var(--primary-dim);
  color: var(--primary);
  border-color: var(--primary);
}

/* ========================================================================= */
/* Callout Boxes                                                             */
/* ========================================================================= */
.callout {
  border-left: 3px solid var(--primary);
  background: rgba(78, 222, 163, 0.08);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.925rem;
  color: #E2E8F0;
}

.callout-warning {
  border-left-color: var(--warning);
  background: rgba(245, 158, 11, 0.08);
}

.callout-danger {
  border-left-color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.callout-info {
  border-left-color: var(--secondary);
  background: rgba(76, 215, 246, 0.08);
}

.callout b {
  color: var(--text);
}

/* ========================================================================= */
/* Chapter Bottom Navigation                                                 */
/* ========================================================================= */
.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.chapter-nav a {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.chapter-nav a:hover {
  border-color: rgba(78, 222, 163, 0.4);
  background: var(--surface-raised);
}

.chapter-nav .nav-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.chapter-nav .nav-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.chapter-nav .next {
  text-align: right;
}

/* ========================================================================= */
/* PDF Library Styles                                                        */
/* ========================================================================= */
.library-category {
  margin-bottom: 3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.75rem;
}

.library-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.library-category-title {
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.library-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-card {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-subtle);
  border: 1px solid var(--line-light);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.meta-card strong {
  color: var(--primary);
}

.pdf-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.pdf-part-card {
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.pdf-part-card:hover {
  border-color: rgba(76, 215, 246, 0.4);
  background: var(--surface-raised);
}

.pdf-part-name {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 0.5rem;
}

.pdf-download-btn {
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid rgba(78, 222, 163, 0.3);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pdf-download-btn:hover {
  background: var(--primary);
  color: #000;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary);
  color: #090D12;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.65rem 1.15rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.button:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.button-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(78, 222, 163, 0.4);
}

.button-outline:hover {
  background: var(--primary-dim);
  color: #fff;
}

/* ========================================================================= */
/* Footer                                                                    */
/* ========================================================================= */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer p {
  margin-bottom: 0.5rem;
}

.footer-disclaimer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* ========================================================================= */
/* Responsive Breakpoints                                                    */
/* ========================================================================= */
@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1.5rem;
  }
  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 860px) {
  .header .nav {
    display: none;
  }
  .mobile-toggle {
    display: grid;
  }
  .docs-layout {
    display: block;
    padding-top: 1rem;
    padding-bottom: 4rem;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0 0 1.5rem;
    margin-bottom: 2rem;
  }
  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.35rem;
  }
  .module-grid {
    grid-template-columns: 1fr;
  }
  .chapter-nav {
    grid-template-columns: 1fr;
  }
  .chapter-nav .next {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .header {
    padding: 0 1rem;
    height: 62px;
  }
  .docs-layout {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .cover {
    padding: 3rem 1rem 2rem;
  }
  .cover h1 {
    font-size: clamp(1.85rem, 8vw, 2.5rem);
  }
  .motto {
    font-size: 0.95rem;
  }
  .lead {
    font-size: 0.95rem;
  }
  .search-container {
    margin: 1.25rem auto 2rem;
  }
  .modules-section {
    padding: 1.5rem 1rem 3.5rem;
  }
  .library-category {
    padding: 1.25rem 1rem;
  }
  .library-category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .pdf-parts-grid {
    grid-template-columns: 1fr;
  }
  .article-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
  }
  .article h1 {
    font-size: 1.85rem;
  }
  .article h2 {
    font-size: 1.35rem;
    margin: 2rem 0 0.75rem;
  }
  .article h3 {
    font-size: 1.05rem;
  }
  .command pre {
    padding: 0.85rem 4rem 0.85rem 0.9rem;
    font-size: 0.8rem;
  }
  .copy {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }
  .callout {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .sidebar-nav {
    grid-template-columns: 1fr;
  }
  .stats-row {
    gap: 0.65rem;
  }
  .stat {
    min-width: 120px;
    flex: 1 1 calc(50% - 0.65rem);
    padding: 0.85rem 0.75rem;
  }
  .stat h3 {
    font-size: 1.5rem;
  }
  .badge-row {
    gap: 0.4rem;
  }
  .thm-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }
  .search-box input {
    padding: 0.75rem 0.85rem 0.75rem 2.5rem;
    font-size: 0.875rem;
  }
  .search-box .search-icon {
    left: 0.75rem;
  }
  .card {
    padding: 1.2rem;
  }
  .footer {
    padding: 2rem 1rem;
  }
}

@media (max-width: 360px) {
  .header {
    padding: 0 0.75rem;
  }
  .brand .mark {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  .brand-text b {
    font-size: 0.75rem;
  }
  .stat {
    flex: 1 1 100%;
  }
}
