/* 8sheets.com: one stylesheet for the landing pages and the documentation.
   No external requests: system fonts only, no remote images, no imports. */

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  /* Color: warm paper neutrals with one indigo accent. */
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --surface-3: #eae7e0;
  --ink: #15171c;
  --ink-2: #52565f;
  --ink-3: #6a6e78;
  --line: #e4e1da;
  --line-strong: #cfcbc2;
  --accent: #3b3fd0;
  --accent-hover: #2c30b4;
  --accent-soft: #ecedfc;
  --accent-line: #c9cbf6;
  --accent-fill: #3b3fd0;
  --accent-fill-hover: #2c30b4;
  --on-accent: #ffffff;
  --focus: #3b3fd0;
  --grid-line: rgba(21, 23, 28, 0.07);
  --header-bg: rgba(251, 250, 247, 0.82);

  /* The inverted band and the code card. */
  --band-bg: #15171c;
  --band-surface: #1d2027;
  --band-ink: #f1f1f4;
  --band-ink-2: #a9adba;
  --band-line: #2c2f39;
  --band-accent: #aeb2ff;
  --code-bg: #f3f1ec;
  --code-ink: #23262d;
  --tok-keyword: #3b3fd0;
  --tok-string: #8a4b1c;
  --tok-comment: #6a6e78;
  --tok-number: #7a3fa0;

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Code", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  --text-2xl: clamp(1.875rem, 1.3rem + 2.4vw, 3rem);
  --text-3xl: clamp(2.5rem, 1.35rem + 5vw, 4.75rem);

  /* Space (4 px base) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --section: clamp(4rem, 2.5rem + 6vw, 8rem);
  --gutter: clamp(1.25rem, 0.5rem + 3vw, 2.5rem);
  --wrap: 72rem;

  /* Shape */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(21, 23, 28, 0.06);
  --shadow-md: 0 1px 2px rgba(21, 23, 28, 0.05), 0 8px 24px -8px rgba(21, 23, 28, 0.12);
  --shadow-lg: 0 2px 4px rgba(21, 23, 28, 0.04), 0 24px 48px -16px rgba(21, 23, 28, 0.18), 0 60px 120px -40px rgba(59, 63, 208, 0.22);

  --header-h: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1014;
    --surface: #17191f;
    --surface-2: #1e2028;
    --surface-3: #272a34;
    --ink: #ecedf1;
    --ink-2: #abafbc;
    --ink-3: #8e93a3;
    --line: #2a2d37;
    --line-strong: #3a3e4b;
    --accent: #aeb2ff;
    --accent-hover: #c7caff;
    --accent-soft: #22253a;
    --accent-line: #3a3e68;
    --accent-fill: #9ba0ff;
    --accent-fill-hover: #b4b8ff;
    --on-accent: #0f1014;
    --focus: #aeb2ff;
    --grid-line: rgba(236, 237, 241, 0.05);
    --header-bg: rgba(15, 16, 20, 0.8);
    --band-bg: #17191f;
    --band-surface: #1e2028;
    --band-line: #2f323d;
    --code-bg: #17191f;
    --code-ink: #e3e4ea;
    --tok-keyword: #aeb2ff;
    --tok-string: #f0b48f;
    --tok-comment: #8e93a3;
    --tok-number: #d3a6f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.7), 0 60px 120px -40px rgba(155, 160, 255, 0.18);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1014;
  --surface: #17191f;
  --surface-2: #1e2028;
  --surface-3: #272a34;
  --ink: #ecedf1;
  --ink-2: #abafbc;
  --ink-3: #8e93a3;
  --line: #2a2d37;
  --line-strong: #3a3e4b;
  --accent: #aeb2ff;
  --accent-hover: #c7caff;
  --accent-soft: #22253a;
  --accent-line: #3a3e68;
  --accent-fill: #9ba0ff;
  --accent-fill-hover: #b4b8ff;
  --on-accent: #0f1014;
  --focus: #aeb2ff;
  --grid-line: rgba(236, 237, 241, 0.05);
  --header-bg: rgba(15, 16, 20, 0.8);
  --band-bg: #17191f;
  --band-surface: #1e2028;
  --band-line: #2f323d;
  --code-bg: #17191f;
  --code-ink: #e3e4ea;
  --tok-keyword: #aeb2ff;
  --tok-string: #f0b48f;
  --tok-comment: #8e93a3;
  --tok-number: #d3a6f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.7), 0 60px 120px -40px rgba(155, 160, 255, 0.18);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.9em; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-fill); color: var(--on-accent); }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: var(--s-4); top: -4rem; z-index: 100;
  padding: var(--s-2) var(--s-4); border-radius: var(--r-sm);
  background: var(--accent-fill); color: var(--on-accent); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s-3); color: var(--on-accent); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: var(--s-4); min-height: var(--header-h); }

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem; flex: none;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.03em;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 1.75rem; height: 1.75rem; flex: none; }
.brand-mark .tile { fill: var(--accent-fill); }
.brand-mark .glyph { fill: none; stroke: var(--on-accent); }
.brand-tag {
  margin-left: 0.1rem; padding: 0.1rem 0.45rem; border: 1px solid var(--line-strong); border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2);
}

