:root, [data-theme="dark"] {
  --bg: #000000;
  --bg-elev: #0E0E10;
  --bg-card: #111114;
  --bg-code: #0A0A0B;
  --bg-icon: #1A1A1E;
  --bg-nav: rgba(0, 0, 0, 0.88);
  --border: #1F1F24;
  --border-soft: #141418;
  --border-card: #22222A;
  --text: #FAFAFA;
  --text-dim: #9C9CA7;
  --text-muted: #6B6B77;
  --accent: #B794F4;
  --accent-bright: #C7A9FF;
  --accent-dim: #8B6FE0;
  --accent-soft: rgba(183, 148, 244, 0.12);
  --win: #34D399;
  --warn: #F59E0B;
  --danger: #F87171;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  --bg: #FFFFFF;
  --bg-elev: #F7F7F9;
  --bg-card: #FFFFFF;
  --bg-code: #F4F4F6;
  --bg-icon: #F0F0F3;
  --bg-nav: rgba(255, 255, 255, 0.92);
  --border: #E4E4E8;
  --border-soft: #EEEEF1;
  --border-card: #DCDCE2;
  --text: #0A0A0B;
  --text-dim: #4A4A55;
  --text-muted: #7B7B85;
  --accent: #7C3AED;
  --accent-bright: #6D28D9;
  --accent-dim: #5B21B6;
  --accent-soft: rgba(124, 58, 237, 0.10);
  --win: #059669;
  --warn: #D97706;
  --danger: #DC2626;
}

html { transition: background-color 0.2s ease; }
body, nav.top, .card, .eco-box, .btn { transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--bg-code); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-soft); }
pre { font-family: var(--mono); }
pre code { background: transparent; padding: 0; border: none; }

/* Top nav (shared across all pages) */
nav.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
  display: flex; align-items: center; justify-content: space-between;
}
nav.top .brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 20px;
  letter-spacing: -0.01em;
}
nav.top .brand img { height: 32px; width: 32px; }
nav.top ul { list-style: none; display: flex; gap: 32px; align-items: center; }
nav.top ul a { color: var(--text-dim); font-size: 15px; font-weight: 500; }
nav.top ul a:hover { color: var(--text); text-decoration: none; }
nav.top ul a.active { color: var(--text); }
nav.top .search-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); cursor: pointer;
}
nav.top .search-btn:hover { color: var(--text); }
nav.top .gh-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text) !important; font-size: 15px; font-weight: 500;
}
nav.top .gh-btn:hover { text-decoration: none; color: var(--accent) !important; }
nav.top .gh-btn .star-count { color: var(--text); font-weight: 600; }
nav.top .support-btn {
  background: var(--accent); color: #0A0A0B !important;
  padding: 10px 20px; border-radius: 999px;
  font-weight: 600; font-size: 14px;
}
nav.top .support-btn:hover { background: var(--accent-bright); text-decoration: none; }
[data-theme="light"] nav.top .support-btn { color: #FFFFFF !important; }
[data-theme="light"] nav.top .support-btn:hover { color: #FFFFFF !important; }

nav.top .theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); cursor: pointer;
}
nav.top .theme-toggle:hover { color: var(--text); background: var(--bg-elev); }
nav.top .theme-toggle .sun-icon { display: none; }
nav.top .theme-toggle .moon-icon { display: block; }
[data-theme="light"] nav.top .theme-toggle .sun-icon { display: block; }
[data-theme="light"] nav.top .theme-toggle .moon-icon { display: none; }

