/* Hydra docs. Laid out like Fumadocs (sidebar · page · "On this page"), in Hydra's colours. */
@font-face { font-family: "Inter"; src: url("InterVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root, [data-theme="dark"] {
  --bg: #0b0c0f; --side: #0d0f13; --panel: #111318; --panel-2: #161920; --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .12);
  --text: #e9ebef; --muted: #9aa1ad; --faint: #6b7280; --accent: #ff3b50; --accent-text: #ff8b98; --accent-soft: rgba(245, 22, 47, .12);
  --code-bg: #0e1015; --glow: rgba(245, 22, 47, .10);
  --tk-c: #6b7280; --tk-s: #a5d6a7; --tk-k: #ff8b98; --tk-n: #f0b429;
  --note: #6ea8fe; --tip: #3ccf8e; --warn: #f0b429; color-scheme: dark;
}
[data-theme="light"] {
  --bg: #ffffff; --side: #fafafa; --panel: #f6f7f9; --panel-2: #eef0f3; --line: rgba(15, 18, 25, .08); --line-2: rgba(15, 18, 25, .14);
  --text: #12151b; --muted: #545b67; --faint: #8a919c; --accent: #e0122a; --accent-text: #c40f25; --accent-soft: rgba(224, 18, 42, .08);
  --code-bg: #f6f7f9; --glow: rgba(224, 18, 42, .05);
  --tk-c: #8a919c; --tk-s: #2e7d32; --tk-k: #c40f25; --tk-n: #a15c00;
  --note: #2563eb; --tip: #15803d; --warn: #b45309; color-scheme: light;
}
/* Hydra Venom pages wear the product's green */
body.venom { --accent: #8be04e; --accent-text: #8be04e; --accent-soft: rgba(139, 224, 78, .12); --glow: rgba(139, 224, 78, .08); }
[data-theme="light"] body.venom { --accent: #3f8f12; --accent-text: #3f8f12; --accent-soft: rgba(63, 143, 18, .1); --glow: rgba(63, 143, 18, .05); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.7 "Inter", "Segoe UI", system-ui, sans-serif; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 520px; pointer-events: none; background: radial-gradient(900px 420px at 60% -120px, var(--glow), transparent 70%); z-index: 0; }
a { color: inherit; }
.i { flex: none; }
kbd { font: 600 11px/1 "Inter", sans-serif; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); }

.layout { position: relative; z-index: 1; display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }

/* ---- sidebar ---- */
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px; border-right: 1px solid var(--line); background: var(--side); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand b { font-weight: 600; color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--panel); color: var(--text); }
.side-close { display: none; }
.search-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--faint); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.search-btn span { flex: 1; }
.search-btn:hover { border-color: var(--accent); color: var(--muted); }
.nav { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px 12px; scrollbar-width: thin; }
.nav-group { margin-top: 18px; }
.nav-group:first-child { margin-top: 4px; }
.nav-title { padding: 0 10px 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; text-decoration: none; line-height: 1.45; transition: background .12s, color .12s; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.nav-group.venom .nav-title { color: #8be04e; }
[data-theme="light"] .nav-group.venom .nav-title { color: #3f8f12; }
.nav-group.venom .nav-item.active { background: rgba(139, 224, 78, .12); color: #8be04e; }
[data-theme="light"] .nav-group.venom .nav-item.active { color: #3f8f12; background: rgba(63, 143, 18, .1); }
.side-foot { display: flex; align-items: center; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-link { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.side-link:hover { color: var(--text); background: var(--panel); }
.theme { margin-left: auto; display: flex; padding: 2px; border-radius: 999px; border: 1px solid var(--line-2); }
.theme button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 999px; background: none; color: var(--faint); cursor: pointer; }
[data-theme="light"] .theme [data-theme-set="light"], [data-theme="dark"] .theme [data-theme-set="dark"] { background: var(--panel-2); color: var(--text); }

/* ---- page ---- */
.topbar, .scrim { display: none; }
.main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; padding: 0 40px; max-width: 1240px; width: 100%; }
.page { min-width: 0; max-width: 820px; padding: 56px 0 40px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--accent-text); margin-bottom: 10px; }
h1 { margin: 0; font-size: 34px; line-height: 1.2; letter-spacing: -.025em; font-weight: 700; }
.lead { margin: 12px 0 0; font-size: 17px; line-height: 1.6; color: var(--muted); }
.prose { margin-top: 32px; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { position: relative; letter-spacing: -.015em; scroll-margin-top: 24px; }
.prose h2 { margin: 44px 0 14px; font-size: 24px; line-height: 1.3; font-weight: 650; }
.prose h3 { margin: 32px 0 10px; font-size: 18.5px; font-weight: 600; }
.prose h4 { margin: 24px 0 8px; font-size: 15.5px; font-weight: 600; }
.anchor { position: absolute; left: -22px; top: 0; opacity: 0; color: var(--faint); text-decoration: none; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; }
.prose p { margin: 14px 0; }
.prose ul, .prose ol { margin: 14px 0; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--faint); }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; font-weight: 500; }
.prose a:hover { color: var(--accent-text); }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose code { font: 13px/1.5 "Cascadia Mono", "JetBrains Mono", ui-monospace, Consolas, monospace; padding: 2px 6px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); }

.code { margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--code-bg); overflow: hidden; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.copy { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--faint); cursor: pointer; }
.copy:hover { background: var(--panel-2); color: var(--text); }
.copy.done { color: #3ccf8e; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.code pre code { font: 13px/1.65 "Cascadia Mono", "JetBrains Mono", ui-monospace, Consolas, monospace; padding: 0; border: 0; background: none; }
.tk-c { color: var(--tk-c); font-style: italic; } .tk-s { color: var(--tk-s); } .tk-k { color: var(--tk-k); } .tk-n { color: var(--tk-n); }

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

.callout { display: flex; gap: 12px; margin: 18px 0; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--note); border-radius: 10px; background: var(--panel); font-size: 14.5px; }
.callout > .i { margin-top: 3px; color: var(--note); }
.callout > div > :first-child { margin-top: 0; } .callout > div > :last-child { margin-bottom: 0; }
.callout.tip { border-left-color: var(--tip); } .callout.tip > .i { color: var(--tip); }
.callout.warning, .callout.important { border-left-color: var(--warn); } .callout.warning > .i, .callout.important > .i { color: var(--warn); }

.steps { counter-reset: step; margin: 22px 0; padding-left: 34px; border-left: 1px solid var(--line-2); margin-left: 13px; }
.steps > h3 { counter-increment: step; margin-top: 28px; }
.steps > h3:first-child { margin-top: 0; }
.steps > h3::before { content: counter(step); position: absolute; left: -48px; top: -1px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--text); }
.steps > h3 .anchor { display: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 20px 0; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none !important; transition: border-color .15s, background .15s; }
.card .i { color: var(--accent-text); margin-bottom: 4px; }
.card b { font-weight: 600; font-size: 15px; }
.card span { color: var(--muted); font-size: 13.5px; font-weight: 400; line-height: 1.5; }
.card:hover { border-color: var(--accent); background: var(--panel-2); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color .15s; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 12.5px; }
.pager b { font-weight: 600; font-size: 14.5px; }
.pager .next { text-align: right; align-items: flex-end; }
.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.foot a { color: var(--muted); }

