/* systeminformation v6 docs - site styles (no framework) */

@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --navy: #00456e;
  --steel: #5f9ac0;
  --ice: #acc9e3;

  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-2: #edf2f7;
  --text: #0e1d2b;
  --text-2: #3f5466;
  --text-3: #5b6f81;
  --border: #d9e2eb;
  --border-strong: #b9c8d6;
  --accent: #005f97;
  --accent-strong: #00456e;
  --accent-soft: #e2eef7;
  --on-accent: #ffffff;
  --code-bg: #eef3f8;
  --code-text: #102536;
  --warn: #8a4b00;
  --warn-bg: #fff4e0;
  --warn-border: #f0c98a;
  --danger: #a3261b;
  --danger-bg: #fdecea;
  --ok: #1f6f43;
  --ok-bg: #e5f4ea;
  --shadow-1: 0 1px 2px rgb(14 29 43 / 0.06), 0 2px 8px rgb(14 29 43 / 0.05);
  --shadow-2: 0 4px 12px rgb(14 29 43 / 0.08), 0 16px 40px rgb(14 29 43 / 0.1);

  --hl-keyword: #8a2f9e;
  --hl-string: #1f6f43;
  --hl-number: #a8530b;
  --hl-comment: #6a7c8c;
  --hl-attr: #005f97;
  --hl-title: #00456e;

  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --topbar-h: 60px;
  --sidebar-w: 264px;
  --toc-w: 220px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 150ms;
  --dur-2: 240ms;
  --dur-3: 420ms;

  color-scheme: light;
  accent-color: var(--accent);
}