/* Shared containers */
section.page { max-width: 1280px; margin: 0 auto; padding: 80px 40px; text-align: center; }
section.page.narrow { max-width: 880px; text-align: left; }
section.page.left { text-align: left; max-width: 1120px; }
section.page h2 {
  font-size: clamp(26px, 3.2vw, 42px); font-weight: 800; margin-bottom: 14px;
  letter-spacing: -0.02em; line-height: 1.15;
}
section.page h2 .accent { color: var(--accent); }
section.page h3 { font-size: 18px; font-weight: 600; margin: 22px 0 12px; }
section.page p.section-lede {
  color: var(--text-dim); font-size: clamp(15px, 1.1vw, 17px);
  margin: 0 auto 40px; max-width: 680px;
}
section.page.narrow p.section-lede, section.page.left p.section-lede { margin-left: 0; margin-right: 0; }
section.page p { margin-bottom: 14px; color: var(--text); }
section.page ul, section.page ol { margin: 12px 0 18px 22px; color: var(--text); text-align: left; }
section.page li { margin-bottom: 6px; line-height: 1.7; }

/* Code blocks */
pre.code {
  background: var(--bg-code); border: 1px solid var(--border);
  padding: 20px; border-radius: 8px;
  font-size: 14px; color: var(--text);
  overflow-x: auto; line-height: 1.55;
  margin: 14px 0 22px;
}
pre.code .cm { color: var(--text-muted); }
pre.code .kw { color: var(--accent); font-weight: 500; }
pre.code .str { color: var(--win); }
pre.code .num { color: var(--warn); }
pre.code .fn { color: #60A5FA; }

/* Cards — DuckDB-style with icon container */
.grid { display: grid; gap: 28px; margin-top: 20px; text-align: left; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: transparent; border: none;
  padding: 0;
  transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-2px); }
.card .icon-box {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--bg-icon); border: 1px solid var(--border-card);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); margin-bottom: 22px;
}
.card .icon-box svg { width: 28px; height: 28px; }
.card h3 {
  font-size: 19px; font-weight: 700; margin: 0 0 10px;
  letter-spacing: -0.01em; color: var(--text);
  display: block;
}
.card p { color: var(--text-dim); font-size: 14px; line-height: 1.65; margin: 0 0 12px; }
.card code { font-size: 13px; }
.card a.card-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 2px; font-size: 15px; font-weight: 500;
  color: var(--accent);
}
.card a.card-link:hover { color: var(--accent-bright); text-decoration: none; }
.card a.card-link::after { content: "→"; transition: transform 0.15s ease; }
.card a.card-link:hover::after { transform: translateX(3px); }

/* Bordered card variant (used in ecosystem + install grids) */
.card.bordered {
  background: var(--bg-card); border: 1px solid var(--border-card);
  padding: 28px; border-radius: 14px;
}
.card.bordered:hover { border-color: var(--accent); transform: none; }

