/* VectoUI Site - Core Premium CSS */

:root {
  --bg-color: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.7);
  --text-color: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --accent: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.2);
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(15, 23, 42, 0.6);
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Background glow grid */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 800px;
  background: radial-gradient(circle at 10% 20%, var(--primary-glow) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, var(--accent-glow) 0%, transparent 50%);
  pointer-events: none;
  z-index: -2;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  padding: 0.75rem 0;
}

/* Three-zone grid: logo | search | nav */
.nav-container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

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

.nav-logo-text {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

/* Search trigger pill */
.nav-search-trigger {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 0.45rem 0.875rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.nav-search-trigger:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.nav-search-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.55;
}

.nav-search-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-search-kbd {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Right nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-shrink: 0;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

.nav-link-active {
  color: var(--accent) !important;
}

.nav-github-link {
  display: flex;
  align-items: center;
  color: var(--text-muted) !important;
}

.nav-github-link:hover {
  color: var(--text-color) !important;
}

.nav-github-icon {
  width: 20px;
  height: 20px;
}

/* Search modal overlay */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}

.search-modal[hidden] {
  display: none;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.search-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 1.5rem;
  background: #0e1525;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.1),
    0 24px 80px rgba(0, 0, 0, 0.65);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.search-field-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.5;
}

.search-field-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-color);
  font-size: 1rem;
  font-family: var(--font-body);
  caret-color: var(--accent);
}

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

.search-field-esc {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-body {
  padding: 1rem 1.25rem;
  min-height: 96px;
  max-height: 420px;
  overflow-y: auto;
}

.search-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.25rem 0;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.875rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.12s ease;
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.search-result-active {
  background: rgba(99, 102, 241, 0.12);
}

.search-result-section {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.search-result-title {
  font-size: 0.925rem;
  color: var(--text-color);
}

/* Heading sub-result: visually indented */
.search-result-heading .search-result-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 0.25rem;
}

.search-result-hash {
  color: var(--primary);
  margin-right: 0.2em;
  font-size: 0.85em;
}

/* Keyword highlight inside search results */
.search-result-title mark {
  background: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
  border-radius: 2px;
  padding: 0 0.1em;
}

/* Hero Section */
.hero-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88vh;
  padding: 4rem 0;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  background: radial-gradient(900px 520px at 78% 22%, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(760px 520px at 16% 78%, rgba(99, 102, 241, 0.1), transparent 60%),
    radial-gradient(1200px 800px at 50% 50%, #070b16 0%, #05070f 70%);
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 2rem;
  pointer-events: none; /* Let pointer events pass to canvas behind for interaction */
}

.hero-content * {
  pointer-events: auto; /* Re-enable pointer events on buttons and texts */
}

.badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 99px;
  color: #a5b4fc;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-title {
  font-family: var(--font-title);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: -1.5px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Features Section */
.features-section {
  padding: 8rem 0;
}

.section-title {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4rem;
  color: #fff;
  letter-spacing: -0.5px;
}

/* Balanced 2×2 grid (collapses to one column on narrow screens). A 4-card set
   in an auto-fit grid wrapped to an awkward 3 + 1; a fixed 2-column track keeps
   the rows even and gives each card's paragraph room to breathe. */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
}

.feature-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.25rem;
  overflow: hidden;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

/* A thin accent line along the top edge, revealed on hover. */
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: rgba(91, 156, 255, 0.45);
  box-shadow: 0 12px 36px rgba(37, 99, 235, 0.12);
}

.feature-card:hover::before {
  opacity: 1;
}

/* Icon as a contained rounded badge instead of a bare oversized emoji. */
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
  border-radius: 14px;
  background: rgba(91, 156, 255, 0.1);
  border: 1px solid rgba(91, 156, 255, 0.2);
}

.feature-card h3 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.75rem;
}

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

/* Section subtitle (muted one-liner below a section title) */
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: -2.5rem;
  margin-bottom: 3rem;
}

/* Four-column features grid for the expanded 8-card layout */
.features-grid.wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .features-grid.wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Use cases section */
.usecases-section {
  padding: 6rem 0;
  border-top: 1px solid var(--border-color);
}