:root[data-theme='dark'] {
  --bg: #08111d;
  --surface: #0e1a29;
  --surface-2: #132235;
  --text: #e3ebf3;
  --text-2: #b3c3d3;
  --text-3: #8fa3b7;
  --border: #1f3147;
  --border-strong: #2f4662;
  --accent: #8cc0e3;
  --accent-strong: #acc9e3;
  --accent-soft: #132c43;
  --on-accent: #06121f;
  --code-bg: #0b1724;
  --code-text: #dbe6f0;
  --warn: #f2b35a;
  --warn-bg: #2a1d08;
  --warn-border: #6b4a12;
  --danger: #ff8f84;
  --danger-bg: #2c1110;
  --ok: #7fd3a1;
  --ok-bg: #0f2519;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4), 0 2px 8px rgb(0 0 0 / 0.25);
  --shadow-2: 0 6px 16px rgb(0 0 0 / 0.4), 0 20px 48px rgb(0 0 0 / 0.45);

  --hl-keyword: #d4a5f5;
  --hl-string: #9bdcaf;
  --hl-number: #f5bb7a;
  --hl-comment: #7d91a5;
  --hl-attr: #8cc0e3;
  --hl-title: #c6dcef;

  color-scheme: dark;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
  interpolate-size: allow-keywords;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.65 var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection {
  background: color-mix(in srgb, var(--steel) 40%, transparent);
  color: inherit;
}
img,
svg {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition:
    text-decoration-color var(--dur-1),
    color var(--dur-1);
}
a:hover {
  text-decoration-color: currentColor;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
h1,
h2,
h3,
h4,
h5 {
  line-height: 1.2;
  text-wrap: balance;
  color: var(--text);
  margin: 0;
}
p,
ul,
ol {
  margin: 0 0 1rem;
}
li + li {
  margin-top: 0.25rem;
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
strong,
.bold {
  font-weight: 650;
}
.warn {
  color: var(--warn);
}
abbr[title] {
  text-decoration: none;
  cursor: help;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* ---------- code ---------- */
code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
  font-variant-ligatures: none;
}
:not(pre) > code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.12em 0.38em;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
td :not(pre) > code,
li :not(pre) > code {
  white-space: normal;
  overflow-wrap: anywhere;
}
pre {
  position: relative;
  margin: 0 0 1.25rem;
  padding: 1rem 1.125rem;
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.6;
  tab-size: 2;
}
pre code {
  font-size: inherit;
  background: none;
  padding: 0;
}
/* terminal art: box-drawing glyphs are missing in the JetBrains subset, use one system font for all chars */
pre.term code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  line-height: 1.3;
}
pre.output {
  padding-top: 2.1rem;
}
pre.output::before {
  content: 'Output';
  position: absolute;
  top: 0.6rem;
  left: 1.125rem;
  font: 600 0.6875rem/1 var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.1em 0.4em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
  color: var(--text-2);
  background: var(--surface);
}
.hljs-keyword,
.hljs-built_in,
.hljs-literal {
  color: var(--hl-keyword);
}
.hljs-string,
.hljs-regexp {
  color: var(--hl-string);
}
.hljs-number {
  color: var(--hl-number);
}
.hljs-comment {
  color: var(--hl-comment);
  font-style: italic;
}
.hljs-attr,
.hljs-property {
  color: var(--hl-attr);
}
.hljs-title,
.hljs-title.function_ {
  color: var(--hl-title);
  font-weight: 600;
}
.copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity var(--dur-1),
    color var(--dur-1),
    border-color var(--dur-1);
}
pre:hover .copy-btn,
.copy-btn:focus-visible,
.copy-btn.done {
  opacity: 1;
}
@media (hover: none) {
  .copy-btn {
    opacity: 1;
  }
}
.copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.copy-btn.done {
  color: var(--ok);
  border-color: var(--ok);
}
.copy-btn.done i {
  animation: pop var(--dur-2) var(--ease-out);
}
@keyframes pop {
  from {
    transform: scale(0.4);
  }
}

/* ---------- buttons, badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 0.9375rem/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--dur-1) var(--ease-out),
    background-color var(--dur-1),
    border-color var(--dur-1),
    box-shadow var(--dur-2);
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-strong);
  box-shadow: var(--shadow-1);
}
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.btn-link:hover {
  text-decoration-color: currentColor;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font: 600 0.75rem/1.2 var(--font-sans);
  background: var(--accent-soft);
  color: var(--accent-strong);
  white-space: nowrap;
}
.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

/* ---------- topbar ---------- */
.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-s);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus {
  top: 0.75rem;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  view-transition-name: topbar;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.brand img {
  width: 32px;
  height: 32px;
}
.topbar .brand {
  gap: 0.7rem;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}
.topbar .brand img {
  width: 36px;
  height: 36px;
}
.logo-dark {
  display: none;
}
:root[data-theme='dark'] .logo-dark {
  display: inline;
}
:root[data-theme='dark'] .logo-light {
  display: none;
}
.version-badge {
  font-family: var(--font-mono);
  font-weight: 500;
}
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: 260px;
  height: 40px;
  padding: 0 0.6rem 0 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-3);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition:
    border-color var(--dur-1),
    box-shadow var(--dur-2);
}
.search-trigger:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-1);
}
.search-trigger span {
  margin-right: auto;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--dur-1),
    color var(--dur-1);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.menu-btn {
  display: none;
}

/* ---------- shell layout ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 0 2.5rem;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.sidebar,
.toc {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100dvh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.75rem 0 3rem;
}
.doc {
  min-width: 0;
  padding: 2.25rem 0 5rem;
  max-width: 880px;
  view-transition-name: doc;
}
body[data-page='index'] .shell {
  display: block;
  max-width: none;
  padding: 0;
}
body[data-page='index'] .sidebar,
body[data-page='index'] .toc {
  display: none;
}
body[data-page='index'] .doc {
  max-width: none;
  padding: 0;
}

/* sidebar nav */
.nav-group + .nav-group {
  margin-top: 1.5rem;
}
.nav-title {
  margin: 0 0 0.4rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--text);
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list li {
  margin: 0;
}
.nav-list a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-size: 0.9375rem;
  text-decoration: none;
  transition:
    background-color var(--dur-1),
    color var(--dur-1);
}
.nav-list a i {
  width: 1.1em;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-3);
  transition:
    color var(--dur-1),
    transform var(--dur-2) var(--ease-out);
}
.nav-list a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-list a:hover i {
  transform: translateX(1px);
  color: var(--accent);
}
.nav-list a[aria-current='page'] {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 600;
}
.nav-list a[aria-current='page'] i {
  color: var(--accent);
}
.nav-list a[aria-current='page']::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  view-transition-name: nav-indicator;
}

