:root {
  --bg-main: #08000e;
  --bg-sidebar: rgba(14, 4, 24, 0.88);
  --bg-card: rgba(24, 10, 40, 0.65);
  --bg-elevated: rgba(30, 14, 50, 0.85);
  --accent: #c918fa;
  --accent-glow: rgba(201, 24, 250, 0.5);
  --accent-hover: #d94dfa;
  --accent-muted: rgba(201, 24, 250, 0.1);
  --accent2: #f472d0;
  --accent2-glow: rgba(244, 114, 208, 0.3);
  --star: #ffd700;
  --star-glow: rgba(255, 215, 0, 0.3);
  --teal: #00f5d4;
  --teal-glow: rgba(0, 245, 212, 0.2);
  --text-primary: #f0e6f0;
  --text-secondary: #d4c4dc;
  --text-muted: #9a80a8;
  --border: rgba(201, 24, 250, 0.08);
  --border-hover: rgba(201, 24, 250, 0.35);
  --sidebar-width: 300px;
  --top-bar-height: 72px;
  --glass: blur(20px) saturate(180%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.8);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-title: 'Montserrat', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; cursor: none !important; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  cursor: none !important;
}
a, button, input, textarea, select, [role="button"], .nav-item, .nav-btn-link, .top-action-btn, .tab-link, .boutique-btn, .discord-link, .solus-badge, .cta-btn, .accueil-card, .markdown-body a, .logo, #fab-top, #mobile-open, #mobile-close, .solus-footer-link, #scroll-top-btn {
  cursor: none !important;
}

.cursor-arrow {
  position: fixed; pointer-events: none; z-index: 2147483647;
  width: 24px; height: 24px;
  color: var(--accent);
  transform: translate(-2px, -2px);
  transition: color 0.2s, opacity 0.15s, transform 0.15s;
}
body.cursor-pointer .cursor-arrow {
  color: var(--accent2);
  transform: translate(-2px, -2px) scale(1.15);
}
body.cursor-text .cursor-arrow {
  opacity: 0;
  transform: translate(-2px, -2px) scale(0.8);
}

.cursor-beam {
  position: fixed; pointer-events: none; z-index: 2147483647;
  width: 24px; height: 24px;
  color: var(--accent);
  transform: translate(-12px, -12px);
  opacity: 0;
  transition: opacity 0.15s, color 0.2s;
}
body.cursor-text .cursor-beam {
  opacity: 1;
}
body.cursor-pointer .cursor-beam {
  opacity: 0;
}

.cursor-glow {
  position: fixed; pointer-events: none; z-index: 2147483646;
  width: 0; height: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,24,250,0.06) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease, background 0.3s;
  opacity: 0;
}
body.cursor-pointer .cursor-glow {
  width: 55px; height: 55px;
  opacity: 1;
  background: radial-gradient(circle, rgba(244,114,208,0.1) 0%, transparent 70%);
}
body.cursor-text .cursor-glow {
  width: 24px; height: 24px;
  opacity: 0.25;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
}

body.cursor-click .cursor-arrow {
  transform: translate(-2px, -2px) scale(0.8);
  transition: transform 0.08s;
}

.cursor-ripple {
  position: fixed; pointer-events: none; z-index: 2147483646;
  width: 0; height: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  transform: translate(-50%, -50%);
  animation: cursorRipple 0.5s ease-out forwards;
}

@keyframes cursorRipple {
  0% { width: 0; height: 0; opacity: 0.7; border-width: 2px; }
  100% { width: 60px; height: 60px; opacity: 0; border-width: 0; }
}

.cursor-burst {
  position: fixed; pointer-events: none; z-index: 2147483645;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 6px var(--accent2-glow);
  transform: translate(-50%, -50%);
  animation: cursorBurst 0.6s ease-out forwards;
}

@keyframes cursorBurst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px))) scale(0); }
}

