html { scroll-padding-top: 68px; }
/* ============================================================
   docs.adunai.org · Clerk-style developer documentation
   ------------------------------------------------------------
   Industry-standard developer docs register:
   - White background, no decorative backdrops
   - Three-column: left sidebar nav + content + right rail TOC
   - Sans for headings + body, mono prominent for code/identifiers
   - Light code blocks, generous syntax color, scannable
   - Brand tokens preserved (teal accent, gold pill, type stack)
   ============================================================ */

:root{
  /* Brand tokens (preserved from marketing) */
  --bg:        #FFFFFF;
  --bg-soft:   #FAFAF7;
  --bg-code:   #F7F6F0;
  --bg-card:   #FBFAF6;
  --ink:       #0E1113;
  --fg:        #1A1D1F;
  --fg-soft:   #3A3E40;
  --fg-mute:   #6A6E70;
  --fg-faint:  #98989A;
  --line:      #ECE9DD;
  --line-hard: #DAD6C4;
  --rule:      rgba(10,11,14,0.08);
  --accent:    #0A3B36;
  --accent-2:  #16524A;
  --accent-br: #1F6F66;
  --accent-bg: rgba(10,59,54,0.06);
  --gold-500:  #C89B3C;
  --gold-700:  #9b6e1f;
  --gold-bg:   rgba(200,155,60,0.10);
  --warn:      #b67c00;

  --sans:    'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --display: 'Manrope', var(--sans);
  --mono:    'IBM Plex Mono', SF Mono, Menlo, monospace;
  --serif:   'Newsreader', Georgia, serif;

  --d-fast: 140ms;
  --d-med:  220ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --sidebar-w: 256px;
  --toc-w:     220px;
  --content-max: 760px;
  --topbar-h: 56px;
}

[data-theme="dark"]{
  --bg:        #0B0D0F;
  --bg-soft:   #131618;
  --bg-code:   #15191B;
  --bg-card:   #131618;
  --ink:       #F6F4EF;
  --fg:        #E8E4D7;
  --fg-soft:   #C8C4B7;
  --fg-mute:   #9B9788;
  --fg-faint:  #6B675A;
  --line:      #1F2326;
  --line-hard: #2A2E32;
  --rule:      rgba(232,228,215,0.08);
  --accent:    #6CBEB1;
  --accent-2:  #4FA29A;
  --accent-br: #88D2C6;
  --accent-bg: rgba(108,190,177,0.10);
  --gold-bg:   rgba(200,155,60,0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-family: var(--sans); color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; font-feature-settings: "ss01", "cv11"; font-size: 15px; line-height: 1.6; }

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

/* ============================================================
   TOP BAR · light, sticky, with search affordance
   ============================================================ */
.docs-top{
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
          backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  height: var(--topbar-h);
}
[data-theme="dark"] .docs-top{ background: rgba(11,13,15,0.88); }
.docs-top-inner{
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; gap: 28px;
}
.docs-top .brand{
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700;
  font-size: 13px; letter-spacing: 0.10em;
  color: var(--fg); flex-shrink: 0;
}
.docs-top .brand svg{ width: 16px; height: 20px; }
.docs-top .brand .sub{
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: lowercase;
  color: var(--fg-mute); font-weight: 400;
  padding: 3px 8px; border: 1px solid var(--line-hard); border-radius: 4px;
  margin-left: 4px;
}

/* Search affordance */
.docs-search{
  flex: 1; max-width: 360px;
  position: relative;
  display: flex; align-items: center;
}
.docs-search input{
  width: 100%; padding: 8px 12px 8px 36px;
  font-family: var(--sans); font-size: 13.5px;
  color: var(--fg); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 6px;
  outline: none;
  transition: border-color var(--d-fast) var(--ease), background var(--d-fast) var(--ease);
}
.docs-search input::placeholder{ color: var(--fg-mute); }
.docs-search input:focus{ border-color: var(--accent); background: var(--bg); }
.docs-search .icon{
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--fg-mute); pointer-events: none;
}
.docs-search .kbd{
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px;
  padding: 2px 6px; border: 1px solid var(--line-hard); border-radius: 4px;
  color: var(--fg-mute); background: var(--bg);
}

