/* ===================== Design tokens ===================== */
:root {
  --bg: #0a0b10;
  --bg-soft: #0f1117;
  --surface: #14161f;
  --surface-2: #1a1d29;
  --surface-hover: #20232f;
  --border: #262a38;
  --border-soft: #1e212c;
  --text: #e8eaf2;
  --text-dim: #a7adc0;
  --text-mute: #6d7387;
  --accent: #8b7bff;
  --accent-2: #5eead4;
  --accent-warm: #ffb454;
  --accent-grad: linear-gradient(135deg, #8b7bff 0%, #6f8cff 50%, #5eead4 100%);
  --shadow-soft: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px rgba(139, 123, 255, 0.15), 0 8px 24px -8px rgba(139, 123, 255, 0.25);
  --border-hover: #343a4c;
  --body-grad-1: rgba(139, 123, 255, 0.10);
  --body-grad-2: rgba(94, 234, 212, 0.06);
  --badge-bg: rgba(139, 123, 255, 0.12);
  --badge-color: #b6acff;
  --badge-border: rgba(139, 123, 255, 0.25);
  --code-bg: #0d0e14;
  --code-text: #d7dae6;
  --hero-grad-top: #ffffff;
  --hero-grad-bottom: #b7bcd6;
  --header-bg: rgba(10, 11, 16, 0.72);
  --scrollbar-thumb-hover: #333849;
  --brand-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --brand-glow: 0 0 14px rgba(139, 123, 255, 0.55);
  --crack-glow: rgba(139, 123, 255, 0.55);
  --crack-glow-2: rgba(94, 234, 212, 0.45);
  --radius: 14px;
  --radius-sm: 9px;
  --content-gutter: 48px;
  --header-h: 68px;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  --bg: #f4f5fa;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef0f7;
  --surface-hover: #e5e8f2;
  --border: #e1e4ee;
  --border-soft: #ebedf4;
  --border-hover: #c7cbdb;
  --text: #14151f;
  --text-dim: #4b5163;
  --text-mute: #868c9e;
  --accent: #6d54f5;
  --accent-2: #0d9488;
  --accent-warm: #d97706;
  --accent-grad: linear-gradient(135deg, #6d54f5 0%, #4f6df5 50%, #0d9488 100%);
  --shadow-soft: 0 10px 30px -14px rgba(20, 21, 31, 0.18);
  --shadow-glow: 0 0 0 1px rgba(109, 84, 245, 0.16), 0 8px 20px -10px rgba(109, 84, 245, 0.25);
  --body-grad-1: rgba(109, 84, 245, 0.07);
  --body-grad-2: rgba(13, 148, 136, 0.05);
  --badge-bg: rgba(109, 84, 245, 0.10);
  --badge-color: #5943d6;
  --badge-border: rgba(109, 84, 245, 0.28);
  --code-bg: #f1f2f8;
  --code-text: #262a3b;
  --hero-grad-top: #14151f;
  --hero-grad-bottom: #4b5163;
  --header-bg: rgba(255, 255, 255, 0.72);
  --scrollbar-thumb-hover: #c2c6d4;
  --brand-shadow: 0 1px 2px rgba(20, 21, 31, 0.18);
  --brand-glow: 0 0 12px rgba(109, 84, 245, 0.4);
  --crack-glow: rgba(109, 84, 245, 0.35);
  --crack-glow-2: rgba(13, 148, 136, 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 15% -10%, var(--body-grad-1), transparent 60%),
              radial-gradient(1000px 500px at 100% 0%, var(--body-grad-2), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ===================== Home background crack ===================== */
.home-crack {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.home-crack svg { width: 100%; height: 100%; display: block; }

.home-crack .crack-main {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
  filter: drop-shadow(0 0 6px var(--crack-glow));
}
.home-crack .crack-branch {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.35;
  filter: drop-shadow(0 0 5px var(--crack-glow-2));
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

::selection { background: rgba(139, 123, 255, 0.35); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); background-clip: padding-box; }

/* ===================== Shell / centering ===================== */
.shell {
  width: 100%;
  padding: 0 var(--content-gutter);
  box-sizing: border-box;
}

@media (max-width: 1000px) {
  .shell { --content-gutter: 24px; }
}

@media (min-width: 1000px) {
  .shell {
    max-width: 80vw;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===================== Header / top nav ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
}

.brand-icon {
  height: 34px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-text {
  display: inline-flex;
  text-shadow: var(--brand-shadow);
  transition: text-shadow 0.2s ease;
}

.brand-repo { color: var(--text); }
.brand-db { color: #c2410c; }

.brand:hover .brand-text {
  text-shadow: var(--brand-shadow), var(--brand-glow);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.top-nav::-webkit-scrollbar { display: none; }

.top-nav-item {
  position: relative;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.top-nav-item:hover { color: var(--text); }

.top-nav-item.active {
  color: var(--text);
  background: var(--surface-2);
}

.top-nav-item.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -14px;
  height: 2px;
  background: var(--accent-grad);
  border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ===================== Mobile section nav (drawer) ===================== */
.nav-drawer { display: none; }

.nav-drawer-link {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
}
.nav-drawer-link:hover { color: var(--text); background: var(--surface-2); }
.nav-drawer-link.active { color: var(--text); background: var(--surface-2); }

.btn-subscribe {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-grad);
  color: #0a0b10;
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-subscribe:hover { filter: brightness(1.08); transform: translateY(-1px); }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-hover); }

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-hover); transform: translateY(-1px); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* ===================== Search ===================== */
.search-box {
  position: relative;
  width: 200px;
  flex-shrink: 0;
  transition: width 0.2s ease;
}
.search-box:focus-within { width: 320px; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-mute);
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 30px 8px 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.search-input::placeholder { color: var(--text-mute); }
.search-input:focus { border-color: var(--accent); background: var(--surface-2); }

.search-kbd {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-mute);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  background: var(--surface-2);
  pointer-events: none;
}
.search-input:focus ~ .search-kbd,
.search-input:not(:placeholder-shown) ~ .search-kbd { display: none; }

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 340px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  z-index: 70;
  display: none;
}
.search-results.open { display: block; }

.search-result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.search-result-item:hover,
.search-result-item.active { background: var(--surface-hover); }

.search-result-item .sr-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.search-result-item .sr-meta { font-size: 11.5px; color: var(--text-mute); }
.search-result-item .sr-excerpt {
  font-size: 12px;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty {
  padding: 18px 10px;
  font-size: 13px;
  color: var(--text-mute);
  text-align: center;
}

@media (max-width: 900px) {
  .search-box { display: none; }
  .top-nav { display: none; }
  .nav-drawer.open {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px var(--content-gutter) 14px;
    box-shadow: var(--shadow-soft);
    z-index: 55;
  }
}

/* ===================== Top nav dropdowns ===================== */
.nav-item-wrap { display: flex; }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 60;
}

.nav-item-wrap:hover .nav-dropdown,
.nav-item-wrap:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-desc {
  font-size: 12.5px;
  color: var(--text-mute);
  line-height: 1.5;
  padding: 0 8px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.nav-dropdown-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }

.nav-dropdown-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.nav-dropdown-link:hover { background: var(--surface-hover); }
.nav-dropdown-link .nd-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.nav-dropdown-link .nd-meta { font-size: 11.5px; color: var(--text-mute); }

.nd-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mute);
  opacity: 0.75;
  margin: 10px 0 2px 10px;
}
.nd-group-label:first-child { margin-top: 0; }

/* ===================== Layout: 3-pane doc view ===================== */
.layout {
  display: grid;
  grid-template-columns: 297px minmax(0, 1fr) 297px;
  gap: 40px;
  padding-top: 36px;
  padding-bottom: 96px;
  align-items: start;
}

.layout.no-right { grid-template-columns: 297px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  max-height: calc(100vh - var(--header-h) - 56px);
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 12px 4px;
}

.topic-list { display: flex; flex-direction: column; gap: 2px; }

.topic-group { margin-top: 14px; }
.topic-group:first-child { margin-top: 0; }

.topic-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 4px 12px 4px 4px;
  margin: 0 0 2px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mute);
  opacity: 0.75;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.topic-group-label:hover { opacity: 1; }
.topic-group-label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-group-chevron {
  font-size: 13px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.topic-group-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.topic-group.collapsed .topic-group-chevron { transform: rotate(0deg); }
.topic-group.collapsed .topic-group-items { display: none; }

.topic-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-dim);
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}

.topic-link:hover { color: var(--text); background: var(--surface); }

.topic-link.active {
  color: var(--text);
  background: var(--surface-2);
  border-left-color: var(--accent);
  font-weight: 600;
}

.toc-list { display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--border-soft); }