@media (max-width: 768px) {
  body, a, button, input, textarea, select, [role="button"], .nav-item, .nav-btn-link, .top-action-btn, .tab-link, .boutique-btn, .discord-link, .solus-badge, .cta-btn, .accueil-card, .markdown-body a, .logo, #fab-top, #mobile-open, #mobile-close, .solus-footer-link, #scroll-top-btn {
    cursor: auto !important;
  }
  .cursor-arrow, .cursor-beam, .cursor-glow { display: none !important; }
}

::selection { background: rgba(201, 24, 250, 0.15); color: inherit; }
::-moz-selection { background: rgba(201, 24, 250, 0.15); color: inherit; }

body { user-select: none; }

.sel-highlight {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 2147483645;
}
.sel-highlight-rect {
  position: fixed; pointer-events: none;
  background: rgba(201, 24, 250, 0.1);
  border: 1px solid rgba(201, 24, 250, 0.15);
  border-radius: 3px;
  animation: selRectIn 0.2s cubic-bezier(0.22,1,0.36,1);
}
@keyframes selRectIn {
  0% { opacity: 0; transform: scaleY(0.5); }
  100% { opacity: 1; transform: scaleY(1); }
}

body.is-selecting .sel-highlight-rect {
  background: rgba(201, 24, 250, 0.15);
  border-color: rgba(201, 24, 250, 0.25);
}

.ctx-menu {
  position: fixed; z-index: 2147483646;
  min-width: 180px;
  padding: 6px;
  background: rgba(16, 4, 30, 0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(201,24,250,0.08);
  opacity: 0; pointer-events: none;
  transform-origin: top left;
  transform: scale(0.92);
  transition: opacity 0.12s, transform 0.15s cubic-bezier(0.22,1,0.36,1);
}
.ctx-menu.visible {
  opacity: 1; pointer-events: auto;
  transform: scale(1);
}
.ctx-menu button {
  display: block; width: 100%;
  background: none; border: none;
  color: var(--text-secondary);
  font: 500 13px/1 var(--font-sans);
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.12s, color 0.12s, transform 0.12s;
  white-space: nowrap;
}
.ctx-menu button:hover {
  background: var(--accent-muted);
  color: var(--text-primary);
  transform: translateX(3px);
}
.ctx-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--border);
}
.markdown-body, input, textarea, [contenteditable] { user-select: none; }

.sel-popup {
  position: fixed; z-index: 2147483646;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  padding: 5px;
  background: rgba(20, 6, 36, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,24,250,0.1);
  opacity: 0; pointer-events: none;
  transform: translateX(-50%) translateY(6px) scale(0.92);
  transition: opacity 0.2s cubic-bezier(0.22,1,0.36,1),
              transform 0.25s cubic-bezier(0.22,1,0.36,1);
}
.sel-popup.visible {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}
.sel-popup button {
  background: none; border: none;
  color: var(--text-secondary);
  font: 500 11px/1 var(--font-sans);
  padding: 5px 8px;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  opacity: 0; transform: translateY(4px);
}
.sel-popup.visible button {
  opacity: 1; transform: translateY(0);
  transition: background 0.12s, color 0.12s, opacity 0.2s cubic-bezier(0.22,1,0.36,1), transform 0.2s cubic-bezier(0.22,1,0.36,1);
}
.sel-popup.visible button:nth-child(1) { transition-delay: 0.02s; }
.sel-popup.visible button:nth-child(2) { transition-delay: 0.04s; }
.sel-popup.visible button:nth-child(3) { transition-delay: 0.06s; }
.sel-popup.visible button:nth-child(4) { transition-delay: 0.08s; }
.sel-popup.visible button:nth-child(5) { transition-delay: 0.10s; }
.sel-popup.visible button:nth-child(6) { transition-delay: 0.12s; }
.sel-popup button:hover {
  background: var(--accent-muted);
  color: var(--text-primary);
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--accent), #6a0dad); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }

.mobile-only { display: none !important; }

canvas#particles {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}

.stars-overlay {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1; overflow: hidden; pointer-events: none;
}

