/* LoCrew documentation — same tokens as the landing page, with a light theme. */

:root {
  --bg: #07090f;
  --bg-2: #0b0f18;
  --panel: #0f1420;
  --panel-2: #131a29;
  --line: rgba(148, 163, 184, 0.14);
  --line-2: rgba(148, 163, 184, 0.24);
  --text: #e8edf5;
  --text-2: #b3bdcc;
  --text-3: #7c889b;
  --teal: #35d6c1;
  --teal-strong: #5fe3d1;
  --teal-ink: #04201c;
  --link: #5fe3d1;
  --lav: #a78bfa;
  --amber: #f59e0b;
  --code-bg: #0b111d;
  --code-bar: #0f1727;
  --inline-code: rgba(148, 163, 184, 0.14);
  --tk-keyword: #c4b5fd;
  --tk-string: #86efac;
  --tk-number: #fbbf24;
  --tk-comment: #6b7a90;
  --tk-key: #7dd3fc;
  --tk-fn: #5fe3d1;
  --tk-flag: #fca5a5;
  --header-bg: rgba(7, 9, 15, 0.8);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff; --bg-2: #f7f9fc; --panel: #f4f6fa; --panel-2: #eef2f7;
    --line: rgba(15, 23, 42, 0.09); --line-2: rgba(15, 23, 42, 0.16);
    --text: #111827; --text-2: #3d4757; --text-3: #5b6576;
    --teal-ink: #04201c; --link: #0b7c6f;
    --code-bg: #f6f8fb; --code-bar: #eef2f7; --inline-code: rgba(15, 23, 42, 0.07);
    --tk-keyword: #6d28d9; --tk-string: #15803d; --tk-number: #b45309; --tk-comment: #6b7280; --tk-key: #0369a1; --tk-fn: #0b7c6f; --tk-flag: #b91c1c;
    --header-bg: rgba(255, 255, 255, 0.85); --shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.25);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #ffffff; --bg-2: #f7f9fc; --panel: #f4f6fa; --panel-2: #eef2f7;
  --line: rgba(15, 23, 42, 0.09); --line-2: rgba(15, 23, 42, 0.16);
  --text: #111827; --text-2: #3d4757; --text-3: #5b6576;
  --teal-ink: #04201c; --link: #0b7c6f;
  --code-bg: #f6f8fb; --code-bar: #eef2f7; --inline-code: rgba(15, 23, 42, 0.07);
  --tk-keyword: #6d28d9; --tk-string: #15803d; --tk-number: #b45309; --tk-comment: #6b7280; --tk-key: #0369a1; --tk-fn: #0b7c6f; --tk-flag: #b91c1c;
  --header-bg: rgba(255, 255, 255, 0.85); --shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.25);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
img, video { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
kbd { font: 500 11.5px/1 'JetBrains Mono', monospace; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); }
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--teal); color: var(--teal-ink); font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.dh { position: sticky; top: 0; z-index: 40; background: var(--header-bg); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); }
.dh__inner { display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 20px; max-width: 1480px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand__mark { flex: none; }
.dh__docs { color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; padding-left: 14px; border-left: 1px solid var(--line-2); }
.dh__search { margin-left: auto; display: flex; align-items: center; gap: 10px; width: min(340px, 34vw); height: 38px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-3); font-size: 14px; text-align: left; transition: border-color 150ms ease; }
.dh__search span { flex: 1; }
.dh__search:hover { border-color: var(--teal); }
.dh__links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.dh__links a { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); text-decoration: none; }
.dh__links a:hover { color: var(--text); }
.dh__theme { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); display: grid; place-items: center; }
.i-sun, .i-moon { width: 16px; height: 16px; border-radius: 50%; }
.i-sun { display: none; background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); width: 12px; height: 12px; }
.i-moon { box-shadow: inset -5px -3px 0 0 var(--text-2); }
:root[data-theme="light"] .i-sun { display: block; } :root[data-theme="light"] .i-moon { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .i-sun { display: block; } :root:not([data-theme="dark"]) .i-moon { display: none; } }
.dh__menu { display: none; width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); position: relative; }
.dh__menu span, .dh__menu span::before, .dh__menu span::after { position: absolute; left: 10px; width: 16px; height: 2px; background: var(--text); border-radius: 2px; content: ''; }
.dh__menu span { top: 17px; } .dh__menu span::before { top: -5px; left: 0; } .dh__menu span::after { top: 5px; left: 0; }