/* toc */
.toc-title {
  margin: 0 0 0.6rem;
  font-size: 0.8125rem;
  font-weight: 650;
}
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}
.toc li {
  margin: 0;
}
.toc a {
  display: block;
  padding: 0.22rem 0 0.22rem 0.85rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition:
    color var(--dur-2),
    border-color var(--dur-2);
}
.toc a.lvl-3 {
  padding-left: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.toc a:hover {
  color: var(--text);
}
.toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

/* ---------- document typography ---------- */
.doc > h1 {
  font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
}
.doc h2 {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 3rem 0 1rem;
}
.doc h3 {
  font-size: 1.1875rem;
  font-weight: 650;
  margin: 2rem 0 0.75rem;
}
.doc h4 {
  font-size: 1.0625rem;
  font-weight: 650;
  margin: 1.75rem 0 0.6rem;
}
.doc h5 {
  font-size: 0.9375rem;
  font-weight: 650;
  margin: 1.25rem 0 0.5rem;
  color: var(--text-2);
}
.doc p,
.doc li {
  max-width: 72ch;
  overflow-wrap: break-word;
}
.doc > h1 + p {
  font-size: 1.125rem;
  color: var(--text-2);
}
.heading-anchor {
  margin-left: 0.4rem;
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.8em;
  opacity: 0;
  transition: opacity var(--dur-1);
}
:is(h2, h3):hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

/* generic tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table-wrap th,
.table-wrap td {
  padding: 0.55rem 0.8rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.table-wrap thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-weight: 650;
  font-size: 0.8125rem;
  color: var(--text-2);
  white-space: nowrap;
}
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}
.table-wrap tbody tr:hover td {
  background: color-mix(in srgb, var(--accent-soft) 45%, transparent);
}

/* ---------- function card ---------- */
.fn {
  position: relative;
  margin: 2rem 0 2.5rem;
  padding: 1.5rem 1.5rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.fn > h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1875rem;
}
.fn > h3 code {
  font-size: 1em;
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-strong);
  white-space: normal;
  overflow-wrap: anywhere;
}
.fn-desc {
  color: var(--text-2);
  margin-bottom: 0.9rem;
}
.fn-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-3);
}
.os-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.os-list li {
  margin: 0;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
}
.fn .table-wrap {
  margin: 0 -0.25rem 1.25rem;
}
table.fields td:first-child {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text);
  white-space: nowrap;
}
table.fields td:last-child {
  color: var(--text-2);
  min-width: 14rem;
}
table.fields .os-cell {
  width: 2.25rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  text-align: center;
}
.os-yes {
  color: var(--accent);
  font-size: 0.75rem;
}
.os-no {
  display: inline-block;
  width: 6px;
  height: 1px;
  background: var(--border-strong);
  vertical-align: middle;
}
.fn:target {
  animation: target-flash 1.6s var(--ease-out);
}
@keyframes target-flash {
  0%,
  25% {
    border-color: var(--accent);
    box-shadow:
      0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent),
      var(--shadow-1);
  }
}

