/* vecturadb.org: one stylesheet for every page. Light and dark follow the system setting. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-elevated: #ffffff;
  --fg: #0f172a;
  --fg-muted: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-db: #0d9488;
  --on-brand: #ffffff;
  --link: #4338ca;
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
  --code-muted: #94a3b8;
  --code-border: #1e293b;
  --code-accent: #a5b4fc;
  --inline-code-bg: #f1f5f9;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 12px 32px -8px rgb(15 23 42 / 0.14);
  --glow-1: rgb(79 70 229 / 0.13);
  --glow-2: rgb(13 148 136 / 0.11);
  --radius: 12px;
  --header-h: 64px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --bg-soft: #0f172a;
    --bg-elevated: #111a2e;
    --fg: #e2e8f0;
    --fg-muted: #94a3b8;
    --border: #1e293b;
    --border-strong: #334155;
    --brand: #818cf8;
    --brand-hover: #a5b4fc;
    --brand-db: #2dd4bf;
    --on-brand: #0b1120;
    --link: #a5b4fc;
    --code-bg: #060b18;
    --code-border: #24304a;
    --inline-code-bg: #1e293b;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -8px rgb(0 0 0 / 0.55);
    --glow-1: rgb(129 140 248 / 0.16);
    --glow-2: rgb(45 212 191 / 0.09);
  }
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
code, pre { font-family: var(--mono); }
h1, h2, h3 { color: var(--fg); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 8px 14px; border-radius: 8px;
  background: var(--brand); color: var(--on-brand); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* Header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
  }
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-size: 1.2rem; font-weight: 700; letter-spacing: -0.015em; text-decoration: none;
}
.brand img { width: 30px; height: 30px; display: block; }
.w-vectura { color: var(--brand); }
.w-db { color: var(--brand-db); }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  color: var(--fg-muted); font-size: 0.95rem; font-weight: 500; text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); background: var(--bg-soft); }
.site-nav .nav-github { margin-left: 8px; border: 1px solid var(--border); color: var(--fg); }
.icon { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.icon-stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.menu-toggle { display: none; }

@media (max-width: 760px) {
  .js .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-left: auto;
    border: 1px solid var(--border); border-radius: 10px;
    background: transparent; color: var(--fg); cursor: pointer;
  }
  .menu-toggle .icon { width: 22px; height: 22px; }
  .menu-toggle .icon-close, .menu-open .menu-toggle .icon-open { display: none; }
  .menu-open .menu-toggle .icon-close { display: block; }
  .js .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    padding: 8px 16px 16px; background: var(--bg);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .js .menu-open .site-nav { display: block; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; }
  .js .site-nav a { display: flex; padding: 12px; font-size: 1rem; }
  .js .site-nav .nav-github { margin: 8px 0 0; justify-content: center; }
  /* Without JavaScript the links wrap under the name. */
  html:not(.js) .header-inner { flex-wrap: wrap; gap: 4px 16px; padding-top: 12px; padding-bottom: 8px; }
  html:not(.js) .site-nav { margin-left: 0; width: 100%; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; }
}

/* Buttons and pills */

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 10px;
  font-size: 0.98rem; font-weight: 600; text-decoration: none;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--bg-elevated); color: var(--fg); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--fg-muted); }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-elevated); color: var(--fg-muted);
  font-size: 0.85rem; font-weight: 500; text-decoration: none;
}
.pill:hover { color: var(--fg); border-color: var(--border-strong); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-db); }

/* Code */

