/* trunkjet documentation (D-1845, redesigned D-1869): the type and colour system of the public
   front (web/src/site.css): Reddit Sans and JetBrains Mono served from /docs/assets/fonts/ (OFL), a
   white ground, near-black ink, one blue for links. A reading layout: the manual on the left, a
   measure of about 70 characters, the page's sections on the right on wide screens. The only
   script is /docs/assets/docs.js (copy buttons, the current section, the remembered theme); every
   page reads fine without it. */
@font-face { font-family: 'Reddit Sans'; src: url('/docs/assets/fonts/reddit-sans.3e3b66d2.woff2') format('woff2'); font-weight: 200 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/docs/assets/fonts/jetbrains-mono.18be4527.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #fdfcf9; --surface: #f1efe8; --ink: #111111; --ink-2: #333333; --muted: #5f5f5f;
  --line: rgb(17 17 17 / 0.13); --line-soft: rgb(17 17 17 / 0.08);
  --link: #1a4be0; --link-hover: #1640c4; --tint: rgb(26 75 224 / 0.08); --action: #1a4be0; --action-ink: #ffffff;
  --code-bg: #f1efe8; --code-ink: #111111;
  --f-text: 'Reddit Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --r-sm: 4px; --r-md: 6px; --r-lg: 8px;
  --nav: 64px; --gut: 32px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #1b1a17; --surface: #262521; --ink: #f4f4f4; --ink-2: #d4d4d4; --muted: #a3a3a3;
    --line: rgb(255 255 255 / 0.14); --line-soft: rgb(255 255 255 / 0.08);
    --link: #9db7ff; --link-hover: #c2d3ff; --tint: rgb(157 183 255 / 0.12); --action: #ffffff; --action-ink: #111111;
    --code-bg: #262521; --code-ink: #f2f2f2;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #1b1a17; --surface: #262521; --ink: #f4f4f4; --ink-2: #d4d4d4; --muted: #a3a3a3;
  --line: rgb(255 255 255 / 0.14); --line-soft: rgb(255 255 255 / 0.08);
  --link: #9db7ff; --link-hover: #c2d3ff; --tint: rgb(157 183 255 / 0.12); --action: #ffffff; --action-ink: #111111;
  --code-bg: #262521; --code-ink: #f2f2f2;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav) + var(--s-5)); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.7 var(--f-text); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: var(--r-sm); }
.skip { position: absolute; left: var(--s-4); top: -60px; background: var(--ink); color: var(--bg); padding: var(--s-2) var(--s-4); border-radius: var(--r-md); z-index: 30; }
.skip:focus { top: var(--s-2); color: var(--bg); }

/* ---- the header: fixed, opaque, one hairline */
.top { position: sticky; top: 0; z-index: 20; height: var(--nav); background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1440px; height: 100%; margin: 0 auto; padding: 0 var(--gut); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-5); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; color: var(--ink); min-height: 44px; }
.brand:hover { color: var(--ink); }
.brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.brand .mark svg { width: 17px; height: 17px; fill: none; stroke: var(--bg); stroke-width: 2.4; stroke-linecap: round; }
.top-words { display: flex; gap: var(--s-1); justify-self: center; }
.top-words a, .top-actions .plain { color: var(--ink); font-size: 14px; font-weight: 500; padding: 0 var(--s-3); height: 40px; display: inline-flex; align-items: center; border-radius: var(--r-md); position: relative; }
.top-words a:hover, .top-actions .plain:hover { background: var(--tint); color: var(--ink); }
.top-words a[aria-current='page']::after { content: ''; position: absolute; left: var(--s-3); right: var(--s-3); bottom: 4px; height: 2px; background: var(--ink); border-radius: 2px; }
.top-actions { display: flex; align-items: center; gap: var(--s-2); }
.top-actions .btn { height: 36px; padding: 0 var(--s-4); border-radius: 999px; background: var(--action); color: var(--action-ink); font: 500 14px/1 var(--f-text); display: inline-flex; align-items: center; white-space: nowrap; transition: transform .18s var(--ease); }
.top-actions .btn:hover { transform: translateY(-1px); color: var(--action-ink); }
.search { position: relative; display: flex; align-items: center; margin-bottom: var(--s-5); }
.search svg { position: absolute; left: 12px; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 64px 0 36px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--ink); font: 400 15px var(--f-text); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 2px solid var(--link); outline-offset: 0; }
.search button { position: absolute; right: 4px; height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: 500 13px var(--f-text); cursor: pointer; }
.search button:hover { color: var(--ink); background: var(--tint); }
.search-m { display: none; }

