/* ── Theme Definitions ────────────────────────────────── */
:root {
  --docs-sidebar-w: 260px;
  --docs-header-h: 60px;

  /* Dark Theme (Default) */
  --page-bg: #0f0e17;
  --page-text: #fffffe;
  --page-text-muted: rgba(255, 255, 255, 0.65);
  --header-bg: rgba(15, 14, 23, 0.9);
  --border-color: rgba(255, 255, 255, 0.07);
  --card-bg: rgba(255, 255, 255, 0.04);
  --sidebar-bg: rgba(255, 255, 255, 0.02);
  --code-bg: rgba(255, 255, 255, 0.04);
  --code-border: rgba(255, 255, 255, 0.08);
  --table-row-hover: rgba(255, 255, 255, 0.02);
  --nav-link-color: rgba(255, 255, 255, 0.6);
  --nav-link-active-bg: rgba(108, 99, 255, 0.12);
  --nav-link-active-text: #ffffff;
  --heading-color: #ffffff;
  --heading-sub-color: rgba(255, 255, 255, 0.9);
  --title-gradient-end: #a78bfa;

  /* Overrides for EaseMotion variables in dark mode */
  --ease-color-bg: #0f0e17;
  --ease-color-surface: #1e1b29;
  --ease-color-text: #fffffe;
  --ease-color-muted: rgba(255, 255, 255, 0.65);

  /* Circular Sweep Reveal View Transitions API variables */
  --theme-transition-duration: 0.6s;
  --theme-transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --clip-x: 50%;
  --clip-y: 50%;
}

[data-theme="light"] {
  /* Light Theme */
  --page-bg: #f8fafc;
  --page-text: #0f172a;
  --page-text-muted: #475569;
  --header-bg: rgba(248, 250, 252, 0.9);
  --border-color: rgba(15, 23, 42, 0.08);
  --card-bg: #ffffff;
  --sidebar-bg: rgba(15, 23, 42, 0.02);
  --code-bg: #f1f5f9;
  --code-border: #e2e8f0;
  --table-row-hover: rgba(15, 23, 42, 0.02);
  --nav-link-color: #475569;
  --nav-link-active-bg: rgba(108, 99, 255, 0.1);
  --nav-link-active-text: #6c63ff;
  --heading-color: #0f172a;
  --heading-sub-color: #1e293b;
  --title-gradient-end: #4f46e5;

  /* Overrides for EaseMotion variables in light mode */
  --ease-color-bg: #f8fafc;
  --ease-color-surface: #ffffff;
  --ease-color-text: #0f172a;
  --ease-color-muted: #475569;
}

/* Smooth Transitions for Theme Changes */
body,
.docs-header,
.docs-sidebar,
.docs-sidebar a,
.docs-content,
.docs-h1,
.docs-h2,
.docs-h3,
.docs-p,
.docs-code,
.docs-code pre,
.docs-table,
.docs-table th,
.docs-table td,
.docs-info {
  transition:
    background-color var(--ease-speed-medium) var(--ease-ease),
    background var(--ease-speed-medium) var(--ease-ease),
    border-color var(--ease-speed-medium) var(--ease-ease),
    color var(--ease-speed-medium) var(--ease-ease);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--page-bg);
  color: var(--page-text);
  overflow-x: hidden;
}

/* ── Header ───────────────────────────────────────────── */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--docs-header-h);
  z-index: 200;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 var(--ease-space-6);
  justify-content: space-between;
  gap: var(--ease-space-4);
}

