/* ═══════════════════════════════════════════════════════════════════════════
   VexAI — Complete Site Stylesheet
   Dark theme · Purple-blue gradient accent · Mobile-first
   ═══════════════════════════════════════════════════════════════════════════
   Sections:
     1.  Custom Properties / Tokens
     2.  Reset & Base
     3.  Typography
     4.  Layout Utilities
     5.  Buttons
     6.  Navbar
     7-10. (Moved to landing.css)
     11. Tabs (shared)
     12. (Moved to landing.css)
     13. Footer (shared base)
     14. Docs — Sidebar
     15. Docs — Topbar (mobile)
     16. Docs — Content Area
     17. Docs — Card Grid (index)
     18. Docs — Tables
     19. Docs — Callout Boxes (.info-box etc + .alert pattern)
     20. Docs — Code Blocks & Copy Button
     21. Docs — Prev/Next Navigation
     22. Back-to-Top Button
     23. Animations & Transitions
     24. Prism.js Overrides
     25. Scrollbar & Selection
     26. Media Queries
     27. Print Styles
   ═══════════════════════════════════════════════════════════════════════════ */


/* ──────────────────────────────────────────────────────────────────────────
   1. Custom Properties / Tokens
   ────────────────────────────────────────────────────────────────────────── */

:root {
  /* Surfaces */
  --color-bg:           #0a0a0f;
  --color-card:         #12121a;
  --color-elevated:     #1a1a2e;
  --color-border:       #1e1e2e;
  --color-border-light: #2a2a3e;

  /* Text */
  --color-text:         #e2e2ef;
  --color-text-muted:   #8888a4;
  --color-text-dim:     #55556a;
  --color-white:        #ffffff;

  /* Accent */
  --color-purple:       #7c3aed;
  --color-blue:         #3b82f6;
  --gradient:           linear-gradient(135deg, #8b5cf6, #6366f1, #3b82f6);

  /* Semantic */
  --color-info:         #3b82f6;
  --color-warning:      #eab308;
  --color-success:      #22c55e;
  --color-danger:       #ef4444;

  /* Typography */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Source Code Pro', monospace;

  /* Layout */
  --sidebar-width:      280px;
  --navbar-height:      64px;
  --topbar-height:      56px;
  --content-max-width:  1060px;
  --container-max:      1200px;
  --container-padding:  1.5rem;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  /* Shadows */
  --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 30px rgba(124, 58, 237, 0.15);

  /* Transitions */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --transition:  0.25s var(--ease-out);
}


/* ──────────────────────────────────────────────────────────────────────────
   2. Reset & Base
   ────────────────────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--navbar-height) + 1rem);
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

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

a:hover {
  color: var(--color-purple);
}

ul, ol {
  list-style-position: inside;
}

strong {
  font-weight: 600;
  color: var(--color-white);
}


/* ──────────────────────────────────────────────────────────────────────────
   3. Typography
   ────────────────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  color: var(--color-white);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-elevated);
  color: var(--color-purple);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  word-break: break-word;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 0.85rem;
  border-radius: 0;
}

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


/* ──────────────────────────────────────────────────────────────────────────
   4. Layout Utilities
   ────────────────────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}


/* ──────────────────────────────────────────────────────────────────────────
   5. Buttons
   ────────────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient);
  color: var(--color-white);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.45);
  color: var(--color-white);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border-light);
}

.btn-secondary:hover {
  border-color: var(--color-purple);
  color: var(--color-white);
  background: rgba(124, 58, 237, 0.08);
}

.btn-lg {
  font-size: 1.1rem;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-lg);
}


/* ──────────────────────────────────────────────────────────────────────────
   6. Navbar (Landing)
   ────────────────────────────────────────────────────────────────────────── */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-height);
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.92);
  border-bottom-color: var(--color-border);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

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

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-white);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--color-white);
}

.nav-links {
  display: none;
  list-style: none;
  gap: 2rem;
}

.nav-links li {
  list-style: none;
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  border-radius: 1px;
  transition: width var(--transition);
}

.nav-links a:hover {
  color: var(--color-white);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Mobile nav open state */
.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem var(--container-padding);
  gap: 1rem;
}

.hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition);
}

.hamburger:hover {
  color: var(--color-white);
}


/* ──────────────────────────────────────────────────────────────────────────
   7-10. Landing Page Sections (Hero, Stats, Features, Skills, Quickstart)
   Moved to landing.css — only shared tab/code styles remain below
   ────────────────────────────────────────────────────────────────────────── */