/* ---- the frame: manual | page | on this page */
.shell { max-width: 1440px; margin: 0 auto; padding: 0 var(--gut); display: grid; grid-template-columns: 248px minmax(0, 1fr) 220px; gap: var(--s-7); align-items: start; }
.shell.no-toc { grid-template-columns: 248px minmax(0, 1fr); }
.side { position: sticky; top: var(--nav); max-height: calc(100vh - var(--nav)); overflow-y: auto; padding: var(--s-6) var(--s-2) var(--s-7) 0; font-size: 14.5px; line-height: 1.45; }
.side h2, .mnav h2 { margin: var(--s-5) 0 var(--s-2); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.side-nav h2:first-child { margin-top: 0; }
.side ul, .mnav ul { list-style: none; margin: 0; padding: 0; }
.side a, .mnav a { display: block; padding: 6px var(--s-3); margin-left: calc(-1 * var(--s-3)); border-radius: var(--r-md); color: var(--ink-2); }
.side a:hover, .mnav a:hover { background: var(--tint); color: var(--ink); }
.side a[aria-current='page'], .mnav a[aria-current='page'] { color: var(--ink); font-weight: 600; background: var(--surface); }
.mnav { display: none; }

main { min-width: 0; padding: var(--s-6) 0 var(--s-8); }
.doc, .hero, .sec, .results-wrap { max-width: 72ch; }
.crumb { margin: 0 0 var(--s-2); font-size: 14px; color: var(--muted); }
.doc h1, .hero h1, .results-head { font-size: clamp(32px, 1.6vw + 24px, 44px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 500; margin: 0 0 var(--s-5); text-wrap: balance; }
.doc h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 500; margin: var(--s-7) 0 var(--s-3); }
.doc h3 { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 500; margin: var(--s-6) 0 var(--s-2); }
.doc h4 { font-size: 16px; font-weight: 600; margin: var(--s-5) 0 var(--s-2); }
.doc h1 + p { font-size: 19px; line-height: 1.6; color: var(--ink-2); }
.doc p, .doc ul, .doc ol, .doc blockquote, .tw, .code { margin: 0 0 var(--s-4); }
.doc ul, .doc ol { padding-left: var(--s-5); }
.doc li { margin: var(--s-1) 0; }
.doc li::marker { color: var(--muted); }
.doc li > ul, .doc li > ol { margin: var(--s-1) 0; }
.doc strong { font-weight: 600; }
.doc a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); }
.doc a:hover { text-decoration-color: currentColor; }
.doc code { font: 400 0.875em/1.5 var(--f-mono); background: var(--surface); border-radius: var(--r-sm); padding: 1px 5px; overflow-wrap: anywhere; }
.doc pre { margin: 0; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5); overflow-x: auto; }
.doc pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.65; overflow-wrap: normal; }
.code { position: relative; }
.code .copy { position: absolute; top: 8px; right: 8px; height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--ink); font: 500 13px var(--f-text); cursor: pointer; opacity: 0; transition: opacity .15s var(--ease); }
.code:hover .copy, .code .copy:focus-visible, .code .copy.done { opacity: 1; }
@media (hover: none) { .code .copy { opacity: 1; } }
.doc blockquote { border-left: 2px solid var(--ink); padding: 2px 0 2px var(--s-4); color: var(--ink-2); }
.doc blockquote > :last-child { margin-bottom: 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.doc table { border-collapse: collapse; font-size: 15px; min-width: 100%; line-height: 1.5; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px var(--s-4); border-bottom: 1px solid var(--line-soft); }
.doc tr:last-child td { border-bottom: 0; }
/* a table whose header cells are all empty (a two-column list in Markdown) shows no header row */
.doc thead:not(:has(th:not(:empty))) { display: none; }
.doc th { font-weight: 600; background: var(--surface); border-bottom: 1px solid var(--line); }
.doc .ext { color: var(--ink-2); border-bottom: 1px dotted var(--muted); cursor: help; }
.doc img { max-width: 100%; height: auto; }

/* on this page: inline under the title below 1200px, a quiet column beside the page above */
.toc-in { margin: 0 0 var(--s-6); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 var(--s-4); font-size: 15px; }
.toc-in summary { cursor: pointer; font-weight: 500; min-height: 44px; display: flex; align-items: center; }
.toc-in ul { list-style: none; margin: 0 0 var(--s-3); padding: 0; }
.toc-in a { display: block; padding: 4px 0; color: var(--ink-2); }
.toc { position: sticky; top: var(--nav); padding: var(--s-6) 0; font-size: 14px; line-height: 1.45; max-height: calc(100vh - var(--nav)); overflow-y: auto; }
.toc strong { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: var(--s-2); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px var(--s-3); margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--ink); }