.docs-logo {
  font-size: var(--ease-text-xl);
  font-weight: 800;
  background: linear-gradient(135deg, #6c63ff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.docs-header-links {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--ease-space-5);
  align-items: center;
  justify-content: flex-end;
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-header-links li {
  display: flex;
  align-items: center;
}

.docs-header-links a:not(.ease-btn) {
  color: var(--nav-link-color);
  font-size: var(--ease-text-sm);
  font-weight: 500;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: var(--ease-radius-md);
  transition:
    color 0.3s ease,
    background-color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
}

.docs-header-links a:not(.ease-btn):hover,
.docs-header-links a:not(.ease-btn).active {
  color: var(--nav-link-active-text);
  background: var(--nav-link-active-bg);
  box-shadow: 0 0 10px rgba(108, 99, 255, 0.2);
}

.docs-header-links a:not(.ease-btn)::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: #6c63ff;
  transition: width 0.3s ease;
  border-radius: 2px;
}

.docs-header-links a:not(.ease-btn):hover::after,
.docs-header-links a:not(.ease-btn).active::after {
  width: 60%;
}

[data-theme="light"] .docs-header-links a:not(.ease-btn):hover,
[data-theme="light"] .docs-header-links a:not(.ease-btn).active {
  background: rgba(108, 99, 255, 0.18);
  color: #4f46e5;
  box-shadow: 0 0 10px rgba(108, 99, 255, 0.1);
}

.docs-header-links a.ease-btn {
  color: #ffffff;
}

/* ── Theme Toggle Button ──────────────────────────────── */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--page-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ease-radius-full);
  position: relative;
  overflow: hidden;
  transition:
    background var(--ease-speed-fast) var(--ease-ease),
    color var(--ease-speed-fast) var(--ease-ease),
    border-color var(--ease-speed-fast) var(--ease-ease);
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--ease-color-primary);
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: rgba(15, 23, 42, 0.08);
}

.theme-toggle-btn svg {
  position: absolute;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s;
}

/* Sun Icon Default (Dark Mode active) */
.theme-toggle-btn .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Moon Icon Default (Dark Mode active) */
.theme-toggle-btn .moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

/* Active State Styles (Light Mode active) */
[data-theme="light"] .theme-toggle-btn .sun-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

[data-theme="light"] .theme-toggle-btn .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ── Layout Shell ─────────────────────────────────────── */
.docs-shell {
  display: flex;
  /* stylelint-disable declaration-block-no-duplicate-properties */
  min-height: 100vh;
  min-height: 100dvh;
  /* stylelint-enable declaration-block-no-duplicate-properties */

  /* FIX: Always offset by the real header height */
  padding-top: 60px;
}

/* * — Sidebar ————————————————————————————————————————————— */
.docs-sidebar {
  width: var(--docs-sidebar-w);
  position: fixed;
  top: 60px; /* FIX: Hard-coded so it never gets zeroed out by breakpoint vars */
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: var(--ease-space-8) var(--ease-space-5);
  border-right: 1px solid var(--border-color);
  background: var(--sidebar-bg);
  z-index: 100;

  /* Firefox Support */
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* Chrome, Safari, and New Edge Support */
.docs-sidebar::-webkit-scrollbar {
  width: 6px; /* Explicitly sets the width so custom styles apply */
}

.docs-sidebar::-webkit-scrollbar-track {
  background: transparent; /* Makes the track invisible and seamless */
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(
    --border-color
  ); /* Reuses their existing border color variable */
  border-radius: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(
    --sidebar-accent,
    #6366f1
  ); /* Brightens up slightly on hover if an accent variable exists, otherwise falls back to purple */
}

.sidebar-group {
  margin-bottom: var(--ease-space-6);
}

.sidebar-group-label {
  font-size: var(--ease-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ease-color-primary-light);
  margin-bottom: var(--ease-space-2);
  padding: 0 var(--ease-space-2);
  text-decoration: none;
}

a.sidebar-group-label:hover {
  color: var(--page-text);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav a {
  display: block;
  padding: var(--ease-space-2) var(--ease-space-2);
  font-size: var(--ease-text-sm);
  color: var(--nav-link-color);
  border-radius: var(--ease-radius-sm);
  text-decoration: none;
  transition:
    color var(--ease-speed-fast) var(--ease-ease),
    background var(--ease-speed-fast) var(--ease-ease);
}

.sidebar-nav a.active {
  color: var(--nav-link-active-text);
  background: var(--nav-link-active-bg);
  border-left: 3px solid #6c63ff;
  box-shadow: inset 20px 0 20px -20px rgba(108, 99, 255, 0.25);
}

/* ── Mobile Toggle Button ─────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1.4rem;
  color: var(--page-text);
  z-index: 200;
}

/* ── Content ──────────────────────────────────────────── */
.docs-content {
  margin-left: var(--docs-sidebar-w);
  flex: 1;
  padding: var(--ease-space-12) var(--ease-space-12);
  max-width: 860px;
  min-width: 0;
}

/* ── Section headings ─────────────────────────────────── */
.docs-section {
  margin-bottom: var(--ease-space-16);
  scroll-margin-top: 80px;
}

.docs-h3[id] {
  scroll-margin-top: 80px;
}

.docs-eyebrow {
  font-size: var(--ease-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ease-color-primary-light);
  margin-bottom: var(--ease-space-2);
}

.docs-h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(
    135deg,
    var(--heading-color),
    var(--title-gradient-end)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--ease-space-4);
}

.docs-h2 {
  font-size: var(--ease-text-2xl);
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: var(--ease-space-4);
  padding-bottom: var(--ease-space-3);
  border-bottom: 1px solid var(--border-color);
}

.docs-h3 {
  font-size: var(--ease-text-lg);
  font-weight: 600;
  color: var(--heading-sub-color);
  margin-bottom: var(--ease-space-3);
}

.docs-p {
  color: var(--page-text-muted);
  line-height: 1.75;
  margin-bottom: var(--ease-space-4);
}

/* ── Code Block ───────────────────────────────────────── */
.docs-code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--ease-radius-md);
  padding: var(--ease-space-5);
  margin-bottom: var(--ease-space-6);
  overflow-x: auto;
  position: relative;
}

