/* biome-ignore-all lint/style/noDescendingSpecificity: selectors are scoped to independent page parts, then overridden at responsive breakpoints. */
/* Pipo documentation. Same palette and system fonts as the landing page (site/style.css), plus a dark theme. */
:root {
  --paper: #f6f5ee;
  --panel: #fdfdf9;
  --ink: #20251e;
  --muted: #62685c;
  --line: #d9dccf;
  --accent: #456025;
  --accent-soft: #e6f1c8;
  --lime: #d1ec8c;
  --code-bg: #20251e;
  --code-ink: #e9ecdf;
  --t-key: #b9dc6c;
  --t-str: #f0cf8e;
  --t-tpl: #8fd3e8;
  --t-com: #8d957f;
  --note: #3d6a99;
  --warn: #9a6a12;
  --caution: #a43f2c;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --top: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171a15;
    --panel: #1f231c;
    --ink: #e6e9dd;
    --muted: #a3aa97;
    --line: #343a2e;
    --accent: #b9dc6c;
    --accent-soft: #2c3622;
    --code-bg: #0f110d;
    --note: #86b4e3;
    --warn: #e2b55a;
    --caution: #f08a74;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--top) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px / 1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
pre:focus-visible {
  outline: 3px solid #698c32;
  outline-offset: 2px;
}
::selection {
  background: var(--lime);
  color: #20251e;
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
}
.skip-link:focus {
  top: 8px;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--top);
  padding: 0 20px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.brand .dot {
  color: var(--accent);
}
.brand-docs {
  margin-left: -8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.menu {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
}
.search {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
}
.search input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.search kbd {
  position: absolute;
  right: 10px;
  top: 9px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font: 12px / 18px var(--mono);
}
#search-results {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  max-height: 70vh;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}
#search-results a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}
#search-results a:hover,
#search-results [aria-selected="true"] a {
  background: var(--accent-soft);
}
#search-results .r-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
}
#search-results .r-text {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
#search-results mark {
  background: var(--lime);
  color: #20251e;
  border-radius: 2px;
}
.top-links {
  display: flex;
  gap: 16px;
}
.top-links a {
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}
.top-links a:hover {
  color: var(--accent);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  max-width: 1440px;
  margin: 0 auto;
}
.sidebar,
.toc {
  position: sticky;
  top: var(--top);
  align-self: start;
  max-height: calc(100vh - var(--top));
  overflow-y: auto;
  padding: 24px 16px 48px 20px;
  font-size: 14.5px;
}
.sidebar {
  border-right: 1px solid var(--line);
}
.nav-title {
  margin: 20px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-title:first-child {
  margin-top: 0;
}
.sidebar ul,
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.sidebar a,
.toc a {
  display: block;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}
.sidebar a:hover,
.toc a:hover {
  background: var(--accent-soft);
}
.sidebar a[aria-current="page"],
.sidebar a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.sidebar ul ul {
  margin: 2px 0 4px 12px;
  border-left: 1px solid var(--line);
}
.toc {
  font-size: 13.5px;
}
.toc a {
  color: var(--muted);
  padding: 3px 8px;
}
.toc .toc-3 a {
  padding-left: 20px;
}
.toc a.current {
  color: var(--accent);
  font-weight: 600;
}
.content {
  min-width: 0;
  padding: 32px 48px 64px;
}

/* Prose */
.prose {
  max-width: 820px;
}
.prose h1 {
  margin: 0 0 16px;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.prose h2 {
  margin: 48px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.prose h3 {
  margin: 32px 0 8px;
  font-size: 20px;
  line-height: 1.3;
}
.prose h4 {
  margin: 24px 0 8px;
  font-size: 17px;
}
.prose h2 code,
.prose h3 code {
  font-size: 0.9em;
}
.anchor {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
}
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor,
.anchor:focus {
  opacity: 1;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}
.prose li + li {
  margin-top: 4px;
}
.prose li > p {
  margin-bottom: 8px;
}
.prose code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--panel));
  font: 0.88em var(--mono);
}
.prose a code {
  color: var(--accent);
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}
.prose blockquote {
  margin: 0 0 16px;
  padding: 4px 16px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.prose img {
  max-width: 100%;
}
.table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
}
.prose th,
.prose td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--panel);
  font-weight: 600;
}
.prose tr:last-child td {
  border-bottom: 0;
}
.prose td code {
  white-space: nowrap;
}

/* Code */
.code {
  position: relative;
  margin: 0 0 20px;
}
.code[data-lang] pre {
  padding-top: 34px;
}
.code[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 9px;
  left: 18px;
  color: var(--t-com);
  font: 12px var(--mono);
}
.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
  font: 13.5px / 1.6 var(--mono);
  tab-size: 2;
}
.code pre code {
  padding: 0;
  background: none;
  font: inherit;
}
.copy {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 2px 10px;
  border: 1px solid #3f4637;
  border-radius: 6px;
  background: #2b3127;
  color: #cfd5c3;
  font: 12px var(--sans);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.code:hover .copy,
.copy:focus-visible {
  opacity: 1;
}
.t-key {
  color: var(--t-key);
}
.t-str {
  color: var(--t-str);
}
.t-tpl {
  color: var(--t-tpl);
}
.t-com {
  color: var(--t-com);
  font-style: italic;
}
.t-cmd {
  color: var(--t-key);
}
.t-prompt {
  color: var(--t-com);
  user-select: none;
}

/* Callouts */
.callout {
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--note);
  border-radius: 8px;
  background: var(--panel);
}
.callout p:last-child {
  margin-bottom: 0;
}
.callout .callout-title {
  margin: 0 0 4px;
  color: var(--note);
  font-weight: 700;
  font-size: 14px;
}
.callout-tip {
  border-left-color: var(--accent);
}
.callout-tip .callout-title {
  color: var(--accent);
}
.callout-warning,
.callout-important {
  border-left-color: var(--warn);
}
.callout-warning .callout-title,
.callout-important .callout-title {
  color: var(--warn);
}
.callout-caution {
  border-left-color: var(--caution);
}
.callout-caution .callout-title {
  color: var(--caution);
}

/* Pager and footer */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 820px;
  margin-top: 56px;
}
.pager a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.pager a:hover {
  border-color: var(--accent);
}
.pager span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.pager-next {
  text-align: right;
}
.page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 820px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}
@media (max-width: 860px) {
  :root {
    --top: 56px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .menu {
    display: inline-block;
  }
  .topbar {
    gap: 10px;
    padding: 0 16px;
  }
  .top-links,
  .search kbd {
    display: none;
  }
  .brand {
    font-size: 20px;
  }
  .brand img {
    width: 24px;
    height: 24px;
  }
  .sidebar {
    position: fixed;
    top: var(--top);
    left: 0;
    bottom: 0;
    z-index: 9;
    width: min(300px, 85vw);
    max-height: none;
    background: var(--paper);
    box-shadow: 8px 0 24px rgb(0 0 0 / 0.15);
    transform: translateX(-105%);
    transition: transform 0.2s;
  }
  body.nav-open .sidebar {
    transform: none;
  }
  .content {
    padding: 24px 16px 48px;
  }
  .prose h1 {
    font-size: 32px;
  }
  .prose h2 {
    font-size: 23px;
  }
  .copy {
    opacity: 1;
  }
  .code:not([data-lang]) pre {
    padding-top: 34px;
  }
}
@media (max-width: 520px) {
  .brand-docs {
    display: none;
  }
  .pager {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .copy {
    transition: none;
  }
}