/* Tabs — shared between landing page and docs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--color-border);
}

.tab {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color var(--transition);
}

.tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  border-radius: 1px 1px 0 0;
  transition: background var(--transition);
}

.tab:hover {
  color: var(--color-white);
}

.tab.active {
  color: var(--color-white);
}

.tab.active::after {
  background: var(--gradient);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.3s var(--ease-out);
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────────────────────────────────────────────────
   12-13. CTA Banner & Footer — moved to landing.css
   Shared footer base styles retained for potential docs use
   ────────────────────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 2rem;
}


/* ──────────────────────────────────────────────────────────────────────────
   14. Docs — Sidebar
   ────────────────────────────────────────────────────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

.docs-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 1200;
  background: var(--color-card);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease-out);
  display: flex;
  flex-direction: column;
}

.docs-sidebar.open {
  transform: translateX(0);
}

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

.sidebar-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  text-decoration: none;
}

.sidebar-logo:hover {
  color: var(--color-white);
}

.sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
}

.sidebar-close:hover {
  color: var(--color-white);
  background: var(--color-border-light);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-section {
  padding: 0.25rem 0;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  padding: 0.75rem 1.5rem 0.4rem;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.sidebar-section-title:hover {
  color: var(--color-text-muted);
}

/* Collapsible sidebar sections */
.sidebar-section.collapsed .sidebar-link {
  display: none;
}

.sidebar-link {
  display: block;
  padding: 0.45rem 1.5rem 0.45rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 450;
  color: var(--color-text-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}

.sidebar-link:hover {
  color: var(--color-white);
  background: linear-gradient(to right, rgba(124, 58, 237, 0.06), transparent);
  border-left-color: var(--color-border-light);
}

.sidebar-link.active {
  color: var(--color-white);
  background: linear-gradient(to right, rgba(124, 58, 237, 0.18), transparent);
  border-left-color: var(--color-purple);
  border-left-width: 3px;
  font-weight: 600;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}


/* ──────────────────────────────────────────────────────────────────────────
   15. Docs — Topbar (mobile)
   ────────────────────────────────────────────────────────────────────────── */

.docs-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  height: var(--topbar-height);
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1rem;
}

.sidebar-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all var(--transition);
}

.sidebar-toggle:hover span {
  background: var(--color-white);
}

.docs-topbar-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-white);
  text-decoration: none;
}

.docs-topbar-logo:hover {
  color: var(--color-white);
}

.docs-topbar-section {
  color: var(--color-text-dim);
  font-size: 0.85rem;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ──────────────────────────────────────────────────────────────────────────
   16. Docs — Content Area
   ────────────────────────────────────────────────────────────────────────── */

.docs-page .docs-content {
  padding-top: calc(var(--topbar-height) + 2rem);
  padding-bottom: 4rem;
  min-height: 100vh;
}

.docs-content-inner {
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
  overflow-x: hidden;
}

.docs-content-inner h1 {
  margin-bottom: 0.75rem;
}

.docs-lead {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 780px;
}

.docs-section {
  margin-top: 3rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.docs-section h2 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-top: 0;
}

/* Lists in docs content */
.docs-content ul,
.docs-content ol {
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

.docs-content li {
  margin-bottom: 0.35rem;
  color: var(--color-text);
  line-height: 1.7;
}

.docs-content li::marker {
  color: var(--color-text-dim);
}


/* ──────────────────────────────────────────────────────────────────────────
   17. Docs — Card Grid (index)
   ────────────────────────────────────────────────────────────────────────── */

.docs-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 3rem;
}

.docs-card {
  display: block;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-decoration: none;
  transition: all var(--transition);
}

.docs-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-light);
  box-shadow: var(--shadow-glow), var(--shadow-md);
  color: var(--color-text);
}

