/* Rezin Core documentation. Brand: Obsidian #08090B, Gunmetal #30363E, Titanium #727E8C, Electric Blue #009DE0, Silver #E5E7EB */
:root {
  --bg: #08090b; --bg2: #0d0f12; --panel: #121418; --line: #23282f; --text: #e5e7eb; --soft: #c3c8cf; --muted: #8f99a6;
  --blue: #009de0; --blue-text: #4cc0f5; --on-blue: #08090b; --code: #0f1215; --warn: #e0a84c; --warn-bg: rgba(224, 168, 76, 0.08);
  --note-bg: rgba(0, 157, 224, 0.07); --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff; --bg2: #f5f6f8; --panel: #ffffff; --line: #e1e4e8; --text: #08090b; --soft: #24292f; --muted: #5b6570;
    --blue-text: #006f9f; --code: #f5f6f8; --warn: #8a5a00; --warn-bg: rgba(224, 168, 76, 0.13);
    --note-bg: rgba(0, 157, 224, 0.07); --shadow: 0 24px 60px -28px rgba(8, 9, 11, 0.28);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #ffffff; --bg2: #f5f6f8; --panel: #ffffff; --line: #e1e4e8; --text: #08090b; --soft: #24292f; --muted: #5b6570;
  --blue-text: #006f9f; --code: #f5f6f8; --warn: #8a5a00; --warn-bg: rgba(224, 168, 76, 0.13);
  --note-bg: rgba(0, 157, 224, 0.07); --shadow: 0 24px 60px -28px rgba(8, 9, 11, 0.28);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-text); text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }
.only-light { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .only-light { display: block; } :root:not([data-theme="dark"]) .only-dark { display: none; } }
:root[data-theme="light"] .only-light { display: block; }
:root[data-theme="light"] .only-dark { display: none; }

/* ---- top bar */
.top { position: sticky; top: 0; z-index: 10; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; }
.brand .word { height: 18px; width: auto; }
.docs-home { color: var(--muted); font-size: 14px; font-weight: 500; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
.docs-home:hover { color: var(--text); }
.search { position: relative; margin-left: auto; width: min(360px, 36vw); }
.search input { width: 100%; height: 36px; padding: 0 38px 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent); }
.search kbd { position: absolute; right: 9px; top: 8px; font: 12px/18px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; pointer-events: none; }
.results { position: absolute; right: 0; top: 44px; width: min(520px, 92vw); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
.results a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--text); }
.results a:hover, .results a.chosen { background: var(--bg2); }
.results b { display: block; font-weight: 600; font-size: 15px; }
.results .where { display: block; font-size: 12px; color: var(--blue-text); margin: 1px 0 3px; }
.results .snip { display: block; font-size: 13px; line-height: 1.45; color: var(--muted); }
.results .none { margin: 0; padding: 14px 12px; color: var(--muted); font-size: 14px; }
.icon-button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; }
.icon-button:hover { color: var(--text); }
.menu { display: none; }
.signin { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--blue); color: var(--blue-text); font-size: 14px; font-weight: 600; white-space: nowrap; }
.signin:hover { background: var(--blue); color: var(--on-blue); }

/* ---- three columns */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr) 216px; max-width: 1380px; margin: 0 auto; }
.side { position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto; padding: 26px 14px 40px 24px; border-right: 1px solid var(--line); }
.side .group + .group { margin-top: 22px; }
.label { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.side .label { padding-left: 10px; }
.side a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--soft); font-size: 14.5px; line-height: 1.4; }
.side a:hover { background: var(--bg2); color: var(--text); }
.side a[aria-current] { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue-text); font-weight: 600; }
.side a i { font-style: normal; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 4px; font-weight: 500; }
main { min-width: 0; }
.doc { max-width: 780px; margin: 0 auto; padding: 44px 40px 72px; }
.toc { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; padding: 48px 20px 40px 4px; }
.toc a { display: block; padding: 3px 0 3px 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.45; }
.toc a.l3 { padding-left: 24px; }
.toc a:hover { color: var(--text); }
.toc a.here { color: var(--blue-text); border-left-color: var(--blue); }

