/* ═══════════════════════════════════════════════════════════════
   QUANTUM MECHANICS — PREMIUM STUDY GUIDE
   State-of-the-art dark theme · Editorial-grade design
   ═══════════════════════════════════════════════════════════════ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  /* Surface layers */
  --bg-0: #09090b;
  --bg-1: #0c0c0f;
  --bg-2: #111114;
  --bg-3: #18181b;
  --bg-4: #1e1e22;
  --bg-elevated: rgba(24, 24, 30, 0.7);
  --bg-elevated-solid: #16161a;

  /* Borders */
  --border-subtle: rgba(255,255,255, 0.04);
  --border-default: rgba(255,255,255, 0.06);
  --border-strong: rgba(255,255,255, 0.09);
  --border-accent: rgba(124, 131, 255, 0.2);

  /* Text */
  --text-1: #fafafa;
  --text-2: rgba(250,250,250, 0.72);
  --text-3: rgba(250,250,250, 0.44);
  --text-4: rgba(250,250,250, 0.28);

  /* Accent palette — sophisticated indigo/violet */
  --accent: #7c83ff;
  --accent-dim: rgba(124,131,255, 0.12);
  --accent-dimmer: rgba(124,131,255, 0.06);
  --accent-glow: rgba(124,131,255, 0.08);
  --accent-text: #a5abff;
  --accent-2: #c084fc;  /* secondary purple */

  /* Semantic */
  --green: #4ade80;
  --green-dim: rgba(74,222,128, 0.08);
  --amber: #fbbf24;
  --amber-dim: rgba(251,191,36, 0.08);
  --cyan: #22d3ee;
  --cyan-dim: rgba(34,211,238, 0.08);
  --rose: #fb7185;
  --rose-dim: rgba(251,113,133, 0.08);

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-2: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-3: 0 16px 48px rgba(0,0,0,0.4);
  --glow: 0 0 60px -12px rgba(124,131,255, 0.15);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Fonts */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', monospace;

  /* Layout */
  --nav-h: 56px;
  --content-w: 820px;
  --unit-accent: var(--accent);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--sans);
  background: var(--bg-0);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---- Noise Texture Overlay ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px;
}

/* ---- Atmospheric Background ---- */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.04;
  will-change: transform;
}
.orb-1 {
  width: 800px; height: 800px;
  background: #7c83ff;
  top: -300px; left: -200px;
  animation: drift 40s ease-in-out infinite;
}
.orb-2 {
  width: 600px; height: 600px;
  background: #c084fc;
  top: 40%; right: -250px;
  animation: drift 45s ease-in-out infinite reverse;
}
.orb-3 {
  width: 500px; height: 500px;
  background: #22d3ee;
  bottom: -200px; left: 30%;
  animation: drift 50s ease-in-out infinite;
  animation-delay: -15s;
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -30px); }
}

/* ═══════════ PROGRESS BAR ═══════════ */
.progress-bar {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 1002;
  width: 0%;
  transition: width 0.06s linear;
}

/* ═══════════ TOP NAVIGATION ═══════════ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(9, 9, 11, 0.6);
  backdrop-filter: blur(32px) saturate(120%);
  -webkit-backdrop-filter: blur(32px) saturate(120%);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1001;
  gap: 8px;
  transition: all 0.3s ease;
}
.topnav.scrolled {
  background: rgba(9, 9, 11, 0.88);
  border-color: var(--border-default);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 4px;
}
.nav-icon { font-size: 18px; opacity: 0.8; }
.nav-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 1px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent);
  padding: 0 12px;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  color: var(--text-3);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
  letter-spacing: -0.01em;
}
.nav-link:hover {
  color: var(--text-2);
  background: rgba(255,255,255,0.03);
}
.nav-link.active {
  color: var(--text-1);
  background: rgba(255,255,255,0.05);
}

/* Search Trigger */
.nav-search-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  color: var(--text-4);
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.nav-search-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-strong);
  color: var(--text-3);
}
.nav-search-btn svg { opacity: 0.5; }
.nav-search-btn .kbd {
  font-size: 10px;
  font-family: var(--mono);
  background: rgba(255,255,255,0.04);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  line-height: 1.4;
  color: var(--text-4);
}