.docs-code pre {
  background: none;
  color: var(--page-text);
  padding: 0;
  margin: 0;
  font-size: var(--ease-text-sm);
  line-height: 1.7;
  border-radius: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.docs-code-lang {
  position: absolute;
  top: var(--ease-space-3);
  right: var(--ease-space-4);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--page-text-muted);
  opacity: 0.5;
  font-family: var(--ease-font-mono);
  transition: opacity var(--ease-speed-fast) var(--ease-ease);
}

.docs-content code {
  background: rgba(108, 99, 255, 0.12);
  color: var(--ease-color-primary-light);
  border: 1px solid rgba(108, 99, 255, 0.2);
  padding: 0.1em 0.45em;
  border-radius: var(--ease-radius-sm);
  font-size: 0.87em;
}

.docs-code pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* ── Table ────────────────────────────────────────────── */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ease-text-sm);
  margin-bottom: var(--ease-space-8);
}

.docs-table th {
  text-align: left;
  padding: var(--ease-space-3) var(--ease-space-4);
  background: var(--code-bg);
  color: var(--page-text-muted);
  font-weight: 600;
  font-size: var(--ease-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border-color);
}

.docs-table td {
  padding: var(--ease-space-3) var(--ease-space-4);
  border-bottom: 1px solid var(--border-color);
  color: var(--page-text-muted);
}

.docs-table tr:hover td {
  background: var(--table-row-hover);
}

/* ── Info Box ─────────────────────────────────────────── */
.docs-info {
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.25);
  border-radius: var(--ease-radius-md);
  padding: var(--ease-space-4) var(--ease-space-5);
  color: var(--page-text-muted);
  font-size: var(--ease-text-sm);
  line-height: 1.7;
  margin-bottom: var(--ease-space-6);
  display: flex;
  gap: var(--ease-space-3);
}

.docs-info-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Divider ──────────────────────────────────────────── */
.docs-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--ease-space-10) 0;
}

/* ── Pill badge ───────────────────────────────────────── */
.docs-badge {
  display: inline-block;
  padding: 0.15em 0.65em;
  border-radius: var(--ease-radius-full);
  font-size: var(--ease-text-xs);
  font-weight: 700;
  background: rgba(108, 99, 255, 0.15);
  color: var(--ease-color-primary-light);
  border: 1px solid rgba(108, 99, 255, 0.25);
  margin-right: var(--ease-space-1);
}