.star {
  position: absolute;
  width: 3px; height: 3px;
  background: white;
  border-radius: 50%;
  animation: starTwinkle var(--dur, 3s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
.star.sm { width: 2px; height: 2px; }
.star.lg { width: 5px; height: 5px; box-shadow: 0 0 6px #fff, 0 0 12px var(--star); }

.star.md {
  width: 4px; height: 4px;
  background: var(--star);
  box-shadow: 0 0 4px var(--star-glow);
}

@keyframes starTwinkle {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.3; transform: scale(0.8); }
}

.sparkle {
  position: fixed; pointer-events: none;
  width: 6px; height: 6px;
  background: var(--star);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: sparkleFloat 4s ease-in-out infinite;
  opacity: 0; z-index: 0;
}
.sparkle:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; --sparkle-size: 6px; }
.sparkle:nth-child(2) { top: 75%; left: 85%; animation-delay: 1s; --sparkle-size: 4px; }
.sparkle:nth-child(3) { top: 40%; left: 92%; animation-delay: 2s; --sparkle-size: 8px; }
.sparkle:nth-child(4) { top: 85%; left: 20%; animation-delay: 0.5s; --sparkle-size: 5px; background: var(--teal); }
.sparkle:nth-child(5) { top: 20%; left: 75%; animation-delay: 1.5s; --sparkle-size: 7px; background: var(--accent2); }

@keyframes sparkleFloat {
  0% { opacity: 0; transform: translateY(0) scale(0) rotate(0deg); }
  20% { opacity: 0.6; transform: translateY(-15px) scale(1) rotate(45deg); }
  40% { opacity: 0.8; transform: translateY(-30px) scale(1.1) rotate(90deg); }
  60% { opacity: 0.4; transform: translateY(-45px) scale(0.8) rotate(135deg); }
  80% { opacity: 0.2; transform: translateY(-55px) scale(0.5) rotate(180deg); }
  100% { opacity: 0; transform: translateY(-70px) scale(0) rotate(225deg); }
}

.bg-orbs {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #0c0018 0%, #05000a 100%);
}

.orb {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.1;
  animation: orbFloat 25s infinite alternate ease-in-out;
}
.orb-1 { width: 55vw; height: 55vw; background: var(--accent); top: -20%; left: -10%; }
.orb-2 { width: 45vw; height: 45vw; background: #6a0dad; bottom: -10%; right: -10%; animation-delay: -7s; }
.orb-3 { width: 35vw; height: 35vw; background: var(--accent2); top: 30%; left: 40%; animation-delay: -14s; }

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8vw, 12vh) scale(1.15); }
}

#app { display: flex; flex-direction: column; min-height: 100vh; position: relative; z-index: 1; }
#app-body { display: flex; flex: 1; width: 100%; position: relative; }

#top-bar {
  height: var(--top-bar-height);
  background: rgba(8, 0, 14, 0.85);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 3rem;
  position: sticky; top: 0; width: 100%; z-index: 1000;
  animation: slideDown 0.5s ease-out;
}

.top-bar-left { display: flex; align-items: center; gap: 1.25rem; }

.logo {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-title); font-weight: 900;
  font-size: 1.3rem; letter-spacing: 0.02em;
  text-decoration: none; color: var(--text-primary);
}

.logo-gem {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  background: linear-gradient(135deg, rgba(201, 24, 250, 0.15), rgba(201, 24, 250, 0.04));
  border: 1px solid rgba(201, 24, 250, 0.15);
  border-radius: 10px;
  animation: gemPulse 3s ease-in-out infinite;
  transition: transform 0.3s ease;
}
.logo:hover .logo-gem { transform: scale(1.1) rotate(-5deg); }

@keyframes gemPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(201, 24, 250, 0.1); }
  50% { box-shadow: 0 0 20px rgba(201, 24, 250, 0.25); }
}

