/* arche-lang.xyz — monochrome, glass. One stylesheet for every page. */

/* ---------- tokens ---------- */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f5f5f7;
  --bg-deep: #ececef;
  --fg: #1d1d1f;
  --fg-2: #515154;
  --fg-3: #86868b;
  --line: rgba(0, 0, 0, 0.12);
  --line-strong: rgba(0, 0, 0, 0.2);
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-solid: #fbfbfd;
  --card: rgba(255, 255, 255, 0.78);
  --fill: rgba(0, 0, 0, 0.045);
  --fill-2: rgba(0, 0, 0, 0.08);
  --code-bg: rgba(0, 0, 0, 0.035);
  /* code: VS Code's Light Modern token colours */
  --syn-fg: #3b3b3b; --syn-keyword: #0000ff; --syn-control: #af00db; --syn-property: #001080; --syn-type: #267f99;
  --syn-function: #795e26; --syn-constant: #0070c1; --syn-number: #098658; --syn-string: #a31515; --syn-comment: #008000;
  --syn-variable: #001080; --syn-operator: #3b3b3b; --syn-tag: #800000;
  --ink: #000;            /* the strongest button */
  --ink-fg: #fff;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.04), 0 8px 28px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.04), 0 24px 64px rgba(0, 0, 0, 0.14);
  --err: #a8322d;
  --warn: #8a6a1d;
  --hair: 0.5px;
  --r-s: 10px;
  --r: 14px;
  --r-l: 20px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --topbar-h: 52px;
  --glow-1: rgba(255, 255, 255, 0.95);
  --glow-2: rgba(0, 0, 0, 0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000;
    --bg-deep: #0a0a0b;
    --fg: #f5f5f7;
    --fg-2: #c7c7cc;
    --fg-3: #8e8e93;
    --line: rgba(255, 255, 255, 0.14);
    --line-strong: rgba(255, 255, 255, 0.24);
    --glass: rgba(28, 28, 30, 0.6);
    --glass-strong: rgba(28, 28, 30, 0.8);
    --glass-solid: #1c1c1e;
    --card: rgba(28, 28, 30, 0.7);
    --fill: rgba(255, 255, 255, 0.06);
    --fill-2: rgba(255, 255, 255, 0.11);
    --code-bg: rgba(255, 255, 255, 0.05);
    /* code: VS Code's Dark Modern token colours */
    --syn-fg: #d4d4d4; --syn-keyword: #569cd6; --syn-control: #c586c0; --syn-property: #9cdcfe; --syn-type: #4ec9b0;
    --syn-function: #dcdcaa; --syn-constant: #4fc1ff; --syn-number: #b5cea8; --syn-string: #ce9178; --syn-comment: #6a9955;
    --syn-variable: #9cdcfe; --syn-operator: #d4d4d4; --syn-tag: #569cd6;
    --ink: #fff;
    --ink-fg: #000;
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.7);
    --err: #e0857f;
    --warn: #d4b46a;
    --glow-1: rgba(255, 255, 255, 0.09);
    --glow-2: rgba(255, 255, 255, 0.035);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000;
  --bg-deep: #0a0a0b;
  --fg: #f5f5f7;
  --fg-2: #c7c7cc;
  --fg-3: #8e8e93;
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --glass: rgba(28, 28, 30, 0.6);
  --glass-strong: rgba(28, 28, 30, 0.8);
  --glass-solid: #1c1c1e;
  --card: rgba(28, 28, 30, 0.7);
  --fill: rgba(255, 255, 255, 0.06);
  --fill-2: rgba(255, 255, 255, 0.11);
  --code-bg: rgba(255, 255, 255, 0.05);
  /* code: VS Code's Dark Modern token colours */
  --syn-fg: #d4d4d4; --syn-keyword: #569cd6; --syn-control: #c586c0; --syn-property: #9cdcfe; --syn-type: #4ec9b0;
  --syn-function: #dcdcaa; --syn-constant: #4fc1ff; --syn-number: #b5cea8; --syn-string: #ce9178; --syn-comment: #6a9955;
  --syn-variable: #9cdcfe; --syn-operator: #d4d4d4; --syn-tag: #569cd6;
  --ink: #fff;
  --ink-fg: #000;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.7);
  --err: #e0857f;
  --warn: #d4b46a;
  --glow-1: rgba(255, 255, 255, 0.09);
  --glow-2: rgba(255, 255, 255, 0.035);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 20px); }