.usecases-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.usecase-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  transition: border-color 0.25s ease;
}

.usecase-tile:hover {
  border-color: rgba(91, 156, 255, 0.3);
}

.usecase-label {
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.45rem;
}

.usecase-tile h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.4rem;
}

.usecase-tile p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .usecases-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .usecases-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.footer {
  background: #06090f;
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: 8rem;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Visually-hidden but accessible (SEO / no-JS / screen-reader fallback). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Docs Layout — /learn/* and /reference/*
   ============================================================ */

:root {
  --navbar-h: 56px;
  --sidebar-w: 240px;
  --toc-w: 210px;
}

/* Main 3-column grid */
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  grid-template-rows: 1fr;
  min-height: calc(100vh - var(--navbar-h));
  max-width: 1440px;
  margin: 0 auto;
}

/* ---- Left Sidebar ---- */
.docs-sidebar {
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
  padding: 2rem 0 2rem 1.5rem;
  border-right: 1px solid var(--border-color);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-group-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.5rem 0.6rem;
}

.sidebar-link {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 450;
  color: var(--text-muted);
  text-decoration: none;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.sidebar-link:hover {
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
  font-weight: 600;
}

/* ---- Main Article ---- */
.docs-content {
  min-width: 0; /* prevent grid blowout */
  padding: 3rem 3.5rem;
  max-width: 860px;
}

/* ---- Right TOC ---- */
.docs-toc {
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
  padding: 2.5rem 1rem 2rem 1.5rem;
  border-left: 1px solid var(--border-color);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.toc-link {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.5;
  padding: 0.2rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.625rem;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.toc-link:hover {
  color: var(--text-color);
}

.toc-link.toc-active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-depth-3 {
  padding-left: 1.25rem;
  font-size: 0.78rem;
}

/* ============================================================
   Prose / Markdown article typography
   ============================================================ */

.prose {
  color: var(--text-color);
  font-size: 0.975rem;
  line-height: 1.75;
}

.prose h1 {
  font-family: var(--font-title);
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.prose h2 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.3;
}

.prose h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose h4 {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.prose p {
  margin-bottom: 1.1rem;
  color: var(--text-muted);
}

.prose strong {
  color: var(--text-color);
  font-weight: 600;
}

.prose em {
  color: #cbd5e1;
  font-style: italic;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(56, 189, 248, 0.4);
  transition: text-decoration-color 0.15s;
}

.prose a:hover {
  text-decoration-color: var(--accent);
}

/* Inline code */
.prose :not(pre) > code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a5f3fc;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Fenced code blocks (Shiki output) */
.prose pre.astro-code {
  position: relative;
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.865rem;
  line-height: 1.7;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* Code copy button */
.code-block-wrapper {
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
  z-index: 2;
}

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

.code-copy-btn.copied {
  color: #10b981;
  border-color: #10b981;
  opacity: 1;
}

/* Language badge on code blocks */
.code-lang-badge {
  position: absolute;
  top: 0.55rem;
  left: 1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #4b5563;
  pointer-events: none;
  user-select: none;
}

/* Back-to-top button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(8px);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}

.back-to-top:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
}

/* Smooth in-page scroll; offset anchors below sticky navbar */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--navbar-h) + 1rem);
}

/* Heading anchor links */
.prose h2 .heading-anchor,
.prose h3 .heading-anchor {
  display: inline-block;
  margin-left: 0.45em;
  opacity: 0;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8em;
  vertical-align: middle;
  transition: opacity 0.15s;
}

.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor {
  opacity: 1;
}

.prose pre.astro-code code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Blockquote */
.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.875rem 1.25rem;
  border-left: 3px solid var(--primary);
  background: rgba(99, 102, 241, 0.06);
  border-radius: 0 8px 8px 0;
  color: #94a3b8;
  font-style: italic;
}

.prose blockquote p {
  margin: 0;
  color: #94a3b8;
}

.prose blockquote strong {
  color: #c7d2fe;
}

/* Lists */
.prose ul,
.prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.1rem;
}