a.brand-tag { text-decoration: none; }
a.brand-tag:hover { color: var(--ink); border-color: var(--ink-3); }
.doc-header-inner, .doc-page .site-footer .wrap { max-width: calc(86rem + 2 * var(--gutter)); }

.site-nav { display: flex; align-items: center; gap: var(--s-1); margin-left: var(--s-5); }
.site-nav a {
  padding: 0.4rem 0.7rem; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-size: var(--text-sm); font-weight: 500;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }

.icon-btn {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none; padding: 0;
  border: 1px solid transparent; border-radius: var(--r-md); background: transparent; color: var(--ink-2);
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* The toggle shows the theme it switches to. */
.theme-btn .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }

.menu-btn { display: none; }
[data-menu] .i-close, [data-menu][aria-expanded="true"] .i-open { display: none; }
[data-menu][aria-expanded="true"] .i-close { display: block; }

@media (max-width: 47.99rem) {
  .header-inner { flex-wrap: wrap; gap: var(--s-2); }
  .header-actions { gap: 0.125rem; }
  .header-actions .btn { margin-left: var(--s-1); }
  /* Without JavaScript the links sit in a second row; with it they fold into a menu. */
  .site-nav { order: 3; width: 100%; margin: 0 0 var(--s-2); gap: 0; overflow-x: auto; }
  .site-nav a { padding: 0.35rem 0.5rem; font-size: 0.875rem; white-space: nowrap; }
  .site-nav a:first-child { margin-left: -0.5rem; }
  .js .menu-btn { display: inline-grid; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open {
    display: flex; flex-direction: column; align-items: stretch; margin: 0 0 var(--s-3);
    padding-top: var(--s-2); border-top: 1px solid var(--line);
  }
  .js .site-nav.is-open a { margin: 0; padding: 0.7rem 0.25rem; font-size: var(--text-base); }
}

@media (max-width: 26rem) {
  .brand { font-size: 1.0625rem; gap: 0.45rem; }
  .brand-mark { width: 1.5rem; height: 1.5rem; }
  .brand-tag { display: none; }
  .header-actions .icon-btn { width: 2.25rem; }
  .header-actions .btn { padding-inline: 0.7rem; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.7rem 1.35rem;
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: var(--text-base); font-weight: 600; line-height: 1.2; letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn svg { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s ease; }
.btn:hover svg { transform: translateX(2px); }
.btn-primary { background: var(--accent-fill); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-fill-hover); color: var(--on-accent); }
.btn-ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-sm { min-height: 2.5rem; padding: 0.45rem 0.95rem; font-size: var(--text-sm); }
.btn-lg { min-height: 3.5rem; padding: 0.9rem 1.75rem; font-size: 1.125rem; }

/* ---------- Shared section pieces ---------- */

.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--line); }

