/* RivetHub design system. One stylesheet for rivethub.io, rivethub.dev and rivethub.org.
   Source of truth: rivethub-io/public/design/. The other sites vendor this directory
   and must not edit their copy. Guide: rivethub-io/docs/BRAND.md. */

@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/dm-sans-400.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/dm-sans-500.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/dm-sans-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/jetbrains-mono-700.woff2") format("woff2"); }

/* ---------- Tokens. Dark is the default; light follows the system or the footer control.
   The colours are the app's rivethub and rivethub-light themes (rivethub-app apps/web/src/styles.css). */
:root {
  --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem);
  --text-2xl: clamp(2.125rem, 1.2rem + 4vw, 3.75rem);

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: 6rem;

  --r-sm: 6px; --r-md: 12px; --r-lg: 18px; --r-pill: 999px;
  --wrap: 72rem;
  --measure: 66ch;

  /* Terminal blocks are screens: dark in both themes. */
  --term-bg: #0a0f0d;
  --term-ink: #dee4df;
  --term-dim: #8f9a94;
  --term-accent: #6cdbac;
  --term-line: #232a26;

  --bg: #0f1512;
  --surface: #141a17;
  --raised: #1b221e;
  --ink: #dee4df;
  --ink-dim: #a7b2ab;
  --ink-faint: #85908a;
  --accent: #6cdbac;
  --on-accent: #003825;
  --line: #353d39;
  --chip: #1f4535;
  --on-chip: #a6f2cd;
  --warn: #f5c56b;
  --danger: #ffb4ab;
  --info: #8ecbff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2f7f3;
    --surface: #fbfdfb;
    --raised: #e9f0eb;
    --ink: #171d1a;
    --ink-dim: #56615b;
    --ink-faint: #616b65;
    --accent: #006c4c;
    --on-accent: #ffffff;
    --line: #c6d0c9;
    --chip: #c4ecd8;
    --on-chip: #002114;
    --warn: #8a5100;
    --danger: #ba1a1a;
    --info: #0b57d0;
    --shadow: 0 18px 48px rgba(23, 29, 26, 0.12);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f2f7f3;
  --surface: #fbfdfb;
  --raised: #e9f0eb;
  --ink: #171d1a;
  --ink-dim: #56615b;
  --ink-faint: #616b65;
  --accent: #006c4c;
  --on-accent: #ffffff;
  --line: #c6d0c9;
  --chip: #c4ecd8;
  --on-chip: #002114;
  --warn: #8a5100;
  --danger: #ba1a1a;
  --info: #0b57d0;
  --shadow: 0 18px 48px rgba(23, 29, 26, 0.12);
  color-scheme: light;
}

/* ---------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; overflow-x: clip; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: var(--text-2xl); letter-spacing: -0.03em; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); line-height: 1.25; letter-spacing: -0.01em; }
p, ul, ol, dl, figure, pre, table { margin: 0; }
p + p, p + ul, p + ol, ul + p, ol + p { margin-top: var(--s4); }
ul, ol { padding-left: 1.3rem; }
li + li { margin-top: var(--s2); }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--chip); color: var(--on-chip); }
strong { font-weight: 700; }
code, kbd, pre { font-family: var(--font-mono); }
:not(pre) > code {
  font-size: 0.875em;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.08em 0.36em;
}
h1 > code, h2 > code, h3 > code { background: none; border: 0; padding: 0; font-size: 0.92em; color: var(--accent); }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: var(--s4); top: -4rem; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: var(--s2) var(--s4); border-radius: var(--r-sm); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--s2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Layout */
.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.prose { max-width: var(--measure); }
.section { padding-block: clamp(var(--s7), 8vw, var(--s9)); }
.section + .section { border-top: 1px solid var(--line); }
.section-tight { padding-block: var(--s7); }
.page-hero + .section-tight { padding-top: var(--s2); }
.section-head { max-width: var(--measure); margin-bottom: var(--s6); }
.section-head p:not(.kicker) { color: var(--ink-dim); margin-top: var(--s3); font-size: var(--text-lg); line-height: 1.5; }
.stack > * + * { margin-top: var(--s4); }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6) var(--s7); align-items: center; }
@media (min-width: 60rem) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .split-wide-left { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); } }

