:root {
  --ink: #171716;
  --sub: #5f5f5a;
  --muted: #85857f;
  --line: #e6e6e1;
  --soft-line: #eeeeea;
  --surface: #ffffff;
  --soft: #f7f7f4;
  --green: #137a4b;
  --green-soft: #edf8f2;
  --code: #181817;
  --shadow-sm: 0 1px 2px rgba(16, 24, 16, .05), 0 8px 24px rgba(16, 24, 16, .05);
  --shadow-md: 0 2px 4px rgba(16, 24, 16, .06), 0 18px 46px rgba(16, 24, 16, .08);
  --sidebar: 264px;
  --header: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 24px); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Geist, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 680; }
.brand-mark { display: grid; width: 28px; height: 28px; place-items: center; color: white; background: var(--ink); border-radius: 7px; font-size: 12px; font-weight: 750; box-shadow: 0 1px 2px rgba(0,0,0,.16); }
.brand-divider { width: 1px; height: 17px; margin: 0 2px; background: var(--line); }
.brand-docs { color: var(--sub); font-weight: 520; }
.site-header nav { display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 550; }
.site-header nav a:hover { color: var(--green); }
.header-cta { padding: 7px 12px; color: white !important; background: var(--ink); border-radius: 7px; }
.header-cta:hover { background: #30302e; }
.menu-button { display: none; width: 36px; height: 36px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.menu-button > span:not(.sr-only) { display: block; height: 1.5px; margin: 3px 0; background: var(--ink); }

.docs-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) 220px; max-width: 1520px; min-height: calc(100vh - var(--header)); margin: 0 auto; }
.sidebar { border-right: 1px solid var(--soft-line); }
.sidebar-inner { position: sticky; top: var(--header); max-height: calc(100vh - var(--header)); overflow-y: auto; padding: 34px 28px 48px; }
.sidebar section + section { margin-top: 28px; }
.sidebar h2 { margin: 0 0 8px; color: var(--muted); font-size: 10px; line-height: 1.4; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.sidebar a { display: block; margin: 2px 0; padding: 6px 9px; border-radius: 6px; color: var(--sub); font-size: 13px; line-height: 1.35; }
.sidebar a:hover { color: var(--ink); background: var(--soft); }
.sidebar a[aria-current="page"] { color: var(--ink); background: #f0f0ec; font-weight: 620; }

.docs-main { min-width: 0; padding: 56px 64px 96px; }
article { width: 100%; max-width: 820px; margin: 0 auto; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; color: var(--muted); font-size: 12px; }
.breadcrumbs a:hover { color: var(--green); }
.article-header { margin-bottom: 56px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 11px; line-height: 1.4; font-weight: 720; text-transform: uppercase; letter-spacing: .08em; }
h1 { max-width: 760px; margin: 0; font-size: clamp(34px, 5vw, 50px); line-height: 1.08; font-weight: 680; letter-spacing: 0; text-wrap: balance; }
.lead { max-width: 700px; margin: 20px 0 0; color: var(--sub); font-size: 18px; line-height: 1.62; }
.notice { margin-top: 24px; padding: 13px 15px; border-left: 3px solid var(--green); color: #345b48; background: var(--green-soft); font-size: 13px; border-radius: 0 6px 6px 0; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 22px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.status-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px var(--green-soft); }
article section { padding: 0 0 52px; }
article section + section { padding-top: 4px; border-top: 1px solid var(--soft-line); }
h2 { margin: 38px 0 15px; font-size: 25px; line-height: 1.24; font-weight: 650; letter-spacing: 0; }
h3 { margin: 28px 0 9px; font-size: 17px; line-height: 1.35; font-weight: 650; }
p { margin: 0 0 17px; color: var(--sub); }
.section-intro { max-width: 700px; margin-bottom: 24px; }
ul, ol { margin: 0 0 18px; padding-left: 22px; color: var(--sub); }
li { margin: 7px 0; padding-left: 3px; }
strong { color: var(--ink); font-weight: 650; }
code { padding: .12em .34em; color: #31312f; background: #efefeb; border: 1px solid #e4e4df; border-radius: 4px; font-size: .88em; }
pre { margin: 14px 0 22px; padding: 20px; overflow-x: auto; color: #e9e9e4; background: var(--code); border: 1px solid #292927; border-radius: 8px; font-size: 12px; line-height: 1.72; box-shadow: 0 12px 30px rgba(0,0,0,.08); }
pre code { padding: 0; color: inherit; background: transparent; border: 0; border-radius: 0; }
.code-label { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 -15px; padding: 7px 12px 21px; color: #aaa9a2; background: var(--code); border: 1px solid #292927; border-bottom: 0; border-radius: 8px 8px 0 0; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.code-label + pre { position: relative; margin-top: 0; border-top: 0; border-radius: 0 0 8px 8px; box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.code-label button { padding: 3px 7px; color: #ddd; background: transparent; border: 1px solid #454541; border-radius: 4px; font-size: 10px; cursor: pointer; }
.code-label button:hover { background: #282826; }

.primary-guide { display: block; padding: 28px; border: 1px solid #cfd8d2; border-radius: 8px; background: linear-gradient(135deg, #f5faf7 0%, #fff 72%); box-shadow: var(--shadow-sm); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.primary-guide:hover { border-color: #95b8a4; transform: translateY(-1px); }
.primary-guide > strong { display: block; margin: 8px 0; font-size: 22px; line-height: 1.25; }
.primary-guide > span:not(.guide-kicker):not(.text-link) { display: block; color: var(--sub); }
.guide-kicker { color: var(--green); font-size: 10px; font-weight: 720; text-transform: uppercase; letter-spacing: .08em; }
.text-link { color: var(--green); font-weight: 650; }
.primary-guide .text-link { display: block; margin-top: 18px; font-size: 13px; }
.link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.link-grid a { min-height: 142px; padding: 20px; background: white; }
.link-grid a:hover { background: var(--soft); }
.link-grid strong, .link-grid span { display: block; }
.link-grid strong { margin-bottom: 6px; font-size: 15px; }
.link-grid span { color: var(--sub); font-size: 13px; line-height: 1.55; }

.concept-list { margin: 0; border-top: 1px solid var(--line); }
.concept-list div { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 24px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.concept-list dt { font-weight: 650; }
.concept-list dd { margin: 0; color: var(--sub); }
.steps { margin: 22px 0 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 15px; margin: 0; padding: 0 0 28px; }
.steps li > span { position: relative; z-index: 1; display: grid; width: 32px; height: 32px; place-items: center; color: white; background: var(--ink); border-radius: 50%; font-size: 11px; font-weight: 700; }
.steps li:not(:last-child) > span::after { content: ""; position: absolute; top: 32px; left: 15px; width: 1px; height: calc(100% + 28px); background: var(--line); }
.steps strong { display: block; padding-top: 3px; }
.steps p { margin: 3px 0 0; font-size: 14px; }
.steps.compact li { padding-bottom: 20px; }
.check-list { padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 27px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 1px; color: var(--green); font-weight: 750; }
.workflow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 20px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.workflow div { position: relative; min-height: 104px; padding: 18px 18px 16px 43px; background: white; }
.workflow div::before { content: counter(flow, decimal-leading-zero); counter-increment: flow; position: absolute; left: 16px; top: 19px; color: var(--green); font-family: monospace; font-size: 10px; font-weight: 700; }
.workflow { counter-reset: flow; }
.workflow b, .workflow span { display: block; }
.workflow b { margin-bottom: 5px; font-size: 14px; }
.workflow span { color: var(--sub); font-size: 12px; line-height: 1.5; }
.workflow-with-shot { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 22px; align-items: start; }
.workflow-with-shot .workflow { grid-template-columns: 1fr; margin: 0; }
.workflow-with-shot .workflow div { min-height: 78px; }
.product-shot { margin: 28px 0 8px; overflow: hidden; border: 1px solid #deded8; border-radius: 8px; background: #f8f8f6; box-shadow: var(--shadow-md); }
.product-shot a { display: block; }
.product-shot img { width: 100%; height: auto; background: white; }
.product-shot figcaption { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 14px; color: var(--muted); background: #fafaf8; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.45; }
.product-shot figcaption a { flex: 0 0 auto; color: var(--ink); font-weight: 650; }
.product-shot figcaption a:hover { color: var(--green); }
.product-shot-tall { margin: 0; }
.product-shot-tall img { aspect-ratio: 401 / 819; object-fit: cover; }
.note { margin-top: 20px; padding: 14px 16px; color: var(--sub); background: var(--soft); border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
table { width: 100%; margin: 20px 0; border-collapse: collapse; font-size: 13px; }
th { padding: 10px 12px; color: var(--muted); background: var(--soft); border: 1px solid var(--line); font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 13px 12px; color: var(--sub); border: 1px solid var(--line); vertical-align: top; }
td small { display: block; margin-top: 2px; color: var(--muted); font-family: monospace; }
.stack-diagram { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 22px 0; }
.stack-diagram span, .stack-diagram strong { padding: 14px; border: 1px solid var(--line); border-radius: 7px; text-align: center; font-size: 13px; }
.stack-diagram strong { grid-column: 1 / -1; color: white; background: var(--ink); border-color: var(--ink); }

.toc { position: sticky; top: calc(var(--header) + 34px); align-self: start; max-height: calc(100vh - var(--header) - 60px); padding: 38px 28px 0 0; overflow-y: auto; }
.toc strong { display: block; margin-bottom: 9px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.toc a { display: block; padding: 5px 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.toc a:hover, .toc a.is-active { color: var(--ink); }
.page-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; padding-top: 30px; border-top: 1px solid var(--line); }
.page-nav a { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.page-nav a > span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.page-nav strong { font-size: 13px; }
.page-nav a:hover strong { color: var(--green); }
.page-nav-next { align-items: flex-end; text-align: right; }
.site-footer { display: flex; align-items: center; justify-content: space-between; min-height: 74px; padding: 18px 28px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a:hover { color: var(--ink); }
.not-found { max-width: 700px; min-height: calc(100vh - 139px); margin: 0 auto; padding: 120px 28px; }
.not-found p:not(.eyebrow) { margin: 18px 0 28px; font-size: 17px; }
.button { display: inline-block; padding: 9px 14px; color: white; background: var(--ink); border-radius: 7px; font-size: 13px; font-weight: 650; }

@media (max-width: 1120px) {
  .docs-shell { grid-template-columns: 230px minmax(0,1fr); }
  .toc { display: none; }
  .docs-main { padding-right: 48px; padding-left: 48px; }
}

@media (max-width: 760px) {
  :root { --header: 58px; }
  .site-header { height: var(--header); padding: 0 16px; }
  .site-header nav { display: none; }
  .menu-button { display: block; }
  .docs-shell { display: block; }
  .sidebar { position: fixed; inset: var(--header) 0 0 0; z-index: 35; display: none; overflow-y: auto; border: 0; background: white; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { display: block; }
  .sidebar-inner { position: static; max-height: none; padding: 24px 20px 70px; }
  .sidebar a { padding: 9px; font-size: 14px; }
  .docs-main { padding: 32px 20px 66px; }
  .breadcrumbs { margin-bottom: 22px; }
  .article-header { margin-bottom: 40px; }
  h1 { font-size: 36px; }
  .lead { font-size: 16px; }
  article section { padding-bottom: 40px; }
  h2 { margin-top: 30px; font-size: 22px; }
  .link-grid, .workflow { grid-template-columns: 1fr; }
  .workflow-with-shot { grid-template-columns: 1fr; }
  .workflow-with-shot .workflow { order: 2; }
  .workflow-with-shot .product-shot { order: 1; width: min(100%, 280px); }
  .product-shot figcaption { align-items: flex-start; flex-direction: column; gap: 3px; }
  .product-shot-wide { margin-right: -10px; margin-left: -10px; }
  .link-grid a { min-height: 0; }
  .concept-list div { grid-template-columns: 1fr; gap: 3px; }
  .wide-table { display: block; overflow-x: auto; white-space: normal; }
  .wide-table tbody, .wide-table thead { min-width: 700px; }
  .stack-diagram { grid-template-columns: 1fr; }
  .stack-diagram strong { grid-column: auto; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 10px; padding: 20px; }
  .page-nav { gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
