/* ============================================
   GMT Wiki Easy — Premium Modern Dark UI
   ============================================ */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* === CSS Variables === */
:root {
  /* Dark mode (DEFAULT) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: rgba(30, 41, 59, 0.8);
  --bg-card-solid: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-1: #3b82f6;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --accent-4: #10b981;
  --accent-5: #f59e0b;
  --accent-6: #ef4444;
  --gradient-1: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-2: linear-gradient(135deg, #06b6d4, #3b82f6);
  --gradient-3: linear-gradient(135deg, #8b5cf6, #ec4899);
  --gradient-text: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4);
  --glass-bg: rgba(30, 41, 59, 0.6);
  --glass-border: rgba(148, 163, 184, 0.1);
  --glass-blur: 12px;
  --border: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(148, 163, 184, 0.25);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --transition: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --header-height: 50px;
  --content-max: 800px;
}

/* Light mode */
[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-solid: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(15, 23, 42, 0.08);
  --border: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 23, 42, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.1);
  --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* === Selection === */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: inherit;
}

/* === Focus === */
:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
  border-radius: 4px;
}

/* === Reading Progress Bar === */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-1);
  z-index: 1000;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ============================================
   HEADER — Floating Glassmorphism
   ============================================ */
.header {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 1200px;
  height: var(--header-height);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  padding: 0 20px;
  transition: var(--transition);
}

.header:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.logo svg { width: 28px; height: 28px; flex-shrink: 0; }

.logo-label {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo span {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  display: block;
  line-height: 1;
}

/* Nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
}

.nav-links a.active {
  color: var(--accent-1);
  background: rgba(59, 130, 246, 0.12);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  gap: 6px;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
}

.search-bar:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--glass-border);
}

.search-bar svg {
  color: var(--text-muted);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.search-bar span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.search-bar kbd {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
}

/* Theme toggle */
.theme-toggle {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-5);
  border-color: var(--border-hover);
}

/* Hamburger */
.hamburger {
  display: none;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 1.2rem;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.hamburger:hover {
  background: rgba(59, 130, 246, 0.15);
}

/* ============================================
   MOBILE NAV OVERLAY
   ============================================ */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mobile-nav.active { display: flex; }

.mobile-nav-panel {
  background: var(--bg-secondary);
  width: 280px;
  max-width: 85%;
  height: 100%;
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.mobile-nav-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.mobile-nav-panel a:hover,
.mobile-nav-panel a.active {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
}

.mobile-nav-section {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 16px 14px 6px;
}

.mobile-nav-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  margin-bottom: 10px;
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.search-overlay.active { display: flex; }

.search-modal {
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: fadeInScale 0.2s ease;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.search-modal-header svg {
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.search-modal-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
}

.search-modal-input::placeholder { color: var(--text-muted); }

.search-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
}

.search-results-list {
  overflow-y: auto;
  padding: 8px;
}

.search-result-item {
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: block;
}

.search-result-item:hover {
  background: rgba(59, 130, 246, 0.08);
}

.search-result-item h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.search-result-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.search-result-item mark {
  background: rgba(59, 130, 246, 0.3);
  color: var(--accent-1);
  border-radius: 2px;
  padding: 0 2px;
}

.search-results-header {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

/* ============================================
   LAYOUT
   ============================================ */
.layout {
  padding-top: calc(var(--header-height) + 24px);
  min-height: 100vh;
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px 24px 80px;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--accent-1);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover {
  color: var(--accent-3);
  text-decoration: underline;
}

.breadcrumb .sep { color: var(--text-muted); opacity: 0.5; }

/* ============================================
   PAGE TITLE & SUBTITLE
   ============================================ */
.page-title {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  line-height: 1.7;
}

.last-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(59, 130, 246, 0.08);
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h2 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 40px 0 14px;
  color: var(--text-primary);
  scroll-margin-top: 80px;
  position: relative;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text-primary);
  scroll-margin-top: 80px;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text-secondary);
}

p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

a {
  color: var(--accent-1);
  text-decoration: none;
  transition: var(--transition);
}

a:hover { text-decoration: underline; }