.docs-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.docs-card h3 {
  color: var(--color-white);
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

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


/* ──────────────────────────────────────────────────────────────────────────
   18. Docs — Tables
   ────────────────────────────────────────────────────────────────────────── */

/* Both .docs-table-wrapper and .table-responsive serve as scroll containers */
.docs-table-wrapper,
.table-responsive {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

/* Tables inside wrappers: wrapper handles scroll, table handles visuals */
.docs-table-wrapper > .docs-table,
.table-responsive > .docs-table {
  margin-bottom: 0;
}

.docs-table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  table-layout: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-card);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.docs-table thead {
  background: var(--color-elevated);
  position: sticky;
  top: 0;
  z-index: 1;
}

.docs-table th {
  text-align: left;
  padding: 0.8rem 1.1rem;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.docs-table td {
  padding: 0.7rem 1.1rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  word-break: break-word;
}

/* Keep code-only cells and short columns compact */
.docs-table th,
.docs-table td:has(> code:only-child) {
  white-space: nowrap;
}

/* Last column (usually description) always wraps */
.docs-table td:last-child {
  white-space: normal;
  min-width: 180px;
}

.docs-table tbody tr:nth-child(even) {
  background: rgba(26, 26, 46, 0.3);
}

.docs-table tbody tr:last-child td {
  border-bottom: none;
}

.docs-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.05);
}

.docs-table code {
  font-size: 0.8rem;
  background: rgba(124, 58, 237, 0.1);
}


/* ──────────────────────────────────────────────────────────────────────────
   19. Docs — Callout Boxes (.info-box etc + .alert pattern)
   ────────────────────────────────────────────────────────────────────────── */

/* Shared callout base — covers .info-box, .warning-box, .tip-box, .danger-box */
.info-box,
.warning-box,
.tip-box,
.danger-box {
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-left: 4px solid;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--color-card);
  font-size: 0.925rem;
  line-height: 1.7;
}

.info-box    { border-left-color: var(--color-info); }
.warning-box { border-left-color: var(--color-warning); }
.tip-box     { border-left-color: var(--color-success); }
.danger-box  { border-left-color: var(--color-danger); }

.info-box strong    { color: var(--color-info); }
.warning-box strong { color: var(--color-warning); }
.tip-box strong     { color: var(--color-success); }
.danger-box strong  { color: var(--color-danger); }

.info-box p,
.warning-box p,
.tip-box p,
.danger-box p {
  margin-bottom: 0;
}

/* Alert pattern — covers .alert.alert-info, .alert.alert-warning, etc. */
.alert {
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border-left: 4px solid var(--color-border-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--color-card);
  font-size: 0.925rem;
  line-height: 1.7;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.alert p {
  margin-bottom: 0;
}

.alert p + p {
  margin-top: 0.5rem;
}

.alert-info    { border-left-color: var(--color-info); }
.alert-warning { border-left-color: var(--color-warning); }
.alert-tip     { border-left-color: var(--color-success); }
.alert-danger  { border-left-color: var(--color-danger); }

.alert-info .alert-title    { color: var(--color-info); }
.alert-warning .alert-title { color: var(--color-warning); }
.alert-tip .alert-title     { color: var(--color-success); }
.alert-danger .alert-title  { color: var(--color-danger); }


/* ──────────────────────────────────────────────────────────────────────────
   20. Docs — Code Blocks & Copy Button
   ────────────────────────────────────────────────────────────────────────── */

pre {
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-purple);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.85rem;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
  tab-size: 2;
  max-width: 100%;
}

/* Dynamic wrapper added by JS */
.code-wrapper {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-dim);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: all var(--transition);
}

.code-wrapper:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--color-white);
  border-color: var(--color-border-light);
  background: var(--color-elevated);
}

.copy-btn.copied {
  color: var(--color-success);
  border-color: var(--color-success);
  opacity: 1;
}


/* ──────────────────────────────────────────────────────────────────────────
   21. Docs — Prev/Next Navigation
   ────────────────────────────────────────────────────────────────────────── */

.docs-nav-footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.docs-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition);
}

.docs-nav-link:hover {
  border-color: var(--color-border-light);
  background: var(--color-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
}

.docs-nav-link .label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-nav-link .title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-white);
}

.docs-nav-link.prev {
  align-items: flex-start;
}

.docs-nav-link.next {
  align-items: flex-end;
  text-align: right;
}


/* ──────────────────────────────────────────────────────────────────────────
   22. Back-to-Top Button
   ────────────────────────────────────────────────────────────────────────── */

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}

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

.back-to-top:hover {
  color: var(--color-white);
  border-color: var(--color-purple);
  background: var(--color-card);
}


/* ──────────────────────────────────────────────────────────────────────────
   23. Animations & Transitions
   ────────────────────────────────────────────────────────────────────────── */