/* The eyebrow reads like a name box: a cell reference, then the label. */
.eyebrow {
  display: flex; align-items: center; gap: 0.65rem; margin-bottom: var(--s-5);
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.cellref {
  display: inline-block; min-width: 2.4em; padding: 0.2rem 0.5rem; text-align: center;
  border: 1px solid var(--accent-line); border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent);
  letter-spacing: 0.02em;
}

.section-head { max-width: 44rem; margin-bottom: var(--s-7); }
.section-head h2, .split h2 { font-size: var(--text-2xl); letter-spacing: -0.03em; line-height: 1.08; }
.lede { margin-top: var(--s-5); font-size: var(--text-lg); line-height: 1.55; color: var(--ink-2); max-width: 40rem; }

.split { display: grid; gap: var(--s-7) var(--s-8); align-items: center; }
@media (min-width: 60rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split-wide-right { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}

.check-list { list-style: none; display: grid; gap: var(--s-3); margin-top: var(--s-6); }
.check-list li { position: relative; padding-left: 1.9rem; color: var(--ink-2); }
.check-list li strong { color: var(--ink); font-weight: 600; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.32em; width: 1.15rem; height: 1.15rem; border-radius: 4px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.check-list li::after {
  content: ""; position: absolute; left: 0.4rem; top: calc(0.32em + 0.2rem); width: 0.33rem; height: 0.6rem;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(40deg);
}

/* ---------- Hero ---------- */

.hero { position: relative; padding-top: clamp(3rem, 1.5rem + 6vw, 6.5rem); padding-bottom: calc(var(--section) * 0.75); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 65px 32px;
  -webkit-mask-image: radial-gradient(120% 75% at 70% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 75% at 70% 0%, #000 0%, transparent 72%);
}
.hero-copy { max-width: 54rem; }
.hero h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.045em; line-height: 0.98; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { margin-top: var(--s-6); font-size: var(--text-xl); line-height: 1.45; max-width: 38rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero-facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-top: var(--s-5);
  font-size: var(--text-sm); color: var(--ink-2);
}
.hero-facts li { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero-facts li::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 1px; background: var(--accent); }

.shot {
  margin: clamp(2.5rem, 1.5rem + 4vw, 5rem) 0 0; padding: clamp(0.3rem, 0.1rem + 0.6vw, 0.6rem);
  border: 1px solid var(--line); border-radius: clamp(0.75rem, 0.4rem + 1.2vw, 1.4rem);
  background: var(--surface-2); box-shadow: var(--shadow-lg);
}
.shot picture {
  display: block; overflow: hidden; border: 1px solid var(--line); background: var(--surface);
  border-radius: clamp(0.5rem, 0.25rem + 0.8vw, 0.95rem);
}
.shot img { width: 100%; }
@media (max-width: 39.99rem) {
  /* Phones: show the left part of the window at a readable size instead of shrinking all of it. */
  .shot img { width: 170%; max-width: none; }
  .cta-row .btn { flex: 1 1 auto; }
  .btn-lg { padding-inline: 1.1rem; }
}

/* ---------- Privacy trio ---------- */

.trio { list-style: none; display: grid; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.trio li { padding: var(--s-6); }
.trio li + li { border-top: 1px solid var(--line); }
@media (min-width: 52rem) {
  .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trio li + li { border-top: 0; border-left: 1px solid var(--line); }
}
.trio h3, .feature h3 { font-size: 1.125rem; letter-spacing: -0.015em; }
.trio p, .feature p { margin-top: var(--s-2); color: var(--ink-2); font-size: var(--text-sm); line-height: 1.6; }
.glyph-box {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin-bottom: var(--s-5);
  border: 1px solid var(--accent-line); border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent);
}
.glyph-box svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.aside-note {
  display: flex; gap: var(--s-3); align-items: baseline; margin-top: var(--s-5);
  font-size: var(--text-sm); color: var(--ink-2);
}
.aside-note .cellref { flex: none; font-family: var(--font-mono); font-size: var(--text-xs); }

/* ---------- Files ---------- */

.ext-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-6); }
.ext-list li {
  padding: 0.35rem 0.75rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
  font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 500;
}

.ledger { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; }
.ledger-title {
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--line); background: var(--surface-2);
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.ledger ul { list-style: none; }
.ledger li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) var(--s-5); }
.ledger li + li { border-top: 1px solid var(--line); }
.ledger-name { font-weight: 600; }
.ledger-name small { display: block; margin-top: 0.1rem; font-size: var(--text-xs); font-weight: 400; color: var(--ink-2); }
.tag {
  flex: none; padding: 0.2rem 0.6rem; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; white-space: nowrap;
}
.tag-muted { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink-2); }