/* example disclosure */
details.example {
  margin: 0 0 1rem;
  border-top: 1px solid var(--border);
}
details.example > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent);
}
details.example > summary::-webkit-details-marker {
  display: none;
}
details.example > summary::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--dur-2) var(--ease-out);
}
details.example[open] > summary::before {
  transform: rotate(45deg) translate(-2px, -2px);
}
details.example::details-content {
  block-size: 0;
  overflow: clip;
  opacity: 0;
  transition:
    block-size var(--dur-3) var(--ease-out),
    opacity var(--dur-2),
    content-visibility var(--dur-3) allow-discrete;
}
details.example[open]::details-content {
  block-size: auto;
  opacity: 1;
}

/* callouts */
.callout {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.callout > i {
  margin-top: 0.2rem;
  color: var(--accent);
}
.callout p:last-child {
  margin-bottom: 0;
}
.callout-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}
.callout-warn > i {
  color: var(--warn);
}

/* security advisories */
.advisory {
  margin: 0 0 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.advisory > h2 {
  margin: 0.6rem 0 1rem;
  font-size: 1.25rem;
}
.advisory h3 {
  margin-top: 1.25rem;
}
.advisory-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.advisory:target {
  animation: target-flash 1.6s var(--ease-out);
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.875rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  max-width: 1480px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}
.footer h2 {
  font-size: 0.8125rem;
  font-weight: 650;
  margin: 0 0 0.75rem;
}
.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer a {
  color: var(--text-2);
  text-decoration: none;
}
.footer a:hover {
  color: var(--accent);
}
.footer .brand {
  margin-bottom: 0.75rem;
}
.footer-note {
  color: var(--text-3);
  max-width: 34ch;
}

/* ---------- dialogs (search, drawer) ---------- */
dialog {
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
}
dialog::backdrop {
  background: rgb(4 12 22 / 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.cmdk {
  width: min(640px, calc(100vw - 2rem));
  margin: 12vh auto auto;
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.cmdk-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
}
.cmdk-head i {
  color: var(--text-3);
}
.cmdk-input {
  flex: 1;
  height: 56px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.0625rem;
}
.cmdk-input::placeholder {
  color: var(--text-3);
}
.cmdk-list {
  max-height: min(60vh, 460px);
  overflow-y: auto;
  margin: 0;
  padding: 0.5rem;
  list-style: none;
}
.cmdk-group {
  padding: 0.6rem 0.65rem 0.3rem;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--text-3);
}
.cmdk-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.15rem 0.75rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-s);
  cursor: pointer;
}
.cmdk-item i {
  grid-row: span 2;
  width: 1.2em;
  text-align: center;
  color: var(--text-3);
}
.cmdk-item .t {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cmdk-item .t code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.9rem;
}
.cmdk-item .d {
  grid-column: 2;
  font-size: 0.8125rem;
  color: var(--text-3);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cmdk-item .p {
  grid-row: 1;
  grid-column: 3;
  font-size: 0.75rem;
  color: var(--text-3);
}
.cmdk-item mark {
  background: none;
  color: var(--accent);
}
.cmdk-item[aria-selected='true'] {
  background: var(--accent-soft);
}
.cmdk-item[aria-selected='true'] i {
  color: var(--accent);
}
.cmdk-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-3);
}
.cmdk-foot {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-3);
}
.drawer {
  width: min(320px, 86vw);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 auto 0 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-2);
}
.drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  padding: 0 0.75rem 0 1rem;
  border-bottom: 1px solid var(--border);
}
.drawer nav {
  padding: 1rem 0.75rem 3rem;
}
@media (prefers-reduced-motion: no-preference) {
  .cmdk,
  .drawer,
  dialog::backdrop {
    transition:
      opacity var(--dur-2) var(--ease-out),
      transform var(--dur-3) var(--ease-out),
      overlay var(--dur-2) allow-discrete,
      display var(--dur-2) allow-discrete;
  }
  .cmdk[open] {
    opacity: 1;
    transform: none;
  }
  .drawer[open] {
    transform: none;
  }
  dialog[open]::backdrop {
    opacity: 1;
  }
  @starting-style {
    .cmdk[open] {
      opacity: 0;
      transform: translateY(-8px) scale(0.98);
    }
    .drawer[open] {
      transform: translateX(-100%);
    }
    dialog[open]::backdrop {
      opacity: 0;
    }
  }
}