/* Mobile Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--r-sm);
}
.nav-toggle:hover { background: rgba(255,255,255,0.04); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-2);
  border-radius: 2px;
  transition: 0.25s ease;
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ═══════════ SEARCH OVERLAY ═══════════ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
}
.search-overlay.open { display: flex; }
.search-container {
  width: min(560px, 92vw);
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3), var(--glow);
  overflow: hidden;
  animation: searchIn 0.2s ease-out;
}
@keyframes searchIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 10px;
  border-bottom: 1px solid var(--border-default);
}
.search-input-wrap svg { flex-shrink: 0; opacity: 0.3; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 15px;
  font-family: var(--sans);
}
.search-input::placeholder { color: var(--text-4); }
.search-esc {
  font-size: 10px;
  font-family: var(--mono);
  background: rgba(255,255,255,0.04);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  color: var(--text-4);
}
.search-results {
  max-height: 48vh;
  overflow-y: auto;
  padding: 6px;
}
.search-results:empty::after {
  content: 'Type to search topics, formulas, concepts...';
  display: block;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-4);
  font-size: 13px;
}
.search-result-item {
  display: block;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: background 0.1s;
  cursor: pointer;
}
.search-result-item:hover,
.search-result-item.active {
  background: rgba(255,255,255,0.04);
}
.search-result-item .sr-unit {
  font-size: 10px;
  color: var(--accent-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.search-result-item .sr-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
  margin-top: 1px;
}
.search-result-item .sr-preview {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.4;
}
.search-result-item mark {
  background: var(--accent-dim);
  color: var(--accent-text);
  border-radius: 2px;
  padding: 0 2px;
}

/* ═══════════ SIDEBAR ═══════════ */
.sidebar {
  position: fixed;
  top: var(--nav-h);
  right: -320px;
  width: 300px;
  height: calc(100vh - var(--nav-h));
  background: rgba(12, 12, 15, 0.96);
  backdrop-filter: blur(24px);
  border-left: 1px solid var(--border-default);
  z-index: 999;
  overflow-y: auto;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px 12px;
}
.sidebar.open { right: 0; }
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 8px;
}
.sidebar-header h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-4);
}
.sidebar-close {
  background: none;
  border: none;
  color: var(--text-4);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: 0.15s;
}
.sidebar-close:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
}
.sidebar-content a {
  display: block;
  color: var(--text-4);
  text-decoration: none;
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 1px;
  transition: all 0.12s;
  line-height: 1.35;
  border-left: 2px solid transparent;
  font-weight: 400;
}
.sidebar-content a:hover {
  color: var(--text-2);
  background: rgba(255,255,255,0.03);
}
.sidebar-content a.toc-active {
  color: var(--text-1);
  background: rgba(255,255,255,0.04);
  border-left-color: var(--accent);
  font-weight: 500;
}
.sidebar-content .toc-unit {
  font-weight: 600;
  color: var(--text-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 16px;
  margin-bottom: 4px;
  padding: 4px 10px;
}
.sidebar-content .toc-unit:first-child { margin-top: 0; }

.sidebar-toggle {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated-solid);
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  z-index: 998;
  box-shadow: var(--shadow-2);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle:hover {
  background: var(--bg-4);
  border-color: var(--border-strong);
  color: var(--text-1);
}

/* ═══════════ HERO ═══════════ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 60px) 24px 80px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(124,131,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content {
  max-width: 680px;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dimmer);
  border: 1px solid rgba(124,131,255,0.12);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--r-full);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
  color: var(--text-1);
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1rem;
  color: var(--text-3);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
}
.hero-stats {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 14px 22px;
  min-width: 88px;
  transition: all 0.2s ease;
}
.stat:hover {
  background: rgba(255,255,255,0.03);
  border-color: var(--border-default);
}
.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-4);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px;
  background: var(--accent);
  color: var(--bg-0);
  font-weight: 700;
  font-size: 13.5px;
  border-radius: var(--r-full);
  text-decoration: none;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
}
.cta-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(124,131,255,0.25);
}

/* Hero Quick Links */
.hero-units {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 48px;
  text-align: left;
}
.hero-unit-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.hero-unit-card:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.03);
}
.hero-unit-card .huc-icon {
  font-size: 13px;
  flex-shrink: 0;
  font-family: var(--mono);
  font-weight: 500;
  color: var(--accent);
  opacity: 0.5;
  width: 24px;
  text-align: center;
}
.hero-unit-card .huc-num {
  font-size: 9px;
  color: var(--text-4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════ MAIN CONTENT ═══════════ */
.main-content {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px 120px;
  position: relative;
  z-index: 1;
}

/* ═══════════ UNIT SECTION ═══════════ */
.unit { margin-bottom: 72px; }

/* Accent colors per unit */
.unit[data-color="blue"]    { --unit-accent: #7c83ff; }
.unit[data-color="purple"]  { --unit-accent: #c084fc; }
.unit[data-color="cyan"]    { --unit-accent: #22d3ee; }
.unit[data-color="green"]   { --unit-accent: #4ade80; }
.unit[data-color="amber"]   { --unit-accent: #fbbf24; }
.unit[data-color="pink"]    { --unit-accent: #f472b6; }
.unit[data-color="red"]     { --unit-accent: #f87171; }
.unit[data-color="orange"]  { --unit-accent: #fb923c; }
.unit[data-color="teal"]    { --unit-accent: #2dd4bf; }

.unit-header {
  padding: 56px 0 24px;
  margin-bottom: 28px;
  position: relative;
}
.unit-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 48px;
  height: 1px;
  background: var(--unit-accent, var(--accent));
  opacity: 0.5;
}
.unit-number {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--unit-accent, var(--accent));
  margin-bottom: 8px;
  opacity: 0.8;
}
.unit-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  line-height: 1.2;
  color: var(--text-1);
}
.unit-desc {
  color: var(--text-4);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ═══════════ TOPIC CARDS ═══════════ */
.topic {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  position: relative;
}
.topic:hover {
  background: rgba(255,255,255,0.025);
  border-color: var(--border-default);
}

/* Collapsible header */
.topic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 12px;
  user-select: none;
}
.topic-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.35;
  flex: 1;
  margin: 0;
  transition: color 0.15s;
  letter-spacing: -0.02em;
}
.topic-header:hover h3 {
  color: var(--accent-text);
}
.topic-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  flex-shrink: 0;
  transition: all 0.2s;
}
.topic-toggle svg {
  transition: transform 0.2s ease;
  color: var(--text-4);
  width: 12px;
  height: 12px;
}
.topic.collapsed .topic-toggle svg {
  transform: rotate(-90deg);
}
.topic.collapsed .topic-body {
  display: none;
}
.topic-body {
  margin-top: 16px;
}

/* Standalone h3 */
.topic > h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-1);
  letter-spacing: -0.02em;
}
.topic h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.topic p {
  color: var(--text-2);
  margin-bottom: 8px;
}
.topic ul, .topic ol {
  margin: 4px 0 12px 18px;
  color: var(--text-2);
}
.topic li {
  margin-bottom: 4px;
  line-height: 1.65;
}
.topic li strong {
  color: var(--text-1);
  font-weight: 600;
}

/* ═══════════ CONCEPT BOX ═══════════ */
.concept-box {
  display: flex;
  gap: 12px;
  background: var(--accent-dimmer);
  border: 1px solid rgba(124,131,255,0.1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 12px 0;
  align-items: flex-start;
}
.concept-icon { font-size: 20px; flex-shrink: 0; line-height: 1.4; opacity: 0.8; }
.concept-text { flex: 1; font-size: 14px; }
.concept-text strong { color: var(--text-1); }

/* ═══════════ FORMULA BOX ═══════════ */
.formula-box {
  background: var(--bg-2);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin: 12px 0;
  text-align: center;
  overflow-x: auto;
}
.formula-title {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-text);
  font-weight: 700;
  margin-bottom: 10px;
  opacity: 0.7;
}
.formula {
  font-size: 1rem;
  margin: 4px 0;
  color: var(--text-1);
}

/* ═══════════ DATA TABLE ═══════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}
.data-table th {
  background: rgba(255,255,255,0.02);
  color: var(--text-3);
  font-weight: 600;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-default);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.data-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-2);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td {
  background: rgba(255,255,255,0.01);
}
.data-table td:first-child {
  font-weight: 500;
  color: var(--text-1);
}

/* ═══════════ CALLOUTS ═══════════ */
.callout {
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin: 12px 0;
  border-left: 2px solid;
  font-size: 13.5px;
}
.callout-info {
  background: var(--cyan-dim);
  border-color: var(--cyan);
}
.callout-warning {
  background: var(--amber-dim);
  border-color: var(--amber);
}
.callout-important {
  background: var(--accent-dimmer);
  border-color: var(--accent);
}
.callout strong { color: var(--text-1); }

/* ═══════════ EXAMPLE BOX ═══════════ */
.example-box {
  background: var(--green-dim);
  border: 1px solid rgba(74,222,128,0.08);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 12px 0;
}
.example-title {
  font-weight: 700;
  color: var(--green);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}
.example-box p { color: var(--text-2); font-size: 14px; }

/* ═══════════ CODE BLOCK ═══════════ */
.code-block {
  background: var(--bg-2);
  border: 1px solid var(--border-default);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 8px 0;
  white-space: pre-wrap;
  color: var(--accent-text);
}

/* ═══════════ GRID CARDS ═══════════ */
.two-col, .three-col {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.two-col { grid-template-columns: 1fr 1fr; }
.three-col { grid-template-columns: 1fr 1fr 1fr; }
.col-card {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 16px;
  transition: border-color 0.15s;
}
.col-card:hover {
  border-color: var(--border-default);
}
.col-card h4 {
  margin: 0 0 8px !important;
  font-size: 0.85rem !important;
  color: var(--text-1) !important;
}
.col-card ul { margin-left: 14px; font-size: 13.5px; }
.highlight-card {
  background: var(--accent-dimmer);
  border-color: rgba(124,131,255,0.1);
}
.shape-visual {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 8px;
  padding: 10px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--r-sm);
  border: 1px dashed var(--border-subtle);
}

/* ═══════════ POSTULATE LIST ═══════════ */
.postulate-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}
.postulate {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.postulate-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

/* ═══════════ COMPOUND CARD ═══════════ */
.compound-card {
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 16px;
  margin: 8px 0;
  transition: border-color 0.15s;
}
.compound-card:hover {
  border-color: var(--border-default);
}
.compound-card h4 {
  color: var(--rose) !important;
  margin: 0 0 8px !important;
  font-size: 0.85rem !important;
}

/* ═══════════ FORMULA CHEAT TABLE ═══════════ */
.formula-table td:first-child {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-text);
}

/* ═══════════ FOOTER ═══════════ */
.footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 24px;
  text-align: center;
}
.footer-content p {
  color: var(--text-4);
  font-size: 13px;
  margin-bottom: 4px;
}
.footer-small {
  font-size: 12px !important;
  margin-top: 12px !important;
}
.footer-kbd {
  display: inline-flex;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-kbd span {
  font-size: 11px;
  color: var(--text-4);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.footer-kbd .kbd {
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(255,255,255,0.03);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

/* ═══════════ BACK TO TOP ═══════════ */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated-solid);
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-0);
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(9, 9, 11, 0.97);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-default);
    flex-direction: column;
    padding: 8px;
    gap: 1px;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 10px 14px; font-size: 13px; }
  .nav-search-btn .kbd { display: none; }
  .hero-units { grid-template-columns: 1fr 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .topic { padding: 20px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { gap: 6px; }
  .stat { min-width: 72px; padding: 10px 14px; }
  .stat-num { font-size: 1.25rem; }
  .sidebar-toggle { bottom: 20px; right: 72px; }
}

@media (max-width: 480px) {
  :root { --nav-h: 52px; }
  .topnav { padding: 0 12px; }
  .main-content { padding: 0 16px 80px; }
  .topic { padding: 16px; border-radius: var(--r-md); }
  .formula-box { padding: 14px; }
  .concept-box { flex-direction: column; gap: 6px; }
  .postulate { gap: 8px; padding: 10px; }
  .hero-units { grid-template-columns: 1fr; gap: 6px; }
  .hero-badge { font-size: 10px; }
  .hero { padding-top: calc(var(--nav-h) + 40px); }
}

/* ═══════════ SCROLLBAR & SELECTION ═══════════ */
::selection {
  background: rgba(124,131,255, 0.25);
  color: var(--text-1);
}
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* ═══════════ REVEAL ANIMATION ═══════════ */
.topic.reveal-ready {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.topic.revealed {
  opacity: 1;
  transform: none;
}

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