/* Docs site — sidebar layout, not dashboard chrome */

:root {
  --bg: #fff;
  --bg-subtle: #f8f9fb;
  --border: #e6e8ec;
  --text: #1b1f24;
  --text-secondary: #5c6570;
  --text-tertiary: #8b949e;
  --accent: #0969da;
  --accent-fg: #fff;
  --sidebar-w: 272px;
  --header-h: 56px;
  --toc-w: 200px;
  --content-max: 48rem;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica,
    Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font: 16px/1.6 var(--font);
  color: var(--text);
  background: var(--bg);
}

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

/* —— Site header (thin) —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}
.site-header-inner {
  max-width: 100%;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-right: auto;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.site-brand img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  image-rendering: pixelated;
}
.brand:hover {
  text-decoration: none;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}
.toplink {
  color: var(--text-secondary);
}
.toplink:hover {
  color: var(--text);
  text-decoration: none;
}
.toplink.on {
  color: var(--text);
  font-weight: 500;
}
.sidebar-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}

/* —— Doc layout —— */
.layout-doc .layout-body {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  border-right: 1px solid var(--border);
  background: var(--bg-subtle);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}
.sidebar-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 20px 16px 48px;
}
.nav-section {
  margin-bottom: 20px;
}
.nav-section-title {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}
.nav-list a:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
  text-decoration: none;
}
.nav-list a.active {
  background: #fff;
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 0 0 1px var(--border);
}

.search {
  position: relative;
  margin-bottom: 20px;
}
.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.search-input:focus {
  outline: 2px solid var(--accent, #3b82f6);
  outline-offset: -1px;
}
.search-results {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.search-results li {
  margin: 0;
}
.search-results a {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}
.search-results a:hover {
  background: var(--bg-subtle);
  text-decoration: none;
}
.search-context {
  display: block;
  padding: 0 8px 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.content-column {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 32px 40px 80px;
  min-width: 0;
}
.doc-main {
  flex: 1;
  max-width: var(--content-max);
  min-width: 0;
}
.doc-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-tertiary);
}
.doc-footer a {
  color: var(--text-secondary);
}

/* TOC */
.toc {
  flex: 0 0 var(--toc-w);
  width: var(--toc-w);
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: flex-start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  font-size: 13px;
}
.toc-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}
.toc li {
  margin: 0;
}
.toc a {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
}
.toc a:hover {
  color: var(--accent);
  text-decoration: none;
}
.toc:empty,
.toc:not(:has(li)) {
  display: none;
}