/* ---------- home ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #e6eef6;
  background: #08111d;
  margin-top: calc(-1 * var(--topbar-h));
  padding: calc(var(--topbar-h) + clamp(3rem, 8vw, 6.5rem)) 1.25rem clamp(3.5rem, 7vw, 6rem);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url('hero.webp') center 40% / cover no-repeat;
  opacity: 0.85;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(6 14 25 / 0.94) 0%, rgb(6 14 25 / 0.78) 48%, rgb(6 14 25 / 0.45) 100%), linear-gradient(0deg, rgb(8 17 29 / 1) 0%, rgb(8 17 29 / 0) 30%);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.25rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin: 1.25rem 0 1.25rem;
}
.hero h1 .dim {
  color: var(--ice);
}
.hero-lead {
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  color: #c3d3e2;
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.hero .btn-primary {
  background: var(--ice);
  color: #04203a;
}
.hero .btn-primary:hover {
  background: #fff;
}
.hero .btn-ghost {
  color: #e6eef6;
  border-color: rgb(172 201 227 / 0.4);
}
.hero .btn-ghost:hover {
  color: #fff;
  border-color: var(--ice);
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  border: 1px solid rgb(172 201 227 / 0.3);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: #c3d3e2;
  text-decoration: none;
  background: rgb(8 17 29 / 0.5);
  transition: border-color var(--dur-1);
}
.hero-tag:hover {
  border-color: var(--ice);
  color: #fff;
}
.hero-tag .badge {
  background: var(--ice);
  color: #04203a;
}
.install {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 26rem;
  padding: 0 0.4rem 0 1rem;
  height: 52px;
  border: 1px solid rgb(172 201 227 / 0.28);
  border-radius: var(--radius);
  background: rgb(4 11 20 / 0.7);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: #e6eef6;
}
.install .prompt {
  color: var(--steel);
  user-select: none;
}
.install code {
  flex: 1;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.install .copy-btn {
  position: static;
  opacity: 1;
  background: transparent;
  border-color: rgb(172 201 227 / 0.28);
  color: #c3d3e2;
}

/* hero console - signature */
.console {
  border: 1px solid rgb(172 201 227 / 0.22);
  border-radius: var(--radius-l);
  background: rgb(5 12 22 / 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.5);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #dbe6f0;
}
.console-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  border-bottom: 1px solid rgb(172 201 227 / 0.14);
  overflow-x: auto;
}
.console-tab {
  flex: none;
  min-height: 36px;
  padding: 0 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: transparent;
  color: #9fb3c6;
  font: 500 0.8125rem/1 var(--font-mono);
  cursor: pointer;
  transition:
    color var(--dur-1),
    background-color var(--dur-1),
    border-color var(--dur-1);
}
.console-tab:hover {
  color: #fff;
}
.console-tab[aria-selected='true'] {
  color: #fff;
  background: rgb(172 201 227 / 0.12);
  border-color: rgb(172 201 227 / 0.25);
}
.console-pause {
  margin-left: auto;
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: #9fb3c6;
  cursor: pointer;
}
.console-pause:hover {
  color: #fff;
}
.console-body {
  padding: 1.1rem 1.25rem 1.25rem;
  min-height: 22.5rem;
}
.console-cmd {
  color: #fff;
  margin: 0 0 0.85rem;
  white-space: pre-wrap;
}
.console-cmd .k {
  color: #d4a5f5;
}
.console-cmd .f {
  color: var(--ice);
}
.console-out {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #c3d3e2;
  font-size: inherit;
  white-space: pre;
  overflow: hidden;
}
.console-out .key {
  color: #8cc0e3;
}
.console-out .str {
  color: #9bdcaf;
}
.console-out .num {
  color: #f5bb7a;
}
.console-out.swap {
  animation: scan var(--dur-3) var(--ease-out);
}
@keyframes scan {
  from {
    clip-path: inset(0 0 100% 0);
    filter: blur(2px);
  }
  to {
    clip-path: inset(0 0 0 0);
    filter: none;
  }
}
.console-progress {
  height: 2px;
  background: rgb(172 201 227 / 0.1);
}
.console-progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--steel);
  transform-origin: left;
  transform: scaleX(0);
}
.console-progress span.run {
  animation: progress 5s linear forwards;
}
@keyframes progress {
  to {
    transform: scaleX(1);
  }
}