/* ---------- layout ---------- */
.dl { display: grid; grid-template-columns: 272px minmax(0, 1fr) 232px; gap: 40px; max-width: 1480px; margin: 0 auto; padding: 0 20px; }
.sb { position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow-y: auto; padding: 24px 6px 48px 0; scrollbar-width: thin; }
.sb__head { display: none; }
.sb__group { margin-bottom: 6px; }
.sb__group summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.sb__group summary::-webkit-details-marker { display: none; }
.sb__group summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(-45deg); transition: transform 150ms ease; }
.sb__group[open] summary::after { transform: rotate(45deg); }
.sb__group summary:hover { background: var(--panel); }
.sb ul { list-style: none; margin: 2px 0 10px; padding: 0 0 0 10px; border-left: 1px solid var(--line); margin-left: 12px; }
.sb li a { display: block; padding: 5px 10px; border-radius: 7px; font-size: 14px; line-height: 1.45; color: var(--text-2); text-decoration: none; position: relative; }
.sb li a:hover { color: var(--text); background: var(--panel); }
.sb li a.is-active { color: var(--link); background: rgba(53, 214, 193, 0.1); font-weight: 500; }
.sb li a.is-active::before { content: ''; position: absolute; left: -11px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--teal); }
.sb__scrim { position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, 0.5); }

.dm { min-width: 0; padding: 28px 0 64px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 18px; font-size: 13px; color: var(--text-3); }
.crumbs li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--line-2); }
.crumbs a { color: var(--text-3); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.toc { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 28px 0 40px; font-size: 13px; }
.toc__title { margin: 0 0 10px; font-weight: 600; color: var(--text); font-size: 12.5px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-3); text-decoration: none; line-height: 1.45; }
.toc li.toc__l3 a { padding-left: 24px; }
.toc li a:hover { color: var(--text); }
.toc li a.is-active { color: var(--link); border-left-color: var(--teal); }