.toc-link {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 13px;
  color: var(--text-mute);
  transition: all 0.15s ease;
}

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

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

/* ===================== Article content ===================== */
.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--badge-bg);
  color: var(--badge-color);
  border: 1px solid var(--badge-border);
}

.dot { color: var(--text-mute); }
.meta-text { font-size: 13px; color: var(--text-mute); }

.article h1 {
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 800;
}

.article .lede {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.65;
  margin: 0 0 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-soft);
}

.article section { margin-bottom: 40px; scroll-margin-top: calc(var(--header-h) + 20px); }

.article h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 32px 0 14px;
  scroll-margin-top: calc(var(--header-h) + 20px);
  display: flex;
  align-items: center;
  gap: 10px;
}
.article h2:first-of-type { margin-top: 0; }

.article h2::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-grad);
  flex-shrink: 0;
}

.article p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-dim);
  margin: 0 0 16px;
}

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

.article a {
  color: var(--accent-2);
  background-image: linear-gradient(var(--accent-2), var(--accent-2));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  padding-bottom: 1px;
  transition: background-size 0.25s ease, color 0.2s ease;
}
.article a:hover {
  color: var(--text);
  background-size: 100% 1px;
}

.article code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--accent-2);
}

.code-block-wrapper {
  position: relative;
}