.logo-text {
  background: linear-gradient(90deg, #c918fa, #f472d0, #f0e6f0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.top-actions { display: flex; align-items: center; gap: 0.75rem; }

.nav-btn-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: 10px;
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; text-decoration: none;
  transition: var(--transition); border: 1px solid var(--border);
  font-family: var(--font-title);
}

.discord-link { color: var(--text-secondary); background: rgba(255,255,255,0.02); }
.discord-link:hover {
  color: #fff; background: #5865F2; border-color: #5865F2;
  box-shadow: 0 4px 12px rgba(88,101,242,0.35); transform: translateY(-2px);
}

.boutique-btn {
  color: #fff; background: linear-gradient(135deg, #c918fa, #6a0dad);
  border-color: var(--accent); box-shadow: 0 4px 12px rgba(201,24,250,0.3);
}
.boutique-btn:hover {
  background: linear-gradient(135deg, #d94dfa, #c918fa);
  box-shadow: 0 6px 20px rgba(201,24,250,0.5); transform: translateY(-2px);
}

.top-action-btn {
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  color: var(--text-secondary); width: 40px; height: 40px;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.top-action-btn:hover {
  background: var(--accent-muted); color: var(--accent);
  border-color: var(--accent); transform: translateY(-2px);
}

#sidebar {
  width: 280px; margin: 1.5rem;
  background: var(--bg-sidebar); backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  height: calc(100vh - var(--top-bar-height) - 3rem);
  position: sticky; top: calc(var(--top-bar-height) + 1.5rem);
  align-self: flex-start;
  display: flex; flex-direction: column;
  z-index: 900; transition: var(--transition); box-shadow: var(--shadow-md);
  animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.sidebar-header { padding: 1.5rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }

.sidebar-search { padding: 1.5rem 1.25rem 1.25rem; position: relative; }

.search-box {
  position: relative; display: flex; align-items: center;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.6rem 0.85rem; transition: var(--transition);
}
.search-box:focus-within {
  border-color: var(--accent); background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.search-icon { color: var(--text-muted); margin-right: 0.75rem; flex-shrink: 0; }
#search-input {
  background: none; border: none; color: var(--text-primary);
  font-family: inherit; font-size: 0.9rem; width: 100%; outline: none;
}
.search-kbd {
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  font-size: 0.7rem; padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--border); white-space: nowrap; margin-left: 0.5rem;
}

#search-results {
  position: absolute; top: 100%; left: 1.25rem; right: 1.25rem;
  background: var(--bg-elevated); backdrop-filter: var(--glass);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 1100;
  max-height: 400px; overflow-y: auto;
  display: none; padding: 0.5rem; margin-top: 8px;
}
#search-results.active { display: block; animation: fadeUp 0.2s ease-out; }

.search-result-item {
  display: block; padding: 0.85rem 1rem; text-decoration: none;
  color: var(--text-primary); border-radius: 8px;
  transition: var(--transition); border: 1px solid transparent; margin-bottom: 2px;
}
.search-result-item:hover { background: rgba(255,255,255,0.04); border-color: var(--border-hover); }
.search-result-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; display: block; }
.search-result-path { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

#nav-menu { flex: 1; overflow-y: auto; padding: 1rem; mask-image: linear-gradient(to bottom, transparent, black 2%, black 98%, transparent); }
.nav-loading { text-align: center; color: var(--text-muted); padding: 2rem; font-size: 0.9rem; }

.nav-section { margin-bottom: 2rem; }
.nav-section-title {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: 0.12em;
  margin-bottom: 0.75rem; padding-left: 0.75rem;
}

.nav-item {
  display: flex; align-items: center;
  padding: 0.7rem 1rem; color: var(--text-secondary);
  text-decoration: none; border-radius: 10px;
  font-size: 0.9rem; font-weight: 500;
  transition: var(--transition); margin-bottom: 3px;
  border: 1px solid transparent; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-muted); color: var(--accent);
  border-color: rgba(201,24,250,0.2); font-weight: 600;
  box-shadow: 0 0 12px rgba(201,24,250,0.08);
}

.nav-item-wrapper { position: relative; }
.nav-submenu {
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(0,0,0,0.15); margin-left: 0.5rem;
  border-left: 1px solid var(--border); border-radius: 0 0 0 12px;
}
.nav-item-wrapper.open > .nav-submenu { max-height: 2000px; margin-top: 2px; margin-bottom: 8px; }

