/* Tokens copied from nimbia.ai (the --aurius-* variables in its stylesheet). */
@font-face {
  font-family: "KMR Melange Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(https://nimbia.ai/fonts/kmr-melange/woff2/KMRMelangeGrotesk-SemiBold.woff2) format("woff2");
}
@font-face {
  font-family: "KMR Melange Grotesk Fallback";
  src: local(Arial);
  size-adjust: 93.7%;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/Inter-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Fragment Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/FragmentMono-Regular.woff2) format("woff2");
}

:root {
  --text: #001528;
  --text-strong: #001528d9;
  --text-nav: #001528cc;
  --text-secondary: #001528b0;
  --text-muted: #00152899;
  --border: #00000012;
  --line: #0015281a;
  --overlay-soft: #0015280f;
  --overlay: #00152812;
  --overlay-medium: #0015281f;
  --tint: #f5f9ff;
  --accent: oklch(0.632 0.202 253.6);
  --link: #2463eb;
  --code-bg: #001528; /* build.mjs swaps the shiki theme background for this value */
  --header-bg: #ffffffb8;
  --font-body: Inter, system-ui, sans-serif;
  --font-display: "KMR Melange Grotesk", "KMR Melange Grotesk Fallback", Inter, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, monospace;
  --max-width: 1328px;
  --header-h: 80px;
  --sidebar-w: 248px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}
.prose a:hover,
.page-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.frame {
  max-width: var(--max-width);
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.wordmark {
  display: block;
  height: 32px;
  width: auto;
}
/* Small uppercase mono labels. */
.brand-tag,
.eyebrow,
.code-lang,
.table th {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.brand-tag {
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--overlay-soft);
  position: relative;
  top: 2px;
}
.header-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.header-link {
  font-weight: 600;
  color: var(--text-nav);
}
.header-link:hover {
  color: var(--text);
}
.pill {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--overlay);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.pill:hover {
  background: var(--overlay-medium);
}

/* The soft blue wash behind the top of the page, as on the nimbia.ai hero. */
.glow {
  position: absolute;
  inset: 0 0 auto 0;
  height: 640px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 60% at 22% 0%, rgba(0, 136, 255, 0.13), transparent 70%),
    radial-gradient(35% 50% at 85% 10%, rgba(140, 120, 255, 0.08), transparent 70%),
    linear-gradient(to bottom, var(--tint), #fff);
}

/* Three-column layout */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 232px;
  min-height: calc(100vh - var(--header-h));
  /* Full-height divider next to the sidebar; the sticky sidebar itself is shorter. */
  background: linear-gradient(var(--border), var(--border)) var(--sidebar-w) 0 / 1px 100% no-repeat;
}

.sidebar,
.toc {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 40px 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--text-muted);
}

.nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.nav a {
  display: block;
  padding: 7px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.32;
  color: var(--text-nav);
}
.nav a:hover {
  background: rgba(0, 21, 40, 0.05);
  color: var(--text);
}
.nav a[aria-current="page"] {
  background: var(--overlay);
  color: var(--text);
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--line);
}
.toc li a {
  display: block;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-muted);
}
.toc li a:hover {
  color: var(--text);
}
.toc .toc-3 a {
  padding-left: 12px;
}