ul, ol {
  margin: 10px 0 14px 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

li { margin-bottom: 6px; }

blockquote {
  border-left: 3px solid var(--accent-2);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 14px 18px;
  margin: 14px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-secondary);
}

code {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-2);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: var(--font-mono);
}

pre {
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid var(--border);
}

pre code {
  background: none;
  color: var(--text-secondary);
  padding: 0;
}

strong { color: var(--text-primary); }

/* ============================================
   TABLE
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: rgba(59, 130, 246, 0.04); }

/* ============================================
   INFOBOX — Glassmorphism
   ============================================ */
.infobox {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin: 20px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: var(--transition);
}

.infobox:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.infobox-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }

.infobox-title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.infobox p { font-size: 0.9rem; margin: 0; }

.infobox.info {
  border-left: 3px solid var(--accent-1);
}

.infobox.warning {
  border-left: 3px solid var(--accent-5);
}

.infobox.tip {
  border-left: 3px solid var(--accent-4);
}

/* ============================================
   CARD GRID — Hover Lift + Glow
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(59, 130, 246, 0.06),
    transparent 40%
  );
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow), var(--shadow-md);
  text-decoration: none;
}

.card:hover::after { opacity: 1; }

.card-icon { font-size: 1.8rem; margin-bottom: 10px; }

.card h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.82rem;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================
   FLOWCHART
   ============================================ */
.flowchart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 20px 0;
}

.flow-step {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px 24px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  transition: var(--transition);
}

.flow-step:hover {
  border-color: var(--accent-1);
  box-shadow: var(--shadow-glow);
}

.flow-step h4 { margin: 0 0 4px; font-size: 0.95rem; color: var(--text-primary); }
.flow-step p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.flow-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: 6px 0;
  opacity: 0.6;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline {
  position: relative;
  padding: 10px 0 10px 28px;
  border-left: 2px solid var(--border);
  margin: 20px 0;
}

.timeline-item {
  margin-bottom: 22px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-1);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.timeline-year {
  font-weight: 800;
  font-size: 1rem;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.timeline-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================
   TAGS — Pill Shape
   ============================================ */
.tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  margin: 2px;
  border: 1px solid transparent;
}

.tag-blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-1);
  border-color: rgba(59, 130, 246, 0.2);
}

.tag-green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-4);
  border-color: rgba(16, 185, 129, 0.2);
}

.tag-orange {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-5);
  border-color: rgba(245, 158, 11, 0.2);
}

.tag-red {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-6);
  border-color: rgba(239, 68, 68, 0.2);
}

/* ============================================
   TOC — Table of Contents
   ============================================ */
.toc {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 28px;
}

.toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
}

.toc ul { list-style: none; padding-left: 0; }
.toc ul ul { padding-left: 16px; }

.toc li a {
  color: var(--accent-1);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 3px 0;
  display: block;
  transition: var(--transition);
}

.toc li a:hover {
  color: var(--accent-3);
}

/* ============================================
   FLOATING TOC (for article pages)
   ============================================ */
.floating-toc {
  position: fixed;
  top: calc(var(--header-height) + 40px);
  right: 24px;
  width: 220px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  z-index: 50;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.floating-toc.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.floating-toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.floating-toc ul { list-style: none; padding-left: 0; }

.floating-toc li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  padding: 4px 0;
  display: block;
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: var(--transition);
  line-height: 1.5;
}

.floating-toc li a:hover {
  color: var(--text-primary);
  border-left-color: var(--accent-1);
}

.floating-toc li a.active {
  color: var(--accent-1);
  border-left-color: var(--accent-1);
  font-weight: 600;
}

.floating-toc li.sub a {
  padding-left: 22px;
  font-size: 0.74rem;
}

/* ============================================
   GLOSSARY
   ============================================ */
.glossary-term {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.glossary-term strong {
  color: var(--accent-1);
  font-size: 0.98rem;
}

.glossary-term p {
  font-size: 0.9rem;
  margin: 4px 0 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  margin-top: 50px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.footer a { color: var(--accent-1); }

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 90;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent-1);
  color: white;
  border-color: var(--accent-1);
  box-shadow: var(--shadow-glow);
}