.has-submenu { justify-content: space-between !important; }
.chevron { transition: transform 0.3s ease; opacity: 0.5; }
.nav-item-wrapper.open > .has-submenu .chevron { transform: rotate(180deg); opacity: 1; color: var(--accent); }

.sidebar-footer { padding: 1.5rem; border-top: 1px solid var(--border); background: rgba(0,0,0,0.2); }
.sidebar-footer p { font-size: 0.75rem; color: var(--text-muted); }

#sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); z-index: 950;
  opacity: 0; pointer-events: none; transition: var(--transition);
}
#sidebar-overlay.active { opacity: 1; pointer-events: auto; }

#main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; background: transparent; }

#global-banner {
  position: relative; width: 100%;
  background-size: cover; background-position: center center;
  background-repeat: no-repeat;
  display: flex; align-items: center; overflow: hidden;
  border-bottom: 1px solid rgba(201,24,250,0.05);
  min-height: 160px;
}
.global-banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,0,14,0.65) 0%, rgba(8,0,14,0.5) 50%, rgba(8,0,14,0.75) 100%);
  z-index: 1;
}
.global-banner-content {
  position: relative; width: 100%; max-width: 1100px;
  margin: 0 auto; padding: 3rem 3rem; z-index: 2;
  display: flex; align-items: center;
}

.banner-left { display: flex; align-items: center; gap: 1rem; }
#global-banner #breadcrumbs { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
#global-banner-title { font-family: var(--font-title); font-size: 1.75rem; font-weight: 900; color: #fff; line-height: 1.2; text-shadow: 0 2px 12px rgba(0,0,0,0.5); }

#content-render {
  flex: 1; padding: 3rem 4rem 6rem; max-width: 1100px;
  margin: 0 auto; width: 100%;
  animation: contentFade 0.5s ease-out;
}

@keyframes contentFade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.markdown-body { color: var(--text-secondary); font-size: 1rem; }

.markdown-body h1 {
  font-family: var(--font-title); font-size: 2.8rem; font-weight: 900;
  color: var(--text-primary); margin-bottom: 2rem;
  letter-spacing: -0.03em; line-height: 1.1;
  position: relative;
}
.markdown-body h1::after {
  content: ''; display: block; width: 60px; height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  margin-top: 1rem; border-radius: 3px;
  box-shadow: 0 0 15px var(--accent-glow);
}

.markdown-body h2 {
  font-family: var(--font-title); font-size: 1.7rem; font-weight: 800;
  color: var(--text-primary); margin: 3rem 0 1.2rem;
  letter-spacing: -0.02em; position: relative; padding-bottom: 12px;
}
.markdown-body h2::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  height: 3px; width: 50px; background: linear-gradient(90deg, var(--accent), var(--accent2));
  box-shadow: 0 0 10px var(--accent-glow); border-radius: 3px;
}

.markdown-body h3 {
  font-family: var(--font-title); font-size: 1.3rem; font-weight: 700;
  color: var(--accent2); margin: 2.2rem 0 1rem;
}
.markdown-body h4 { font-family: var(--font-title); font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 1.5rem 0 1rem; }