.docs-top .util{
  display: flex; gap: 18px; align-items: center;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--fg-mute); margin-left: auto;
}
.docs-top .util a{ color: var(--fg-mute); }
.docs-top .util a:hover{ color: var(--fg); }
.docs-top .util .pill{
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.10em;
  padding: 4px 9px; border: 1px solid var(--line-hard); border-radius: 999px;
  color: var(--fg-mute); text-transform: lowercase;
}
.docs-top .util .back{ display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }

/* Theme toggle button */
.docs-theme-btn{
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  padding: 0; margin: 0;
  background: transparent; color: var(--fg-mute);
  border: 1px solid var(--line); border-radius: 6px;
  cursor: pointer;
  transition: color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), background var(--d-fast) var(--ease);
}
.docs-theme-btn:hover{ color: var(--fg); border-color: var(--line-hard); background: var(--bg-soft); }
.docs-theme-btn .icon-moon{ display: none; }
html[data-theme="dark"] .docs-theme-btn .icon-sun{ display: none; }
html[data-theme="dark"] .docs-theme-btn .icon-moon{ display: inline; }

@media (max-width: 880px){
  .docs-search{ display: none; }
  .docs-top .util .back{ display: none; }
}

/* ============================================================
   THREE-COLUMN SHELL · sidebar + content + TOC
   ============================================================ */
.docs-shell{
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 48px;
}
@media (max-width: 1180px){
  .docs-shell{ grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 40px; }
  .docs-toc{ display: none; }
}
@media (max-width: 1024px){
  .docs-shell{ grid-template-columns: 1fr; padding: 0 20px; gap: 0; }
  .docs-nav{
    position: relative !important; height: auto !important;
    padding: 16px 0 !important;
    border-right: none !important; border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
  }
  .docs-nav h6:first-child{ margin-top: 0; }
}

/* ============================================================
   LEFT SIDEBAR · dense, mono-leaning
   ============================================================ */
.docs-nav{
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  padding: 28px 16px 32px 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  font-family: var(--sans); font-size: 13.5px;
}
.docs-nav h6{
  font-family: var(--sans); font-size: 11.5px;
  font-weight: 600; letter-spacing: 0.04em;
  text-transform: none; color: var(--fg);
  margin: 22px 0 8px;
}
.docs-nav h6:first-child{ margin-top: 4px; }
.docs-nav ul{ list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; border-left: 1px solid var(--line); }
.docs-nav a{
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 12px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--fg-mute);
  transition: color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
  font-weight: 400;
}
.docs-nav a:hover{ color: var(--fg); }
.docs-nav a.is-on{
  color: var(--accent); font-weight: 500;
  border-left-color: var(--accent);
}
.docs-nav .nav-tag{
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--fg-faint); margin-left: 8px;
  padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px;
}
.docs-nav a.is-on .nav-tag{ color: var(--accent); border-color: var(--accent-bg); background: var(--accent-bg); }
.docs-nav .nav-future a{ color: var(--fg-faint); cursor: default; }
.docs-nav .nav-future a:hover{ color: var(--fg-faint); }

/* ============================================================
   CENTER CONTENT · sans body, sans headings, mono for code
   ============================================================ */
.docs-main{
  padding: 56px 0 96px;
  max-width: var(--content-max);
  font-family: var(--sans); font-size: 15px; line-height: 1.65;
  color: var(--fg);
}

.docs-main .breadcrumb{
  display: flex; gap: 8px; align-items: center;
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  color: var(--fg-faint); margin-bottom: 16px;
}
.docs-main .breadcrumb a{ color: var(--fg-mute); }
.docs-main .breadcrumb a:hover{ color: var(--accent); }
.docs-main .breadcrumb .sep{ opacity: 0.5; }
.docs-main .breadcrumb .cur{ color: var(--fg); }