/* ============================================
   HERO SECTION (Homepage)
   ============================================ */
.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 40px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at 30% 20%,
    rgba(59, 130, 246, 0.08) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at 70% 60%,
    rgba(139, 92, 246, 0.06) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at 50% 80%,
    rgba(6, 182, 212, 0.05) 0%,
    transparent 50%
  );
  pointer-events: none;
  animation: heroPulse 8s ease-in-out infinite alternate;
}

@keyframes heroPulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--gradient-1);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
  position: relative;
  z-index: 1;
}

.hero-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
  text-decoration: none;
}

.hero-cta svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.hero-cta:hover svg {
  transform: translateX(3px);
}

/* ============================================
   MIND MAP SECTION (Homepage)
   ============================================ */
.mindmap-section {
  position: relative;
  width: 100%;
  padding: 20px 0;
  background: var(--bg-primary);
  overflow: visible;
}

.mindmap-section-header {
  text-align: center;
  padding: 40px 24px 20px;
}

.mindmap-section-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.mindmap-section-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.mindmap-container {
  width: 100%;
  height: 0;
  min-height: 90vh;
  max-height: 1400px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
}

/* jsMind canvas fills container */
.mindmap-container canvas {
  display: block;
}

/* jsMind dark theme overrides */
div[jm_nodes] {
  position: absolute;
}

/* jsMind node styling — premium dark */
jmnode {
  display: inline-block;
  padding: 8px 16px !important;
  border-radius: 10px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #f1f5f9 !important;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
  border: 1px solid rgba(148, 163, 184, 0.15) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  max-width: 260px;
}

jmnode:hover {
  border-color: rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.25), 0 4px 12px rgba(0, 0, 0, 0.4) !important;
  transform: translateY(-1px);
}

/* Root node — larger, gradient accent */
jmnode[level='0'],
jmnode.root {
  font-size: 16px !important;
  padding: 12px 24px !important;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.3), 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  border-radius: 14px !important;
}

/* Level 1 nodes — category colors */
jmnode[level='1'] {
  font-size: 14px !important;
  padding: 10px 20px !important;
  border-radius: 12px !important;
}

/* Expand/collapse indicator — clear +/- buttons */
jmexpander {
  display: inline-block !important;
  width: 22px !important;
  height: 22px !important;
  line-height: 22px !important;
  text-align: center !important;
  border-radius: 50% !important;
  background: #3b82f6 !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4) !important;
  transition: all 0.2s ease !important;
  z-index: 10 !important;
}

jmexpander:hover {
  background: #60a5fa !important;
  transform: scale(1.2);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.6) !important;
}

/* jsMind default theme overrides for dark bg */
.jsmind-inner {
  background: transparent !important;
  outline: none !important;
}

