/* Tokens lifted from lanlan.site so docs share brand identity. Dark mode
   uses the same verdigris-family lift as the marketing /dev/ pages
   (--accent: #7FC2AC), NOT the sage variant. */
:root {
  color-scheme: light dark;
  --paper: #F4EFE6;
  --paper-2: #EDE6D8;
  --paper-rule: rgba(26, 22, 19, .12);
  --paper-soft-rule: rgba(26, 22, 19, .06);
  --ink: #1A1613;
  --ink-2: #3A342E;
  --ink-soft: #6B6259;
  --ink-faint: #9B9489;
  --moss: #3F7A66;
  --moss-2: #519682;
  --moss-soft: rgba(63, 122, 102, .14);
  --moss-faint: rgba(63, 122, 102, .06);
  --clay: #C99566;
  --clay-soft: rgba(201, 149, 102, .18);
  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --rule: var(--paper-rule);
  --rule-soft: var(--paper-soft-rule);
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-soft: var(--ink-soft);
  --fg-faint: var(--ink-faint);
  --accent: var(--moss);
  --accent-2: var(--moss-2);
  --accent-soft: var(--moss-soft);
  --accent-faint: var(--moss-faint);
  --code-bg: rgba(26, 22, 19, .055);
  --font-display: 'Newsreader', 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --max-w: 1240px;
  --content-w: 760px;
  --sidebar-w: 240px;
  --nav-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Auto-applies when the user's OS is set to dark. The :not([data-theme='light'])
   guard lets a manual toggle override prefers-color-scheme later if we add one. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #15110E;
    --bg-2: #1C1813;
    --rule: rgba(242, 235, 223, .12);
    --rule-soft: rgba(242, 235, 223, .06);
    --fg: #F2EBDF;
    --fg-2: #D9D0C2;
    --fg-soft: #988C7B;
    --fg-faint: #6B6259;
    --accent: #7FC2AC;
    --accent-2: #9CD7C4;
    --accent-soft: rgba(127, 194, 172, .20);
    --accent-faint: rgba(127, 194, 172, .08);
    --clay: #D9A87A;
    --code-bg: rgba(242, 235, 223, .07);
  }
}
[data-theme='dark'] {
  --bg: #15110E;
  --bg-2: #1C1813;
  --rule: rgba(242, 235, 223, .12);
  --rule-soft: rgba(242, 235, 223, .06);
  --fg: #F2EBDF;
  --fg-2: #D9D0C2;
  --fg-soft: #988C7B;
  --fg-faint: #6B6259;
  --accent: #7FC2AC;
  --accent-2: #9CD7C4;
  --accent-soft: rgba(127, 194, 172, .20);
  --accent-faint: rgba(127, 194, 172, .08);
  --clay: #D9A87A;
  --code-bg: rgba(242, 235, 223, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg-2);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.docs-layout { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
@media (max-width: 640px) { body { font-size: 16px; line-height: 1.6; } }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--paper); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) ::selection { background: var(--accent); color: var(--bg); }
}
[data-theme='dark'] ::selection { background: var(--accent); color: var(--bg); }

/* Skip-to-content link — visible only when keyboard-focused, fulfils
   WCAG 2.4.1 'bypass blocks'. Mirrors the marketing site's pattern. */
.skip-link {
  position: absolute;
  top: 8px; left: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--paper);
  font-family: var(--font-body); font-size: 14px;
  border-radius: 4px;
  transform: translateY(-200%);
  transition: transform 180ms ease;
  z-index: 100;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { transform: translateY(0); }