/* ---------- Performance band ---------- */

.band { background: var(--band-bg); color: var(--band-ink); border-block: 1px solid var(--band-line); position: relative; overflow: hidden; }
.section + .band, .band + .section { border-top: 0; }
.band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 65px 32px;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 100%);
  mask-image: linear-gradient(100deg, transparent 30%, #000 100%);
}
.band > .wrap { position: relative; }
.band .eyebrow, .band .lede, .band .point p { color: var(--band-ink-2); }
.band .cellref { border-color: #3a3e68; background: #22253a; color: var(--band-accent); }
.stat { margin: 0; }
.stat-figure {
  display: block; font-size: clamp(2.75rem, 1rem + 8.2vw, 6.75rem); font-weight: 700; letter-spacing: -0.055em; line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.stat-figure span { color: var(--band-accent); }
.stat-label { display: block; margin-top: var(--s-4); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--band-ink-2); }
.points { list-style: none; display: grid; gap: var(--s-6); margin-top: var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--band-line); }
@media (min-width: 48rem) { .points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-8); } }
.point h3 { font-size: 1.125rem; }
.point p { margin-top: var(--s-2); font-size: var(--text-sm); max-width: 30rem; }

/* ---------- Features sheet ---------- */

.sheet {
  list-style: none; display: grid;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden;
}
/* Each cell draws its right and bottom rule; the outer ones are clipped by the frame. */
.feature { margin: 0 -1px -1px 0; padding: var(--s-6); border: solid var(--line); border-width: 0 1px 1px 0; transition: background-color 0.15s ease; }
.feature:hover { background: var(--bg); }
@media (min-width: 40rem) {
  .sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-wide { grid-column: span 2; }
}
@media (min-width: 62rem) { .sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature .glyph-box { margin-bottom: var(--s-4); }
.feature-wide p { max-width: 36rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: var(--s-4); }
.chips li {
  padding: 0.15rem 0.5rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2);
}
.chips-plain li { font-family: var(--font-sans); font-size: var(--text-xs); }

/* ---------- Offline / phone ---------- */

.phone {
  width: min(15.5rem, 70vw); margin: 0 auto; padding: 0.5rem;
  border: 1px solid var(--line-strong); border-radius: 2.1rem; background: #0b0c10; box-shadow: var(--shadow-md);
}
.phone img { width: 100%; border-radius: 1.65rem; }
.phone-stage {
  display: grid; place-items: center; padding: var(--s-7) var(--s-5);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background-color: var(--surface-2);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 65px 32px;
}

/* ---------- Developers ---------- */

