/* docs.quantcoin.world */

@font-face { font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/open-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/open-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/open-sans-800.woff2") format("woff2"); }

:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --ink: #0b0d12;
  --muted: #4a5160;
  --line: #e1e4ea;
  --accent: #ff6a2b;
  --accent-text: #c2410c;
  --accent-soft: #fff0e8;
  --chip: #eef0f4;
  --code-bg: #0d1117;
  --code-ink: #e6edf3;
  --note-bg: #f4f6fb;
  --footer-bg: #ffffff;
  --header-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07080b;
    --surface: #0f1116;
    --ink: #eef1f6;
    --muted: #9aa1ad;
    --line: #1f232b;
    --accent-text: #ff8a55;
    --accent-soft: #24150e;
    --chip: #1a1d24;
    --code-bg: #0d1117;
    --note-bg: #11141a;
    --footer-bg: #07080b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07080b; --surface: #0f1116; --ink: #eef1f6; --muted: #9aa1ad; --line: #1f232b;
  --accent-text: #ff8a55; --accent-soft: #24150e; --chip: #1a1d24; --note-bg: #11141a; --footer-bg: #07080b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Open Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #0b0d12; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* brand marks: light/dark variants */
.on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .on-light { display: none; }
  :root:not([data-theme="light"]) .on-dark { display: revert; }
}

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--header-h); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; }
.brand img { width: 28px; height: 28px; }
.brand small { font-weight: 700; letter-spacing: 0; color: var(--muted); font-size: 14px; }
.menu-btn { display: none; background: none; border: 0; color: var(--ink); padding: 6px; margin-left: -6px; cursor: pointer; border-radius: 6px; }
.top-links { display: flex; gap: 20px; margin-left: auto; }
.top-links a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; }
.top-links a:hover { color: var(--ink); }

.search { position: relative; flex: 0 1 380px; margin-left: 24px; }
.search input { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 36px 7px 12px; }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 12px ui-monospace, Consolas, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; max-height: 70vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 6px; }
.results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.results a:hover, .results a[aria-selected="true"] { background: var(--surface); }
.results a small { display: block; color: var(--muted); font-size: 12px; }
.results .empty { padding: 10px; color: var(--muted); font-size: 14px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; max-width: 1440px; margin: 0 auto; }
.side { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 24px 16px 40px 24px; border-right: 1px solid var(--line); }
.side-group { margin-bottom: 22px; }
.side h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px 10px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.4; }
.side a:hover { background: var(--surface); }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }

.content { padding: 32px 48px 64px; min-width: 0; }
.crumb { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.06em; }

.toc { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 32px 20px; font-size: 13px; }
.toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; overflow-wrap: anywhere; padding: 3px 0 3px 12px; margin-left: -1px; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; line-height: 1.4; }
.toc li.l3 a { padding-left: 24px; }
.toc li a:hover { color: var(--ink); }
.toc li a.active { color: var(--accent-text); border-left-color: var(--accent); }

@media (max-width: 1180px) { .layout { grid-template-columns: 240px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .side { position: fixed; z-index: 30; top: var(--header-h); left: 0; width: min(300px, 85vw); background: var(--bg); transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .side.open { transform: none; }
  .content { padding: 24px 16px 56px; }
  .top { padding: 0 12px; gap: 10px; }
  .top-links { display: none; }
  .search { margin-left: auto; flex: 1 1 auto; }
  .search kbd { display: none; }
  .brand small { display: none; }
  .results { left: auto; right: 0; min-width: min(92vw, 360px); }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ---------- prose ---------- */
.prose { max-width: 820px; }
.prose h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 20px; }
.prose h2 { font-size: 26px; line-height: 1.25; font-weight: 800; margin: 48px 0 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.prose h3 { font-size: 19px; font-weight: 800; margin: 32px 0 8px; }
.prose h4 { font-size: 16px; font-weight: 800; margin: 24px 0 6px; }
.prose h2 + h3 { margin-top: 16px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose li > p { margin: 0; }
.prose strong { font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose :is(h2, h3) a { color: inherit; text-decoration: none; }

.prose code { font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, Menlo, monospace; font-size: 0.88em; background: var(--chip); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.prose pre { position: relative; margin: 0 0 20px; background: var(--code-bg) !important; color: var(--code-ink); border-radius: 10px; padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; border: 1px solid #1f2630; }
.prose pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; color: inherit; }
.copy-btn { position: absolute; top: 8px; right: 8px; font: 12px "Open Sans", sans-serif; font-weight: 700; color: #c9d1d9; background: #21262d; border: 1px solid #30363d; border-radius: 6px; padding: 3px 8px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.prose pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
@media (hover: none) { .copy-btn { opacity: 1; } }

.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 20px; font-size: 14.5px; max-width: 100%; }
.prose th, .prose td { text-align: left; padding: 8px 14px; border: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--surface); font-weight: 700; white-space: nowrap; }
.prose td code { white-space: nowrap; }

.prose blockquote { margin: 0 0 20px; padding: 12px 18px; background: var(--note-bg); border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; color: var(--ink); }
.prose blockquote p:last-child { margin-bottom: 0; }

.edit { margin: 40px 0 0; font-size: 14px; }
.edit a { color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; max-width: 820px; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- footer ---------- */
.foot { background: var(--footer-bg); border-top: 1px solid var(--line); padding: 28px 24px 40px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; }
.foot p { margin: 0; max-width: 70ch; }
.wordmark { display: inline-block; line-height: 0; }
.wordmark img { height: 40px; width: auto; }