/* previous and next */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); max-width: 72ch; margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.pn a { display: block; padding: var(--s-3) 0; color: var(--ink); font-weight: 500; font-size: 17px; transition: transform .18s var(--ease); }
.pn a:hover { color: var(--link); }
.pn small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.pn .next { text-align: right; grid-column: 2; }
.pn .prev { grid-column: 1; }

/* the docs front page */
.hero { padding-top: var(--s-4); }
.hero p { font-size: 19px; line-height: 1.6; color: var(--ink-2); margin: 0 0 var(--s-6); }
.starts { list-style: none; margin: 0 0 var(--s-8); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); max-width: 960px; }
.starts a { display: grid; gap: var(--s-1); height: 100%; padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink); transition: transform .2s var(--ease), border-color .2s var(--ease); }
.starts a:hover { transform: translateY(-2px); border-color: var(--ink); color: var(--ink); }
.starts small { color: var(--muted); font-size: 13px; }
.starts strong { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.starts span { color: var(--muted); font-size: 15px; line-height: 1.5; }
.hero + .starts + .more, .more { color: var(--muted); max-width: 72ch; }
.sec { margin: 0 0 var(--s-7); max-width: 960px; }
.sec h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; margin: 0 0 var(--s-3); }
.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); }
.list a { display: block; padding: var(--s-3) 0; border-top: 1px solid var(--line-soft); color: var(--ink); }
.list a:hover strong { color: var(--link); }
.list strong { display: block; font-weight: 500; }
.list span { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.5; }

/* search results */
.results { list-style: none; margin: 0; padding: 0; }
.results li { padding: var(--s-4) 0; border-top: 1px solid var(--line-soft); }
.results a { font-weight: 500; font-size: 18px; }
.results p { margin: var(--s-1) 0 0; color: var(--ink-2); font-size: 15px; overflow-wrap: anywhere; }
.results small { color: var(--muted); }

/* the footer */
.foot { border-top: 1px solid var(--line); margin-top: var(--s-7); }
.foot-in { max-width: 1440px; margin: 0 auto; padding: var(--s-5) var(--gut) var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; justify-content: space-between; font-size: 14px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); }
.foot a { color: var(--muted); min-height: 32px; display: inline-flex; align-items: center; }
.foot a:hover { color: var(--ink); }

@media (max-width: 1199px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (min-width: 1200px) { .toc-in { display: none; } }
@media (max-width: 899px) {
  :root { --gut: 24px; }
  .shell, .shell.no-toc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { display: none; }
  .mnav { display: block; margin: var(--s-4) 0 var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 var(--s-4); }
  .mnav summary { cursor: pointer; font-weight: 500; min-height: 44px; display: flex; align-items: center; }
  .mnav nav { padding-bottom: var(--s-3); }
  .mnav a { min-height: 44px; display: flex; align-items: center; margin-left: 0; }
  .top-words { display: none; }
  .top-in { grid-template-columns: 1fr auto; }
  .search-m { display: block; margin-top: var(--s-4); }
  .search-m .search { margin-bottom: 0; }
  .starts { grid-template-columns: 1fr; }
  .list { grid-template-columns: 1fr; }
}
@media (max-width: 599px) {
  :root { --nav: 56px; --gut: 16px; }
  .top-actions .btn { display: none; }
  .top-actions .plain { height: 44px; }
  .search input { height: 44px; }
  .doc h1 + p { font-size: 17px; }
  .doc pre { margin-left: calc(-1 * var(--gut)); margin-right: calc(-1 * var(--gut)); border-radius: 0; border-left: 0; border-right: 0; }
  .pn { grid-template-columns: 1fr; }
  .pn .next, .pn .prev { grid-column: 1; text-align: left; }
  .foot a { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .top, .side, .mnav, .toc, .toc-in, .pn, .foot, .code .copy { display: none; } .shell { display: block; } }

/* a page without "On this page" (wide tables, such as the comparison) may use the room */
.shell.no-toc .doc { max-width: 110ch; }
