/* Wisp Docs — neon azure (matches wispfn.com). Layout: sticky header with tabs; three columns (nav · article · on this page). */
:root {
  --bg: #04060c;
  --bg-raised: #0a0f1d;
  --bg-hover: #111830;
  --border: #1c2540;
  --text: #eef3ff;
  --text-2: #a3aecb;
  --text-3: #6f7a9a;
  --accent: #3d8bff;
  --accent-text: #7fb2ff;
  --accent-soft: rgba(61, 139, 255, 0.14);
  --accent-glow: rgba(61, 139, 255, 0.45);
  --on-accent: #ffffff;
  --dot: #131a2e;
  --code-bg: #070b16;
  --note: #7fb2ff;
  --tip: #5cf2c4;
  --warn: #ffc27a;
  --important: #b79bff;
  --hl-keyword: #7fb2ff;
  --hl-string: #5cf2c4;
  --hl-number: #ffc27a;
  --hl-comment: #56617f;
  --hl-title: #c4d8ff;
  --hl-attr: #b79bff;
  --radius: 16px;
  --sans: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Sora', ui-sans-serif, system-ui, sans-serif;
  --header-h: 112px;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f7f9ff;
  --bg-raised: #eef2fc;
  --bg-hover: #e3e9f8;
  --border: #d5ddf0;
  --text: #0a1024;
  --text-2: #3c4766;
  --text-3: #636d8c;
  --accent: #1f6fff;
  --accent-text: #1a5fe0;
  --accent-soft: rgba(31, 111, 255, 0.08);
  --accent-glow: rgba(31, 111, 255, 0.3);
  --on-accent: #ffffff;
  --dot: #dfe5f4;
  --code-bg: #eef2fc;
  --note: #1a5fe0;
  --tip: #0f8a63;
  --warn: #a35d00;
  --important: #6b3fd1;
  --hl-keyword: #1a5fe0;
  --hl-string: #0f7a58;
  --hl-number: #a35d00;
  --hl-comment: #7a84a2;
  --hl-title: #0a1024;
  --hl-attr: #6b3fd1;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.7 var(--sans); }
a { color: inherit; }
kbd { font: 11px var(--mono); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text-3); background: var(--bg-raised); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--bg-raised); padding: 6px 10px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-row { max-width: 1480px; margin: 0 auto; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand-fn { color: var(--accent-text); }
.brand-docs { font-weight: 500; color: var(--text-3); font-size: 15px; padding-left: 9px; border-left: 1px solid var(--border); }
.search-btn { display: flex; align-items: center; gap: 10px; margin: 0 auto; width: min(360px, 40vw); height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-raised); color: var(--text-3); font: inherit; font-size: 14px; cursor: pointer; }
.search-btn:hover { border-color: color-mix(in srgb, var(--text-3) 50%, var(--border)); }
.search-btn span { flex: 1; text-align: left; }
.top-links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.top-links a { text-decoration: none; color: var(--text-2); }
.top-links a:hover { color: var(--text); }
.top-links .cta { display: inline-flex; align-items: center; gap: 4px; background: var(--accent); color: var(--on-accent); font-weight: 600; padding: 8px 14px; border-radius: 9px; }
.top-links .cta:hover { color: var(--on-accent); filter: brightness(1.06); }
.theme-btn, .menu-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer; }
.theme-btn:hover, .menu-btn:hover { background: var(--bg-hover); color: var(--text); }
:root[data-theme='light'] .theme-btn .sun, :root:not([data-theme='light']) .theme-btn .moon { display: none; }
.menu-btn { display: none; }
.cta-short { display: none; }
.tabs { max-width: 1480px; margin: 0 auto; display: flex; gap: 28px; height: 48px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); overflow-x: auto; }
.tabs a { display: flex; align-items: center; text-decoration: none; color: var(--text-2); font-size: 14.5px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

/* Columns */
.shell { max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: 280px minmax(0, 1fr) 260px; gap: 48px; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.sidebar { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 28px 8px 40px 0; }
.nav-group { margin-bottom: 26px; }
.nav-group-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; padding: 0 12px 8px; }
.nav-group-title .icon { color: var(--text-2); }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-size: 14.5px; line-height: 1.45; }
.nav-group a:hover { color: var(--text); background: var(--bg-hover); }
.nav-group a.active { color: var(--accent-text); background: var(--accent-soft); font-weight: 500; }

