:root {
  --ink: #171620;
  --muted: #666375;
  --line: #dfdce8;
  --paper: #faf9f5;
  --panel: #ffffff;
  --violet: #6d50e6;
  --violet-soft: #eeeafd;
  --green: #0d6d5b;
  --code: #171620;
  --code-line: #302d3b;
  --max: 1180px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { position: relative; margin: 0; min-width: 320px; overflow-x: hidden; background: var(--paper); }
body::before, body::after { content: ""; position: fixed; z-index: -1; border-radius: 50%; pointer-events: none; }
body::before { width: 420px; height: 420px; top: -250px; right: -180px; border: 1px solid rgba(109,80,230,.13); box-shadow: 0 0 0 62px rgba(109,80,230,.022), 0 0 90px rgba(109,80,230,.07); }
body::after { width: 310px; height: 310px; left: -230px; top: 58vh; border: 1px solid rgba(13,109,91,.08); box-shadow: 0 0 0 48px rgba(13,109,91,.015); }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.docs-topbar {
  position: sticky; top: 0; z-index: 30; min-height: 68px; padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: color-mix(in srgb, var(--paper) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px);
}
.docs-brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; }
.docs-brand img { width: 34px; height: 34px; border-radius: 9px; }
.docs-brand em { padding-left: 11px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; font-style: normal; font-weight: 650; letter-spacing: .02em; }
.docs-topbar nav { display: flex; align-items: center; gap: 23px; color: var(--muted); font-size: 14px; font-weight: 650; }
.docs-topbar nav a:hover, .docs-sidebar a:hover { color: var(--violet); }

.docs-layout { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: 210px minmax(0, 790px); gap: 70px; align-items: start; }
.docs-sidebar { position: sticky; top: 96px; padding: 24px 24px 48px 0; max-height: calc(100vh - 108px); overflow: auto; border-right: 1px solid var(--line); }
.docs-sidebar p { margin: 22px 0 8px; color: #94909f; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.docs-sidebar p:first-child { margin-top: 0; }
.docs-sidebar a { position: relative; display: block; padding: 7px 10px; margin-left: -10px; border-radius: 7px; color: var(--muted); font-size: 13px; line-height: 1.35; transition: color .15s ease, background .15s ease; }
.docs-sidebar a.is-active { background: var(--violet-soft); color: #4935a9; font-weight: 760; }
.docs-sidebar a.is-active::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--violet); }
.docs-main { min-width: 0; padding-bottom: 100px; }