.docs-main h1{
  font-family: var(--display); font-weight: 700;
  font-size: 36px; line-height: 1.12;
  letter-spacing: -0.02em; color: var(--fg);
  margin: 0 0 12px; text-wrap: balance;
}
.docs-main h1 em{ font-style: normal; color: var(--fg); }
.docs-main h1 code{
  font-family: var(--mono); font-size: 0.78em; font-weight: 600;
  color: var(--accent); background: var(--accent-bg);
  padding: 2px 10px; border-radius: 5px;
  vertical-align: 2px;
}
.docs-main h1 + .lede{
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  color: var(--fg-soft); font-weight: 400;
  margin: 0 0 32px; max-width: 62ch;
}
.docs-main h1 + .lede em{ font-style: italic; color: var(--fg-mute); }
.docs-main h1 + .lede strong{ color: var(--fg); font-weight: 600; }

.docs-main h2{
  font-family: var(--display); font-weight: 600;
  font-size: 22px; line-height: 1.25; letter-spacing: -0.005em;
  color: var(--fg); margin: 56px 0 16px;
  padding-top: 28px; border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.docs-main h2:first-of-type{ border-top: none; padding-top: 0; margin-top: 16px; }
.docs-main h2 em{ font-style: normal; color: var(--fg-mute); }
.docs-main h2 code{
  font-family: var(--mono); font-size: 0.85em; font-weight: 600;
  color: var(--accent);
}

.docs-main h3{
  font-family: var(--display); font-weight: 600;
  font-size: 17px; line-height: 1.3;
  color: var(--fg); margin: 32px 0 10px;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.docs-main h3 em{ font-style: normal; color: var(--fg-mute); }
.docs-main h3 code{
  font-family: var(--mono); font-size: 0.92em; font-weight: 600;
  color: var(--accent);
}

.docs-main p{ margin: 0 0 16px; color: var(--fg-soft); }
.docs-main p em{ font-style: italic; color: var(--fg-mute); }
.docs-main p strong{ font-weight: 600; color: var(--fg); }
.docs-main p code,
.docs-main li code,
.docs-main td code{
  font-family: var(--mono); font-size: 0.85em; font-weight: 500;
  background: var(--bg-code); padding: 2px 6px;
  border: 1px solid var(--line); border-radius: 4px;
  color: var(--accent);
}
.docs-main ul, .docs-main ol{ padding-left: 20px; margin: 0 0 20px; color: var(--fg-soft); }
.docs-main li{ margin-bottom: 6px; }

/* ============================================================
   CODE BLOCKS · light theme, Clerk-style
   ============================================================ */
.docs-main pre{
  background: var(--bg-code);
  color: var(--fg);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
  padding: 18px 22px; margin: 0 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  position: relative;
}
.docs-main pre .cm{ color: var(--fg-faint); font-style: italic; }
.docs-main pre .kw{ color: #9b6e1f; font-weight: 500; }     /* keywords gold */
.docs-main pre .st{ color: #0A3B36; }                        /* strings teal */
.docs-main pre .fn{ color: var(--fg); }
.docs-main pre .pn{ color: var(--fg-mute); }
.docs-main pre .vr{ color: #1A1D1F; font-weight: 500; }
.docs-main pre .nm{ color: #16524A; }
.docs-main pre .num{ color: #b67c00; }

[data-theme="dark"] .docs-main pre .cm{ color: var(--fg-faint); }
[data-theme="dark"] .docs-main pre .kw{ color: #E8B86D; }
[data-theme="dark"] .docs-main pre .st{ color: #9FCFA5; }
[data-theme="dark"] .docs-main pre .vr{ color: #F4EFE2; }
[data-theme="dark"] .docs-main pre .nm{ color: #6CBEB1; }
[data-theme="dark"] .docs-main pre .num{ color: #E8B86D; }

/* Code-block header pill */
.docs-main .code-h{
  background: var(--bg-card);
  color: var(--fg-mute);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.04em;
  padding: 8px 18px;
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: 6px 6px 0 0;
  display: flex; justify-content: space-between; align-items: center;
}
.docs-main .code-h + pre{ margin-top: 0; border-radius: 0 0 6px 6px; border-top: 0; }

/* ============================================================
   CALLOUTS · refined, scannable
   ============================================================ */
.docs-main .callout{
  display: grid; grid-template-columns: 20px 1fr; gap: 14px;
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  margin: 0 0 20px;
}
.docs-main .callout.note{ border-left-color: var(--accent); }
.docs-main .callout.warn{
  border-left-color: var(--gold-500);
  background: var(--gold-bg);
  border-color: rgba(200,155,60,0.30);
}
.docs-main .callout .icon{
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  color: var(--accent); line-height: 1.6;
}
.docs-main .callout.warn .icon{ color: var(--gold-700); }
.docs-main .callout p{ margin: 0; font-size: 14px; line-height: 1.55; color: var(--fg); }
.docs-main .callout p + p{ margin-top: 6px; }
.docs-main .callout p em{ font-style: italic; color: var(--fg-mute); }
.docs-main .callout p strong{ color: var(--fg); font-weight: 600; }

/* ============================================================
   TABLES · clean rows, mono identifiers
   ============================================================ */
.docs-main table{
  width: 100%; border-collapse: collapse; margin: 0 0 24px;
  font-family: var(--sans); font-size: 13.5px;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.docs-main table thead th{
  text-align: left; padding: 10px 14px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--fg); background: var(--bg-soft);
  border-bottom: 1px solid var(--line-hard);
}
.docs-main table tbody td{
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  color: var(--fg-soft); vertical-align: top;
}
.docs-main table tbody tr:last-child td{ border-bottom: none; }
.docs-main table tbody tr:hover{ background: var(--bg-soft); }
.docs-main table tbody td em{ font-style: italic; color: var(--fg-mute); }
.docs-main table tbody td strong{ color: var(--fg); font-weight: 600; }

/* ============================================================
   QUICK-LINKS CARDS · used on landing
   ============================================================ */
.docs-cards{
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 0 28px;
}
@media (max-width: 640px){ .docs-cards{ grid-template-columns: 1fr; } }
.docs-card{
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  display: grid; gap: 6px; align-content: start;
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.docs-card:hover{ border-color: var(--line-hard); box-shadow: 0 1px 3px var(--rule); }
.docs-card .k{
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--fg-mute); font-weight: 500;
}
.docs-card .t{
  font-family: var(--display); font-size: 16px; font-weight: 600;
  color: var(--fg); line-height: 1.3;
}
.docs-card .t a{ color: var(--fg); }
.docs-card .t code{
  font-family: var(--mono); font-size: 0.85em; color: var(--accent);
  background: transparent; padding: 0; border: 0;
}
.docs-card .b{
  font-family: var(--sans); font-size: 13.5px; line-height: 1.55;
  color: var(--fg-soft); margin: 0;
}
.docs-card .a{
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  color: var(--accent);
  width: fit-content; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 4px;
}
.docs-card .a:hover{ color: var(--accent-br); }

/* ============================================================
   STATUS PILLS
   ============================================================ */
.docs-main .pill{
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 8px; border: 1px solid currentColor; border-radius: 4px;
}
.docs-main .pill .dot{ width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.docs-main .pill.live{ color: var(--accent); background: var(--accent-bg); }
.docs-main .pill.scope{ color: var(--gold-700); background: var(--gold-bg); }
.docs-main .pill.next{ color: var(--fg-mute); }

/* ============================================================
   RIGHT-RAIL TOC · "On this page"
   ============================================================ */
.docs-toc{
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  padding: 56px 0 32px 0;
  overflow-y: auto;
  font-family: var(--sans); font-size: 12.5px;
}
.docs-toc-h{
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--fg);
  margin: 0 0 10px;
}
.docs-toc ul{ list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; }
.docs-toc a{
  display: block; padding: 4px 0;
  color: var(--fg-mute);
  transition: color var(--d-fast) var(--ease);
  font-weight: 400;
  line-height: 1.4;
}
.docs-toc a:hover{ color: var(--fg); }
.docs-toc a.is-on{ color: var(--accent); font-weight: 500; }
.docs-toc a.lvl-3{ padding-left: 14px; font-size: 12px; }

/* Foot meta */
.docs-foot{
  border-top: 1px solid var(--line);
  padding: 24px 0 0;
  margin-top: 56px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
  font-family: var(--sans); font-size: 12.5px;
  color: var(--fg-faint);
}
.docs-foot .left a{ color: var(--accent); font-weight: 500; }
.docs-foot .left a:hover{ color: var(--accent-br); }
.docs-foot .right{ display: flex; gap: 18px; }
.docs-foot .right a{ color: var(--fg-mute); }
.docs-foot .right a:hover{ color: var(--fg); }

/* inert "coming soon" sidebar items */
.docs-nav a.nav-soon { pointer-events: none; cursor: default; opacity: .5; }

/* client-side search results dropdown */
.docs-search { position: relative; }
.docs-search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  background: var(--bg); border: 1px solid var(--line-hard); border-radius: 10px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.14); max-height: 60vh; overflow-y: auto; }
.docs-search-results a { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); }
.docs-search-results a:last-child { border-bottom: none; }
.docs-search-results a:hover { background: var(--bg-soft); }
.docs-search-results .dsr-t { font-size: 13.5px; color: var(--fg); font-weight: 500; }
.docs-search-results .dsr-h { font-size: 11.5px; color: var(--fg-mute); }
.docs-search-results .dsr-empty { padding: 12px 14px; font-size: 13px; color: var(--fg-mute); }

/* shared site footer (parity with the marketing home) */
.docs-sitefoot { border-top: 1px solid var(--line-hard); background: var(--bg-soft); margin-top: 8px; }
.dsf-inner { max-width: 1200px; margin: 0 auto; padding: 44px var(--pad, 32px) 28px;
  display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; }
@media (max-width: 900px){ .dsf-inner { grid-template-columns: 1fr 1fr; gap: 26px; } }
@media (max-width: 540px){ .dsf-inner { grid-template-columns: 1fr; } }
.dsf-brand a { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.16em; margin-bottom: 12px; }
.dsf-brand p { font-size: 13px; color: var(--fg-mute); line-height: 1.55; max-width: 34ch; }
.dsf-cols { display: contents; }
.dsf-cols h6 { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-faint); margin: 0 0 12px; }
.dsf-cols a { display: block; font-size: 13px; color: var(--fg-soft); padding: 4px 0; }
.dsf-cols a:hover { color: var(--accent); }
.dsf-bottom { max-width: 1200px; margin: 0 auto; padding: 16px var(--pad, 32px);
  border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--fg-faint); }
.dsf-bottom a { color: var(--fg-mute); }

/* section spot illustrations */
.doc-figure { margin: 6px 0 30px; text-align: center; }
.doc-figure img { display: inline-block; width: 100%; max-width: 440px; height: auto; }
.doc-figure.doc-hero img { max-width: 640px; }

.dsf-bottom .dsf-right { display: inline-flex; align-items: center; gap: 14px; }
.dsf-bottom .dsf-right a { color: var(--fg-mute); display: inline-flex; align-items: center; }
.dsf-bottom .dsf-right a:hover { color: var(--accent); }

/* long inline code (e.g. 66-char role hashes) wraps instead of forcing horizontal page scroll */
.md-doc code { overflow-wrap: anywhere; }
.md-doc pre code { overflow-wrap: normal; }