.prose li {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.prose li strong {
  color: var(--text-color);
}

.prose li > code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875em;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a5f3fc;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Horizontal rule */
.prose hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

/* Figures and diagrams */
.prose figure {
  margin: 2rem 0;
}

.prose figure .diagram {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #0a0e1a;
  display: block;
}

.prose figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: #64748b;
  text-align: center;
  font-style: italic;
}

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.prose thead {
  background: rgba(255, 255, 255, 0.05);
}

.prose th {
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prose td {
  padding: 0.6rem 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

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

.prose tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.prose td code,
.prose th code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a5f3fc;
  padding: 0.12em 0.38em;
  border-radius: 4px;
}

/* ============================================================
   Interactive sandbox iframes
   ============================================================ */

.prose figure.sandbox {
  margin: 2rem 0;
}

.sandbox-frame {
  width: 100%;
  height: 380px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #0a0e1a;
  display: block;
  overflow: hidden;
}

.sandbox-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}

.sandbox-bar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.sandbox-bar .sandbox-label {
  font-size: 0.75rem;
  color: #475569;
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
}

.prose figure.sandbox .sandbox-frame {
  border-radius: 0 0 12px 12px;
}

@media (max-width: 640px) {
  .sandbox-frame {
    height: 300px;
  }
}

/* ============================================================
   Docs pagination (prev / next)
   ============================================================ */

.docs-pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
}

.docs-pagination-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.875rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  max-width: 46%;
}

.docs-pagination-link:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.06);
}

.docs-pagination-next {
  margin-left: auto;
  text-align: right;
}

.pagination-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.03em;
}

.pagination-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
}

/* ============================================================
   Responsiveness
   ============================================================ */

/* ============================================================
   Mobile sidebar drawer
   ============================================================ */

/* Strip shown above docs content on mobile */
.docs-mobile-strip {
  display: none;
}

/* Drawer backdrop */
.docs-drawer-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .docs-mobile-strip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(11, 15, 25, 0.95);
    position: sticky;
    top: var(--navbar-h);
    z-index: 50;
  }

  .docs-mobile-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .docs-mobile-menu-btn svg {
    width: 16px;
    height: 16px;
  }

  .docs-mobile-current {
    font-size: 0.82rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Sidebar becomes a slide-in drawer */
  .docs-sidebar {
    display: block !important; /* override the hide */
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    width: min(280px, 85vw);
    height: calc(100dvh - var(--navbar-h));
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    background: #0b0f19;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.25rem 0;
  }

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

  /* Backdrop */
  .docs-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s;
  }

  .docs-drawer-backdrop.drawer-open {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ============================================================
   Responsiveness
   ============================================================ */

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.75rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .features-section {
    padding: 5rem 0;
  }
  .nav-container {
    gap: 0.75rem;
  }
  /* Compact search on mobile: icon only */
  .nav-search-label,
  .nav-search-kbd {
    display: none;
  }
  /* Hide text links, keep GitHub icon */
  .nav-links a:not(.nav-github-link) {
    display: none;
  }
  .footer-container {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  /* Docs: single-column on mobile */
  .docs-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .docs-toc {
    display: none;
  }
  .docs-content {
    padding: 2rem 1.25rem;
  }
}

/* Tablet: two-column (sidebar + content, no TOC) */
@media (max-width: 1100px) and (min-width: 769px) {
  .docs-layout {
    grid-template-columns: var(--sidebar-w) 1fr;
  }
  .docs-toc {
    display: none;
  }
  .docs-content {
    padding: 2.5rem 2rem;
  }
}

/* Version chips in sidebar footer */
.sidebar-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 1rem 1rem 0.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.5rem;
}