.docs-hero { padding: 76px 0 56px; border-bottom: 1px solid var(--line); }
.eyebrow, .section-kicker { color: var(--violet); font-size: 11px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.docs-hero h1 { max-width: 740px; margin: 17px 0 20px; font-size: clamp(42px, 6vw, 68px); line-height: .99; letter-spacing: -.055em; }
.docs-hero > p:not(.eyebrow) { max-width: 720px; margin: 0; color: var(--muted); font-size: 19px; line-height: 1.65; }
.docs-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.docs-hero-actions a, .docs-cta a { min-height: 44px; padding: 11px 17px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 750; }
.docs-hero-actions .primary, .docs-cta .primary { border-color: var(--ink); background: var(--ink); color: white; }
.install-strip { margin-top: 32px; min-height: 58px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 10px 12px 10px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: 0 12px 38px rgba(33, 26, 61, .06); }
.install-strip span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.install-strip code { overflow: auto; color: var(--ink); font-size: 15px; font-weight: 700; }
.install-note { max-width: 900px; margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.install-note code { color: var(--ink); }

.copy-button { border: 1px solid #cbc6dc; border-radius: 7px; background: white; color: #514c60; cursor: pointer; padding: 7px 11px; font-size: 12px; font-weight: 750; }
.copy-button:hover { border-color: var(--violet); color: var(--violet); }
.copy-button.copied { border-color: #8bc6b8; background: #eaf8f4; color: var(--green); }

.docs-section { scroll-margin-top: 88px; padding: 64px 0; border-bottom: 1px solid var(--line); }
.docs-section h2 { margin: 10px 0 17px; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -.045em; }
.docs-section h3 { margin: 0 0 7px; font-size: 16px; letter-spacing: -.015em; }
.docs-section > p { max-width: 730px; color: var(--muted); font-size: 16px; line-height: 1.72; }
.docs-section p code { padding: 2px 5px; border-radius: 4px; background: var(--violet-soft); color: #4935a9; font-size: .9em; }

.code-card { margin: 26px 0; overflow: hidden; border: 1px solid #292633; border-radius: 14px; background: var(--code); color: #f7f5ff; box-shadow: 0 14px 40px rgba(26, 23, 36, .12); }
.code-card > div { min-height: 46px; padding: 8px 10px 8px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--code-line); color: #aaa5b8; font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.code-card .copy-button { border-color: #484354; background: #24212d; color: #cbc6d9; }
.code-card pre { margin: 0; padding: 23px; overflow: auto; font-size: 13px; line-height: 1.72; tab-size: 2; }
.code-card.compact pre { max-height: 540px; }

.callout { margin-top: 25px; padding: 18px 20px; display: grid; grid-template-columns: 180px 1fr; gap: 18px; border-left: 3px solid var(--violet); border-radius: 4px 12px 12px 4px; background: var(--violet-soft); }
.callout strong { font-size: 14px; }
.callout span { color: #5c5670; font-size: 14px; line-height: 1.6; }

.concept-grid, .option-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.concept-grid article, .option-grid article { min-height: 144px; padding: 21px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.72); }
.concept-grid article > span { width: 28px; height: 28px; margin-bottom: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--violet-soft); color: var(--violet); font-size: 12px; font-weight: 850; }
.concept-grid p, .option-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.option-grid code { display: inline-block; margin-bottom: 13px; color: var(--violet); font-size: 14px; font-weight: 800; }

.api-table { margin-top: 25px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.api-table > div { min-height: 58px; padding: 13px 17px; display: grid; grid-template-columns: minmax(150px, .7fr) 1.6fr; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); }
.api-table > div:last-child { border-bottom: 0; }
.api-table code { color: var(--violet); font-size: 13px; font-weight: 750; }
.api-table span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.exit-codes > div { grid-template-columns: 36px 1fr; }

.command-stack { margin-top: 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.command-stack > div { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(180px, .7fr); gap: 14px; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.command-stack > div:last-child { border-bottom: 0; }
.command-stack code { min-width: 0; overflow: auto; font-size: 12px; font-weight: 700; white-space: nowrap; }
.command-stack span { color: var(--muted); font-size: 12px; line-height: 1.45; }

details { margin-top: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.66); }
summary { cursor: pointer; padding: 16px 18px; font-weight: 750; }
details > p { margin: 0; padding: 0 18px 18px; color: var(--muted); font-size: 14px; line-height: 1.65; }
details .code-card { margin: 0 12px 12px; }

.metric-grid { margin: 27px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric-grid article { min-height: 126px; padding: 19px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.metric-grid strong { display: block; margin-bottom: 13px; color: var(--violet); font-size: 30px; line-height: 1; }
.metric-grid span { color: var(--muted); font-size: 12px; line-height: 1.45; }

.check-list { margin: 25px 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding: 10px 0 10px 29px; color: var(--muted); font-size: 14px; line-height: 1.55; border-bottom: 1px solid var(--line); }
.check-list li::before { content: "✓"; position: absolute; left: 2px; top: 10px; color: var(--green); font-weight: 900; }
.note { padding: 12px 15px; border-radius: 9px; background: #f0eee8; font-size: 13px !important; }

.boundary-card { margin-top: 27px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.boundary-card > div { padding: 23px; }
.boundary-card > div + div { border-left: 1px solid var(--line); }
.boundary-card strong { display: block; margin-bottom: 9px; }
.boundary-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.docs-cta { margin-top: 64px; padding: 40px; border-radius: 18px; background: var(--ink); color: white; }
.docs-cta p { margin: 0; color: #aaa5b8; font-size: 13px; font-weight: 700; }
.docs-cta h2 { max-width: 570px; margin: 12px 0 26px; font-size: clamp(30px, 5vw, 48px); letter-spacing: -.045em; }
.docs-cta > div { display: flex; flex-wrap: wrap; gap: 10px; }
.docs-cta a { border-color: #4d4858; background: #24212d; color: white; }
.docs-cta .primary { border-color: white; background: white; color: var(--ink); }

.docs-footer { min-height: 80px; padding: 0 max(24px, calc((100vw - var(--max)) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.docs-footer a { color: var(--muted); text-decoration: none; }
.docs-footer a:hover { color: var(--violet); }
.docs-mobile-nav { display: none; }
.copy-toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; transform: translateY(18px); opacity: 0; pointer-events: none; padding: 10px 14px; border-radius: 9px; background: var(--ink); color: white; font-size: 12px; font-weight: 750; transition: .18s ease; }
.copy-toast.visible { transform: translateY(0); opacity: 1; }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; width: min(760px, calc(100% - 36px)); }
  .docs-sidebar { display: none; }
  .docs-mobile-nav { position: sticky; top: 68px; z-index: 20; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line); background: rgba(250,249,245,.96); }
  .docs-mobile-nav label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
  .docs-mobile-nav select { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); padding: 0 10px; }
  .docs-section { scroll-margin-top: 126px; }
}

@media (max-width: 620px) {
  .docs-topbar { min-height: 62px; padding: 0 16px; }
  .docs-topbar nav { gap: 14px; font-size: 12px; }
  .docs-topbar nav a:first-child { display: none; }
  .docs-brand em { display: none; }
  .docs-mobile-nav { top: 62px; }
  .docs-layout { width: min(100% - 40px, 760px); }
  .docs-hero { padding: 50px 0 43px; }
  .docs-hero h1 { font-size: 43px; }
  .docs-hero > p:not(.eyebrow) { font-size: 16px; }
  .install-strip { grid-template-columns: 1fr auto; gap: 10px; padding-left: 13px; }
  .install-strip span { display: none; }
  .install-strip code { font-size: 13px; }
  .docs-section { padding: 48px 0; }
  .concept-grid, .option-grid, .metric-grid, .boundary-card { grid-template-columns: 1fr; }
  .concept-grid article { min-height: 0; }
  .metric-grid article { min-height: 0; display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; }
  .metric-grid strong { margin: 0; }
  .boundary-card > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .callout { grid-template-columns: 1fr; gap: 8px; }
  .api-table > div { grid-template-columns: 1fr; gap: 5px; }
  .exit-codes > div { grid-template-columns: 30px 1fr; }
  .command-stack > div { grid-template-columns: minmax(0, 1fr) auto; }
  .command-stack span { grid-column: 1 / -1; }
  .code-card pre { padding: 18px; font-size: 12px; }
  .docs-cta { padding: 30px 22px; }
  .docs-footer { padding: 20px 16px; align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .copy-toast { transition: none; }
}