.code-card {
  --code-bg: #14161b; --code-ink: #e3e4ea; --tok-keyword: #aeb2ff; --tok-string: #f0b48f; --tok-comment: #9499a8; --tok-number: #d3a6f0;
  border: 1px solid var(--band-line); border-radius: var(--r-lg); background: var(--code-bg); color: var(--code-ink);
  box-shadow: var(--shadow-md); overflow: hidden; min-width: 0;
}
.code-card-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 0.7rem var(--s-5);
  border-bottom: 1px solid var(--band-line); font-family: var(--font-mono); font-size: var(--text-xs); color: #a9adba;
}
.code-card pre { margin: 0; padding: var(--s-5); overflow-x: auto; font-size: 0.8125rem; line-height: 1.75; tab-size: 2; }
.code-card code { font-size: inherit; }
.tok-k { color: var(--tok-keyword); }
.tok-s { color: var(--tok-string); }
.tok-c { color: var(--tok-comment); font-style: italic; }
.tok-n { color: var(--tok-number); }
.text-link { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: var(--s-6); font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- FAQ ---------- */

.faq-grid { display: grid; gap: var(--s-7) var(--s-8); }
.faq-grid .section-head { margin-bottom: 0; }
@media (min-width: 60rem) { .faq-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); } .faq-grid .section-head { margin-bottom: 0; position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; } }
.faq { border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-5) 0;
  font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 0.6rem; height: 0.6rem; margin-right: 0.3rem;
  border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: translateY(-25%) rotate(45deg); transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(15%) rotate(-135deg); }
.faq summary:hover { color: var(--accent); }
.faq details > p { padding: 0 var(--s-6) var(--s-5) 0; color: var(--ink-2); max-width: 40rem; }
.faq details > p + p { margin-top: calc(-1 * var(--s-2)); }

/* ---------- Final call to action ---------- */

.final { text-align: center; position: relative; overflow: hidden; }
.final::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 65px 32px;
  -webkit-mask-image: radial-gradient(60% 90% at 50% 100%, #000 0%, transparent 75%);
  mask-image: radial-gradient(60% 90% at 50% 100%, #000 0%, transparent 75%);
}
.final h2 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.045em; line-height: 1; max-width: 18ch; margin-inline: auto; }
.final .lede { margin-inline: auto; }
.final .cta-row { justify-content: center; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-7) var(--s-6); background: var(--surface-2); font-size: var(--text-sm); color: var(--ink-2); }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-5); }
.footer-nav { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.footer-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--text-xs); line-height: 1.6; }

/* ---------- Not found ---------- */

.notfound { min-height: calc(100vh - var(--header-h) - 12rem); display: grid; align-content: center; padding-block: var(--section); position: relative; overflow: hidden; }
.notfound::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 65px 32px;
  -webkit-mask-image: radial-gradient(90% 80% at 20% 30%, #000 0%, transparent 75%);
  mask-image: radial-gradient(90% 80% at 20% 30%, #000 0%, transparent 75%);
}
.error-cell {
  display: block; width: max-content; margin-bottom: var(--s-6); padding: 0.2rem 0.9rem;
  border: 2px solid var(--accent); border-radius: var(--r-sm); background: var(--surface);
  font-size: clamp(2.5rem, 1.5rem + 6vw, 5rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; color: var(--ink);
}
.notfound h1 { font-size: var(--text-2xl); letter-spacing: -0.03em; }

/* ---------- Documentation layout ---------- */

.doc-shell {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--s-7);
  max-width: calc(86rem + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter);
}
.doc-main { min-width: 0; padding-block: var(--s-7) var(--s-8); }
.doc-article { max-width: 46rem; }
.doc-sidebar, .doc-toc { font-size: var(--text-sm); }
.doc-sidebar { padding-block: var(--s-6); }
.doc-toc { display: none; }

.doc-search { position: relative; margin-bottom: var(--s-5); }
.doc-search input {
  width: 100%; min-height: 2.5rem; padding: 0.4rem 2.4rem 0.4rem 2.25rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-size: var(--text-sm);
}
.doc-search input::placeholder { color: var(--ink-3); opacity: 1; }
.doc-search input:focus-visible { outline-offset: 0; border-color: var(--focus); border-radius: var(--r-md); }
.doc-search svg { position: absolute; left: 0.7rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.doc-search kbd {
  position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%); padding: 0 0.4rem;
  border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-2); color: var(--ink-2); font-size: 0.75rem; line-height: 1.5; pointer-events: none;
}
.doc-search input:not(:placeholder-shown) ~ kbd { display: none; }
.doc-search-empty { margin-bottom: var(--s-4); color: var(--ink-2); }
.doc-results { list-style: none; display: grid; gap: 2px; margin-bottom: var(--s-4); }
.doc-results a { display: block; padding: 0.45rem 0.75rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; line-height: 1.35; }
.doc-results a:hover, .doc-results a:focus-visible { background: var(--surface-2); }
.doc-results strong { display: block; font-weight: 600; }
.doc-results span { display: block; font-size: var(--text-xs); color: var(--ink-2); }