body {
  margin: 0;
  min-height: 100vh;
  font: 17px/1.53 var(--font);
  letter-spacing: -0.012em;
  color: var(--fg);
  background-color: var(--bg);
  /* a quiet light behind the glass, so the glass reads */
  background-image:
    radial-gradient(1200px 700px at 12% -10%, var(--glow-1), transparent 60%),
    radial-gradient(900px 600px at 95% 10%, var(--glow-2), transparent 65%),
    radial-gradient(1000px 800px at 50% 110%, var(--glow-2), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--fg); color: var(--bg); }
img, svg { max-width: 100%; }
code, kbd, pre, samp { font-family: var(--mono); font-size: 0.86em; }
kbd { border: var(--hair) solid var(--line-strong); border-radius: 6px; padding: 0.05em 0.4em; background: var(--fill); font-size: 0.75em; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--fg); }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -0.2em; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--ink-fg); }
.skip:focus { top: 10px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; border-bottom: var(--hair) solid var(--line); }
.topbar-in { height: var(--topbar-h); max-width: 1240px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; }
.brand .mark { width: 24px; height: 24px; }
.brand.small { font-size: 15px; }
.navlinks { display: flex; gap: 4px; margin-left: 8px; }
.navlinks a { font-size: 14px; color: var(--fg-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; transition: background-color .2s var(--ease), color .2s var(--ease); display: inline-flex; align-items: center; gap: 4px; }
.navlinks a .icon { width: 12px; height: 12px; opacity: .7; }
.navlinks a:hover { color: var(--fg); background: var(--fill); }
.navlinks a[aria-current="page"] { color: var(--fg); background: var(--fill-2); }
.navtools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.iconbtn { appearance: none; border: 0; background: transparent; color: var(--fg); width: 36px; height: 36px; border-radius: 999px; display: inline-grid; place-items: center; cursor: pointer; transition: background-color .2s var(--ease); }
.iconbtn:hover { background: var(--fill); }
.iconbtn .icon { width: 19px; height: 19px; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none; } :root:not([data-theme="light"]) .i-moon { display: block; } }
.menu-btn { display: none; }
@media (max-width: 720px) {
  .menu-btn { display: inline-grid; }
  .navlinks { position: fixed; top: calc(var(--topbar-h) + 8px); left: 12px; right: 12px; flex-direction: column; gap: 2px; margin: 0; padding: 8px; border-radius: var(--r-l); background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); border: var(--hair) solid var(--line); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
  .navlinks a { font-size: 17px; padding: 12px 14px; border-radius: 12px; }
  body.menu-open .navlinks { opacity: 1; transform: none; pointer-events: auto; }
}