.site-nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: .5px solid var(--rule);
  height: var(--nav-h);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  height: 100%;
  display: flex; align-items: center; gap: 2rem;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: -0.01em; font-weight: 500;
  color: var(--fg);
  display: inline-flex; align-items: baseline; gap: 2px;
}
.nav-brand .dot { color: var(--accent); font-weight: 600; }
.nav-brand .nav-section {
  margin-left: 8px; font-size: 14px; font-family: var(--font-body);
  font-weight: 500; color: var(--fg-soft); letter-spacing: 0;
  text-transform: lowercase;
}
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  font-family: var(--font-body); font-size: 15px;
  color: var(--fg-2); font-weight: 500;
  transition: color 180ms ease;
}
.nav-links a:hover { color: var(--fg); }

/* Mobile burger + drawer (mirrors marketing-site pattern) */
.nav-burger {
  display: none;
  appearance: none; background: transparent; border: 0;
  cursor: pointer; padding: 8px; color: var(--fg);
  margin-left: auto;
}
.nav-burger svg { width: 22px; height: 22px; }
.mobile-drawer {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  flex-direction: column;
  padding: 16px clamp(1.25rem, 4vw, 2.5rem) 24px;
  animation: drawer-fade-in 220ms var(--ease);
}
.mobile-drawer.open { display: flex; }
.mobile-drawer-top { display: flex; align-items: center; height: var(--nav-h); }
.mobile-drawer-close {
  margin-left: auto;
  appearance: none; background: transparent; border: 0;
  color: var(--fg); cursor: pointer; padding: 8px;
}
.mobile-drawer-close svg { width: 22px; height: 22px; }
.mobile-drawer nav { display: flex; flex-direction: column; gap: 0; margin-top: 1.5rem; }
.mobile-drawer nav a {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  color: var(--fg); padding: .65rem 0;
  border-bottom: .5px solid var(--rule-soft);
  letter-spacing: -.02em; font-weight: 400;
}
.mobile-drawer nav a:last-child { border-bottom: 0; }
@keyframes drawer-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
}

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-size: 15px; line-height: 1;
  padding: 12px 20px; border-radius: 999px;
  border: .5px solid transparent;
  cursor: pointer; transition: all 200ms var(--ease);
  white-space: nowrap; font-weight: 600; letter-spacing: .005em;
  text-decoration: none;
}
/* Light: cream text on verdigris. Dark: ink-bg-tone text on lifted verdigris,
   following the marketing-site convention so the CTA stays legible. */
.btn-primary { background: var(--accent); color: var(--paper); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn-primary { color: var(--bg); }
}
[data-theme='dark'] .btn-primary { color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); background: var(--accent-2); }
.nav-cta { padding: 10px 18px; font-size: 14px; }

.docs-layout {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  width: 100%;
}
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 2rem; }
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  padding: 32px 0 64px;
  align-self: start;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
@media (max-width: 860px) {
  .docs-sidebar {
    position: static; padding: 16px 0 0;
    border-bottom: .5px solid var(--rule);
    margin-bottom: 24px; max-height: none;
  }
}
.docs-sidebar nav { display: flex; flex-direction: column; gap: 24px; }
.docs-sidebar h4 {
  margin: 0 0 8px;
  font-family: var(--font-body);
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--accent);
}
.docs-sidebar ul { list-style: none; margin: 0; padding: 0; }
.docs-sidebar li { margin: 0; }
.docs-sidebar li a {
  display: block;
  padding: 6px 0 6px 14px;
  font-size: 14.5px;
  color: var(--fg-2);
  border-left: 1.5px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}
.docs-sidebar li a:hover { color: var(--fg); }
.docs-sidebar li a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

main.docs-main { padding: 56px 0 80px; max-width: var(--content-w); }
.breadcrumb { font-size: 13px; color: var(--fg-soft); margin: 0 0 20px; font-family: var(--font-body); }
.breadcrumb a { color: var(--fg-soft); transition: color 180ms ease; }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb .sep { margin: 0 8px; color: var(--fg-faint); }
.breadcrumb .category { text-transform: capitalize; }