.article .mermaid {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 0 0 20px;
  overflow-x: auto;
  text-align: center;
}
.article .mermaid svg { max-width: 100%; }

.article pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 46px 18px 20px;
  overflow-x: auto;
  margin: 0 0 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.code-block-wrapper:hover .code-copy-btn,
.code-copy-btn:focus-visible {
  opacity: 1;
}
.code-copy-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
.code-copy-btn.copied {
  opacity: 1;
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.article pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--code-text);
  font-size: 13.5px;
  line-height: 1.6;
}

/* Rouge syntax highlighting, scoped to article code blocks (applies across languages) */
.article .highlight .k,
.article .highlight .kd,
.article .highlight .kr,
.article .highlight .kp,
.article .highlight .kn { color: var(--accent); }

.article .highlight .kt,
.article .highlight .nc,
.article .highlight .nn,
.article .highlight .nb { color: var(--accent-2); }

.article .highlight .nf,
.article .highlight .nx { color: var(--text); }

.article .highlight .s,
.article .highlight .s1,
.article .highlight .s2,
.article .highlight .sb,
.article .highlight .sr,
.article .highlight .se,
.article .highlight .nv { color: var(--accent-warm); }

.article .highlight .m,
.article .highlight .mi,
.article .highlight .mf,
.article .highlight .mo,
.article .highlight .il { color: var(--accent-warm); }

.article .highlight .c,
.article .highlight .c1,
.article .highlight .cm,
.article .highlight .cp { color: var(--text-mute); font-style: italic; }

.article .highlight .o,
.article .highlight .ow { color: var(--text-dim); }

.article .highlight .p { color: var(--text-mute); }

.article .highlight .n { color: var(--code-text); }

.article ul.list, .article ol.list { margin: 0 0 20px; padding-left: 4px; display: flex; flex-direction: column; gap: 8px; }
.article ul.list li, .article ol.list li { font-size: 15px; color: var(--text-dim); line-height: 1.6; padding-left: 22px; position: relative; }
.article ul.list li::before {
  content: "";
  position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.article blockquote {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim);
  font-size: 14.5px;
}
.article blockquote.warning,
.article blockquote.important { border-left-color: var(--accent-warm); }
.article blockquote.highlight { border-left-color: var(--accent-2); }
.article blockquote p:last-child { margin-bottom: 0; }