/* Scroll-triggered fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

/* Staggered entrance for card grids */
.docs-card-grid .fade-in:nth-child(1) { transition-delay: 0ms; }
.docs-card-grid .fade-in:nth-child(2) { transition-delay: 50ms; }
.docs-card-grid .fade-in:nth-child(3) { transition-delay: 100ms; }
.docs-card-grid .fade-in:nth-child(4) { transition-delay: 150ms; }
.docs-card-grid .fade-in:nth-child(5) { transition-delay: 200ms; }
.docs-card-grid .fade-in:nth-child(6) { transition-delay: 250ms; }
.docs-card-grid .fade-in:nth-child(7) { transition-delay: 300ms; }
.docs-card-grid .fade-in:nth-child(8) { transition-delay: 350ms; }
.docs-card-grid .fade-in:nth-child(9) { transition-delay: 400ms; }
.docs-card-grid .fade-in:nth-child(10) { transition-delay: 450ms; }
.docs-card-grid .fade-in:nth-child(11) { transition-delay: 500ms; }
.docs-card-grid .fade-in:nth-child(12) { transition-delay: 550ms; }
.docs-card-grid .fade-in:nth-child(13) { transition-delay: 600ms; }


/* ──────────────────────────────────────────────────────────────────────────
   24. Prism.js Overrides
   ────────────────────────────────────────────────────────────────────────── */

/* Override Prism's Tomorrow theme to match our dark theme */
code[class*="language-"],
pre[class*="language-"] {
  color: var(--color-text);
  text-shadow: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
}

pre[class*="language-"] {
  background: var(--color-elevated);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-purple);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

:not(pre) > code[class*="language-"] {
  background: var(--color-elevated);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Token colors */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: var(--color-text-dim);
}

.token.punctuation {
  color: var(--color-text-muted);
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #f87171;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #a5f3a3;
}

.token.operator,
.token.entity,
.token.url {
  color: var(--color-text);
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #93c5fd;
}

.token.function,
.token.class-name {
  color: #c4b5fd;
}

.token.regex,
.token.important,
.token.variable {
  color: #fde68a;
}


/* ──────────────────────────────────────────────────────────────────────────
   25. Scrollbar & Selection
   ────────────────────────────────────────────────────────────────────────── */

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-light);
  border-radius: 4px;
}

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

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-light) var(--color-bg);
}

/* Selection */
::selection {
  background: rgba(124, 58, 237, 0.35);
  color: var(--color-white);
}

::-moz-selection {
  background: rgba(124, 58, 237, 0.35);
  color: var(--color-white);
}


/* ──────────────────────────────────────────────────────────────────────────
   26. Media Queries
   ────────────────────────────────────────────────────────────────────────── */

/* ── Small screens (≥ 480px) ── */
@media (min-width: 480px) {
  .docs-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Table padding reduction for narrow viewports */
@media (max-width: 767px) {
  .docs-table th,
  .docs-table td {
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
  }

  .docs-table code {
    font-size: 0.72rem;
  }
}

/* ── Medium screens (≥ 768px) ── */
@media (min-width: 768px) {
  .docs-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .docs-nav-footer {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Large screens (≥ 1024px) — sidebar always visible ── */
@media (min-width: 1024px) {
  /* Landing nav */
  .nav-links {
    display: flex;
    align-items: center;
  }

  .hamburger {
    display: none;
  }

  /* Docs sidebar: always visible */
  .docs-sidebar {
    transform: translateX(0);
  }

  .sidebar-close {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }

  /* Docs topbar: hide on desktop */
  .docs-topbar {
    display: none;
  }

  /* Docs content: offset by sidebar */
  .docs-page .docs-content {
    margin-left: var(--sidebar-width);
    padding-top: 3rem;
  }

  /* Docs card grid: 3 columns */
  .docs-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Extra-large screens (≥ 1280px) ── */
@media (min-width: 1280px) {
  :root {
    --container-padding: 2rem;
  }
}


/* ──────────────────────────────────────────────────────────────────────────
   27. Print Styles
   ────────────────────────────────────────────────────────────────────────── */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .navbar,
  .docs-topbar,
  .docs-sidebar,
  .sidebar-overlay,
  .back-to-top,
  .copy-btn,
  .hamburger,
  .tabs,
  .sidebar-toggle {
    display: none !important;
  }

  .docs-page .docs-content {
    margin-left: 0 !important;
    padding-top: 0 !important;
  }

  .docs-content-inner {
    max-width: 100%;
  }

  a {
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
  }

  pre {
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  .gradient-text {
    -webkit-text-fill-color: initial !important;
    background: none !important;
    color: #000 !important;
  }

  .fade-in {
    opacity: 1 !important;
    transform: none !important;
  }
}