/* The kicker is small monospace capitals. It is one size everywhere. */
.kicker {
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4;
  color: var(--accent); margin-bottom: var(--s3);
}
.lede { font-size: var(--text-lg); line-height: 1.5; color: var(--ink-dim); max-width: var(--measure); }
.muted { color: var(--ink-dim); }
/* For a figure that cannot be read at phone width and repeats what the text beside it says. */
@media (max-width: 39.99rem) { .wide-only { display: none; } }
.small { font-size: var(--text-sm); }

/* ---------- Family bar: the strip that links the RivetHub sites */
.family-bar { background: var(--term-bg); color: var(--term-dim); font-size: var(--text-xs); border-bottom: 1px solid var(--term-line); }
.family-bar .wrap { display: flex; align-items: center; gap: var(--s2) var(--s5); min-height: 2.25rem; flex-wrap: wrap; padding-block: var(--s1); }
.family-bar p { font-family: var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.6875rem; }
.family-bar ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); padding: 0; margin: 0; }
.family-bar li { margin: 0; }
.family-bar a { color: var(--term-ink); text-decoration: none; font-weight: 500; display: inline-block; padding-block: var(--s1); }
.family-bar a:hover { text-decoration: underline; }
.family-bar a[aria-current="true"] { color: var(--term-accent); }
.family-bar a span { color: var(--term-dim); font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 400; margin-left: var(--s1); }
@media (max-width: 34rem) { .family-bar p, .family-bar a span { display: none; } }

/* ---------- Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: var(--s3) var(--s5); min-height: 4rem; flex-wrap: wrap; padding-block: var(--s2); }
.wordmark { display: inline-flex; align-items: center; gap: var(--s2); color: var(--ink); font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.02em; text-decoration: none; margin-right: auto; }
/* The lockup carries 30 units of clear space on each side (6 px at this size); the negative margin lines
   the tile up with the page column while that space still applies to everything around it. */
.wordmark .logo { width: auto; height: 40px; margin: -6px; }
.logo-on-light { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .logo-on-dark { display: none; }
  :root:not([data-theme="dark"]) .logo-on-light { display: block; }
}
:root[data-theme="light"] .logo-on-dark { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }
.wordmark small { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0.1rem 0.5rem; margin-left: var(--s1); }
/* On a narrow phone the site tag would push the header button onto a second row; the family bar above already names the site. */
@media (max-width: 26rem) { .wordmark small { display: none; } }
.site-nav { display: flex; align-items: center; gap: var(--s1) var(--s4); flex-wrap: wrap; }
.site-nav a { color: var(--ink-dim); text-decoration: none; font-size: var(--text-sm); font-weight: 500; padding: var(--s2) var(--s1); border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.site-header .btn { min-height: 2.5rem; padding: var(--s2) var(--s4); font-size: var(--text-sm); }
.search-form { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.search-field { flex: 1 1 auto; min-width: 0; min-height: 2.5rem; padding: var(--s2) var(--s4); font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--ink-faint); border-radius: var(--r-pill); }
.search-field::placeholder { color: var(--ink-faint); opacity: 1; }
.search-field:focus-visible { outline-offset: 2px; border-radius: var(--r-pill); }
.search-form .btn { flex: none; }
.site-header .search-form { flex: 0 1 20rem; }
@media (max-width: 29.99rem) {
  .site-header .search-form { flex: 1 1 0; }
  .site-header .search-form .btn { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }
}
@media (max-width: 47.99rem) {
  .site-nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -1.25rem; padding-inline: 1.25rem; width: calc(100% + 2.5rem); border-top: 1px solid var(--line); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; padding-block: var(--s3); }
  .site-header .wrap { padding-bottom: 0; }
  .site-header .wrap:not(:has(> .site-nav)) { padding-bottom: var(--s2); }
}