.sidebar-version-chip {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 4px;
  padding: 0.2em 0.55em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Reading time chip below article title */
.reading-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: -0.5rem 0 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.reading-time::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='1.6'%3E%3Ccircle cx='10' cy='10' r='8'/%3E%3Cpolyline points='10,5 10,10 13,13' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* ── Callout boxes ──────────────────────────────────────────── */
.prose .callout {
  position: relative;
  margin: 1.5rem 0;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border-radius: 8px;
  border: 1px solid;
  font-style: normal;
}

.prose .callout::before {
  position: absolute;
  left: 0.85rem;
  top: 0.9rem;
  font-size: 0.95rem;
  line-height: 1;
}

.prose .callout p:first-child { margin-top: 0; }
.prose .callout p:last-child  { margin-bottom: 0; }

.prose .callout-note {
  background: rgba(56, 189, 248, 0.07);
  border-color: rgba(56, 189, 248, 0.25);
  color: #bae6fd;
}
.prose .callout-note::before { content: 'ℹ'; color: #38bdf8; }

.prose .callout-tip {
  background: rgba(16, 185, 129, 0.07);
  border-color: rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
}
.prose .callout-tip::before { content: '✦'; color: #10b981; }

.prose .callout-warning {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fde68a;
}
.prose .callout-warning::before { content: '⚠'; color: #f59e0b; }

.prose .callout-caution {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.prose .callout-caution::before {
  content: '!';
  font-weight: 800;
  color: #ef4444;
  font-size: 1.05rem;
}

.prose .callout-important {
  background: rgba(139, 92, 246, 0.07);
  border-color: rgba(139, 92, 246, 0.25);
  color: #ddd6fe;
}
.prose .callout-important::before { content: '★'; color: #8b5cf6; }

/* ── Reading progress bar ───────────────────────────────────── */
.reading-progress-bar {
  position: fixed;
  top: var(--navbar-h, 56px);
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 200;
  pointer-events: none;
  will-change: transform;
}

/* ── Table scroll wrapper ───────────────────────────────────── */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: 10px;
}

.table-scroll-wrapper .prose table {
  margin: 0;
}

/* ── Feedback widget ────────────────────────────────────────── */
.feedback-widget {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  flex-wrap: wrap;
}

.feedback-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  flex-shrink: 0;
}

.feedback-btns {
  display: flex;
  gap: 0.5rem;
}

.feedback-btn {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.feedback-yes:hover {
  border-color: #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.06);
}

.feedback-no:hover {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

/* ── Print styles ───────────────────────────────────────────── */
@media print {
  .navbar,
  .docs-sidebar,
  .docs-toc,
  .docs-mobile-strip,
  .docs-drawer-backdrop,
  .back-to-top,
  .reading-progress-bar,
  .feedback-widget,
  .docs-pagination,
  .nav-search-trigger,
  .search-modal {
    display: none !important;
  }

  .docs-layout {
    display: block;
  }

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

  .prose h2,
  .prose h3 {
    break-after: avoid;
  }

  .prose pre {
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #ccc;
  }

  .prose a::after {
    content: ' (' attr(href) ')';
    font-size: 0.75em;
    color: #666;
  }

  .prose a[href^="#"]::after {
    content: '';
  }
}

/* ── Prose <kbd> element ────────────────────────────────────── */
.prose kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8em;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-width: 2px;
  border-radius: 4px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  vertical-align: baseline;
  white-space: nowrap;
}

/* ── Prose <dl>/<dt>/<dd> (definition lists) ────────────────── */
.prose dl {
  margin: 1.5rem 0;
}

.prose dt {
  font-weight: 600;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9em;
  margin-top: 1rem;
}

.prose dt:first-child {
  margin-top: 0;
}

.prose dd {
  margin: 0.25rem 0 0.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.92em;
  line-height: 1.65;
}

/* ── Search snippet preview ─────────────────────────────────── */
.search-result-snippet {
  display: block;
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.4;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.search-result-snippet mark {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* ── Keyboard shortcuts modal ───────────────────────────────── */
.shortcuts-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.shortcuts-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.shortcuts-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0;
  width: min(380px, 90vw);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

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

.shortcuts-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
}

.shortcuts-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.shortcuts-close:hover { color: var(--text-color); }

.shortcuts-list {
  margin: 0;
  padding: 0.5rem 0;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1.25rem;
  gap: 1rem;
}

.shortcut-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.shortcut-row dt {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  font-family: inherit;
  font-weight: normal;
  color: inherit;
  font-size: inherit;
}

.shortcut-row dt kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-width: 2px;
  border-radius: 4px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.shortcut-row dd {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  text-align: right;
}