/* home sections */
.home-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 6rem) 1.25rem 0;
}
.home-section > h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.375rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
}
.section-lead {
  max-width: 60ch;
  color: var(--text-2);
  font-size: 1.0625rem;
  margin-bottom: 2.25rem;
}
.advisory-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  max-width: 1240px !important;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  font-size: 0.9375rem;
}
.advisory-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.advisory-banner i {
  color: var(--warn);
}
.advisory-banner .t {
  font-weight: 600;
}
.advisory-banner a.all {
  margin-left: auto;
  font-weight: 600;
  white-space: nowrap;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.75rem;
  margin: 2.75rem 0 0;
  padding: 0;
  list-style: none;
}
.facts li {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.facts b {
  font-size: 1.625rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.facts span {
  font-size: 0.8125rem;
  color: #9fb3c6;
}

/* function catalog */
.catalog {
  columns: 3 280px;
  column-gap: 2.5rem;
}
.cat {
  break-inside: avoid;
  margin: 0 0 2.25rem;
}
.cat-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 650;
}
.cat-head a {
  color: var(--text);
  text-decoration: none;
}
.cat-head a:hover {
  color: var(--accent);
}
.cat-head i {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-s);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.875rem;
  transition:
    transform var(--dur-2) var(--ease-out),
    background-color var(--dur-2),
    color var(--dur-2);
}
.cat:hover .cat-head i {
  transform: rotate(-6deg) scale(1.06);
  background: var(--accent);
  color: var(--on-accent);
}
.cat ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cat li {
  margin: 0;
}
.cat li a {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.28rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: var(--radius-s);
  text-decoration: none;
  color: var(--text);
  transition:
    background-color var(--dur-1),
    transform var(--dur-2) var(--ease-out);
}
.cat li a code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--accent-strong);
}
.cat li a .d {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-3);
  white-space: nowrap;
}
.cat li a:hover {
  background: var(--surface-2);
  transform: translateX(3px);
}