/* Tables */
table.data {
  width: 100%; border-collapse: collapse;
  margin-top: 14px; font-size: 14px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
}
table.data th, table.data td {
  padding: 11px 18px; text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
table.data th {
  background: var(--bg-code); color: var(--text-dim);
  font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
table.data td.num { text-align: right; font-family: var(--mono); }
table.data td.win { color: var(--win); font-weight: 600; text-align: right; font-family: var(--mono); }
table.data tr:last-child td { border-bottom: none; }

/* Buttons — pill shaped, DuckDB-style */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 32px; border-radius: 999px;
  font-weight: 600; font-size: 16px; line-height: 1;
  border: 1px solid transparent;
  cursor: pointer; transition: all 0.15s ease;
}
.btn.primary { background: var(--accent); color: #0A0A0B; }
.btn.primary:hover { background: var(--accent-bright); text-decoration: none; transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: var(--border-card); color: var(--text); }
.btn.ghost:hover { background: var(--bg-elev); text-decoration: none; border-color: var(--accent); }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 32px 50px;
  text-align: center;
  color: var(--text-muted); font-size: 14px;
  margin-top: 40px;
}
footer .cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-width: 920px; margin: 0 auto 28px;
  gap: 30px; text-align: left;
}
footer .cols h4 { color: var(--text); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
footer .cols ul { list-style: none; }
footer .cols li { margin-bottom: 6px; }
footer .cols a { color: var(--text-dim); font-size: 14px; }
footer .cols a:hover { color: var(--accent); }
footer .meta { font-size: 13px; padding-top: 24px; border-top: 1px solid var(--border-soft); }

/* ─── Homepage-specific ─── */

section.hero {
  position: relative;
  padding: 90px 32px 80px;
  max-width: 1280px; margin: 0 auto;
  text-align: center;
  overflow: hidden;
}
section.hero .sql-bg {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0.10; z-index: 0;
  font-family: var(--mono); color: var(--text-dim);
  font-weight: 400;
}
section.hero .sql-bg span {
  position: absolute; white-space: nowrap;
  font-size: 15px; letter-spacing: 0.05em;
}
section.hero .sql-bg .sql-1 { top: 12%; left: 4%; font-size: 13px; }
section.hero .sql-bg .sql-2 { top: 28%; right: 5%; font-size: 14px; }
section.hero .sql-bg .sql-3 { top: 50%; left: 7%; font-size: 16px; color: var(--accent); opacity: 0.25; }
section.hero .sql-bg .sql-4 { top: 68%; right: 9%; font-size: 13px; }
section.hero .sql-bg .sql-5 { bottom: 15%; left: 12%; font-size: 14px; }
section.hero .sql-bg .sql-6 { bottom: 8%; right: 15%; font-size: 15px; color: var(--accent); opacity: 0.22; }
section.hero .inner { position: relative; z-index: 1; }
section.hero img.banner {
  max-width: 720px; width: 100%; height: auto;
  margin: 0 auto 36px; display: block;
}
section.hero h1 {
  font-size: clamp(34px, 5.2vw, 68px);
  line-height: 1.1; font-weight: 800;
  margin-bottom: 26px; letter-spacing: -0.03em;
}
section.hero h1 .accent { color: var(--accent); }
section.hero p.lede {
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--text-dim); font-weight: 400;
  max-width: 620px; margin: 0 auto 36px;
  line-height: 1.55;
}
section.hero .ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
section.hero .used-by {
  margin-top: 28px; color: var(--accent);
  font-size: 14px; font-weight: 500;
}
section.hero .hero-chips {
  display: flex; gap: 32px; justify-content: center; flex-wrap: wrap;
  margin-top: 80px;
}
section.hero .hero-chips .chip-group {
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: 14px; padding: 22px 26px;
  text-align: left; min-width: 240px;
}
section.hero .hero-chips .chip-group-title {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-size: 15px; font-weight: 600;
  margin-bottom: 14px;
}
section.hero .hero-chips .chip-group-title svg { color: var(--accent); }
section.hero .hero-chips .chips { display: flex; flex-wrap: wrap; gap: 8px; }
section.hero .hero-chips .chip {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-icon); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 999px;
}

/* Language tabs on homepage */
.tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border);
  margin-bottom: 0; flex-wrap: wrap;
}
.tabs button {
  background: transparent; border: none;
  color: var(--text-dim); padding: 10px 18px;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Demo wrapper */
.demo-wrap {
  background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 14px;
  padding: 24px; display: flex; justify-content: center; margin-top: 20px;
}
.demo-wrap img { max-width: 100%; height: auto; }

/* Ecosystem — DuckDB-style grid with right-angle connectors + subtle single pulse */
.ecosystem {
  position: relative;
  max-width: 1120px; margin: 40px auto 0;
  text-align: left;
}
.eco-connectors {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  overflow: visible;
}
.eco-connectors path {
  stroke-width: 1.2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.eco-connectors .base { stroke: var(--border-card); opacity: 0.6; }
.eco-connectors .pulse {
  stroke: var(--accent);
  opacity: 0;
  filter: drop-shadow(0 0 5px var(--accent));
  animation: eco-pulse 10s ease-in-out infinite;
}
.eco-connectors .pulse.p1 { animation-delay: 0s; }
.eco-connectors .pulse.p2 { animation-delay: 2.5s; }
.eco-connectors .pulse.p3 { animation-delay: 5s; }
.eco-connectors .pulse.p4 { animation-delay: 7.5s; }
@keyframes eco-pulse {
  0%, 20%, 100% { opacity: 0; }
  8%, 14%       { opacity: 0.85; }
}

.eco-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px 48px; align-items: start;
}
.eco-col { display: flex; flex-direction: column; gap: 22px; }
.eco-box {
  background: var(--bg-card); border: 1px solid var(--border-card);
  border-radius: 14px; padding: 18px 20px;
}
.eco-box .eco-title {
  display: flex; align-items: center; gap: 9px;
  color: var(--text); font-size: 13px; font-weight: 600;
  margin-bottom: 14px;
}
.eco-box .eco-title svg { color: var(--accent); flex-shrink: 0; }
.eco-box .eco-tiles {
  display: grid;
  grid-template-columns: repeat(4, 56px);
  gap: 10px;
  justify-content: start;
}
.eco-box.narrow .eco-tiles { grid-template-columns: repeat(3, 56px); }
.eco-tile {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--bg-icon); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: all 0.15s ease;
}
.eco-tile svg { width: 24px; height: 24px; }
.eco-tile:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.eco-center-anchor {
  background: var(--bg-card);
  border: 1.5px solid var(--accent);
  border-radius: 14px; padding: 18px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--text); font-size: 18px; font-weight: 700;
  box-shadow: 0 0 32px -6px var(--accent-soft);
}
.eco-center-anchor img { height: 26px; width: 26px; }