/* ---------- Buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 3rem; padding: var(--s3) var(--s5);
  border-radius: var(--r-pill); border: 1px solid var(--ink-faint);
  background: transparent; color: var(--ink);
  font: inherit; font-weight: 700; font-size: var(--text-md); line-height: 1.2; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--raised); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
.text-link { font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link::after { content: " \2192"; }

/* ---------- Hero */
.hero { padding-block: clamp(var(--s7), 9vw, var(--s9)) clamp(var(--s7), 7vw, var(--s8)); }
.hero h1 { max-width: 16ch; }
.hero .lede { margin-top: var(--s5); }
.hero .btn-row { margin-top: var(--s6); }
.hero-note { margin-top: var(--s4); color: var(--ink-dim); font-size: var(--text-sm); }
.page-hero { padding-block: clamp(var(--s7), 7vw, var(--s8)) var(--s6); }
.page-hero h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3rem); max-width: 22ch; }
.page-hero .lede { margin-top: var(--s4); }

/* ---------- Terminal and code blocks */
.term { position: relative; background: var(--term-bg); color: var(--term-ink); border: 1px solid var(--term-line); border-radius: var(--r-md); overflow: hidden; }
.term-label { display: block; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--term-dim); padding: var(--s3) 5.5rem 0 var(--s4); }
.term pre { padding: var(--s4); overflow-x: auto; font-size: 0.875rem; line-height: 1.65; white-space: pre; tab-size: 2; }
/* A block that can scroll sideways shows it: shadows at an edge with more text behind it (no script). */
.term pre {
  background:
    linear-gradient(to right, var(--term-bg) 30%, transparent) left / 2rem 100% no-repeat local,
    linear-gradient(to left, var(--term-bg) 30%, transparent) right / 2rem 100% no-repeat local,
    linear-gradient(to right, color-mix(in srgb, var(--term-accent) 40%, transparent), transparent) left / 0.75rem 100% no-repeat scroll,
    linear-gradient(to left, color-mix(in srgb, var(--term-accent) 40%, transparent), transparent) right / 0.75rem 100% no-repeat scroll;
}
/* One-line commands wrap instead, so a phone shows the whole command. */
.term pre.cmd { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8125rem; }
.term pre:focus-visible { outline-offset: -3px; }
/* Room for the copy button, reserved in CSS so adding the button never moves the page: above a block,
   or beside a one-line command, where the button sits centered at the right. */
.term:not(:has(> .term-label)) > pre[data-copy]:not(.cmd) { padding-top: 2.875rem; }
.term:not(:has(> .term-label)) > pre.cmd[data-copy] { padding-right: 5.5rem; }
.term:not(:has(> .term-label)):has(> pre.cmd) > .copy { top: 50%; transform: translateY(-50%); }
@media (max-width: 29.99rem) {
  .term pre { font-size: 0.8125rem; }
  .term:not(:has(> .term-label)) > pre.cmd[data-copy] { padding-top: 2.875rem; padding-right: var(--s4); }
  .term:not(:has(> .term-label)):has(> pre.cmd) > .copy { top: var(--s2); transform: none; }
}
.term .ps, .term .dim { color: var(--term-dim); user-select: none; }
.term .dim { user-select: auto; }
.term .ok { color: var(--term-accent); }
.term .copy {
  position: absolute; top: var(--s2); right: var(--s2);
  min-height: 2rem; min-width: 4.25rem; padding: 0 var(--s3);
  background: var(--term-line); color: var(--term-ink); border: 1px solid #353d39; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: var(--text-xs); cursor: pointer;
}
.term .copy:hover { border-color: var(--term-accent); color: var(--term-accent); }
.term + p, p + .term, .term + .term { margin-top: var(--s4); }

/* ---------- Cards */
.card-grid { list-style: none; padding: 0; display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.card-grid > li { margin: 0; }
.card-grid.one-col { grid-template-columns: minmax(0, 1fr); }
.card { height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); }
.card h3 { font-size: 1.125rem; }
.card p { color: var(--ink-dim); font-size: var(--text-sm); margin: 0; }
.card .text-link { margin-top: auto; padding-top: var(--s3); font-size: var(--text-sm); }
a.card { color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent); }
.card-tag { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent); letter-spacing: 0.04em; }