.code-card {
  background: var(--code-bg); color: var(--code-fg);
  border: 1px solid var(--code-border); border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden;
}
.code-card :focus-visible { outline-color: var(--code-accent); }
.code-card pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 0.875rem; line-height: 1.7; }
.code-card .caption {
  margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--code-border);
  color: var(--code-muted); font-size: 0.875rem;
}
.code-card .caption code { color: var(--code-fg); }
.code-card .caption a { color: var(--code-accent); }
.code-card .tablist { display: flex; gap: 4px; padding: 6px 10px 0; border-bottom: 1px solid var(--code-border); overflow-x: auto; }
.code-card [role="tab"] {
  appearance: none; margin-bottom: -1px; padding: 12px 12px 11px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--code-muted); font: 500 0.9rem/1 var(--font); cursor: pointer;
}
.code-card [role="tab"]:hover { color: var(--code-fg); }
.code-card [role="tab"][aria-selected="true"] { color: #ffffff; border-bottom-color: var(--code-accent); }
.panel-label { margin: 0; padding: 14px 20px 0; color: var(--code-muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.js .panel-label { display: none; }

/* The code panels are dark in both themes, so the colours of the tokens are the same. */
pre .c, pre .c1, pre .ch, pre .cm, pre .cp, pre .cs { color: #94a3b8; font-style: italic; }
pre .k, pre .kc, pre .kd, pre .kn, pre .kp, pre .kr, pre .kt, pre .ow { color: #c4b5fd; }
pre .s, pre .s1, pre .s2, pre .sa, pre .sb, pre .sc, pre .sd, pre .se, pre .sh, pre .si, pre .sr, pre .ss, pre .sx { color: #5eead4; }
pre .m, pre .mf, pre .mh, pre .mi, pre .mo, pre .il { color: #fcd34d; }
pre .nf, pre .fm, pre .nt { color: #93c5fd; }
pre .nc, pre .nn { color: #f9a8d4; }
pre .nb, pre .bp { color: #fda4af; }
pre .nv, pre .na, pre .vg { color: #fde68a; }

/* Tabs: without JavaScript every panel is shown, with its label. */
[data-tabs] [role="tablist"] { display: none; }
.js [data-tabs] [role="tablist"] { display: flex; }
.js [data-tabs]:not([data-ready]) [role="tabpanel"] ~ [role="tabpanel"] { display: none; }

/* Guides: the same step in several languages, or with and without Docker, as tabs. The heading of each panel names it
   when JavaScript is off and every panel is shown. */
.guide-tabs { margin: 24px 0 8px; }
.guide-tabs .tablist { gap: 22px; margin-bottom: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.guide-tabs [role="tab"] {
  appearance: none; margin-bottom: -1px; padding: 10px 2px 11px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--fg-muted); font: 600 0.98rem/1.2 var(--font); white-space: nowrap; cursor: pointer;
}
.guide-tabs [role="tab"]:hover { color: var(--fg); }
.guide-tabs [role="tab"][aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.js .guide-tabs .panel-heading { display: none; }

/* Home */

.hero {
  padding: 72px 0 64px;
  background:
    radial-gradient(640px 320px at 12% -10%, var(--glow-1), transparent 70%),
    radial-gradient(520px 300px at 92% 0%, var(--glow-2), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: center; }
.hero h1 {
  margin: 20px 0 18px;
  font-size: clamp(1.95rem, 1.3rem + 2vw, 2.85rem); font-weight: 760; line-height: 1.1; letter-spacing: -0.03em;
}
.grad { background: linear-gradient(90deg, var(--brand), var(--brand-db)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 34rem; margin: 0 0 28px; color: var(--fg-muted); font-size: 1.15rem; }

.facts { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.facts ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.facts li { padding: 22px 24px; border-left: 1px solid var(--border); }
.facts li:first-child { padding-left: 0; border-left: 0; }
.fact-k { display: block; color: var(--fg-muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.fact-v { display: block; margin-top: 4px; font-weight: 600; }
.fact-v code { font-size: 0.92em; }

.section { padding: 88px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow { margin: 0 0 10px; color: var(--brand); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.section h2 {
  margin: 0 0 16px;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.35rem); font-weight: 720; line-height: 1.15; letter-spacing: -0.025em;
}
.section-intro { max-width: 46rem; margin: 0 0 40px; color: var(--fg-muted); font-size: 1.08rem; }
.section p { max-width: 46rem; }

.feature-tabs .tablist { gap: 24px; margin-bottom: 36px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.feature-tabs [role="tab"] {
  appearance: none; margin-bottom: -1px; padding: 12px 2px 13px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--fg-muted); font: 600 1rem/1.2 var(--font); white-space: nowrap; cursor: pointer;
}
.feature-tabs [role="tab"]:hover { color: var(--fg); }
.feature-tabs [role="tab"][aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.feature-panel { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: 48px; align-items: start; }
.feature-panel > div:first-child { position: sticky; top: calc(var(--header-h) + 24px); }
.feature-panel .code-card pre { font-size: 0.85rem; }
.feature-panel h3 { margin: 0 0 12px; font-size: 1.4rem; letter-spacing: -0.015em; }
.feature-panel p { margin: 0 0 14px; color: var(--fg-muted); }
.feature-panel :not(pre) > code, .section-intro code, .split :not(pre) > code, .open-source :not(pre) > code {
  padding: 0.1em 0.35em; border-radius: 6px; background: var(--inline-code-bg); font-size: 0.9em;
}
html:not(.js) .feature-panel + .feature-panel { margin-top: 56px; }

.split { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 56px; align-items: start; }
.split .code-card { margin: 24px 0 28px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  display: block; padding: 20px 22px;
  background: var(--bg-elevated); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.card h3 { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; font-size: 1.05rem; }
.card .arrow { color: var(--brand); }
.card p { margin: 0; color: var(--fg-muted); font-size: 0.95rem; }

.open-source p { color: var(--fg-muted); }

/* Documentation pages: Get started and the guides */

.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding-top: 48px; padding-bottom: 88px; }
.doc-aside {
  position: sticky; top: calc(var(--header-h) + 24px); align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px); overflow: auto;
}
.doc-aside h2 { margin: 0 0 10px; color: var(--fg-muted); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.doc-aside ul { margin: 0 0 24px; padding: 0; list-style: none; border-left: 1px solid var(--border); }
.doc-aside a {
  display: block; margin-left: -1px; padding: 6px 0 6px 14px; border-left: 2px solid transparent;
  color: var(--fg-muted); font-size: 0.93rem; text-decoration: none;
}
.doc-aside a:hover { color: var(--fg); }
.doc-aside a[aria-current="page"] { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.doc { min-width: 0; max-width: 780px; }

.prose h1 { margin: 0 0 16px; font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem); font-weight: 740; line-height: 1.15; letter-spacing: -0.025em; }
.prose h2 { margin: 48px 0 12px; font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.015em; }
.prose h3 { margin: 32px 0 8px; font-size: 1.15rem; }
.prose h4 { margin: 28px 0 8px; font-size: 1rem; }
.prose p, .prose li { margin: 10px 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose :not(pre) > code { padding: 0.12em 0.38em; border-radius: 6px; background: var(--inline-code-bg); font-size: 0.9em; overflow-wrap: anywhere; }
.prose pre {
  margin: 16px 0; padding: 16px 18px; overflow-x: auto;
  background: var(--code-bg); color: var(--code-fg);
  border: 1px solid var(--code-border); border-radius: var(--radius);
  font-size: 0.875rem; line-height: 1.7;
}
.prose pre:focus-visible { outline-color: var(--code-accent); }
.prose .hl { margin: 16px 0; }
.prose .hl pre { margin: 0; }
.prose blockquote { margin: 16px 0; padding: 2px 18px; border-left: 3px solid var(--border-strong); color: var(--fg-muted); }
.prose .note {
  margin: 0 0 28px; padding: 4px 18px;
  background: var(--bg-soft); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 10px;
  font-size: 0.95rem;
}
.prose .table { margin: 20px 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.prose table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.9rem; }
.prose th, .prose td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose th + th, .prose td + td { border-left: 1px solid var(--border); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--bg-soft); font-weight: 600; }
.hero-note { margin: -8px 0 28px; max-width: 40rem; color: var(--fg-muted); font-size: 0.92rem; }
.lead-doc { color: var(--fg-muted); font-size: 1.12rem; }
/* Clients: the package names break only where the page allows it. */
.clients-table td:nth-child(2) { min-width: 11.5rem; }
.clients-table td:nth-child(2) code { overflow-wrap: normal; }
.crumb { margin: 0 0 12px; color: var(--fg-muted); font-size: 0.9rem; }
.crumb a { color: var(--fg-muted); }

/* Footer */

.site-footer { padding: 56px 0 32px; border-top: 1px solid var(--border); font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-brand p { max-width: 22rem; margin: 12px 0 0; color: var(--fg-muted); }
.footer-col h2 { margin: 0 0 12px; color: var(--fg-muted); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-col ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.footer-col a { color: var(--fg); text-decoration: none; }
.footer-col a:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
  color: var(--fg-muted); font-size: 0.875rem;
}
.footer-bottom p { margin: 0; }

/* Not found */

.not-found { padding-top: 120px; padding-bottom: 120px; text-align: center; }
.not-found h1 { margin: 0 0 12px; font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); letter-spacing: -0.025em; }
.not-found p { margin: 0 auto 28px; color: var(--fg-muted); }
.not-found .actions { justify-content: center; }

/* Narrow screens */

@media (max-width: 960px) {
  .hero { padding: 48px 0; }
  .hero-grid, .feature-panel, .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature-panel > div:first-child { position: static; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 32px; }
  .doc-aside { position: static; max-height: none; padding: 16px 16px 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
}
@media (max-width: 860px) {
  .facts ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts li, .facts li:first-child { padding: 18px 16px 18px 0; border-left: 0; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .section { padding: 64px 0; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .code-card pre { padding: 16px; }
  .feature-tabs .tablist, .guide-tabs .tablist { flex-wrap: wrap; gap: 8px; border-bottom: 0; }
  .feature-tabs [role="tab"], .guide-tabs [role="tab"] { margin: 0; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.95rem; }
  .feature-tabs [role="tab"][aria-selected="true"], .guide-tabs [role="tab"][aria-selected="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }
  /* Clients: one card per client, with the name of each server before its result. */
  .clients-table table { min-width: 0; }
  .clients-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .clients-table tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .clients-table tr:last-child { border-bottom: 0; }
  .clients-table td, .clients-table td + td { display: block; padding: 2px 0; border: 0; }
  .clients-table td:first-child, .clients-table td:nth-child(2) { display: inline; min-width: 0; font-weight: 600; }
  .clients-table td:nth-child(2)::before { content: " · "; }
  .clients-table td[data-label]::before { content: attr(data-label) ": "; color: var(--fg-muted); }
  .clients-table td:last-child { margin-top: 4px; color: var(--fg-muted); }
}
@media (max-width: 420px) {
  .actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}