/* —— Prose —— */
.prose h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.75em;
  letter-spacing: -0.02em;
}
.prose h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2em 0 0.65em;
  padding-top: 0.25em;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5em 0 0.5em;
  scroll-margin-top: calc(var(--header-h) + 12px);
}
.prose p,
.prose ul,
.prose ol {
  margin: 0.85em 0;
}
.prose ul,
.prose ol {
  padding-left: 1.35em;
}
.prose li {
  margin: 0.25em 0;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.35em;
}
.prose pre {
  margin: 1.25em 0;
  padding: 14px 16px;
  background: #0d1117;
  color: #e6edf3;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-family: var(--mono);
}
.prose pre.shell-block .sh-cli {
  color: #79c0ff;
  font-weight: 600;
}
.prose pre.shell-block .sh-cmd {
  color: #d2a8ff;
}
.prose pre.shell-block .sh-arg {
  color: #e6edf3;
}
.prose pre.shell-block .sh-flag {
  color: #7ee787;
}
.prose pre.shell-block .sh-comment {
  color: #8b949e;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 1.25em 0;
  display: block;
  overflow-x: auto;
}
.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.prose th {
  background: var(--bg-subtle);
  font-weight: 600;
}
.prose blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 3px solid var(--border);
  color: var(--text-secondary);
}
.prose .mermaid-figure {
  margin: 1.75em 0;
}
.prose .mermaid-viewport {
  width: 100%;
  padding: 16px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: visible;
}
.prose .mermaid-figure .mermaid {
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
.prose .mermaid-viewport svg {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
}

/* —— Home —— */
body.layout-home {
  background: #fff;
  --home-max: 1120px;
}
.layout-home .site-header-inner,
.home-section,
.home-footer {
  max-width: var(--home-max);
  margin-inline: auto;
}
.home-section {
  padding-inline: 28px;
}
.home-hero {
  min-height: 670px;
  padding-top: clamp(100px, 15vh, 160px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.home-kicker,
.eyebrow {
  color: var(--text-secondary);
  font: 650 11px/1.4 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.home-kicker {
  margin-bottom: 26px;
}
.home-hero h1 {
  max-width: 900px;
  font-size: clamp(3rem, 7.2vw, 6.3rem);
  font-weight: 650;
  line-height: 0.95;
  margin: 0;
  letter-spacing: -0.065em;
}
.home-hero h1 span {
  color: var(--text-tertiary);
}
.home-lead {
  max-width: 680px;
  margin: 32px auto 0;
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.6;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}
.btn {
  gap: 16px;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #d8dadd;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease,
    background 160ms ease;
}
.btn:hover {
  border-color: #aeb4bb;
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-primary {
  border-color: #111;
  background: #111;
  color: #fff;
}
.btn-primary:hover {
  border-color: #292929;
  background: #292929;
  color: #fff;
  filter: none;
}
.install-line {
  display: flex;
  align-items: center;
  max-width: 100%;
  gap: 12px;
  margin-top: 24px;
  padding: 11px 15px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  color: #363b42;
  font-size: 13px;
  text-align: left;
  scrollbar-width: none;
}
.install-line code {
  white-space: nowrap;
}
.prompt {
  color: #8b949e;
  font-family: var(--mono);
  user-select: none;
}
.product-stage {
  padding-bottom: 140px;
}
.knowledge-board {
  margin: 0 auto;
  overflow: hidden;
  border-block: 1px solid #dfe2e6;
}
.knowledge-head {
  min-height: 150px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 34px 0;
  border-bottom: 1px solid #e8eaed;
}
.knowledge-head > div {
  margin-right: auto;
}
.knowledge-head span,
.knowledge-flow h3,
.knowledge-uses > span {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.knowledge-head h2 {
  margin: 10px 0 0;
  color: var(--text);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  font-weight: 620;
  letter-spacing: -.04em;
}
.knowledge-head a {
  color: var(--text-secondary);
  font-size: 13px;
}
.knowledge-flow {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  min-height: 390px;
}
.knowledge-sources,
.knowledge-guides {
  padding: 46px 0;
}
.knowledge-flow h3 {
  margin: 0 0 30px;
}
.knowledge-sources > div,
.knowledge-guides > div {
  min-height: 76px;
  padding: 16px 0;
  border-top: 1px solid #eceef0;
}
.knowledge-sources strong,
.knowledge-guides span {
  font-size: 15px;
  font-weight: 600;
}
.knowledge-sources p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.knowledge-guides > div {
  display: flex;
  align-items: center;
  gap: 20px;
}
.knowledge-guides code {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 12px;
}
.knowledge-divider {
  position: relative;
}
.knowledge-divider::before {
  content: "";
  position: absolute;
  top: 46px;
  bottom: 46px;
  left: 50%;
  border-left: 1px solid #dfe2e6;
}
.knowledge-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  border: solid #8f969e;
  border-width: 1px 1px 0 0;
  background: #fff;
  transform: translate(-65%, -50%) rotate(45deg);
}
.knowledge-uses {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 0;
  border-top: 1px solid #e8eaed;
}
.knowledge-uses > span {
  margin-right: auto;
}
.knowledge-uses a {
  color: var(--text);
  font-size: 13px;
}
.how,
.run-section {
  padding-bottom: 150px;
}
.section-intro {
  max-width: 680px;
  margin-bottom: 64px;
}
.eyebrow {
  margin: 0 0 20px;
}
.section-intro h2,
.self-hosted h2,
.final-cta h2 {
  margin: 0;
  color: #111;
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  font-weight: 620;
  line-height: 1.05;
  letter-spacing: -0.055em;
}
.section-intro > p:last-child,
.self-hosted > div > p:last-child {
  margin: 24px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.7;
}
.steps {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}
.steps li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid var(--border);
}
.steps > li > span,
.run-number {
  padding-top: 3px;
  color: var(--text-tertiary);
  font: 600 11px var(--font);
}
.steps li div > code {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}
.steps li p {
  margin: 6px 0 0;
  color: var(--text-secondary);
}
.run-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.run-grid > a {
  min-height: 310px;
  padding: 30px;
  color: var(--text);
  background: #fff;
  border-right: 1px solid var(--border);
  transition: background 180ms ease;
}
.run-grid > a:last-child {
  border-right: 0;
}
.run-grid > a:hover {
  background: #f8f9fa;
  text-decoration: none;
}
.run-grid h3 {
  margin: 56px 0 12px;
  font-size: 20px;
  letter-spacing: -0.025em;
}
.run-grid p {
  min-height: 76px;
  margin: 0 0 28px;
  color: var(--text-secondary);
  font-size: 14px;
}
.run-grid > a > code {
  color: #333940;
  font-size: 11px;
}
.self-hosted {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(50px, 9vw, 110px);
  margin-bottom: 150px;
  padding-block: 90px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.server-command {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 24px;
  border: 1px solid #24282f;
  border-radius: 14px;
  background: #101216;
  color: #e8e9eb;
  font-size: 13px;
  overflow: hidden;
}
.server-command code {
  white-space: nowrap;
}
.server-command a {
  grid-column: 2;
  margin-top: 24px;
  color: #a9b0ba;
  font-size: 12px;
}
.final-cta {
  padding-bottom: 150px;
  text-align: center;
}
.final-cta p {
  margin: 20px 0 28px;
  color: var(--text-secondary);
}
.home-footer {
  min-height: 100px;
  padding: 30px 28px;
  display: flex;
  align-items: center;
  gap: 30px;
  border-top: 1px solid var(--border);
}
.home-footer nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: 13px;
}
.home-footer nav a {
  color: var(--text-secondary);
}
@media (prefers-reduced-motion: no-preference) {
  .home-kicker,
  .home-hero h1,
  .home-lead,
  .home-actions,
  .install-line {
    animation: home-enter 700ms cubic-bezier(.2, .75, .25, 1) both;
  }
  .home-kicker { animation-delay: 70ms; }
  .home-hero h1 { animation-delay: 140ms; }
  .home-lead { animation-delay: 210ms; }
  .home-actions { animation-delay: 280ms; }
  .install-line { animation-delay: 350ms; }
  @keyframes home-enter {
    from { opacity: 0; transform: translateY(14px); }
  }
  .knowledge-divider span {
    animation: knowledge-mark 3.2s ease-in-out infinite;
  }
  @keyframes knowledge-mark {
    0%, 100% { opacity: .45; }
    50% { opacity: 1; }
  }
}

/* —— Mobile —— */
@media (max-width: 1100px) {
  .toc {
    display: none;
  }
}
@media (max-width: 900px) {
  .sidebar-toggle {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--header-h);
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
  }
  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 80;
  }
  .content-column {
    padding: 24px 20px 64px;
  }
  .home-hero {
    min-height: 600px;
    padding-top: 100px;
  }
  .product-stage,
  .how,
  .run-section {
    padding-bottom: 100px;
  }
  .run-grid {
    grid-template-columns: 1fr;
  }
  .run-grid > a {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .run-grid > a:last-child {
    border-bottom: 0;
  }
  .run-grid h3 {
    margin-top: 28px;
  }
  .run-grid p {
    min-height: 0;
  }
  .self-hosted {
    grid-template-columns: 1fr;
    margin-bottom: 100px;
  }
  .knowledge-flow {
    grid-template-columns: 1fr;
  }
  .knowledge-divider {
    height: 55px;
  }
  .knowledge-divider::before {
    top: 0;
    bottom: 0;
  }
  .knowledge-divider span {
    transform: translate(-50%, -65%) rotate(135deg);
  }
  .knowledge-sources {
    padding-bottom: 0;
  }
  .knowledge-guides {
    padding-top: 0;
  }
}
@media (max-width: 600px) {
  .site-header-inner {
    padding-inline: 16px;
  }
  .topnav {
    gap: 13px;
  }
  .topnav a:nth-child(2) {
    display: none;
  }
  .home-section {
    padding-inline: 18px;
  }
  .home-hero h1 {
    font-size: clamp(2.7rem, 13vw, 4.2rem);
  }
  .knowledge-head,
  .knowledge-uses {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .knowledge-head {
    padding-block: 28px;
  }
  .knowledge-head a {
    margin-top: 4px;
  }
  .knowledge-uses {
    padding-block: 24px;
  }
  .knowledge-uses > span {
    margin: 0 0 8px;
  }
  .steps li {
    grid-template-columns: 42px 1fr;
  }
  .home-footer {
    align-items: flex-start;
  }
  .home-footer nav {
    flex-direction: column;
    gap: 8px;
  }
}
