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

@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #171a1f;
  --muted: #566174;
  --line: #d8dfe8;
  --blue: #1768ba;
  --background: #ffffff;
  --panel: #ffffff;
  --focus: #1768ba;
  --gutter: clamp(20px, 4.35vw, 68px);
  font-family: Inter, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9ebef;
  --muted: #abb2bf;
  --line: #303844;
  --blue: #75b5ff;
  --background: #0d0f12;
  --panel: #171a1f;
  --focus: #75b5ff;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
  border-radius: 2px;
}
img { display: block; object-fit: contain; }
.logo-for-dark { display: none; }
[data-theme="dark"] .logo-for-light { display: none; }
[data-theme="dark"] .logo-for-dark { display: block; }
.shell { width: calc(100% - 2 * var(--gutter)); max-width: 1404px; margin-inline: auto; }
.skip-link { position: absolute; top: 8px; left: var(--gutter); padding: 12px 18px; background: var(--background); z-index: 2; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 3px; color: var(--ink); text-decoration: none; }
.nav-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--muted); }
.nav-icon:hover { color: var(--ink); }
.nav-icon:focus-visible { outline-offset: 3px; }
.nav-icon svg { width: 18px; height: 18px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--muted); cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--ink); border-color: var(--muted); }
.theme-toggle:focus-visible { outline-offset: 3px; }
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun, [data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

/* Box-drawing glyphs from DejaVu so tree output lines up. */
@font-face {
  font-family: "SQLStack Box Drawing";
  src: url("assets/fonts/dejavu-sans-mono-diagram.woff2") format("woff2");
  unicode-range: U+2500-257F;
  font-display: swap;
}

:root {
  --mono: "IBM Plex Mono", "SQLStack Box Drawing", ui-monospace, monospace;
  --sqlbuild: #1680ff;
  --sqltide: #00b8bd;
  --sqlclean: #00a87d;
  --fensu: #ff6b00;
  --sqlbabel: #c9a800;
  --sqlload: #ff5268;
  --code-bg: #fbfcfe;
  --code-fg: #2b3038;
  --faint: #98a0ad;
  --ok: #16825c;
  --bad: #c74757;
  --warn: #aa6c16;
  --note: #7756b9;
  --kw: #1a56c4;
  --arg: #0f766e;
}

:root[data-theme="dark"] {
  --sqltide: #00d7dc;
  --sqlclean: #00c995;
  --sqlbabel: #ffe000;
  --code-bg: #111418;
  --code-fg: #c9cdd4;
  --faint: #626975;
  --ok: #54cf8e;
  --bad: #f47089;
  --warn: #f0c267;
  --note: #a78bfa;
  --kw: #5aa9e6;
  --arg: #4dd6c4;
}

/* Hero */
.hero { border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 48px; min-height: min(640px, calc(100vh - 59px)); padding-block: 64px; }
h1 { margin: 0; max-width: 11ch; font-size: clamp(44px, 5.4vw, 80px); line-height: 1.02; letter-spacing: -.05em; font-weight: 800; text-wrap: balance; }
.lede { max-width: 34em; margin: 28px 0 0; color: var(--muted); font-size: 19px; line-height: 1.5; }
.lede strong { color: var(--ink); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 12px; margin-top: 36px; }
.button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid var(--line); border-radius: 2px; color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; }
.button:hover { text-decoration: none; border-color: var(--muted); }
.button.primary { border-color: var(--ink); background: var(--ink); color: var(--background); }
.button.primary:hover { opacity: .88; }
.actions-note { margin-left: 8px; color: var(--muted); font-size: 15px; }

