/* Arbr docs — shares the marketing site's design system (index.html :root). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-var-latin.woff2") format("woff2");
}

:root {
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, "Cascadia Code", monospace;
  --ink: #171817;
  --ink-2: #292b29;
  --paper: #f3f2ed;
  --paper-2: #ebeae4;
  --card: #fbfaf6;
  --line: rgba(23, 24, 23, .14);
  --line-soft: rgba(23, 24, 23, .08);
  --muted: #6d706c;
  --muted-2: #5f625e;
  /* Signal blue, single-sourced from the -rgb channel (matches the marketing site). */
  --signal-rgb: 47, 55, 255;
  --signal: rgb(var(--signal-rgb));
  --signal-deep: #2517e0;
  --max: 1240px;
  --radius: 20px;
  --radius-sm: 12px;
  --sidebar-w: 250px;
  --toc-w: 200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.62;
}

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: var(--mono); }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 60px;
  padding: 0 24px;
  background: rgba(243, 242, 237, .82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: inline-flex; align-items: center; gap: 12px; }
.topbar .brand img { height: 17px; display: block; }
.topbar .brand .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
  transition: transform .15s, background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-dark { background: var(--ink); color: var(--white, #fbfaf6); border-color: var(--ink); }
.btn-dark:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn-light:hover { border-color: var(--signal); color: var(--signal); }
/* "Star on GitHub" — the count stays hidden until gh-stars.js has a real number,
   so the button is complete without it and nothing reflows when it lands. */
.btn-star { gap: 7px; }
.btn-star svg { width: 15px; height: 15px; flex: none; }
.gh-count {
  margin-left: 1px; padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,.22);
  font-variant-numeric: tabular-nums; font-weight: 600;
}

/* ── Layout: sidebar · content · toc ─────────────────────────────────────── */
.shell {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 48px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 60px;
  align-self: start;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 32px 8px 48px 0;
}
.sidebar .group { margin-bottom: 24px; }
.sidebar .group-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.sidebar a {
  display: block;
  padding: 6px 12px;
  margin: 1px 0;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.35;
}
.sidebar a:hover { background: var(--paper-2); text-decoration: none; }
.sidebar a.active {
  background: rgba(var(--signal-rgb), .08);
  color: var(--signal);
  font-weight: 500;
}

/* Mobile nav (a <details> that only shows narrow) */
.mobile-nav { display: none; }

.content {
  min-width: 0;
  padding: 40px 0 96px;
  max-width: 760px;
}

/* Right-hand "on this page" */
.toc {
  position: sticky;
  top: 60px;
  align-self: start;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 44px 0 48px;
  font-size: 13px;
}
.toc .toc-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  line-height: 1.4;
}
.toc a:hover { color: var(--ink); border-color: var(--muted); text-decoration: none; }

/* ── Typography ──────────────────────────────────────────────────────────── */
.content .kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 14px;
}
.content h1 {
  font-size: clamp(34px, 4.6vw, 46px);
  line-height: 1.05;
  letter-spacing: -.022em;
  font-weight: 500;
  margin: 0 0 18px;
}
.content .lede {
  font-size: 19px;
  line-height: 1.5;
  color: var(--muted-2);
  margin: 0 0 8px;
}
.content h2 {
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -.015em;
  font-weight: 500;
  margin: 56px 0 16px;
  padding-top: 12px;
}
.content h2:first-of-type { margin-top: 40px; }
.content h3 {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -.01em;
  font-weight: 600;
  margin: 34px 0 12px;
}
.content h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--ink-2);
}
.content p { margin: 0 0 16px; color: var(--ink-2); }
.content strong { font-weight: 600; color: var(--ink); }
.content ul, .content ol { margin: 0 0 16px; padding-left: 22px; color: var(--ink-2); }
.content li { margin: 6px 0; }
.content li::marker { color: var(--muted); }
.content hr { border: none; border-top: 1px solid var(--line); margin: 44px 0; }

/* Anchored headings */
.content h2, .content h3 { scroll-margin-top: 76px; }

/* ── Inline code + code blocks ───────────────────────────────────────────── */
.content :not(pre) > code {
  font-size: .86em;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: .12em .38em;
  color: var(--ink);
}
.codeblock {
  position: relative;
  margin: 0 0 20px;
}
.codeblock pre {
  margin: 0;
  background: var(--ink);
  color: #e7e8e4;
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}
.codeblock pre code { color: inherit; background: none; border: none; padding: 0; }
.codeblock .lang {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-dark, #a9aca7);
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(243, 242, 237, .22);
  background: rgba(243, 242, 237, .06);
  color: #cfd0cc;
  font: 500 11px/1 var(--sans);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.codeblock:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(243, 242, 237, .16); }
.codeblock:has(.lang) .copy-btn { top: 8px; right: 10px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 14px;
}
.content th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 14px 8px;
  border-bottom: 1px solid var(--line);
}
.content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  color: var(--ink-2);
}
.content td code { white-space: nowrap; }
/* Screenshots / figures */
.content figure { margin: 0 0 24px; }
.content figure img,
.content > img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.content figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.table-scroll { overflow-x: auto; margin: 0 0 22px; max-width: 100%; }
.table-scroll > table { margin-bottom: 0; min-width: 460px; }

/* ── Callouts ────────────────────────────────────────────────────────────── */
.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  background: rgba(var(--signal-rgb), .04);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0 0 20px;
  font-size: 14px;
}
.note.warn { border-left-color: #b26b1f; background: rgba(178, 107, 31, .06); }
.note p:last-child { margin-bottom: 0; }
.note .note-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

/* ── Cards (feature grids, next-steps) ───────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 18px;
}
.card h3, .card h4 { margin-top: 0; }
.card p { font-size: 14px; margin-bottom: 0; }
a.card { color: inherit; display: block; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--signal); transform: translateY(-2px); text-decoration: none; }
a.card .go { color: var(--signal); font-size: 13px; font-weight: 500; margin-top: 8px; display: inline-block; }

/* Pills for enum values etc. */
.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  margin: 2px 4px 2px 0;
  color: var(--ink);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.docs-footer {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding: 28px 0 60px;
  font-size: 13px;
  color: var(--muted);
}
.docs-footer a { color: var(--muted); }
.docs-footer a:hover { color: var(--ink); }
.docs-initiative { color: var(--ink); font-weight: 500; }
.docs-initiative a { color: var(--signal); font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .sidebar { display: none; }
  .mobile-nav { display: block; margin: 16px 0 0; }
  .mobile-nav > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-weight: 500;
    background: var(--card);
  }
  .mobile-nav > summary::-webkit-details-marker { display: none; }
  .mobile-nav[open] > summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .mobile-nav .m-links {
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 8px;
  }
  .mobile-nav .m-links a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; }
  .mobile-nav .m-links a.active { color: var(--signal); background: rgba(var(--signal-rgb), .08); }
  .content { padding: 28px 0 72px; }
  .topbar .brand .tag { display: none; }
  .btn-hide-mobile { display: none; }
}