h1.docs-h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  line-height: 1.05; letter-spacing: -.025em;
  margin: 0 0 16px; color: var(--fg);
}
p.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0 0 36px;
  max-width: 580px;
  font-family: var(--font-body);
  font-weight: 400;
}

.docs-content h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.85rem; margin: 36px 0 12px;
  letter-spacing: -.02em; color: var(--fg);
}
.docs-content h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.55rem; letter-spacing: -.018em;
  margin: 44px 0 14px; line-height: 1.2; color: var(--fg);
}
.docs-content h3 {
  font-family: var(--font-body); font-weight: 600;
  font-size: 1.05rem; margin: 28px 0 10px; color: var(--fg);
}
.docs-content p { margin: 0 0 14px; max-width: 62ch; }
.docs-content ul, .docs-content ol { margin: 0 0 16px; padding-left: 24px; max-width: 62ch; }
.docs-content li { margin: 0 0 4px; line-height: 1.55; }
.docs-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: opacity 160ms ease;
}
.docs-content a:hover { opacity: .75; }
.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--fg);
}
.docs-content pre {
  background: var(--code-bg);
  padding: 18px; border-radius: 10px;
  overflow-x: auto; margin: 18px 0;
  border: .5px solid var(--rule);
}
.docs-content pre code {
  background: none; padding: 0;
  font-size: 0.88rem; line-height: 1.6;
}
.docs-content blockquote {
  border-left: 3px solid var(--accent-soft);
  padding: 6px 18px;
  margin: 18px 0;
  color: var(--fg-2);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  font-style: normal;
}
.docs-content em {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}
.docs-content strong { color: var(--ink); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .docs-content strong { color: var(--fg); }
}
[data-theme='dark'] .docs-content strong { color: var(--fg); }
.docs-content blockquote em { color: inherit; font-weight: 600; font-style: normal; }

.page-footer-meta {
  margin-top: 64px;
  padding-top: 18px;
  border-top: .5px solid var(--rule);
  font-size: 12.5px;
  color: var(--fg-soft);
  font-family: var(--font-body);
}
.page-footer-meta a { color: var(--fg-soft); }
.page-footer-meta a:hover { color: var(--fg); }

.site-footer {
  border-top: .5px solid var(--rule);
  margin-top: 64px;
  padding: 32px 0 40px;
  background: var(--bg-2);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 500; font-size: 18px;
  color: var(--fg);
}
.footer-brand .dot { color: var(--accent); font-weight: 600; }
.footer-links { display: inline-flex; gap: 22px; }
.footer-links a {
  color: var(--fg-soft); font-size: 14px; font-family: var(--font-body);
}
.footer-links a:hover { color: var(--fg); }
.footer-fineprint {
  width: 100%; margin: 8px 0 0;
  font-size: 12.5px; color: var(--fg-faint);
  font-family: var(--font-body);
}

.docs-landing { padding: 64px 0 56px; }
.docs-landing h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  line-height: 1.04; letter-spacing: -.028em;
  margin: 0 0 18px; color: var(--fg);
  max-width: 720px;
}
.docs-landing .lede {
  font-size: 1.2rem; max-width: 620px;
  color: var(--fg-2); margin: 0 0 40px;
}
.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin: 36px 0 56px;
}
.landing-card {
  display: block; padding: 22px 24px;
  background: var(--bg-2);
  border: .5px solid var(--rule);
  border-radius: 12px;
  text-decoration: none;
  color: var(--fg);
  transition: transform 200ms var(--ease), border-color 200ms ease;
}
.landing-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.landing-card .label {
  font-family: var(--font-body);
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .12em; font-weight: 600;
  color: var(--accent); margin: 0 0 8px;
}
.landing-card h3 {
  margin: 0 0 6px;
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.2rem; letter-spacing: -.012em;
  color: var(--fg);
}
.landing-card p {
  margin: 0; font-size: 14.5px;
  color: var(--fg-soft); line-height: 1.5;
  font-family: var(--font-body);
}