/* jsmind primary theme color overrides */
.jsmind-inner jmnode {
  background: linear-gradient(135deg, #1e293b, #334155) !important;
}

/* Category-specific node colors via nth-child for level 1 */
jmnode[level='1']:nth-child(1) { background: linear-gradient(135deg, #1e3a5f, #1e4d7a) !important; border-color: rgba(59, 130, 246, 0.3) !important; }
jmnode[level='1']:nth-child(2) { background: linear-gradient(135deg, #2d1b69, #3b2580) !important; border-color: rgba(139, 92, 246, 0.3) !important; }
jmnode[level='1']:nth-child(3) { background: linear-gradient(135deg, #0e3d44, #134e56) !important; border-color: rgba(6, 182, 212, 0.3) !important; }
jmnode[level='1']:nth-child(4) { background: linear-gradient(135deg, #3d2e0a, #52400e) !important; border-color: rgba(245, 158, 11, 0.3) !important; }
jmnode[level='1']:nth-child(5) { background: linear-gradient(135deg, #3d1e0a, #52290e) !important; border-color: rgba(249, 115, 22, 0.3) !important; }
jmnode[level='1']:nth-child(6) { background: linear-gradient(135deg, #0a3d2a, #0e5238) !important; border-color: rgba(16, 185, 129, 0.3) !important; }
jmnode[level='1']:nth-child(7) { background: linear-gradient(135deg, #0a3638, #0e4a4c) !important; border-color: rgba(20, 184, 166, 0.3) !important; }
jmnode[level='1']:nth-child(8) { background: linear-gradient(135deg, #3d3a0a, #524d0e) !important; border-color: rgba(234, 179, 8, 0.3) !important; }
jmnode[level='1']:nth-child(9) { background: linear-gradient(135deg, #3d0a2a, #520e38) !important; border-color: rgba(236, 72, 153, 0.3) !important; }
jmnode[level='1']:nth-child(10) { background: linear-gradient(135deg, #0e3d44, #134e56) !important; border-color: rgba(6, 182, 212, 0.3) !important; }
jmnode[level='1']:nth-child(11) { background: linear-gradient(135deg, #2a2d35, #3a3d45) !important; border-color: rgba(100, 116, 139, 0.3) !important; }
jmnode[level='1']:nth-child(12) { background: linear-gradient(135deg, #2a2825, #3a3835) !important; border-color: rgba(120, 113, 108, 0.3) !important; }

/* jsMind connector lines */
.jsmind-inner svg line,
.jsmind-inner svg path {
  stroke: #334155 !important;
  stroke-width: 2 !important;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-fade-in:nth-child(1) { transition-delay: 0s; }
.animate-fade-in:nth-child(2) { transition-delay: 0.06s; }
.animate-fade-in:nth-child(3) { transition-delay: 0.12s; }
.animate-fade-in:nth-child(4) { transition-delay: 0.18s; }
.animate-fade-in:nth-child(5) { transition-delay: 0.24s; }
.animate-fade-in:nth-child(6) { transition-delay: 0.3s; }
.animate-fade-in:nth-child(7) { transition-delay: 0.36s; }
.animate-fade-in:nth-child(8) { transition-delay: 0.42s; }
.animate-fade-in:nth-child(9) { transition-delay: 0.48s; }
.animate-fade-in:nth-child(10) { transition-delay: 0.54s; }
.animate-fade-in:nth-child(11) { transition-delay: 0.6s; }
.animate-fade-in:nth-child(12) { transition-delay: 0.66s; }

/* Page load stagger */
.content > * {
  animation: fadeInUp 0.4s ease both;
}

.content > *:nth-child(1) { animation-delay: 0s; }
.content > *:nth-child(2) { animation-delay: 0.04s; }
.content > *:nth-child(3) { animation-delay: 0.08s; }
.content > *:nth-child(4) { animation-delay: 0.12s; }
.content > *:nth-child(5) { animation-delay: 0.16s; }
.content > *:nth-child(n+6) { animation-delay: 0.2s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1280px) {
  .floating-toc { display: none; }
}

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .search-bar kbd { display: none; }
  .floating-toc { display: none; }
}

@media (max-width: 768px) {
  :root {
    --header-height: 48px;
  }

  .header {
    top: 4px;
    width: calc(100% - 16px);
    padding: 0 14px;
  }

  .search-bar span { display: none; }

  .hero {
    min-height: 60vh;
    padding: 60px 20px 30px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .mindmap-container {
    height: 55vh;
    min-height: 380px;
  }

  jmnode {
    font-size: 11px !important;
    padding: 6px 12px !important;
    max-width: 180px;
  }

  jmnode[level='0'], jmnode.root {
    font-size: 13px !important;
    padding: 8px 16px !important;
  }

  jmnode[level='1'] {
    font-size: 12px !important;
    padding: 7px 14px !important;
  }

  .content {
    padding: 16px 16px 60px;
  }

  .page-title {
    font-size: 1.7rem;
  }
}

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hero-title {
    font-size: 1.7rem;
  }

  .page-title {
    font-size: 1.4rem;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 8px 10px;
  }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .header,
  .reading-progress,
  .floating-toc,
  .back-to-top,
  .mobile-nav { display: none !important; }

  .content {
    max-width: 100%;
    padding: 0;
  }

  .layout { padding-top: 0; }

  body {
    background: white;
    color: black;
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================
   COPY LINK TOAST
   ============================================ */
.copy-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 300;
}

.copy-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
