/* qargi documentation: one stylesheet, system fonts, no scripts. Light and dark follow the reader's
   system setting (prefers-color-scheme). Text contrast is at least 4.5:1 in both. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1b1f24;
  --muted: #4a5560;
  --link: #0b5cad;
  --border: #d0d7de;
  --code-bg: #f3f5f7;
  --head-bg: #f6f8fa;
  --focus: #0b5cad;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --fg: #e6e9ec;
    --muted: #a3adb8;
    --link: #6cb6ff;
    --border: #2d353d;
    --code-bg: #171d24;
    --head-bg: #131920;
    --focus: #6cb6ff;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.6 var(--sans);
  overflow-wrap: break-word;
}
.wrap { max-width: 52rem; margin: 0 auto; padding: 0 1rem; }
a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.skip {
  position: absolute; left: 0.5rem; top: -4rem; padding: 0.5rem 0.75rem;
  background: var(--bg); color: var(--fg); border: 2px solid var(--focus); z-index: 10;
}
.skip:focus { top: 0.5rem; }

.site-header { border-bottom: 1px solid var(--border); background: var(--head-bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
.stamp { color: var(--muted); font-size: 0.875rem; }
.site-header nav { flex: 1 1 100%; }
.site-header ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-header nav a { color: var(--fg); text-decoration: none; padding: 0.25rem 0; display: inline-block; }
.site-header nav a:hover { text-decoration: underline; }
.site-header nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; }

main { padding-top: 1.25rem; padding-bottom: 3rem; }
.crumbs ol { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; font-size: 0.9rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 0.25rem; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; line-height: 1.25; margin: 2.25rem 0 0.75rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
h3 { font-size: 1.2rem; line-height: 1.3; margin: 1.75rem 0 0.5rem; }
h4 { font-size: 1rem; margin: 1.25rem 0 0.4rem; }
h2[id], h3[id], h4[id] { scroll-margin-top: 1rem; }
.anchor { margin-left: 0.4rem; text-decoration: none; font-weight: 400; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; }
p, ul, ol, blockquote, pre, .table-wrap, details { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
li > ul, li > ol { margin: 0.25rem 0; }
li + li { margin-top: 0.25rem; }
blockquote { border-left: 4px solid var(--border); padding: 0.1rem 1rem; color: var(--muted); }
blockquote > :last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
code { font: 0.9em/1.4 var(--mono); background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 4px; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; overflow-x: auto; }
pre code { background: none; padding: 0; font-size: 0.875rem; white-space: pre; }
.usage code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; vertical-align: bottom; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 100%; font-size: 0.95rem; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--head-bg); }
td:first-child code { white-space: nowrap; }

.toc { border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 1rem; background: var(--head-bg); }
.toc summary { cursor: pointer; font-weight: 600; }
.toc ul { margin: 0.5rem 0 0.25rem; }
.summary, .lede { color: var(--muted); font-size: 1.05rem; }
.dates { color: var(--muted); font-size: 0.9rem; }
.release-meta { color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); background: var(--head-bg); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { padding-top: 1rem; padding-bottom: 1rem; }
.site-footer p { margin: 0.25rem 0; }

@media (max-width: 48rem) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .site-header ul { flex-direction: column; gap: 0; }
  .site-header nav a { padding: 0.4rem 0; }
}
@media print {
  .site-header, .skip, .anchor, .toc { display: none; }
  body { background: #fff; color: #000; }
  a { color: inherit; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