.markdown-body a {
  color: var(--accent2); text-decoration: none; font-weight: 600;
  transition: var(--transition);
  border-bottom: 1px solid rgba(244,114,208,0.3);
}
.markdown-body a:hover { color: #fff; border-bottom-color: var(--accent2); text-shadow: 0 0 8px var(--accent2-glow); }

.markdown-body p { margin-bottom: 1.4rem; line-height: 1.75; }
.markdown-body strong { color: var(--text-primary); font-weight: 600; }

.markdown-body ul, .markdown-body ol { margin-bottom: 1.4rem; padding-left: 1.5rem; }
.markdown-body li { margin-bottom: 0.5rem; }

.markdown-body blockquote {
  background: var(--bg-card); border-left: 4px solid var(--accent2);
  padding: 1.2rem 1.8rem; margin: 1.5rem 0;
  border-radius: 0 14px 14px 0; font-style: italic; color: var(--text-secondary);
}

.markdown-body pre {
  background: rgba(0,0,0,0.4); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.5rem; margin: 1.5rem 0;
  position: relative; overflow: hidden;
}
.markdown-body code { font-family: var(--font-mono); font-size: 0.9em; }
.markdown-body code:not(pre code) {
  background: var(--bg-card); color: var(--accent2);
  padding: 0.15rem 0.4rem; border-radius: 6px; border: 1px solid var(--border);
}

.markdown-body table {
  width: 100%; border-collapse: collapse; margin: 1.5rem 0;
  font-size: 0.95rem; background: rgba(24,10,40,0.4);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.markdown-body th {
  background: rgba(201,24,250,0.06); color: var(--text-primary);
  font-family: var(--font-title); font-weight: 700;
  text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em;
  padding: 1rem 1.25rem; text-align: left;
  border-bottom: 2px solid rgba(201,24,250,0.2);
}
.markdown-body td { padding: 1rem 1.25rem; color: var(--text-secondary); border-bottom: 1px solid var(--border); transition: var(--transition); }
.markdown-body tr:last-child td { border-bottom: none; }
.markdown-body tr:nth-child(even) { background: rgba(255,255,255,0.01); }
.markdown-body tr:hover td { background: rgba(201,24,250,0.02); color: var(--text-primary); }

.markdown-body img { border-radius: 12px; box-shadow: var(--shadow-md); max-width: 100%; }
.markdown-body hr {
  border: none; height: 1px; margin: 2rem 0;
  background: linear-gradient(90deg, transparent, rgba(201,24,250,0.15), transparent);
}

.content-loader { display: flex; justify-content: center; padding: 4rem 0; }

.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(201,24,250,0.08);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: contentFade 0.4s ease-out; }

.search-result-snippet { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; display: block; margin-top: 4px; }
.search-result-snippet mark { background: rgba(201,24,250,0.15); color: var(--accent2); font-weight: 600; border-radius: 2px; padding: 0 2px; }

.code-block-container { margin: 1.5rem 0; border: 1px solid var(--border); border-radius: 12px; background: rgba(8,0,14,0.5); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition); }
.code-block-container:hover { border-color: rgba(201,24,250,0.15); }
.code-block-header { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 1.25rem; background: rgba(0,0,0,0.25); border-bottom: 1px solid var(--border); }
.code-block-dots { display: flex; gap: 0.45rem; }
.code-block-dots .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.code-block-dots .dot.red { background: #ff5f56; }
.code-block-dots .dot.yellow { background: #ffbd2e; }
.code-block-dots .dot.green { background: #27c93f; }
.code-block-lang { font-size: 0.65rem; font-weight: 800; color: var(--text-muted); font-family: var(--font-title); letter-spacing: 0.1em; }
.code-block-container pre { margin: 0 !important; border: none !important; border-radius: 0 !important; background: transparent !important; padding: 1.25rem 1.5rem !important; }

.table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; margin: 1.5rem 0; }
.table-wrap table { margin: 0 !important; border: none !important; }

.error-container { text-align: center; padding: 4rem 2rem; }
.error-container h1 { font-size: 4rem; color: var(--accent); margin-bottom: 1rem; }
.error-container p { color: var(--text-muted); }
.error-container small { color: var(--text-muted); display: block; margin-top: 1rem; }

#fab-top {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), #6a0dad); color: white; border: none;
  border-radius: 16px; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
  box-shadow: 0 8px 32px var(--accent-glow); z-index: 800;
  transition: var(--transition);
  opacity: 0; pointer-events: none;
}
#fab-top.visible { opacity: 1; pointer-events: auto; }
#fab-top:hover { transform: translateY(-5px); box-shadow: 0 12px 40px var(--accent); }

#page-footer {
  padding: 2.5rem 4rem; border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15); margin-top: auto;
}
.footer-content {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-muted); font-size: 0.9rem;
}
.footer-links { display: flex; align-items: center; gap: 1.5rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; transition: var(--transition); }
.footer-links a:hover { color: var(--accent2); }
.footer-sep { opacity: 0.3; }

