/* Doberman docs: the landing palette, tuned for long-form technical reading. */
:root {
  color-scheme: dark;
  --ink-0:  oklch(13% 0.008 55);
  --ink-1:  oklch(16% 0.009 55);
  --ink-2:  oklch(19.5% 0.010 55);
  --ink-3:  oklch(25% 0.012 55);
  --rule:   oklch(34% 0.012 55);
  --rule-2: oklch(25% 0.010 55);

  --fg:   oklch(96% 0 0);
  --fg-2: oklch(78% 0 0);
  --fg-3: oklch(65% 0 0);

  --tan:    oklch(74% 0.140 58);
  --tan-hi: oklch(84% 0.150 64);
  --tan-line: oklch(52% 0.10 58);

  --pass:  oklch(76% 0.16 152);
  --auth:  oklch(82% 0.155 78);
  --block: oklch(66% 0.205 26);

  --r-sm: 3px;
  --r: 6px;
  --d-fast: 140ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Archivo", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --z-sticky: 10;
  --z-drawer: 40;
  --z-backdrop: 39;
  --z-dialog: 50;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--fg);
  font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--tan); color: oklch(16% 0.02 50); }
* { scrollbar-color: var(--rule) var(--ink-1); scrollbar-width: thin; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--ink-1); }
*::-webkit-scrollbar-thumb { background: var(--rule); border: 2px solid var(--ink-1); border-radius: var(--r); }

:focus-visible { outline: 2px solid var(--tan); outline-offset: 2px; }
.skip {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: var(--z-dialog);
  padding: .6rem .9rem;
  border-radius: var(--r);
  background: var(--tan);
  color: var(--ink-0);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--d-fast) var(--ease);
}
.skip:focus { top: 1rem; }

.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  max-width: 1440px;
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--fg);
  font-weight: 700;
  letter-spacing: -.015em;
  text-decoration: none;
}
.brand img { flex: none; }
.docs-word { color: var(--fg-3); font-weight: 500; }

.topbar { display: none; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 1rem 1rem 1.25rem;
  background: var(--ink-1);
  border-right: 1px solid var(--rule-2);
}
.side-head { display: grid; gap: 1rem; }
.side-head .brand { min-height: 2.25rem; }
.close { display: none; }
.search-btn,
.copy,
.copy-md {
  min-height: 2rem;
  padding: .3rem .55rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-2);
  font: 400 .72rem/1.2 var(--mono);
  cursor: pointer;
  transition: color var(--d-fast) var(--ease), background-color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.search-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .55rem .65rem; font-size: .8125rem; }
.search-btn:hover, .copy:hover, .copy-md:hover { color: var(--fg); border-color: var(--tan-line); }
.search-btn span { display: inline-flex; gap: .2rem; }

.side-groups { margin-top: 1.4rem; }
.side-groups section + section { margin-top: 1.2rem; }
.side-groups ul { margin: .25rem 0 0; padding: 0; list-style: none; }
.group { margin: 0; color: var(--fg-3); font-size: .75rem; font-weight: 600; }
.side-groups a {
  position: relative;
  display: block;
  padding: .3rem .6rem .3rem .9rem;
  border-radius: var(--r);
  color: var(--fg-2);
  font-size: .875rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color var(--d-fast) var(--ease);
}
.side-groups a:hover,
.side-groups a[aria-current="page"] { color: var(--fg); }
.side-groups a[aria-current="page"]::before,
.toc a[aria-current="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: .9em;
  border-radius: 1px;
  background: var(--tan);
  transform: translateY(-50%);
}
.side-foot {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-2);
  color: var(--fg-3);
  font-size: .75rem;
  line-height: 1.8;
}
.side-foot a { color: var(--fg-2); text-decoration: none; }
.side-foot a:hover { color: var(--fg); }
.ver { display: block; font-family: var(--mono); }
.backdrop { display: none; }

.content { min-width: 0; padding: 2.5rem clamp(1.25rem, 4vw, 3.5rem) 4rem; }
.doc { max-width: 800px; margin-inline: auto; }
.crumbs { margin: 0 0 .65rem; color: var(--fg-3); font: 400 .8125rem/1.4 var(--mono); }
.crumbs span { padding-inline: .2rem; color: var(--tan-line); }
h1, h2, h3 { color: var(--fg); text-wrap: balance; }
h1 { margin: 0; font-size: 2rem; line-height: 1.15; font-weight: 600; letter-spacing: -.015em; }
.welcome h1 { font-size: 2.5rem; }
h2 { margin: 2.5rem 0 .65rem; font-size: 1.375rem; line-height: 1.3; font-weight: 600; }
h3 { margin: 1.75rem 0 .55rem; font-size: 1.125rem; line-height: 1.35; font-weight: 600; }
h4 { margin: 1.5rem 0 .5rem; font-size: 1rem; line-height: 1.4; font-weight: 600; }
p { text-wrap: pretty; }
.lede { max-width: 62ch; margin: .75rem 0 0; color: var(--fg-2); font-size: 1.0625rem; }
.doc > p:not(.crumbs):not(.doc-foot),
.doc > ul,
.doc > ol,
.callout,
.lede { max-width: 72ch; }
.doc > ul, .doc > ol { padding-left: 1.4rem; }
.doc li + li { margin-top: .3rem; }
.doc li::marker { color: var(--fg-3); }
.doc strong { font-weight: 600; }
.doc hr.rule { height: 0; margin: 1.25rem 0 0; border: 0; border-top: 1px solid var(--rule-2); }
.doc > hr:not(.rule) { margin: 2rem 0; border: 0; border-top: 1px solid var(--rule-2); }

.actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-top: 1rem; font: .8125rem/1.4 var(--mono); }
.actions a, .actions button { color: var(--fg-2); }
.actions a { text-decoration: none; }
.actions a:hover { color: var(--fg); }

.doc a:not(.anchor):not(.actions a):not(.pager a) {
  color: var(--tan);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, var(--tan) 35%, transparent);
  text-underline-offset: .18em;
  transition: color var(--d-fast) var(--ease), text-decoration-color var(--d-fast) var(--ease);
}
.doc a:not(.anchor):not(.actions a):not(.pager a):hover { color: var(--tan-hi); text-decoration-color: currentColor; }
.anchor {
  margin-left: .4rem;
  color: var(--fg-3);
  font: 400 .8em var(--mono);
  opacity: 0;
  text-decoration: none;
  transition: color var(--d-fast) var(--ease), opacity var(--d-fast) var(--ease);
}
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }

code {
  padding: .08em .35em;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-sm);
  background: var(--ink-2);
  font: .9em var(--mono);
}
kbd {
  padding: .08em .35em;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-sm);
  background: var(--ink-2);
  color: var(--fg-2);
  font: .9em var(--mono);
}
pre {
  margin: 0;
  padding: .9rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  background: var(--ink-1);
  color: var(--fg-2);
  font: 400 .875rem/1.55 var(--mono);
  tab-size: 2;
}
pre code { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; }
.code { margin: 1.25rem 0; }
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.25rem;
  padding: .3rem .45rem .3rem .75rem;
  border: 1px solid var(--rule-2);
  border-bottom: 0;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--ink-2);
}
.code-bar + pre { border-radius: 0 0 var(--r) var(--r); }
.code-bar span { color: var(--fg-3); font: 400 .72rem var(--mono); }

code.verdict { padding: .05em .45em; border-radius: var(--r-sm); font-weight: 600; }
code.pass { color: var(--pass); background: color-mix(in oklch, var(--pass) 12%, transparent); border-color: color-mix(in oklch, var(--pass) 35%, transparent); }
code.auth { color: var(--auth); background: color-mix(in oklch, var(--auth) 12%, transparent); border-color: color-mix(in oklch, var(--auth) 35%, transparent); }
code.block { color: var(--block); background: color-mix(in oklch, var(--block) 12%, transparent); border-color: color-mix(in oklch, var(--block) 35%, transparent); }

blockquote { margin: 1.25rem 0; padding: .25rem 1rem; border-left: 1px solid var(--rule); color: var(--fg-2); }
aside.callout { margin: 1.25rem 0; padding: .8rem 1rem; border: 1px solid var(--rule); border-radius: var(--r); background: var(--ink-1); }
.callout > :last-child { margin-bottom: 0; }
.callout-label { margin: 0 0 .25rem; color: var(--fg-2); font: 600 .75rem var(--mono); }
.tip { border-color: color-mix(in oklch, var(--tan) 35%, transparent); background: color-mix(in oklch, var(--tan) 8%, var(--ink-1)); }
.tip .callout-label { color: var(--tan); }
.fail-closed { border-color: color-mix(in oklch, var(--auth) 35%, transparent); background: color-mix(in oklch, var(--auth) 8%, var(--ink-1)); }
.fail-closed .callout-label { color: var(--auth); }
.never { border-color: color-mix(in oklch, var(--block) 35%, transparent); background: color-mix(in oklch, var(--block) 8%, var(--ink-1)); }
.never .callout-label { color: var(--block); }

.table-scroll { margin: 1.25rem 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th { padding: .55rem .75rem; border-bottom: 1px solid var(--rule); color: var(--fg-3); font-size: .8125rem; font-weight: 600; text-align: left; }
td { padding: .55rem .75rem; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
td code { white-space: nowrap; }
.wide .doc { max-width: 1040px; }

.diagram { margin: 1.5rem 0; padding: 1rem; overflow-x: auto; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--ink-1); }
.diagram pre { border: 0; background: transparent; }
.js pre.mermaid:not([data-processed]) { min-height: 220px; visibility: hidden; }
pre.mermaid[data-processed] svg { max-width: none; height: auto; }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule-2); }
.pager a { display: flex; gap: .45rem; max-width: 48%; color: var(--fg); line-height: 1.35; text-decoration: none; }
.pager a[rel="next"] { margin-left: auto; text-align: right; }
.pager small { display: block; color: var(--fg-3); font: 400 .72rem/1.45 var(--mono); }
.doc-foot { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--rule-2); color: var(--fg-3); font-size: .8125rem; }