.badge { display: inline-block; font-family: var(--font-mono); font-size: var(--text-xs); background: var(--chip); color: var(--on-chip); border-radius: var(--r-pill); padding: 0.1rem 0.6rem; }

/* ---------- Numbered steps */
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: var(--s6); }
.steps > li { counter-increment: step; margin: 0; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: var(--s4); }
.steps > li::before {
  content: counter(step); width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--chip); color: var(--on-chip);
  font-family: var(--font-mono); font-weight: 700;
}
.steps h2, .steps h3 { font-size: var(--text-lg); line-height: 1.25; padding-top: 0.4rem; }
.steps > li > div > * + * { margin-top: var(--s3); }
.steps p { color: var(--ink-dim); }

/* ---------- Check lists and definition rows */
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 1.75rem; }
.checks li::before { content: ""; position: absolute; left: 0.2rem; top: 0.45em; width: 0.8rem; height: 0.45rem; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.rows { border-top: 1px solid var(--line); }
.rows > div { display: grid; gap: var(--s1) var(--s5); padding-block: var(--s4); border-bottom: 1px solid var(--line); }
.rows dt { font-weight: 700; }
.rows dd { margin: 0; color: var(--ink-dim); }
@media (min-width: 44rem) { .rows > div { grid-template-columns: 14rem minmax(0, 1fr); } }

/* ---------- Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.table-wrap:focus-visible { outline-offset: 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
th, td { text-align: left; vertical-align: top; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: var(--text-xs); font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; }
tbody th { font-weight: 700; }
.table-wrap code { white-space: nowrap; }
td { color: var(--ink-dim); }
.compare .ours { color: var(--ink); background: color-mix(in srgb, var(--chip) 45%, transparent); }
.compare thead .ours { color: var(--accent); font-weight: 700; }
/* On a phone each row of the comparison becomes a card, RivetHub first, so nothing scrolls sideways. */
@media (max-width: 39.99rem) {
  .table-wrap:has(> .compare) { overflow: visible; border: 0; background: none; }
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compare tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
  .compare tbody th, .compare td.ours { grid-column: 1 / -1; }
  .compare td:not(.ours) { font-size: var(--text-xs); line-height: 1.45; padding-inline: var(--s3); }
  .compare tbody tr + tr { margin-top: var(--s3); }
  .compare tbody th { border-bottom: 1px solid var(--line); }
  .compare td { border-bottom: 0; padding-block: var(--s2); }
  .compare td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-dim); }
  .compare td.ours::before { color: var(--accent); }
  .compare td.ours { padding-block: var(--s3); }
}
.table-wrap + p, p + .table-wrap { margin-top: var(--s4); }

/* ---------- Figures: product screenshots and diagrams */
.shot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.shot img, .shot video { width: 100%; }
figcaption { color: var(--ink-dim); font-size: var(--text-sm); margin-top: var(--s3); }
.shot + figcaption, .shot figcaption { padding: 0 var(--s1); }
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram text { font-family: var(--font-mono); font-size: 13px; fill: var(--ink-dim); }
.diagram .d-label { font-family: var(--font-ui); font-size: 15px; font-weight: 700; fill: var(--ink); }
.diagram .d-box { fill: var(--raised); stroke: var(--line); }
.diagram .d-core { fill: var(--chip); stroke: var(--accent); }
.diagram .d-core-text { fill: var(--on-chip); font-family: var(--font-ui); font-size: 15px; font-weight: 700; }
.diagram .d-in { stroke: var(--accent); fill: none; stroke-width: 1.5; }
.diagram .d-out { stroke: var(--info); fill: none; stroke-width: 1.5; stroke-dasharray: 5 4; }
.diagram .d-in-head { fill: var(--accent); }
.diagram .d-out-head { fill: var(--info); }

/* ---------- Notes */
.note { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); border-radius: var(--r-sm); padding: var(--s4); color: var(--ink-dim); font-size: var(--text-sm); }
.note strong { color: var(--ink); }
.note-warn { border-left-color: var(--warn); }
* + .note, .note + * { margin-top: var(--s4); }