/* quick start split */
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.75rem 3rem;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-weight: 650;
  font-size: 0.875rem;
  color: var(--accent);
  background: var(--surface);
}
.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 1rem;
  top: 2.1rem;
  bottom: 0.3rem;
  width: 1px;
  background: var(--border);
}
.steps h3 {
  font-size: 1.0625rem;
  margin: 0 0 0.35rem;
}
.steps p {
  color: var(--text-2);
  margin: 0;
}
.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.platforms li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.9375rem;
}
.platforms i {
  color: var(--text-3);
}
.v6-note {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
}
.v6-note > i {
  font-size: 1.5rem;
  color: var(--accent);
}
.v6-note h2 {
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
}
.v6-note p {
  margin: 0;
  color: var(--text-2);
}
.v6-note .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.home-end {
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
}
.prev-versions {
  margin-top: 1.5rem;
  color: var(--text-3);
  font-size: 0.9375rem;
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
  ::view-transition-old(doc) {
    animation: vt-out var(--dur-1) var(--ease-in-out) both;
  }
  ::view-transition-new(doc) {
    animation: vt-in var(--dur-3) var(--ease-out) both;
  }
  ::view-transition-group(nav-indicator) {
    animation-duration: var(--dur-3);
    animation-timing-function: var(--ease-out);
  }
  .hero .rise {
    animation: rise 0.9s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 70ms + 80ms);
  }
  @supports (animation-timeline: scroll()) {
    .hero-bg {
      animation: hero-drift linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }
  }
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}
@keyframes vt-out {
  to {
    opacity: 0;
  }
}
@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
  }
}
@keyframes hero-drift {
  to {
    transform: translateY(12%) scale(1.08);
  }
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}
@media (max-width: 960px) {
  .hero-inner,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 860px) {
  .topbar .brand {
    gap: 0.6rem;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
  }
  .topbar .brand img {
    width: 32px;
    height: 32px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .menu-btn {
    display: inline-grid;
  }
  .search-trigger {
    width: 40px;
    padding: 0;
    justify-content: center;
    border-color: transparent;
    background: transparent;
  }
  .search-trigger span,
  .search-trigger kbd {
    display: none;
  }
  .version-badge {
    display: none;
  }
  .doc {
    padding-top: 1.5rem;
  }
  .v6-note {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .topbar-inner {
    padding: 0 0.5rem 0 0.75rem;
    gap: 0.25rem;
  }
  .shell {
    padding: 0 1rem;
  }
  .fn {
    padding: 1.15rem 1rem 0.25rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }
  /* field table becomes stacked rows with platform chips */
  .fn .table-wrap {
    border: 0;
    background: none;
    margin: 0 0 1rem;
    overflow: visible;
  }
  table.fields thead {
    display: none;
  }
  table.fields,
  table.fields tbody {
    display: block;
  }
  table.fields tr {
    display: grid;
    grid-template-columns: 1fr repeat(5, auto);
    align-items: center;
    gap: 0.15rem 0.2rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
  }
  table.fields td {
    padding: 0;
    border: 0;
    background: none !important;
  }
  table.fields td:first-child {
    white-space: normal;
    overflow-wrap: anywhere;
    padding-right: 0.5rem;
  }
  table.fields td:last-child {
    grid-column: 1 / -1;
    min-width: 0;
    font-size: 0.875rem;
  }
  table.fields .os-cell {
    width: auto;
  }
  table.fields .os-cell::before {
    content: attr(data-os);
    display: grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 4px;
    font: 600 0.6875rem/1 var(--font-sans);
    color: var(--text-3);
    border: 1px dashed var(--border-strong);
    opacity: 0.6;
  }
  table.fields .os-cell.yes::before {
    color: var(--on-accent);
    background: var(--accent);
    border: 1px solid var(--accent);
    opacity: 1;
  }
  table.fields .os-cell > :not(.sr-only) {
    display: none;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
  .advisory {
    padding: 1.15rem 1rem;
  }
  .console-body {
    min-height: 19rem;
    padding: 1rem;
  }
  .install {
    max-width: none;
  }
}

@media print {
  .topbar,
  .sidebar,
  .toc,
  .footer,
  .copy-btn {
    display: none !important;
  }
  .shell {
    display: block;
  }
  details.example::details-content {
    block-size: auto;
    opacity: 1;
  }
}

/* history: keep version and date on one line */
body[data-page='history'] .table-wrap td:nth-child(-n + 2) {
  white-space: nowrap;
}

/* topbar over the dark home hero, in both themes */
.topbar.on-hero {
  background: rgb(8 17 29 / 0.55);
  border-bottom-color: rgb(172 201 227 / 0.14);
  --text: #e6eef6;
  --text-2: #c3d3e2;
  --text-3: #9fb3c6;
  --surface: rgb(8 17 29 / 0.6);
  --surface-2: rgb(172 201 227 / 0.12);
  --border: rgb(172 201 227 / 0.25);
  --border-strong: rgb(172 201 227 / 0.4);
  --accent-soft: rgb(172 201 227 / 0.16);
  --accent-strong: #acc9e3;
  transition: background-color var(--dur-2), border-color var(--dur-2);
}
.topbar.on-hero .logo-light {
  display: none;
}
.topbar.on-hero .logo-dark {
  display: inline;
}