/* {{nav}}: a <ul> of sections, each with a label and a nested <ul> of links. */
.doc-nav ul { list-style: none; }
.doc-nav > ul { display: grid; gap: var(--s-5); }
.doc-nav > ul > li > :not(ul):not(a) {
  display: block; margin-bottom: var(--s-2); padding-inline: 0.75rem;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.doc-nav a {
  display: block; padding: 0.35rem 0.75rem; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; line-height: 1.4;
}
.doc-nav a:hover { color: var(--ink); background: var(--surface-2); }
.doc-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.doc-nav ul ul ul { margin-left: 0.75rem; padding-left: 0.5rem; border-left: 1px solid var(--line); }

.doc-toc-title { margin-bottom: var(--s-3); font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.doc-toc ul { list-style: none; border-left: 1px solid var(--line); }
.doc-toc ul ul { border-left: 0; padding-left: 0.75rem; }
.doc-toc a { display: block; margin-left: -1px; padding: 0.3rem 0 0.3rem 0.9rem; border-left: 1px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.4; }
.doc-toc a:hover { color: var(--ink); border-left-color: var(--line-strong); }
.doc-toc a.is-active { color: var(--accent); border-left-color: var(--accent); }
.doc-toc:not(:has(a)) { visibility: hidden; }

.doc-pager { display: grid; gap: var(--s-4); max-width: 46rem; margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.doc-pager:not(:has(a)) { display: none; }
@media (min-width: 36rem) { .doc-pager { grid-template-columns: repeat(2, minmax(0, 1fr)); } .doc-pager a[rel="next"] { grid-column: 2; } }
.doc-pager a {
  display: block; padding: var(--s-4) var(--s-5); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.35;
  transition: border-color 0.15s ease;
}
.doc-pager a:hover { border-color: var(--accent); color: var(--accent); }
.doc-pager a[rel="next"] { text-align: right; }
.doc-pager > span:empty { display: none; }
.doc-pager a span { display: block; }
.doc-pager a span:first-child, .doc-pager a small {
  display: block; margin-bottom: 0.2rem; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}

.doc-menu-link { display: none; }

@media (max-width: 55.99rem) {
  /* Phones: the sidebar is a menu. Without JavaScript it sits after the article and the header button jumps to it. */
  .doc-shell { display: flex; flex-direction: column; }
  .doc-sidebar { order: 2; border-top: 1px solid var(--line); scroll-margin-top: var(--header-h); }
  .doc-menu-link { display: inline-grid; }
  .js .doc-sidebar { display: none; }
  .js .doc-sidebar.is-open { display: block; order: -1; border-top: 0; border-bottom: 1px solid var(--line); padding-bottom: var(--s-5); }
  .doc-main { padding-top: var(--s-6); }
}

@media (min-width: 56rem) {
  .doc-shell { grid-template-columns: 15.5rem minmax(0, 1fr); }
  .doc-sidebar {
    position: sticky; top: var(--header-h); align-self: start; height: calc(100vh - var(--header-h)); overflow-y: auto;
    padding-right: var(--s-4); border-right: 1px solid var(--line); overscroll-behavior: contain;
  }
  .doc-sidebar { margin-right: calc(-1 * var(--s-4)); }
}
@media (min-width: 76rem) {
  .doc-shell { grid-template-columns: 15.5rem minmax(0, 1fr) 13rem; }
  .doc-toc { display: block; position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding-block: var(--s-7); }
}

/* ---------- Prose: {{content}} arrives as plain elements, so style by element ---------- */

.prose { font-size: var(--text-base); line-height: 1.7; color: var(--ink); }
.prose > :first-child { margin-top: 0; }
.prose :is(h1, h2, h3, h4) { scroll-margin-top: calc(var(--header-h) + 1.25rem); }
.prose h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; margin-bottom: var(--s-5); }
.prose h1 + p { font-size: var(--text-lg); line-height: 1.55; color: var(--ink-2); }
.prose h2 { font-size: 1.625rem; letter-spacing: -0.025em; margin-top: 3.25rem; padding-top: 1.75rem; border-top: 1px solid var(--line); margin-bottom: var(--s-4); }
.prose h3 { font-size: 1.25rem; margin-top: 2.25rem; margin-bottom: var(--s-3); }
.prose h4 { font-size: 1.0625rem; letter-spacing: -0.01em; margin-top: 1.75rem; margin-bottom: var(--s-2); }
.prose p, .prose ul, .prose ol, .prose pre, .prose table, .prose blockquote, .prose dl, .prose figure { margin-top: 1.15rem; margin-bottom: 0; }
.prose :is(h2, h3, h4) + :is(p, ul, ol, pre, table, blockquote) { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-top: 0.4rem; padding-left: 0.2rem; }
.prose li::marker { color: var(--ink-3); }
.prose li > :is(ul, ol) { margin-top: 0.4rem; }
.prose strong { font-weight: 650; }
.prose a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent-line); }
.prose a:hover { text-decoration-color: currentColor; }
.prose :is(h1, h2, h3, h4) a { color: inherit; text-decoration: none; font-weight: inherit; }
/* The build puts a "#" link at the start of each heading; show it in the margin on hover. */
.prose :is(h2, h3, h4) { position: relative; }
.prose :is(h1, h2, h3, h4) a.anchor {
  position: absolute; right: 100%; padding-right: 0.35em; color: var(--ink-3); font-weight: 400; opacity: 0; transition: opacity 0.15s ease;
}
.prose :is(h2, h3, h4):hover a.anchor, .prose a.anchor:focus-visible { opacity: 1; }
.prose a.anchor:hover { color: var(--accent); }
@media (max-width: 55.99rem) { .prose a.anchor { display: none; } }
.prose hr { margin: var(--s-7) 0; border: 0; border-top: 1px solid var(--line); }
.prose img { margin-top: 1.5rem; border: 1px solid var(--line); border-radius: var(--r-md); }