/* Release-note status pills (New / Breaking / etc.), e.g. {: .label .label-green } */
.article p.label {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 10px;
  border: 1px solid var(--badge-border);
  background: var(--badge-bg);
  color: var(--badge-color);
}
.article p.label-green { background: rgba(34, 197, 94, 0.14); color: #22c55e; border-color: rgba(34, 197, 94, 0.35); }
.article p.label-red { background: rgba(248, 113, 113, 0.14); color: #f87171; border-color: rgba(248, 113, 113, 0.35); }
.article p.label-yellow { background: rgba(234, 179, 8, 0.16); color: #ca8a04; border-color: rgba(234, 179, 8, 0.35); }
.article p.label-blue { background: rgba(96, 165, 250, 0.14); color: #3b82f6; border-color: rgba(96, 165, 250, 0.35); }

.article ul, .article ol {
  margin: 0 0 20px;
  padding-left: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article ul li, .article ol li {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
  padding-left: 22px;
  position: relative;
}
.article ul li::before {
  content: "";
  position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.article ol { counter-reset: ol-counter; }
.article ol li { counter-increment: ol-counter; }
.article ol li::before {
  content: counter(ol-counter) ".";
  position: absolute; left: 0; top: 0;
  color: var(--accent-2);
  font-weight: 700;
  font-size: 13px;
}

.article h4 {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text-dim);
}

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.article th, .article td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
  line-height: 1.5;
}
.article th {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-align: center;
}
.article td {
  color: var(--text-dim);
  background: var(--surface);
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

.nav-card {
  flex: 1;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: all 0.15s ease;
  min-width: 0;
}
.nav-card:hover { border-color: var(--border-hover); background: var(--surface-2); transform: translateY(-1px); }
.nav-card.next { text-align: right; }
.nav-card .cap { font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin-bottom: 6px; }
.nav-card .ttl { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================== Landing / home ===================== */
.hero {
  padding: 88px 0 56px;
  text-align: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.hero-kicker .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(94,234,212,0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(94,234,212,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(94,234,212,0); }
  100% { box-shadow: 0 0 0 0 rgba(94,234,212,0); }
}

.hero h1 {
  font-size: 52px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 0 0 20px;
  background: linear-gradient(180deg, var(--hero-grad-top) 30%, var(--hero-grad-bottom) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 .grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.65;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  padding: 8px 0 64px;
}

.group-card {
  padding: 26px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.group-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120px 90px at 20% 0%, rgba(139,123,255,0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.group-card:hover { transform: translateY(-3px); border-color: var(--border-hover); box-shadow: var(--shadow-soft); }
.group-card:hover::before { opacity: 1; }

.group-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin-bottom: 16px;
}

.databases-grid .group-icon {
  width: 72px;
  height: 72px;
}

.group-card h3 { font-size: 17px; margin: 0 0 8px; font-weight: 700; }
.group-card p { font-size: 13.5px; color: var(--text-mute); margin: 0 0 14px; line-height: 1.55; }
.group-card .count { font-size: 12px; color: var(--text-mute); font-weight: 600; }
.group-card .count b { color: var(--accent-2); }

.subhero {
  text-align: center;
  padding: 12px 0 28px;
}
.subhero h2 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(180deg, var(--hero-grad-top) 30%, var(--hero-grad-bottom) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subhero h2 .grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subhero p {
  font-size: 15.5px;
  color: var(--text-dim);
  max-width: 560px;
  margin: 14px auto 0;
  line-height: 1.6;
}

.telemetry-banner {
  display: block;
  margin: 0 auto 48px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}
.telemetry-banner:hover { border-color: var(--border-hover); box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.telemetry-banner img { display: block; width: 100%; height: auto; }
.telemetry-banner-copy { padding: 22px 26px 26px; }
.telemetry-banner-copy h3 { font-size: 18px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.01em; }
.telemetry-banner-copy p { font-size: 14px; color: var(--text-mute); line-height: 1.6; margin: 0; max-width: 720px; }

.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 0 0 48px;
}
.platform-grid .telemetry-banner { margin: 0; }

@media (max-width: 900px) {
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .platform-grid { grid-template-columns: 1fr; }
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 22px;
}
.section-heading h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.section-heading span { font-size: 13px; color: var(--text-mute); }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  padding-bottom: 64px;
}

.post-card {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.post-card:hover { border-color: var(--border-hover); background: var(--surface-2); transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.post-card .badge { align-self: flex-start; }
.post-card h4 { font-size: 16px; margin: 0; font-weight: 700; line-height: 1.4; }
.post-card p { font-size: 13.5px; color: var(--text-mute); margin: 0; line-height: 1.55; flex: 1; }
.post-card .meta-text { font-size: 12px; }

/* ===================== Page footer (per-doc) ===================== */
.page-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.page-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-top: 28px;
  padding-bottom: 32px;
}

.back-to-top, .page-footer-edit {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
  transition: opacity 0.15s ease;
}
.back-to-top:hover, .page-footer-edit:hover { opacity: 0.8; text-decoration: underline; }

.page-footer-copyright {
  font-size: 13px;
  color: var(--text-mute);
  margin: 0;
}
.page-footer-copyright a { color: var(--accent); }
.page-footer-copyright a:hover { text-decoration: underline; }

.page-footer-built {
  font-size: 11px;
  color: var(--text-mute);
  margin: 0;
  align-self: flex-end;
}

/* ===================== Footer ===================== */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px 0 60px;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-inner .fbrand { font-weight: 700; color: var(--text-dim); font-size: 13.5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { font-size: 13px; color: var(--text-mute); transition: color 0.15s ease; }
.footer-links a:hover { color: var(--text); }

/* ===================== Mobile drawers ===================== */
.mobile-toggle { display: none; }

@media (max-width: 900px) {
  .layout, .layout.no-right { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar { position: static; max-height: none; overflow: visible; padding: 0; }
  .sidebar.left-sidebar, .sidebar.right-sidebar { display: none; }
  .sidebar.left-sidebar.open, .sidebar.right-sidebar.open {
    display: block;
    margin-bottom: 20px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }
  .icon-btn { display: flex; }
  .hero h1 { font-size: 36px; }
  .hero { padding: 56px 0 40px; }
}