.main { min-width: 0; padding: 36px 0 64px; }
article { max-width: 780px; }
.eyebrow { color: var(--accent-text); font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
.lead { font-size: 18px; line-height: 1.6; color: var(--text-2); margin: 14px 0 28px; }

/* Copy page */
.copy-page { position: relative; display: flex; flex: none; border: 1px solid var(--border); border-radius: 9px; overflow: visible; }
.copy-page button { display: flex; align-items: center; gap: 7px; background: none; border: 0; color: var(--text-2); font: 500 13.5px var(--sans); padding: 7px 11px; cursor: pointer; }
.copy-page button:hover { color: var(--text); background: var(--bg-hover); }
.copy-page-btn { border-radius: 8px 0 0 8px; }
.copy-page-more { border-left: 1px solid var(--border) !important; border-radius: 0 8px 8px 0; padding: 7px 9px !important; }
.copy-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; width: 260px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 10px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); }
.copy-menu a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 7px; text-decoration: none; }
.copy-menu a:hover, .copy-menu a:focus { background: var(--bg-hover); outline: none; }
.copy-menu b { font-weight: 500; font-size: 14px; }
.copy-menu span { color: var(--text-3); font-size: 12.5px; }

/* Prose */
.prose { font-size: 15.5px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 24px; letter-spacing: -0.015em; line-height: 1.3; margin: 44px 0 12px; }
.prose h3 { font-size: 18.5px; line-height: 1.35; margin: 30px 0 8px; }
.prose h4 { font-size: 16px; margin: 22px 0 6px; }
.prose h2, .prose h3, .prose h4 { position: relative; }
.prose .anchor { position: absolute; left: -22px; padding-right: 6px; color: var(--text-3); text-decoration: none; opacity: 0; font-weight: 400; }
.prose :is(h2, h3, h4):hover .anchor { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 0; }
.prose a { color: var(--accent-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-text) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent-text); }
.prose strong { font-weight: 600; color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.prose :not(pre) > code { font: 0.86em var(--mono); background: var(--bg-raised); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.prose blockquote { margin: 0 0 16px; padding: 2px 16px; border-left: 3px solid var(--border); color: var(--text-2); }
.prose img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }

.code { position: relative; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--code-bg); }
.code-title { font: 12.5px var(--mono); color: var(--text-3); padding: 8px 14px; border-bottom: 1px solid var(--border); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.65 var(--mono); }
.code-copy { position: absolute; right: 8px; top: 8px; z-index: 1; font: 500 12px var(--sans); color: var(--text-3); background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.code-title + .code-copy { top: 4px; }
.code:hover .code-copy, .code-copy:focus { opacity: 1; }
.hljs-keyword, .hljs-built_in, .hljs-literal, .hljs-selector-tag { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp, .hljs-symbol { color: var(--hl-string); }
.hljs-number { color: var(--hl-number); }
.hljs-comment, .hljs-quote, .hljs-meta { color: var(--hl-comment); font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-section { color: var(--hl-title); }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-params, .hljs-property { color: var(--hl-attr); }

.table { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: 10px; }
.table table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table th, .table td { text-align: left; vertical-align: top; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.table th { background: var(--bg-raised); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }

.callout { margin: 0 0 18px; padding: 12px 16px; border: 1px solid var(--border); border-left: 3px solid var(--note); border-radius: 10px; background: var(--bg-raised); }
.callout p:last-child { margin-bottom: 0; }
.callout-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--note); margin-bottom: 2px; }
.callout-tip { border-left-color: var(--tip); }
.callout-tip .callout-label { color: var(--tip); }
.callout-warning { border-left-color: var(--warn); }
.callout-warning .callout-label { color: var(--warn); }
.callout-important { border-left-color: var(--important); }
.callout-important .callout-label { color: var(--important); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; }
.pager a:hover { border-color: var(--accent); }
.pager span { font-size: 13px; color: var(--text-3); }
.pager b { font-weight: 500; }
.pager .next { text-align: right; grid-column: 2; }
.foot { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text-3); }
.foot a { color: var(--text-3); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* On this page */
.aside { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 40px 0; }
.toc-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 5px 0; text-decoration: none; color: var(--text-2); font-size: 14px; line-height: 1.4; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent-text); }
.toc .toc-d3 a { padding-left: 16px; }