/* ---- on this page ---- */
.toc { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 60px 0 24px; font-size: 13px; }
.toc-title { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.toc-links { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.toc-links a { padding: 4px 0 4px 14px; margin-left: -1px; border-left: 1.5px solid transparent; color: var(--faint); text-decoration: none; line-height: 1.45; }
.toc-links a.toc-l3 { padding-left: 26px; }
.toc-links a:hover { color: var(--text); }
.toc-links a.on { color: var(--accent-text); border-left-color: var(--accent); }

/* ---- search ---- */
.search { position: fixed; inset: 0; z-index: 50; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; background: rgba(4, 5, 8, .6); backdrop-filter: blur(4px); }
.search[hidden] { display: none; }
.search-box { width: min(640px, 100%); border: 1px solid var(--line-2); border-radius: 14px; background: var(--side); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); overflow: hidden; }
.search-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--faint); }
.search-input input { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.search-results { max-height: 56vh; overflow-y: auto; padding: 6px; }
.search-results a { display: block; padding: 9px 12px; border-radius: 9px; text-decoration: none; }
.search-results a.sel, .search-results a:hover { background: var(--accent-soft); }
.search-results b { display: block; font-weight: 600; font-size: 14px; }
.search-results small { display: block; color: var(--faint); font-size: 12.5px; }
.search-results .snip { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results mark { background: none; color: var(--accent-text); font-weight: 600; }
.search-empty { padding: 22px 12px; color: var(--faint); text-align: center; font-size: 14px; }

/* ---- narrow screens ---- */
@media (max-width: 1180px) { .main { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform .2s ease; }
  body.menu .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .5); }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(4, 5, 8, .5); display: none; }
  body.menu .scrim { display: block; }
  .side-close { display: inline-grid; }
  .topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
  .main { padding: 0 16px; }
  .page { padding-top: 28px; }
  h1 { font-size: 28px; }
  .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