/* ---- the page itself */
.crumb { margin: 0 0 10px; color: var(--blue-text); font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.doc h1 { margin: 0 0 18px; font-size: clamp(30px, 4.4vw, 42px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 650; }
.doc h1 + p { font-size: 18.5px; line-height: 1.6; color: var(--soft); }
.doc h2 { margin: 52px 0 12px; padding-top: 6px; font-size: 25px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 640; }
.doc h3 { margin: 34px 0 8px; font-size: 18.5px; letter-spacing: -0.01em; font-weight: 620; }
.doc h4 { margin: 26px 0 6px; font-size: 16px; font-weight: 620; }
.doc .anchor { color: inherit; }
.doc .anchor:hover::after { content: " #"; color: var(--muted); font-weight: 400; }
.doc p, .doc li { color: var(--soft); }
.doc p { margin: 14px 0; }
.doc p a, .doc li a, .doc td a { border-bottom: 1px solid color-mix(in srgb, var(--blue-text) 35%, transparent); }
.doc p a:hover, .doc li a:hover, .doc td a:hover { border-bottom-color: var(--blue-text); }
.doc strong { color: var(--text); font-weight: 620; }
.doc ul, .doc ol { padding-left: 24px; margin: 12px 0; }
.doc li { margin: 6px 0; }
.doc li > ul, .doc li > ol { margin: 6px 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.doc code { font: 0.875em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--text); overflow-wrap: anywhere; }
.doc pre { position: relative; margin: 18px 0; padding: 16px 18px; background: var(--code); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.doc pre code { display: block; background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.65; white-space: pre; overflow-wrap: normal; }
.doc pre .copy { position: absolute; top: 9px; right: 9px; padding: 3px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font: 12px/1.6 inherit; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.doc pre:hover .copy, .doc pre .copy:focus-visible { opacity: 1; }
.doc pre .copy:hover { color: var(--text); }
@media (hover: none) { .doc pre .copy { opacity: 1; } }
.table { margin: 18px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.doc th, .doc td { text-align: left; padding: 10px 14px; vertical-align: top; color: var(--soft); }
.doc th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg2); white-space: nowrap; }
.doc tr + tr td, .doc tbody tr:first-child td { border-top: 1px solid var(--line); }
.callout { margin: 20px 0; padding: 4px 18px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line)); background: var(--note-bg); }
.callout.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-bg); }
.callout p { margin: 12px 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 64px; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); font-weight: 600; font-size: 15px; }
.pager a:hover { border-color: var(--blue); }
.pager a span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 2px; }
.pager .next { text-align: right; }
.meta { margin-top: 28px !important; font-size: 13px; color: var(--muted) !important; }
.meta a { border: 0 !important; }

@media (max-width: 1180px) { .layout { grid-template-columns: 248px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 820px) {
  .top { gap: 10px; padding: 0 14px; }
  .brand .word, .docs-home, .signin, .search kbd { display: none; }
  .search { width: auto; flex: 1; margin-left: 4px; }
  .results { position: fixed; left: 10px; right: 10px; top: 58px; width: auto; }
  .menu { display: block; }
  .layout { display: block; }
  .side { display: none; position: fixed; inset: 60px 0 0 0; z-index: 9; height: auto; background: var(--bg); border-right: 0; padding: 20px 16px 60px; }
  .side.open { display: block; }
  .side a { font-size: 16px; padding: 8px 10px; }
  .doc { padding: 28px 20px 56px; }
  .doc h2 { font-size: 22px; margin-top: 40px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}

/* The site's own header sits above the docs bar and scrolls away; the docs bar stays. On small screens the docs bar is the only one. */
.docs .site-top { position: relative; }
.docs .site-foot { margin-top: 0; }
@media (max-width: 820px) { .docs .site-top { display: none; } }