/* Two stacks, batch and streaming: each a canvas drawing plus one real link per layer laid over it. */
.stacks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 100%; max-width: 620px; justify-self: center; }
.stack-visual { position: relative; aspect-ratio: 10 / 11; }
.stack-caption { position: absolute; top: var(--caption-y, 86%); left: 0; right: 0; margin: 0; color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-align: center; text-transform: uppercase; transition: opacity .2s ease; }
.stack-visual:has(a.is-active) .stack-caption { opacity: 0; }
.stack-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stack-labels a { position: absolute; display: block; color: var(--ink); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.stack-labels a:focus-visible { outline: none; }
/* A layer's name shows under its stack, in place of the caption, while it is pointed at. */
.stack-labels .label { position: absolute; top: var(--label-y, 100%); left: var(--label-x, 50%); display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.25; white-space: nowrap; transform: translate(-50%, -4px); opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.stack-labels .name { font-family: "Space Grotesk", sans-serif; font-size: 16px; font-weight: 700; color: var(--accent); }
.stack-labels .what { color: var(--muted); font-size: 13.5px; }
.stack-labels a.is-active .label, .stack-labels a:focus-visible .label { opacity: 1; }
.stack-labels a:focus-visible .name { text-decoration: underline; text-underline-offset: 4px; }

/* Tools */
.tools { padding: 96px 0 72px; scroll-margin-top: 0; }
.tools h2 { margin: 0 0 40px; font-size: clamp(30px, 3vw, 44px); font-weight: 750; line-height: 1.1; letter-spacing: -.04em; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
/* Each card spans four rows of the grid, so names, lines and snippets start level across a row. */
.tool { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; min-width: 0; padding: 24px 24px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); background: var(--background); }
.tool-head { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.tool-head:hover { text-decoration: none; }
.tool-head:hover .tool-name { text-decoration: underline; text-underline-offset: 4px; }
.tool-head img { width: 28px; height: 28px; }
.tool-head img.wide { width: 34px; }
.tool-name { font-family: "Space Grotesk", sans-serif; font-size: 21px; font-weight: 700; }
.tool-site { margin-left: auto; color: var(--muted); font-size: 13px; }
.tool-head:hover .tool-site { color: var(--blue); }
.tool-what { display: block; margin-top: 12px; color: var(--ink); font-size: 15px; font-weight: 500; line-height: 1.45; }
.tool-line { display: block; margin: 2px 0 20px; color: var(--muted); font-size: 15px; line-height: 1.45; }
/* The snippet opens the docs for what it shows. */
.snippet { position: relative; display: flex; flex: 1; margin: 0 -24px; border-top: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); color: inherit; text-decoration: none; }
.snippet:hover { text-decoration: none; }
.snippet:focus-visible { outline-offset: -3px; }
.snippet .terminal { flex: 1; transition: background-color .15s ease; }
.snippet:hover .terminal { background: var(--code-hover); }
.snippet-hint { position: absolute; right: 16px; bottom: 12px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 2px; background: var(--background); color: var(--blue); font-size: 12.5px; opacity: 0; transition: opacity .15s ease; }
.snippet:hover .snippet-hint, .snippet:focus-visible .snippet-hint { opacity: 1; }

.terminal { margin: 0; padding: 18px 24px 20px; background: var(--code-bg); color: var(--code-fg); font-family: var(--mono); font-size: 11.5px; line-height: 1.65; }
/* Long lines wrap under their own column, as on the tool sites. */
.terminal .ln { display: block; padding-left: var(--hang, 0); text-indent: calc(-1 * var(--hang, 0)); white-space: pre-wrap; overflow-wrap: anywhere; }
/* Short phrases such as a rebuild note or a target type move to the next line whole, and only wrap inside when even a full line is too narrow. */
.terminal .note, .terminal .nw { display: inline-block; max-width: 100%; text-indent: 0; vertical-align: top; }
.terminal .cmd { color: var(--ink); font-weight: 500; }
.terminal .cmd::before { content: "$ "; color: var(--faint); font-weight: 400; }
.terminal .dim, .terminal .cm { color: var(--faint); }
.terminal .ok { color: var(--ok); }
.terminal .bad { color: var(--bad); }
.terminal .warn, .terminal .prompt { color: var(--warn); }
.terminal .note { color: var(--note); }
.terminal .kw { color: var(--kw); }
.terminal .arg, .terminal .ty { color: var(--arg); }
.terminal .fn { color: var(--note); }
.terminal .str { color: var(--ok); }
.terminal .num { color: var(--warn); }
.terminal .strong { font-weight: 500; color: var(--ink); }
.terminal .ok.strong { color: var(--ok); }

.sqlbuild { --accent: var(--sqlbuild); }
.sqltide { --accent: var(--sqltide); }
.sqlload { --accent: var(--sqlload); }
.sqlclean { --accent: var(--sqlclean); }
.fensu { --accent: var(--fensu); }
.sqlbabel { --accent: var(--sqlbabel); }

/* Releases */
.releases { margin: 56px 0 0; }
.releases figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.releases figcaption strong { color: var(--ink); font-weight: 600; }
.releases figcaption a { color: var(--muted); text-decoration: none; }
.releases figcaption a:hover { color: var(--ink); }
.release-bars { display: flex; align-items: flex-end; gap: 2px; height: 56px; }
.release-bars span { flex: 1; min-height: 1px; background: var(--ink); opacity: .22; border-radius: 1px 1px 0 0; }
.release-axis { position: relative; height: 22px; margin-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 11px; }
.release-axis span { position: absolute; top: 6px; }

.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0 24px; font-size: 12px; line-height: 1.5; }
.site-footer span:last-child { color: var(--muted); }

:root { --code-hover: #f3f6fa; }
:root[data-theme="dark"] { --code-hover: #161a1f; }

@media (max-width: 1180px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; min-height: 0; padding-block: 48px 40px; }
  h1 { max-width: 12ch; }
  .stacks { max-width: 560px; justify-self: start; }
}

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

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  h1 { font-size: clamp(38px, 11vw, 52px); }
  .lede { margin-top: 20px; font-size: 17px; }
  .actions { margin-top: 28px; }
  .actions-note { flex-basis: 100%; margin: 4px 0 0; }
  .stacks { gap: 8px; }
  .stack-labels .name { font-size: 15px; }
  .stack-labels .what { display: none; }
  .tools { padding: 64px 0 48px; }
  .tool { padding-inline: 18px; }
  .snippet { margin-inline: -18px; }
  .snippet .terminal { padding-inline: 18px; }
  .terminal .ln { padding-left: min(var(--hang, 0), 6ch); text-indent: calc(-1 * min(var(--hang, 0), 6ch)); }
}