/* ---------- prose ---------- */
.prose { max-width: 760px; }
.prose__head { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.prose__group { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--teal); }
.prose h1 { margin: 0; font-size: clamp(30px, 4vw, 42px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 700; }
.prose__lede { margin: 14px 0 0; font-size: 18px; color: var(--text-2); line-height: 1.6; }
.prose h2 { margin: 48px 0 14px; font-size: 26px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 650; padding-top: 8px; }
.prose h3 { margin: 32px 0 10px; font-size: 19px; line-height: 1.35; letter-spacing: -0.01em; font-weight: 600; }
.prose h4 { margin: 24px 0 8px; font-size: 16px; font-weight: 600; }
.prose h2, .prose h3, .prose h4 { position: relative; }
.anchor { position: absolute; left: -1.1em; width: 1em; color: var(--text-3); text-decoration: none; opacity: 0; transition: opacity 120ms ease; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor, .anchor:focus { opacity: 1; }
.prose p, .prose li { color: var(--text-2); }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose li > ul, .prose li > ol { margin: 6px 0; }
.prose ol > li::marker { color: var(--text-3); font-weight: 600; }
.prose ul > li::marker { color: var(--teal); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose a { text-decoration: underline; text-decoration-color: rgba(53, 214, 193, 0.4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose :not(pre) > code { font: 0.86em 'JetBrains Mono', monospace; padding: 2px 6px; border-radius: 6px; background: var(--inline-code); color: var(--text); word-break: break-word; }
.prose blockquote { margin: 0 0 18px; padding: 4px 0 4px 16px; border-left: 3px solid var(--line-2); }

.code { position: relative; margin: 0 0 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--code-bg); overflow: hidden; }
.code__bar { display: flex; align-items: center; height: 36px; padding: 0 14px; background: var(--code-bar); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--text-3); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.7 'JetBrains Mono', ui-monospace, Consolas, monospace; color: var(--text); tab-size: 2; }
.code__copy { position: absolute; top: 4px; right: 6px; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel); font-size: 12px; color: var(--text-2); opacity: 0.85; }
.code:not(:has(.code__bar)) .code__copy { top: 8px; }
.code__copy:hover { opacity: 1; color: var(--text); }
.code__copy.is-done { color: var(--link); border-color: var(--teal); }
.tk-keyword { color: var(--tk-keyword); } .tk-string { color: var(--tk-string); } .tk-number { color: var(--tk-number); }
.tk-comment { color: var(--tk-comment); font-style: italic; } .tk-key { color: var(--tk-key); } .tk-fn { color: var(--tk-fn); }
.tk-flag { color: var(--tk-flag); } .tk-prompt { color: var(--text-3); user-select: none; }

.table { margin: 0 0 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.table table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { background: var(--panel); font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td { color: var(--text-2); }

.callout { margin: 0 0 22px; padding: 14px 16px 2px; border-radius: 12px; border: 1px solid var(--line-2); border-left-width: 4px; background: var(--panel); }
.callout__title { margin: 0 0 6px !important; font-weight: 600; color: var(--text) !important; font-size: 14.5px; }
.callout p, .callout li { font-size: 15px; }
.callout--note { border-left-color: #60a5fa; }
.callout--tip { border-left-color: var(--teal); }
.callout--important { border-left-color: var(--lav); }
.callout--warning { border-left-color: var(--amber); }
.callout--caution { border-left-color: #f87171; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 24px; }
.cards a { display: block; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; transition: border-color 150ms ease, transform 150ms ease; }
.cards a:hover { border-color: var(--teal); transform: translateY(-1px); }
.cards b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.cards span { display: block; color: var(--text-2); font-size: 14px; line-height: 1.5; }

.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.status--ok { color: #16a34a; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.1); }
.status--beta { color: #d97706; border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.1); }
.status--limited { color: #7c3aed; border-color: rgba(167, 139, 250, 0.45); background: rgba(167, 139, 250, 0.12); }

.pn { max-width: 760px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.pn a { display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; transition: border-color 150ms ease; }
.pn a:hover { border-color: var(--teal); }
.pn span { font-size: 12.5px; color: var(--text-3); }
.pn b { color: var(--text); font-weight: 600; }
.pn__next { text-align: right; grid-column: 2; }
.df { max-width: 760px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.df p { margin: 0 0 6px; }

/* ---------- search ---------- */
.search { position: fixed; inset: 0; z-index: 60; display: grid; justify-items: center; align-items: start; padding: 10vh 16px 16px; background: rgba(2, 6, 14, 0.6); backdrop-filter: blur(4px); }
.search[hidden] { display: none; }
.search__box { width: min(640px, 100%); max-height: 76vh; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg-2); box-shadow: var(--shadow); overflow: hidden; }
.search__field { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 56px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.search__field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 16px 'Inter', system-ui, sans-serif; }
.search__field input::-webkit-search-cancel-button { display: none; }
.search__results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search__results li a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text-2); }
.search__results li a b { display: block; color: var(--text); font-weight: 600; font-size: 14.5px; }
.search__results li a small { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.search__results li a span { display: block; font-size: 13.5px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search__results li a mark { background: rgba(53, 214, 193, 0.25); color: inherit; border-radius: 3px; padding: 0 1px; }
.search__results li[aria-selected="true"] a { background: var(--panel-2); outline: 1px solid var(--teal); }
.search__results .search__empty { padding: 20px 12px; color: var(--text-3); font-size: 14px; }
.search__hint { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .dl { grid-template-columns: 256px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .dl { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .dh__menu { display: block; }
  .dh__docs, .dh__links a span, .dh__search kbd { display: none; }
  .dh__search { width: auto; flex: 1; max-width: 360px; }
  .dh__inner { padding: 0 12px; gap: 10px; }
  .sb { position: fixed; z-index: 45; top: 0; left: 0; bottom: 0; height: 100vh; width: min(320px, 86vw); padding: 0 12px 40px; background: var(--bg-2); border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform 220ms ease; }
  .sb.is-open { transform: none; }
  .sb__head { display: flex; align-items: center; justify-content: space-between; height: 64px; font-weight: 600; position: sticky; top: 0; background: var(--bg-2); z-index: 1; }
  .sb__close { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); font-size: 20px; line-height: 1; }
  .anchor { display: none; }
  .pn { grid-template-columns: 1fr; }
  .pn__next { grid-column: 1; }
}
@media (max-width: 480px) {
  .brand span { display: none; }
  .dh__links { gap: 8px; }
  .prose h2 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { .sb { transition: none; } }