/* ---------- buttons ---------- */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; font: 500 16px/1 var(--font); letter-spacing: -0.01em; text-decoration: none; cursor: pointer; border: var(--hair) solid transparent; transition: transform .15s var(--ease), background-color .2s var(--ease), opacity .2s; white-space: nowrap; }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--ink); color: var(--ink-fg); }
.btn-primary:hover { opacity: .86; }
.btn-secondary { background: var(--fill); color: var(--fg); border-color: var(--line); }
.btn-secondary:hover { background: var(--fill-2); }
.btn:active { transform: scale(.98); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; gap: 6px; }
.btn-sm .icon { width: 15px; height: 15px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; text-decoration: none; }
.link-arrow .icon { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- home ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.hero { text-align: center; padding: 96px 0 56px; }
.hero .mark-big { width: 72px; height: 72px; margin: 0 auto 28px; display: block; color: var(--fg); }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--fg-3); letter-spacing: 0; margin: 0 0 14px; }
.hero h1 { font-size: clamp(44px, 7.4vw, 84px); line-height: 1.04; letter-spacing: -0.045em; font-weight: 700; margin: 0 auto 22px; max-width: 14ch; }
.hero .lede { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.38; letter-spacing: -0.02em; color: var(--fg-2); max-width: 36em; margin: 0 auto 36px; }
.hero .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.section { padding: 64px 0; }
.section-head { text-align: center; margin-bottom: 40px; }
.section h2 { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -0.04em; line-height: 1.08; margin: 0 0 14px; font-weight: 700; }
.section .sub { color: var(--fg-2); font-size: 19px; max-width: 40em; margin: 0 auto; }
.window { border-radius: var(--r-l); border: var(--hair) solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; background: var(--card); }
.window-bar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-bottom: var(--hair) solid var(--line); font-size: 13px; color: var(--fg-3); }
.window-bar .dots { display: flex; gap: 7px; margin-right: 8px; }
.window-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--fill-2); border: var(--hair) solid var(--line); }
.window-bar .spacer { flex: 1; }
.example { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 0; }
.example pre { margin: 0; padding: 20px 22px; max-height: 620px; overflow: auto; font-size: 13px; line-height: 1.6; background: transparent; border-radius: 0; border: 0; }
.example .notes { border-left: var(--hair) solid var(--line); padding: 26px 26px; display: flex; flex-direction: column; gap: 22px; }
.example .notes h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.02em; }
.example .notes p { margin: 0; color: var(--fg-2); font-size: 15px; line-height: 1.5; }
.example .notes .diagram { border-radius: var(--r); background: #fff; border: var(--hair) solid var(--line); padding: 10px; overflow: auto; }
.example .notes .diagram svg { display: block; width: 100%; height: auto; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { position: relative; border-radius: var(--r-l); padding: 28px 26px 26px; border: var(--hair) solid var(--line); background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--fill); border: var(--hair) solid var(--line); }
.card-icon .icon { width: 22px; height: 22px; }
.card h3 { margin: 6px 0 0; font-size: 22px; letter-spacing: -0.03em; }
.card p { margin: 0; color: var(--fg-2); font-size: 15px; flex: 1; }
.card code.cmd { display: block; font-size: 12.5px; padding: 10px 12px; border-radius: var(--r-s); background: var(--code-bg); border: var(--hair) solid var(--line); overflow-x: auto; white-space: nowrap; }
.card .link-arrow { margin-top: 6px; }
.card .link-arrow::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--r-l); overflow: hidden; border: var(--hair) solid var(--line); }
.features > div { background: var(--glass-solid); padding: 26px; }
.features h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -0.02em; }
.features p { margin: 0; color: var(--fg-2); font-size: 15px; }
.store-band { border-radius: var(--r-l); padding: 44px 40px; display: flex; align-items: center; gap: 28px; border: var(--hair) solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.store-band .icon-big { width: 64px; height: 64px; flex: none; border-radius: 16px; display: grid; place-items: center; background: var(--ink); color: var(--ink-fg); }
.store-band .icon-big .icon { width: 32px; height: 32px; }
.store-band h2 { font-size: 32px; margin: 0 0 6px; letter-spacing: -0.035em; }
.store-band p { margin: 0; color: var(--fg-2); }
.store-band .btn { margin-left: auto; }
@media (max-width: 900px) {
  .example { grid-template-columns: 1fr; }
  .example .notes { border-left: 0; border-top: var(--hair) solid var(--line); }
  .cards, .features { grid-template-columns: 1fr; }
  .store-band { flex-direction: column; align-items: flex-start; padding: 30px 24px; }
  .store-band .btn { margin-left: 0; }
}
@media (max-width: 520px) { .hero { padding: 64px 0 40px; } .section { padding: 44px 0; } }

/* ---------- footer ---------- */
.footer { border-top: var(--hair) solid var(--line); margin-top: 72px; }
.footer-in { max-width: 1120px; margin: 0 auto; padding: 28px 20px 40px; display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; font-size: 13px; color: var(--fg-3); }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer nav a { text-decoration: none; color: var(--fg-2); }
.footer nav a:hover { color: var(--fg); }
.footer .fine { flex-basis: 100%; margin: 0; }

/* ---------- code ---------- */
pre { background: var(--code-bg); border: var(--hair) solid var(--line); border-radius: var(--r); padding: 16px 18px; overflow: auto; line-height: 1.55; font-size: 13.5px; tab-size: 2; }
pre code { font-size: inherit; background: none; border: 0; padding: 0; }
/* highlighting: VS Code's colours, whatever the page's greys */
pre code, .code { color: var(--syn-fg); }
.k { color: var(--syn-keyword); }
.kc { color: var(--syn-control); }
.p { color: var(--syn-property); }
.d, .t { color: var(--syn-type); }
.f { color: var(--syn-function); }
.c { color: var(--syn-keyword); }
.n { color: var(--syn-constant); }
.m { color: var(--syn-number); }
.s { color: var(--syn-string); }
.x { color: var(--syn-comment); font-style: italic; }
.o { color: var(--syn-operator); }
.v { color: var(--syn-variable); }
.g { color: var(--syn-tag); }

/* ---------- prose (docs, download) ---------- */
.prose { font-size: 16.5px; line-height: 1.65; }
.prose h1 { font-size: clamp(34px, 4.4vw, 46px); letter-spacing: -0.04em; line-height: 1.1; margin: 0 0 22px; font-weight: 700; }
.prose h2 { font-size: 28px; letter-spacing: -0.03em; line-height: 1.2; margin: 52px 0 14px; padding-top: 6px; font-weight: 700; }
.prose h3 { font-size: 20px; letter-spacing: -0.02em; margin: 34px 0 10px; font-weight: 600; }
.prose h4 { font-size: 17px; margin: 26px 0 8px; }
.prose h2 .anchor, .prose h3 .anchor, .prose h4 .anchor { margin-left: 8px; color: var(--fg-3); text-decoration: none; opacity: 0; transition: opacity .15s; font-weight: 400; }
.prose :is(h2, h3, h4):hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 4px 0; }
.prose li > p { margin: 0 0 8px; }
.prose :not(pre) > code { background: var(--fill); border: var(--hair) solid var(--line); border-radius: 6px; padding: 0.08em 0.36em; font-size: 0.84em; overflow-wrap: anywhere; }
.prose code.path { color: var(--fg-2); }
.prose pre { margin: 0 0 20px; }
.prose blockquote { margin: 0 0 18px; padding: 4px 0 4px 18px; border-left: 2px solid var(--line-strong); color: var(--fg-2); }
.prose hr { border: 0; border-top: var(--hair) solid var(--line); margin: 36px 0; }
.prose img { border-radius: var(--r); }
.prose a:not(.anchor) { text-decoration-line: underline; }
.table-wrap { overflow-x: auto; margin: 0 0 22px; border: var(--hair) solid var(--line); border-radius: var(--r); background: var(--card); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: var(--hair) solid var(--line); }
.prose th { font-weight: 600; font-size: 13px; color: var(--fg-2); background: var(--fill); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.prose td:first-child { min-width: 9em; }

/* ---------- docs layout ---------- */
.docs { display: grid; grid-template-columns: 272px minmax(0, 1fr) 232px; max-width: 1440px; margin: 0 auto; gap: 0; }
.sidebar { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 24px 14px 40px 20px; border-right: var(--hair) solid var(--line); overscroll-behavior: contain; }
.sidebar .side-search { width: 100%; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; margin: 0 0 18px; border-radius: 10px; border: var(--hair) solid var(--line); background: var(--fill); color: var(--fg-3); font: 14px var(--font); cursor: pointer; text-align: left; }
.sidebar .side-search kbd { margin-left: auto; }
.sidebar .side-search .icon { width: 16px; height: 16px; }
.side-group { margin: 0 0 18px; }
.side-group h2 { font-size: 12px; font-weight: 600; color: var(--fg-3); margin: 0 0 4px; padding: 0 10px; letter-spacing: 0; }
.side-group ul { list-style: none; margin: 0; padding: 0; }
.side-group a { display: block; padding: 5px 10px; border-radius: 8px; font-size: 14px; line-height: 1.35; color: var(--fg-2); text-decoration: none; transition: background-color .15s var(--ease), color .15s; }
.side-group a:hover { background: var(--fill); color: var(--fg); }
.side-group a[aria-current="page"] { background: var(--fill-2); color: var(--fg); font-weight: 600; }
.doc-main { min-width: 0; padding: 40px 56px 40px; }
.doc-main .prose { max-width: 780px; margin: 0 auto; }
.crumbs { font-size: 13px; color: var(--fg-3); margin: 0 auto 12px; max-width: 780px; }
.toc { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 40px 20px 40px 8px; font-size: 13px; overscroll-behavior: contain; }
.toc h2 { font-size: 12px; font-weight: 600; color: var(--fg-3); margin: 0 0 8px; padding-left: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: var(--hair) solid var(--line); }
.toc a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 1.5px solid transparent; color: var(--fg-3); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--fg); }
.toc a.l3 { padding-left: 24px; font-size: 12.5px; }
.toc a.active { color: var(--fg); border-left-color: var(--fg); }
.pager { display: flex; gap: 12px; max-width: 780px; margin: 56px auto 0; }
.pager a { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border-radius: var(--r); border: var(--hair) solid var(--line); background: var(--card); text-decoration: none; transition: background-color .2s; }
.pager a:hover { background: var(--fill); }
.pager a span { font-size: 12px; color: var(--fg-3); }
.pager a strong { font-weight: 600; letter-spacing: -0.015em; }
.pager a.next { text-align: right; }
.docs-menu { display: none; }
.sheet-scrim { display: none; }
@media (max-width: 1240px) { .docs { grid-template-columns: 260px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .doc-main { padding: 20px 20px 40px; }
  .docs-menu { display: flex; position: sticky; top: var(--topbar-h); z-index: 30; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: var(--hair) solid var(--line); font-size: 14px; }
  .docs-menu button { appearance: none; border: 0; background: var(--fill); color: var(--fg); height: 32px; border-radius: 999px; padding: 0 14px 0 10px; display: inline-flex; align-items: center; gap: 6px; font: 500 14px var(--font); cursor: pointer; }
  .docs-menu .here { color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; height: auto; width: min(320px, 86vw); padding-top: 20px; border-right: var(--hair) solid var(--line); background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: var(--shadow-lg); transform: translateX(-104%); transition: transform .28s var(--ease); visibility: hidden; }
  body.sheet-open .sidebar { transform: none; visibility: visible; }
  body.sheet-open .sheet-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .28); }
  .prose h2 { font-size: 24px; }
  .prose pre { font-size: 12.5px; }
}