#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--star));
  z-index: 1001; width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--accent-glow);
}

.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1; transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

.markdown-body a.cta-btn { color: #fff; }
.markdown-body a::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 0; height: 1px;
  background: var(--accent2);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.markdown-body a:hover::after { width: 100%; }

.markdown-body tr {
  transition: transform 0.2s ease;
}
.markdown-body tr:hover {
  transform: scale(1.005);
}

.lightbox-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease-out;
  backdrop-filter: blur(8px);
}
.lightbox-overlay img {
  max-width: 90vw; max-height: 90vh;
  object-fit: contain; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: contentFade 0.25s ease-out;
}
.markdown-body img { cursor: zoom-in; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.markdown-body img:hover { transform: scale(1.02); box-shadow: 0 12px 40px rgba(0,0,0,0.6); }

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

@media (max-width: 1024px) {
  #sidebar {
    position: fixed !important; top: 0 !important; left: 0 !important;
    bottom: 0 !important; margin: 0 !important;
    height: 100vh !important; border-radius: 0 !important;
    width: 280px !important; transform: translateX(-100%);
    z-index: 2000 !important;
    background: rgba(8,0,14,0.98) !important;
    border: none !important; border-right: 1px solid rgba(201,24,250,0.08) !important;
    overflow-y: auto !important;
  }
  #sidebar.open { transform: translateX(0) !important; box-shadow: 20px 0 60px rgba(0,0,0,0.9) !important; }
  #main-content { margin-left: 0; }
  .mobile-only { display: block !important; }
  .sidebar-header.mobile-only { display: flex !important; padding: 2rem 1.5rem 0.5rem !important; }
  #top-bar { padding: 0 1rem; gap: 0.5rem; }
  .nav-btn-link span { display: none; }
  .nav-btn-link { padding: 0.5rem; gap: 0; font-size: 0; }
  .nav-btn-link svg { width: 18px; height: 18px; }
  .search-kbd { display: none; }
  #content-render { padding: 1.5rem 1rem 4rem; }
  #global-banner { min-height: 120px; }
  .global-banner-content { padding: 1.5rem 1.5rem; }
  #global-banner-title { font-size: 1.3rem; }
  .markdown-body h1 { font-size: 2rem; }
  .markdown-body h2 { font-size: 1.4rem; }
  .markdown-body h3 { font-size: 1.1rem; }
  .markdown-body table { font-size: 0.85rem; }
  .markdown-body th, .markdown-body td { padding: 0.75rem 0.85rem; }
  .bg-orbs { display: none; }
  .sparkle { display: none; }
  #page-footer { padding: 1.5rem; }
  .footer-content { flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (max-width: 480px) {
  #top-bar { padding: 0 0.75rem; }
  .logo-text { font-size: 1rem; }
  .logo-gem { width: 28px; height: 28px; font-size: 1rem; }
  .top-actions { gap: 0.4rem; }
  .nav-btn-link { padding: 0.4rem; }
  .nav-btn-link svg { width: 16px; height: 16px; }
  .top-action-btn { width: 34px; height: 34px; }
  #content-render { padding: 1rem 0.75rem 3rem; }
  #global-banner { min-height: 90px; }
  .global-banner-content { padding: 1rem; }
  #global-banner-title { font-size: 1.1rem; }
  #global-banner #breadcrumbs { font-size: 0.65rem; }
  .markdown-body h1 { font-size: 1.6rem; }
  .markdown-body h1::after { width: 40px; }
  .markdown-body h2 { font-size: 1.2rem; }
  .markdown-body { font-size: 0.92rem; }
  .markdown-body pre { padding: 1rem; }
  .code-block-container pre { padding: 0.75rem 1rem !important; }
  #page-footer { padding: 1rem; font-size: 0.8rem; }
  #fab-top { width: 44px; height: 44px; bottom: 1rem; right: 1rem; }
  .stars-overlay { opacity: 0.4; }
}