.toc { position: sticky; top: 2.5rem; align-self: start; padding: 0 1rem 1rem 0; color: var(--fg-3); font-size: .8125rem; }
.toc-title { margin: 0 0 .65rem 1rem; color: var(--fg-2); font-weight: 600; }
.toc ul { margin: 0; padding: 0 0 0 1rem; border-left: 1px solid var(--rule-2); list-style: none; }
.toc .toc-sub { margin: .15rem 0 0 .45rem; padding-left: .55rem; border-left-color: var(--ink-3); }
.toc li { position: relative; margin: 0; }
.toc a { position: relative; display: block; padding: .25rem 0 .25rem .55rem; color: var(--fg-3); line-height: 1.35; text-decoration: none; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--fg); }
.toc-inline { display: none; }

dialog.search {
  width: min(640px, 92vw);
  margin: 12vh auto 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--ink-1);
  color: var(--fg);
}
dialog.search::backdrop { background: oklch(0% 0 0 / .6); }
.search input {
  width: 100%;
  padding: .9rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--rule-2);
  border-radius: var(--r) var(--r) 0 0;
  outline: 0;
  background: var(--ink-2);
  color: var(--fg);
  font-size: 1rem;
  caret-color: var(--tan);
}
.search input::placeholder { color: var(--fg-3); }
.results { max-height: 55vh; margin: 0; padding: .4rem; overflow-y: auto; list-style: none; }
.results li { position: relative; margin: 0; padding: .6rem .9rem; border-radius: var(--r-sm); cursor: pointer; }
.results li[aria-selected="true"] { background: var(--ink-3); }
.results li[aria-selected="true"]::before { content: ""; position: absolute; left: .25rem; top: 50%; width: 2px; height: .9em; border-radius: 1px; background: var(--tan); transform: translateY(-50%); }
.results strong { display: block; color: var(--fg); font-weight: 500; }
.results small { display: block; color: var(--fg-3); font: 400 .72rem/1.4 var(--mono); }
.results span { display: block; overflow: hidden; color: var(--fg-2); font-size: .8125rem; text-overflow: ellipsis; white-space: nowrap; }
.results .empty { color: var(--fg-2); font-size: .875rem; cursor: default; }
.hint { margin: 0; padding: .55rem .9rem; border-top: 1px solid var(--rule-2); color: var(--fg-3); font: 400 .7rem/1.5 var(--mono); }

@media (max-width: 1199px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
  .toc-inline { display: block; margin: 1.25rem 0; padding: .65rem .8rem; border: 1px solid var(--rule-2); border-radius: var(--r); color: var(--fg-2); font-size: .8125rem; }
  .toc-inline summary { cursor: pointer; font-weight: 600; }
  .toc-inline ul { margin: .6rem 0 0; padding-left: 1.2rem; }
  .toc-inline a { color: var(--fg-2); text-decoration: none; }
}

@media (max-width: 899px) {
  html { scroll-padding-top: 72px; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding-inline: 1rem;
    border-bottom: 1px solid var(--rule-2);
    background: var(--ink-1);
  }
  .topbar > div { display: flex; align-items: center; gap: .75rem; }
  .topbar .search-btn { width: auto; }
  .menu { color: var(--fg-2); font-size: .875rem; text-decoration: none; }
  .shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: var(--z-drawer);
    width: min(85vw, 320px);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform var(--d-fast) var(--ease);
  }
  .sidebar:target { transform: none; }
  .sidebar:target + .backdrop { opacity: 1; pointer-events: auto; }
  .side-head { grid-template-columns: 1fr auto; }
  .side-head .search-btn { grid-column: 1 / -1; }
  .close { display: inline-flex; align-items: center; color: var(--fg-2); font-size: .8125rem; text-decoration: none; }
  .backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-backdrop);
    display: block;
    opacity: 0;
    pointer-events: none;
    background: oklch(0% 0 0 / .6);
    transition: opacity var(--d-fast) var(--ease);
  }
  .content { padding-top: 2rem; }
}

@media (max-width: 520px) {
  .content { padding-inline: 1rem; }
  .pager { flex-direction: column; }
  .pager a { max-width: 100%; }
  .pager a[rel="next"] { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, ::before, ::after { transition-duration: 0s !important; animation: none !important; }
}

@media print {
  .sidebar, .toc, .toc-inline, .topbar, .actions, .pager, .search, .backdrop { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  body { background: white; color: black; }
}