/* ---------- search ---------- */
.search-layer { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.search-layer[hidden] { display: none; }
.search-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .22); }
.search-box { position: relative; width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; border-radius: var(--r-l); border: var(--hair) solid var(--line); box-shadow: var(--shadow-lg); background: var(--glass-strong); overflow: hidden; animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 56px; border-bottom: var(--hair) solid var(--line); }
.search-field .icon { width: 20px; height: 20px; color: var(--fg-3); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: 18px var(--font); letter-spacing: -0.015em; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.search-results a .where { font-size: 12px; color: var(--fg-3); display: block; }
.search-results a .what { font-weight: 600; letter-spacing: -0.01em; display: block; }
.search-results a .snip { font-size: 13px; color: var(--fg-2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results a mark { background: var(--fill-2); color: var(--fg); border-radius: 3px; padding: 0 1px; }
.search-results li[aria-selected="true"] a, .search-results a:hover { background: var(--fill-2); }
.search-foot { margin: 0; padding: 10px 16px; font-size: 12px; color: var(--fg-3); border-top: var(--hair) solid var(--line); }

/* ---------- download ---------- */
.dl-hero { text-align: center; padding: 72px 0 24px; }
.dl-hero h1 { font-size: clamp(40px, 6vw, 64px); letter-spacing: -0.045em; line-height: 1.05; margin: 0 0 14px; }
.dl-hero p { color: var(--fg-2); font-size: 19px; margin: 0; }
.dl-version { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 6px 14px; border-radius: 999px; background: var(--fill); border: var(--hair) solid var(--line); font-size: 14px; color: var(--fg-2); }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 36px 0 0; }
.dl-card { border-radius: var(--r-l); padding: 28px; border: var(--hair) solid var(--line); background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dl-card header { display: flex; align-items: center; gap: 14px; }
.dl-card h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.dl-card .meta { font-size: 13px; color: var(--fg-3); margin: 0; }
.dl-card .sha { font: 11.5px/1.5 var(--mono); color: var(--fg-3); overflow-wrap: anywhere; margin: 0; }
.dl-card ol { margin: 0; padding-left: 1.2em; color: var(--fg-2); font-size: 15px; }
.dl-card ol li { margin: 8px 0; }
.cmdline { display: flex; align-items: center; gap: 8px; border-radius: var(--r-s); background: var(--code-bg); border: var(--hair) solid var(--line); padding: 6px 6px 6px 12px; margin: 6px 0; }
.cmdline code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 12.5px; color: var(--fg); }
.cmdline button { flex: none; }
.notice { border-radius: var(--r); padding: 14px 16px; background: var(--fill); border: var(--hair) solid var(--line); color: var(--fg-2); font-size: 15px; }
.changelog { margin-top: 72px; }
.changelog-body { max-height: none; }
@media (max-width: 820px) { .dl-grid { grid-template-columns: 1fr; } .dl-card { padding: 22px 18px; } }

/* diagrams drawn by archec: in greys, and inverted on black */
.example .notes .diagram svg { filter: grayscale(1); }
:root[data-theme="dark"] .example .notes .diagram { background: #0b0b0c; }
:root[data-theme="dark"] .example .notes .diagram svg { filter: grayscale(1) invert(.92); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .example .notes .diagram { background: #0b0b0c; }
  :root:not([data-theme="light"]) .example .notes .diagram svg { filter: grayscale(1) invert(.92); }
}
.btn.disabled { opacity: .4; pointer-events: none; }
.cmdline .iconbtn { width: 30px; height: 30px; }
.cmdline .iconbtn .icon { width: 16px; height: 16px; }
.cmdline .iconbtn.done { background: var(--fill-2); }
details.release { border-top: var(--hair) solid var(--line); padding: 4px 0; }
details.release:last-child { border-bottom: var(--hair) solid var(--line); }
details.release summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 0; }
details.release summary::-webkit-details-marker { display: none; }
details.release summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--fg-3); border-bottom: 1.5px solid var(--fg-3); transform: rotate(-45deg); transition: transform .2s var(--ease); flex: none; margin: 0 4px; }
details.release[open] summary::before { transform: rotate(45deg); }
details.release summary h3 { margin: 0; font-size: 18px; }
details.release > :not(summary) { margin-left: 26px; }
.changelog h2 { margin-top: 0; }
.changelog ul li { margin: 10px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