.prose :not(pre) > code {
  padding: 0.12em 0.36em; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2);
  font-size: 0.86em; overflow-wrap: anywhere;
}
.prose a > code { color: inherit; }
.prose pre {
  padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--code-bg); color: var(--code-ink);
  font-size: 0.84375rem; line-height: 1.7; overflow-x: auto; tab-size: 2;
}
.prose pre code { font-size: inherit; }
.prose kbd { padding: 0.1em 0.4em; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); font-size: 0.82em; }

.prose blockquote { margin-inline: 0; padding: 0.9rem 1.15rem; border-left: 3px solid var(--accent); border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--accent-soft); color: var(--ink); }
.prose blockquote > :first-child { margin-top: 0; }

/* Tables scroll inside themselves, with or without the build's .table-wrap around them. */
.prose .table-wrap { margin-top: 1.15rem; max-width: 100%; }
.prose .table-wrap > table { margin-top: 0; }
.prose :is(h2, h3, h4) + .table-wrap { margin-top: 0; }
.prose table {
  display: block; width: max-content; max-width: 100%; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0;
  font-size: var(--text-sm); line-height: 1.5; font-variant-numeric: tabular-nums;
}
.prose th, .prose td { padding: 0.6rem 0.9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th + th, .prose td + td { border-left: 1px solid var(--line); }
.prose thead th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose td { background: var(--surface); }
.prose table code { white-space: nowrap; }
.prose td { min-width: 9rem; }

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  .site-header, .site-footer, .doc-sidebar, .doc-toc, .doc-pager, .skip-link { display: none !important; }
  .doc-shell { display: block; }
  body { background: #fff; color: #000; }
}