@media (max-width: 900px) {
  .eco-grid { grid-template-columns: 1fr; }
  .eco-connectors { display: none; }
  .eco-box .eco-tiles { grid-template-columns: repeat(4, 56px); }
}

/* ─── Docs page (sidebar layout) ─── */

.docs-layout {
  display: grid; grid-template-columns: 260px 1fr;
  max-width: 1280px; margin: 0 auto;
  min-height: calc(100vh - 58px - 200px);
}
.docs-sidebar {
  border-right: 1px solid var(--border-soft);
  padding: 36px 20px 36px 32px;
  font-size: 14px;
}
.docs-sidebar .group { margin-bottom: 24px; }
.docs-sidebar .group h4 {
  color: var(--text-dim); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.docs-sidebar ul { list-style: none; }
.docs-sidebar li { margin-bottom: 2px; }
.docs-sidebar a {
  display: block; padding: 5px 10px; border-radius: 5px;
  color: var(--text-dim); font-size: 14px;
}
.docs-sidebar a:hover { color: var(--text); background: var(--bg-elev); text-decoration: none; }
.docs-sidebar a.active { color: var(--accent); background: var(--accent-soft); }

.docs-content {
  padding: 36px 56px 60px;
  max-width: 860px;
  min-width: 0;
}
.docs-content h1 {
  font-size: 36px; font-weight: 700; margin-bottom: 14px; letter-spacing: -0.02em;
}
.docs-content .doc-lede { color: var(--text-dim); font-size: 17px; margin-bottom: 30px; }
.docs-content h2 { font-size: 24px; font-weight: 700; margin: 40px 0 12px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.docs-content h2:first-of-type { border-top: none; padding-top: 0; }
.docs-content h3 { font-size: 18px; font-weight: 600; margin: 26px 0 10px; }
.docs-content p { margin-bottom: 14px; }
.docs-content ul, .docs-content ol { margin-left: 22px; margin-bottom: 18px; }
.docs-content li { margin-bottom: 6px; }
.docs-content hr { border: none; border-top: 1px solid var(--border-soft); margin: 28px 0; }
.docs-content .note {
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 4px; margin: 18px 0;
  color: var(--text); font-size: 14px;
}

/* Responsive */
@media (max-width: 920px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { border-right: none; border-bottom: 1px solid var(--border); padding: 24px 20px; }
  .docs-content { padding: 30px 20px; }
}
@media (max-width: 700px) {
  nav.top { padding: 12px 18px; }
  nav.top ul { gap: 14px; }
  nav.top ul li.hide-sm { display: none; }
  section.hero { padding: 50px 20px 40px; }
  section.hero h1 { font-size: 34px; }
  section.hero p.lede { font-size: 16px; }
  section.page { padding: 40px 20px; }
  section.page h2 { font-size: 24px; }
  .docs-content h1 { font-size: 28px; }
}