/* ---------- More detail under a step: a native disclosure, closed by default */
.more { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.more > summary { cursor: pointer; font-weight: 700; font-size: var(--text-sm); color: var(--ink); padding: var(--s3) var(--s4); min-height: 2.75rem; }
.more > div { padding: 0 var(--s4) var(--s4); font-size: var(--text-sm); }
.more p { color: var(--ink-dim); }

/* ---------- On-page contents */
.toc { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; padding: 0; margin-top: var(--s5); }
.toc li { margin: 0; }
.toc a { display: inline-block; font-size: var(--text-sm); color: var(--ink-dim); text-decoration: none; border: 1px solid var(--line); border-radius: var(--r-pill); padding: var(--s1) var(--s3); }
.toc a:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- FAQ */
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; padding: var(--s4) var(--s6) var(--s4) 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: var(--s2); top: var(--s4); font-family: var(--font-mono); color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > *:not(summary) { color: var(--ink-dim); max-width: var(--measure); padding-bottom: var(--s4); margin: 0; }

/* ---------- Docs prose (rivethub.dev, rivethub.org and the long pages on rivethub.io) */
.doc > section { padding-block: var(--s6); border-top: 1px solid var(--line); }
.doc > section > * { max-width: 52rem; }
.doc > section > .table-wrap, .doc > section > .card-grid, .doc > section > .term, .doc > section > figure { max-width: none; }
.doc > section > * + * { margin-top: var(--s4); }
.doc > section > h2 + * { margin-top: var(--s3); }
.doc > section > h3 { margin-top: var(--s6); }
.doc p, .doc li { color: var(--ink-dim); }
.doc p strong, .doc li strong { color: var(--ink); }

/* ---------- Search results (rivethub.dev). ui.js filters the entries of a [data-filter-list]; without it the
   page is the whole index, grouped by page. */
.search-form-large { max-width: 36rem; }
.search-form-large .search-field, .search-form-large .btn { min-height: 3rem; font-size: var(--text-md); }
.search-status { margin-top: var(--s4); color: var(--ink-dim); }
.search-results { margin-top: var(--s5); }
.search-group + .search-group { margin-top: var(--s5); }
.search-list { list-style: none; padding: 0; }
.search-entry { padding-block: var(--s4); border-top: 1px solid var(--line); max-width: 52rem; }
.search-entry > * + * { margin-top: var(--s1); }
.search-entry a { font-weight: 700; font-size: var(--text-md); }
.search-entry p:not(.card-tag) { color: var(--ink-dim); font-size: var(--text-sm); }

/* ---------- Docs layout: a page list beside the content (rivethub.dev). The content comes first in the
   source at every width; the grid moves the list to the left on wide screens. */
.docs-shell { display: grid; grid-template-columns: minmax(0, 1fr); --docs-top: 4.0625rem; }
.docs-content { min-width: 0; }
.docs-content .wrap { width: auto; margin-inline: 0; }
.docs-content .card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.docs-content .cta-band { border: 1px solid var(--line); border-radius: var(--r-lg); margin-block: var(--s6) var(--s7); padding-block: var(--s6); }
.docs-jump { display: inline-flex; align-items: center; min-height: 2.75rem; margin-top: var(--s3); font-size: var(--text-sm); }
.docs-nav { margin-top: var(--s6); padding-block: var(--s5) var(--s6); border-top: 1px solid var(--line); font-size: var(--text-sm); }
.docs-nav-title { font-size: var(--text-lg); margin-bottom: var(--s3); }
.docs-nav-group { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); margin-top: var(--s5); }
.docs-nav-title + .docs-nav-group { margin-top: 0; }
.docs-nav ul { list-style: none; padding: 0; margin-top: var(--s2); }
.docs-nav li + li { margin-top: 0; }
.docs-nav a { display: flex; align-items: center; min-height: 2.75rem; padding: var(--s1) var(--s3); border-left: 2px solid transparent; color: var(--ink-dim); text-decoration: none; font-weight: 500; }
.docs-nav a:hover { color: var(--ink); }
.docs-nav a[aria-current="page"] { color: var(--ink); border-left-color: var(--accent); }
@media (min-width: 64rem) {
  .docs-shell { grid-template-columns: 15rem minmax(0, 1fr); }
  .docs-nav { grid-column: 1; grid-row: 1; margin-top: 0; padding-block: var(--s6); padding-right: var(--s4); border-top: 0; border-right: 1px solid var(--line); align-self: start; position: sticky; top: var(--docs-top); max-height: calc(100vh - var(--docs-top)); max-height: calc(100dvh - var(--docs-top)); overflow-y: auto; overscroll-behavior: contain; }
  .docs-nav-title { display: none; }
  .docs-nav a { min-height: 2.25rem; }
  .docs-content { grid-column: 2; grid-row: 1; padding-left: var(--s6); }
  .docs-jump { display: none; }
}