/* Search */
.search { position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(0, 0, 0, 0.55); }
.search[hidden] { display: none; }
.search-panel { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45); overflow: hidden; }
.search-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.search-input input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-input input { flex: 1; height: 52px; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 9px; text-decoration: none; }
.search-results a[aria-selected='true'] { background: var(--accent-soft); }
.search-results .r-path { font-size: 12px; color: var(--text-3); }
.search-results .r-title { font-weight: 500; }
.search-results .r-snippet { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results mark { background: none; color: var(--accent-text); font-weight: 600; }
.search-empty { padding: 20px 14px; color: var(--text-3); font-size: 14px; }

/* Responsive */
@media (max-width: 1200px) {
  .shell { grid-template-columns: 250px minmax(0, 1fr); gap: 40px; }
  .aside { display: none; }
}
@media (max-width: 860px) {
  :root { --header-h: 104px; }
  .top-row { height: 56px; gap: 8px; }
  .menu-btn { display: grid; }
  .search-btn { width: auto; margin: 0 0 0 auto; }
  .search-btn span, .search-btn kbd { display: none; }
  .top-links { gap: 4px; }
  .top-links a:not(.cta) { display: none; }
  .top-links .cta { padding: 7px 10px; font-size: 13px; white-space: nowrap; }
  .cta-long { display: none; }
  .cta-short { display: inline; }
  .tabs { height: 48px; gap: 22px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 15; width: min(320px, 86vw); max-height: none; padding: 20px max(12px, env(safe-area-inset-left, 0px)) 40px 12px; background: var(--bg); border-right: 1px solid var(--border); transform: translateX(-102%); transition: transform 0.2s ease; }
  body.nav-open .sidebar { transform: none; }
  .main { padding-top: 24px; }
  .title-row { flex-direction: column; }
  .prose .anchor { display: none; }
}
@media (max-width: 420px) {
  .brand-docs { display: none; }
  .top-links .cta svg { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .code-copy { transition: none; }
}
.table :not(pre) > code { overflow-wrap: normal; white-space: nowrap; }

/* Neon details: dotted ground, pill controls, rounder cards, a soft glow on the main action. */
body { background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0); background-size: 28px 28px; }
.brand { font-weight: 700; letter-spacing: -0.04em; }
h1, .prose h2, .prose h3 { letter-spacing: -0.04em; }
h1 { font-weight: 800; }
.prose h2 { font-weight: 700; }
.search-btn, .top-links .cta, .copy-page, .theme-btn, .menu-btn { border-radius: 999px; }
.copy-page-btn { border-radius: 999px 0 0 999px; }
.copy-page-more { border-radius: 0 999px 999px 0; }
.top-links .cta { box-shadow: 0 0 24px -6px var(--accent-glow); }
.nav-group a { border-radius: 999px; }
.code, .table, .callout, .pager a, .search-panel, .copy-menu { border-radius: var(--radius); }
.code { box-shadow: 0 0 0 1px var(--accent-soft), 0 24px 60px -36px var(--accent-glow); }
.eyebrow { display: inline-block; padding: 3px 11px; border: 1px solid var(--accent); border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.tabs a.active { border-bottom-color: var(--accent); }
.search-results a, .copy-menu a { border-radius: 12px; }