/* ── Copy Button ──────────────────────────────────────── */
.docs-copy-btn {
  position: absolute;
  top: var(--ease-space-3);
  right: var(--ease-space-4);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 8px;
  border-radius: var(--ease-radius-sm);
  font-size: 11px;
  font-family: var(--ease-font-mono, monospace);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity var(--ease-speed-fast) var(--ease-ease),
    background var(--ease-speed-fast) var(--ease-ease),
    color var(--ease-speed-fast) var(--ease-ease);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.docs-code:hover .docs-code-lang {
  opacity: 0;
}

.docs-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ── Scroll to Top ────────────────────────────────────── */
.ease-scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity var(--ease-speed-medium) var(--ease-ease),
    transform var(--ease-speed-medium) var(--ease-ease-bounce),
    box-shadow var(--ease-speed-fast) var(--ease-ease),
    background var(--ease-speed-fast) var(--ease-ease);
  z-index: 300;
}

.ease-scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ease-scroll-top--primary {
  background: var(--ease-color-primary);
  color: #fff;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    0 0 10px rgba(108, 99, 255, 0.25);
}

.ease-scroll-top--primary:hover {
  background: var(--ease-color-primary-dark);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.25),
    0 0 14px rgba(108, 99, 255, 0.35);
  transform: translateY(-2px);
}

.ease-scroll-top--primary:active {
  transform: scale(0.96);
}

.ease-scroll-top__ring {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.ease-scroll-top__ring circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 2.5;
  stroke-dasharray: 126;
  stroke-dashoffset: 126;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.1s linear;
}

.ease-scroll-top__icon {
  width: 18px;
  height: 18px;
  transition: transform 0.22s var(--ease-ease-bounce);
}

.ease-scroll-top:hover .ease-scroll-top__icon {
  transform: translateY(-3px);
}

.ease-scroll-top:focus-visible {
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.45);
}

/* ── Hover / touch overrides ──────────────────────────── */
@media (hover: none), (pointer: coarse) {
  .docs-table tr:hover td {
    background: transparent;
  }

  .sidebar-nav a:hover:not(.active) {
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
  }
}

.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: none;
}

/* ── Tablet (≤ 900px) ─────────────────────────────────── */

/* FIX: REMOVED --docs-header-h: 0px — that was the root cause of the blank space.
   The header becomes sticky here, so padding-top on .docs-shell handles offset. */
@media (max-width: 900px) {
  .docs-header {
    position: sticky;
    top: 0;
    height: 60px;
    min-height: 60px;
    flex-wrap: nowrap;
    padding: 0 var(--ease-space-4);
  }

  /* Shell no longer needs padding-top because header is now in normal flow */
  .docs-shell {
    flex-direction: row;
    padding-top: 0;
  }

  /* Sidebar stays fixed at 60px from top of viewport */
  .docs-sidebar {
    top: 60px;
  }
}

/* ── Mobile (≤ 768px) ─────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar-toggle {
    display: block;
  }

  /* FIX: Sidebar slides off-screen by default; never participates in layout flow */
  .docs-sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
    background: var(--page-bg);
    border-right: 1px solid var(--border-color);
    padding: var(--ease-space-6) var(--ease-space-4);
  }

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

  /* FIX: No left margin on mobile — sidebar is overlaid, not beside content */
  .docs-content {
    margin-left: 0 !important;
    padding: var(--ease-space-6) var(--ease-space-4);
    width: 100%;
    max-width: 100%;
  }

  /* FIX: Shell uses padding-top equal to the sticky header height */
  .docs-shell {
    flex-direction: column;
    padding-top: 0; /* header is sticky so it's in normal flow */
  }

  .docs-header-links {
    display: none;
  }

  /* Overlay behind sidebar */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 60px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .sidebar-overlay.open {
    display: block;
  }
}