/* Content */
.content {
  padding: 56px 56px 32px;
  min-width: 0;
}
.prose {
  max-width: 760px;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
  position: relative;
}
.prose h1 {
  margin: 0 0 20px;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.prose h2 {
  margin: 48px 0 16px;
  padding-top: 32px;
  border-top: 1px dashed var(--line);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.prose h3 {
  margin: 40px 0 12px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.prose h4 {
  margin: 32px 0 8px;
  font-size: 18px;
  line-height: 1.3;
}
.prose h1 + p {
  font-size: 19px;
  line-height: 1.55;
  color: var(--text-secondary);
}
.prose h1 + h2 {
  margin-top: 32px;
}
.anchor {
  position: absolute;
  left: -0.9em;
  width: 0.9em;
  color: var(--text-muted);
  opacity: 0;
  font-family: var(--font-body);
  font-weight: 500;
}
.prose h2 .anchor {
  top: 32px;
}
.prose :is(h2, h3, h4):hover .anchor,
.anchor:focus-visible {
  opacity: 1;
  text-decoration: none;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
  color: var(--text-strong);
}
.prose ul,
.prose ol {
  padding-left: 22px;
}
.prose li {
  margin: 4px 0;
}
.prose li::marker {
  color: var(--text-muted);
}
.prose strong {
  color: var(--text);
  font-weight: 600;
}
.prose hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 40px 0;
}
.prose blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--tint);
  box-shadow: inset 0 0 0 1px rgba(0, 136, 255, 0.15);
}
.prose blockquote > :last-child {
  margin-bottom: 0;
}

.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--overlay-soft);
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Tables, styled as the white cards on nimbia.ai */
.table {
  margin: 8px 0 24px;
  overflow-x: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 1px 3px -1px rgba(0, 21, 40, 0.18);
}
.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
}
.table th {
  text-align: left;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  background: #00152805;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid #0015280d;
  vertical-align: top;
  color: var(--text-strong);
}
.table tr:last-child td {
  border-bottom: 0;
}
.table td:first-child {
  white-space: nowrap;
}

/* Code blocks, styled as the dark "The Nimbia way" panel on nimbia.ai */
.code {
  margin: 8px 0 24px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--code-bg);
  box-shadow: 0 1px 2px rgba(0, 21, 40, 0.2), 0 16px 24px -12px rgba(0, 21, 40, 0.3);
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dots {
  display: inline-flex;
  gap: 6px;
}
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}
.code-lang {
  flex: 1;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}
.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font: 600 13px/1 var(--font-body);
  cursor: pointer;
}
.copy:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
/* Both labels share one grid cell, so the button keeps the width of "Copied". */
.copy-label {
  display: inline-grid;
}
.copy-label > *,
.copy-label::after {
  grid-area: 1 / 1;
}
.copy-label::after {
  content: "Copied";
  visibility: hidden;
}
.copy[data-copied] {
  color: #80c098;
}
.code pre.shiki {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
}

.page-footer {
  max-width: 760px;
  display: flex;
  justify-content: space-between;
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  color: var(--text-muted);
}
.page-footer a {
  color: var(--text-muted);
}

/* Narrower screens: drop the right-hand contents list. */
@media (max-width: 1180px) {
  .shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}

/* Phones: the page list becomes a row of pills above the content. */
@media (max-width: 780px) {
  :root {
    --header-h: 64px;
  }
  .frame {
    border-left: 0;
    border-right: 0;
  }
  .header-inner {
    padding: 0 16px;
  }
  .wordmark {
    height: 26px;
  }
  .header-link {
    display: none;
  }
  .pill {
    height: 34px;
    padding: 0 14px;
    font-size: 14px;
  }
  .shell {
    display: block;
    background: none;
  }
  .sidebar {
    position: static;
    max-height: none;
    padding: 12px 16px;
    border-bottom: 1px dashed var(--line);
  }
  .sidebar .eyebrow {
    display: none;
  }
  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  .nav a {
    white-space: nowrap;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 14px;
    background: rgba(0, 21, 40, 0.04);
  }
  .content {
    padding: 32px 16px 24px;
  }
  .prose h1 {
    font-size: 36px;
  }
  .prose h1 + p {
    font-size: 17px;
  }
  .prose h2 {
    font-size: 26px;
    padding-top: 24px;
  }
  .anchor {
    display: none;
  }
  .code,
  .table {
    border-radius: 12px;
  }
  .code pre.shiki {
    font-size: 12.5px;
    padding: 14px 16px;
  }
}