/* ---------- Closing call to action */
.cta-band { background: var(--surface); border-top: 1px solid var(--line); padding-block: clamp(var(--s7), 7vw, var(--s8)); }
.cta-band h2 { max-width: 20ch; }
.cta-band p { color: var(--ink-dim); margin-top: var(--s3); max-width: var(--measure); }
.cta-band .btn-row { margin-top: var(--s5); }

/* ---------- Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s7) var(--s6); font-size: var(--text-sm); color: var(--ink-dim); }
.footer-grid { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 60rem) { .footer-grid { grid-template-columns: 1.6fr repeat(4, 1fr); } .footer-brand { grid-column: auto; } }
.footer-brand p { margin-top: var(--s3); max-width: 28ch; }
.site-footer h2 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: var(--s3); }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li + li { margin-top: var(--s1); }
.site-footer a { color: var(--ink); text-decoration: none; display: inline-block; padding-block: var(--s1); }
.site-footer a:hover { text-decoration: underline; }
.site-footer .wordmark { display: inline-flex; }
.footer-base { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); font-size: var(--text-xs); }
.footer-base p { max-width: 70ch; }
.footer-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
.link-button { font: inherit; color: var(--ink); background: none; border: 0; padding: var(--s1) 0; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.link-button:hover { color: var(--accent); }
.theme-control label { display: inline-flex; align-items: center; gap: var(--s2); }
.theme-control select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--ink-faint); border-radius: var(--r-sm); padding: var(--s1) var(--s2); min-height: 2rem; }

/* ---------- Analytics consent: a slim bar on the bottom edge. The page gets matching bottom padding while it
   shows, and focus scrolls clear of it, so it never sits on top of an action. */
:root { --consent-h: 4rem; }
@media (max-width: 47.99rem) { :root { --consent-h: 7.25rem; } }
/* Under 360 px the sentence takes a third line. */
@media (max-width: 22.49rem) { :root { --consent-h: 8.5rem; } }
.consent {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  background: var(--surface); color: var(--ink); font-size: var(--text-sm);
  border-top: 1px solid var(--ink-faint);
}
.consent .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5); padding-block: var(--s2); }
.consent p { max-width: none; margin: 0; flex: 1 1 20rem; line-height: 1.45; }
.consent .btn-row { gap: var(--s3); flex-wrap: nowrap; }
.consent .btn { min-height: 2.75rem; min-width: 7rem; padding: var(--s2) var(--s4); font-size: var(--text-sm); }
@media (max-width: 47.99rem) { .consent .btn-row { width: 100%; } .consent .btn { flex: 1 1 0; } }
body:has(.consent) { padding-bottom: var(--consent-h); }
html:has(.consent) { scroll-padding-bottom: calc(var(--consent-h) + var(--s4)); }

/* ---------- Self-report buttons at the end of setup */
.report { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.report-thanks { color: var(--accent); font-weight: 700; }

@media print {
  .family-bar, .site-header, .site-footer, .copy, .cta-band, .consent, .docs-nav, .docs-jump { display: none; }
  .docs-shell { display: block; }
  .docs-content { padding-left: 0; }
  body { background: #fff; color: #000; }
}

/* ---------- Spacing helpers, for the few places a component's default gap is wrong */
.mt-3 { margin-top: var(--s3); }
.mt-4 { margin-top: var(--s4); }
.mt-5 { margin-top: var(--s5); }
.mt-6 { margin-top: var(--s6); }