/* ── Small mobile (≤ 640px) ───────────────────────────── */
@media (max-width: 640px) {
  .docs-logo {
    font-size: var(--ease-text-lg);
  }

  .docs-h1 {
    font-size: 2rem;
  }

  .docs-code {
    padding: var(--ease-space-4);
  }

  .docs-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .docs-info {
    padding: var(--ease-space-4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ease-scroll-top {
    transition: opacity var(--ease-speed-fast) linear;
  }

  .ease-scroll-top__ring circle {
    transition: none;
  }
}

/* ── Brand Logo Styling ──────────────────────────────────── */

.docs-logo-img {
  height: 36px;
  width: auto;
  display: block;
  transition: filter var(--ease-speed-medium) var(--ease-ease);
}

/* In light theme, invert colors of the transparent SVG to maintain visibility */
[data-theme="light"] .docs-logo-img {
  filter: invert(0.9) hue-rotate(180deg) brightness(0.2) saturate(200%);
}

/* ── Circular Reveal Animations (View Transitions API) ── */
@keyframes clip-expand {
  from {
    clip-path: circle(0% at var(--clip-x) var(--clip-y));
  }

  to {
    clip-path: circle(150% at var(--clip-x) var(--clip-y));
  }
}

@keyframes clip-contract {
  from {
    clip-path: circle(150% at var(--clip-x) var(--clip-y));
  }

  to {
    clip-path: circle(0% at var(--clip-x) var(--clip-y));
  }
}

/* Deactivate default cross-fade animation */
::view-transition-image-pair(root) {
  isolation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
  display: block;
}

/* Sun Transition (Expanding Circle Reveal to Light Theme) */
html[data-transition-theme="light"]::view-transition-new(root) {
  animation-name: clip-expand;
  animation-duration: var(--theme-transition-duration);
  animation-timing-function: var(--theme-transition-easing);
  z-index: 2;
}

html[data-transition-theme="light"]::view-transition-old(root) {
  z-index: 1;
}

/* Moon Transition (Contracting Circle Reveal to Dark Theme) */
html[data-transition-theme="dark"]::view-transition-old(root) {
  animation-name: clip-contract;
  animation-duration: var(--theme-transition-duration);
  animation-timing-function: var(--theme-transition-easing);
  z-index: 2;
}

html[data-transition-theme="dark"]::view-transition-new(root) {
  z-index: 1;
}

/* Disable transitions during view transitions to avoid delay in snapshot capture */
html[data-transition-theme],
html[data-transition-theme] * {
  transition: none !important;
}

/* ── Standout Navigation Button ─────────────────────────── */
.docs-header-links a.ease-nav-button {
  display: inline-block;
  background-color: #6c63ff;
  color: #ffffff !important;
  padding: 8px 16px;
  border-radius: var(--ease-radius-md, 6px);
  font-weight: 500;
  text-decoration: none;
  font-size: var(--ease-text-sm, 14px);
  transition:
    background-color 0.2s ease,
    transform 0.1s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(108, 99, 255, 0.25);
  border: none;
  position: relative;
}

.docs-header-links a.ease-nav-button::after {
  display: none !important;
}

.docs-header-links a.ease-nav-button:hover {
  background-color: #5b54db;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
  color: #ffffff !important;
}

.docs-header-links a.ease-nav-button:active {
  transform: scale(0.95);
  background-color: #4a43c7;
}

/* Light mode overrides */
[data-theme="light"] .docs-header-links a.ease-nav-button {
  background-color: #4f46e5;
  color: #ffffff !important;
}

[data-theme="light"] .docs-header-links a.ease-nav-button:hover {
  background-color: #3b31c4;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* ── Improved Documentation Layout & Visual Hierarchy ── */
.docs-shell {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

body > .docs-shell {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.docs-header {
  max-width: 100%;
  padding: 0 2.5rem;
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.25);
}

.docs-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(108, 99, 255, 0.5) 30%,
    rgba(167, 139, 250, 0.5) 70%,
    transparent
  );
}

.docs-logo {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  transition: opacity 0.2s ease;
}
.docs-logo:hover {
  opacity: 0.85;
}

.docs-sidebar {
  padding: 2rem 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-group-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(108, 99, 255, 0.8);
  margin-bottom: 6px;
  padding: 0 0.5rem;
}

.sidebar-nav a {
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.84rem;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  background: rgba(108, 99, 255, 0.08);
  border-left-color: rgba(108, 99, 255, 0.4);
  color: rgba(255, 255, 255, 0.9);
  padding-left: 14px;
}

.sidebar-nav a.active {
  background: linear-gradient(
    90deg,
    rgba(108, 99, 255, 0.15),
    rgba(108, 99, 255, 0.05)
  );
  border-left: 2px solid #6c63ff;
  color: #ffffff;
  padding-left: 14px;
}

.docs-content {
  padding: 3rem 4rem 4rem 3.5rem;
  max-width: 820px;
}

.docs-h1 {
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  letter-spacing: -0.05em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.docs-h2 {
  font-size: 1.6rem;
  letter-spacing: -0.025em;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
}

.docs-h3 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
}

.docs-p {
  font-size: 0.9625rem;
  line-height: 1.8;
  max-width: 68ch;
  color: rgba(255, 255, 255, 0.62);
}

[data-theme="light"] .docs-p {
  color: #4b5563;
}

.docs-section {
  margin-bottom: 4.5rem;
  padding-bottom: 0.5rem;
  animation: section-in 0.4s ease both;
}

.docs-divider {
  margin: 3rem 0;
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(108, 99, 255, 0.3),
    rgba(255, 255, 255, 0.04),
    transparent
  );
}

.docs-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.docs-eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 2px;
  background: linear-gradient(90deg, #6c63ff, #a78bfa);
  border-radius: 2px;
}

.docs-info {
  background: linear-gradient(
    135deg,
    rgba(108, 99, 255, 0.07),
    rgba(108, 99, 255, 0.03)
  );
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.docs-code {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.docs-table {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.docs-table th {
  background: rgba(108, 99, 255, 0.06);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  padding: 0.7rem 1rem;
}

.docs-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}
.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-badge {
  font-size: 0.7rem;
  padding: 0.2em 0.7em;
  border-radius: 99px;
  letter-spacing: 0.04em;
}

#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.docs-header,
.docs-shell,
.ease-scroll-progress {
  position: relative;
  z-index: 1;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.hero-orb-1 {
  width: 400px;
  height: 400px;
  background: rgba(108, 99, 255, 0.12);
  top: -100px;
  right: -80px;
  animation: orb-drift 8s ease-in-out infinite alternate;
}

.hero-orb-2 {
  width: 300px;
  height: 300px;
  background: rgba(167, 139, 250, 0.08);
  top: 80px;
  left: -60px;
  animation: orb-drift 11s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(20px, 30px) scale(1.08);
  }
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="light"] .docs-code {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .docs-table {
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] #particle-canvas {
  opacity: 0.15;
}

[data-theme="light"] .hero-orb-1 {
  background: rgba(108, 99, 255, 0.07);
}

@media (max-width: 1100px) {
  .docs-content {
    padding: 2.5rem 2rem;
  }
}

@media (max-width: 900px) {
  .docs-content {
    padding: 2rem 1.25rem;
  }
  .docs-h1 {
    font-size: 2rem;
  }
  .docs-shell {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .docs-header {
    padding: 0 1rem;
  }
  .docs-h1 {
    font-size: 1.75rem;
  }
  .docs-p {
    max-width: 100%;
  }
}

/* ── Mobile Overflow Fixes ── */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ease-text-sm);
  margin-bottom: var(--ease-space-8);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--ease-space-3);
  z-index: 200;
}

@media (max-width: 900px) {
  .docs-header-links {
    gap: var(--ease-space-3);
  }

  .docs-header-links a:not(.ease-btn) {
    padding: 8px 12px;
    font-size: var(--ease-text-xs);
  }
}

.search-bar input {
  width: 100%;
  max-width: 300px;
}

@media (max-width: 768px) {
  .demo-nav-inner {
    flex-direction: column;
    gap: var(--ease-space-3);
    align-items: center;
  }

  .demo-nav-links {
    gap: var(--ease-space-3);
    flex-wrap: wrap;
    justify-content: center;
  }
}
