/* Mirexa site: tokens, base elements and the parts every page shares (header,
   footer, buttons, code blocks, tables, notes). Page layouts stay in each
   page's own <style>.

   The home page follows the structure of go.dev's home page (a coloured hero
   with a short list and two buttons, then plain full-width bands, then a
   footer of link columns); go.dev is BSD-3-Clause, Copyright The Go Authors.
   No code is copied from it. Type is Figtree for text and JetBrains Mono for
   code, both SIL OFL. */

:root {
  --paper: #ffffff;
  --sheet: #ffffff;
  --alt: #f4f6f9;
  --ink: #18202e;
  --ink-2: #4c5668;
  --rule: #dde3ea;
  --proof: #1a5fb4;
  --proof-wash: #e9f0fa;
  --loss: #c2501c;
  --loss-wash: #fcefe7;
  --closed: #8a94a3;
  --closed-wash: #eef1f4;
  --code: #f5f7fa;
  --band: #0f1d38;
  --band-ink: #eef2f8;
  --band-ink-2: #a8b5ca;
  --band-rule: #273a5c;
  --brand: #f26b38;
  --brand-ink: #1a0d05;
  --hl-kw: #cf222e; --hl-str: #0a3069; --hl-num: #0550ae;
  --hl-fn: #8250df; --hl-type: #953800; --hl-com: #6e7781;

  --f-display: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --wide: 1180px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0f141c; --sheet: #141b26; --alt: #121a26;
  --ink: #e6ebf2; --ink-2: #9ca8ba; --rule: #263041;
  --proof: #7cadf3; --proof-wash: #15253c;
  --loss: #f0884f; --loss-wash: #2b1c13;
  --closed: #6f7a8b; --closed-wash: #1a2230;
  --code: #0b1017;
  --band: #13213d; --band-rule: #2a3d61;
  --hl-kw: #ff7b72; --hl-str: #a5d6ff; --hl-num: #79c0ff;
  --hl-fn: #d2a8ff; --hl-type: #ffa657; --hl-com: #8b949e;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --paper: #0f141c; --sheet: #141b26; --alt: #121a26;
  --ink: #e6ebf2; --ink-2: #9ca8ba; --rule: #263041;
  --proof: #7cadf3; --proof-wash: #15253c;
  --loss: #f0884f; --loss-wash: #2b1c13;
  --closed: #6f7a8b; --closed-wash: #1a2230;
  --code: #0b1017;
  --band: #13213d; --band-rule: #2a3d61;
  --hl-kw: #ff7b72; --hl-str: #a5d6ff; --hl-num: #79c0ff;
  --hl-fn: #d2a8ff; --hl-type: #ffa657; --hl-com: #8b949e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { font-family: var(--f-display); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; margin: 0; }
p, ul, ol, pre, figure, dl, table { margin: 0; }
a { color: var(--proof); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 650; }
img { max-width: 100%; height: auto; }
code, pre, kbd { font-variant-ligatures: none; }
code { font-family: var(--f-mono); font-size: 0.86em; background: color-mix(in srgb, var(--rule) 55%, transparent); padding: 0.1em 0.3em; border-radius: 4px; overflow-wrap: anywhere; }
kbd { font-family: var(--f-mono); font-size: 0.82em; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; padding: 0.05em 0.35em; }
:focus-visible { outline: 2px solid var(--proof); outline-offset: 2px; }

/* Header */
.site-bar { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-bar-in { max-width: var(--wide); margin-inline: auto; padding: 0.7rem 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.75rem; }
.site-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font: 700 1.2rem/1 var(--f-display); margin-right: auto; }
.site-brand img { width: 28px; height: 28px; border-radius: 6px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.97rem; padding-block: 0.35rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.site-tools { display: flex; align-items: center; gap: 0.4rem; }
.site-tools a, .theme-toggle { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-2); text-decoration: none; font: 500 0.92rem/1 var(--f-body); background: none; border: 1px solid transparent; border-radius: 6px; padding: 0.45rem 0.5rem; cursor: pointer; }
.site-tools a:hover, .theme-toggle:hover { color: var(--ink); border-color: var(--rule); }
.site-tools svg { width: 18px; height: 18px; fill: currentColor; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: inline; }
}
@media (max-width: 640px) {
  .site-nav { order: 3; width: 100%; gap: 0.2rem 1.1rem; }
  .site-tools .gh-label { display: none; }
}

/* Footer */
.site-foot { background: var(--band); color: var(--band-ink-2); margin-top: 5rem; font-size: 0.95rem; }
.site-foot-in { max-width: var(--wide); margin-inline: auto; padding: 2.8rem 16px 2.2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 1.8rem; }
.site-foot h2 { font-size: 0.95rem; color: var(--band-ink); margin-bottom: 0.7rem; letter-spacing: 0; }
.site-foot ul { list-style: none; padding: 0; display: grid; gap: 0.45rem; }
.site-foot a { color: var(--band-ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--band-ink); text-decoration: underline; }
.site-foot .about { grid-column: span 2; max-width: 40ch; display: grid; gap: 0.6rem; align-content: start; }
.site-foot .about b { color: var(--band-ink); font-size: 1.05rem; }
@media (max-width: 520px) { .site-foot .about { grid-column: auto; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font: 600 0.98rem/1 var(--f-body); text-decoration: none; padding: 0.8rem 1.2rem; border-radius: 6px; border: 1px solid var(--rule); color: var(--ink); background: var(--paper); }
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: #ff7d4c; border-color: #ff7d4c; }

/* Code blocks */
.code { position: relative; border: 1px solid var(--rule); border-radius: 8px; background: var(--code); min-width: 0; }
.code .label { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.35rem 0.4rem 0.35rem 0.9rem; border-bottom: 1px solid var(--rule); font: 500 0.82rem/1.3 var(--f-body); color: var(--ink-2); }
.code pre { padding: 0.9rem 1rem; overflow-x: auto; font: 400 0.84rem/1.65 var(--f-mono); tab-size: 4; }
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
.code .out { color: var(--ink-2); }
.copy { font: 500 0.8rem/1 var(--f-body); color: var(--ink-2); background: var(--paper); border: 1px solid var(--rule); border-radius: 5px; padding: 0.35rem 0.6rem; cursor: pointer; }
.copy:hover { color: var(--ink); border-color: var(--ink-2); }
.hl-kw { color: var(--hl-kw); } .hl-str { color: var(--hl-str); } .hl-num { color: var(--hl-num); }
.hl-fn { color: var(--hl-fn); } .hl-type { color: var(--hl-type); } .hl-com { color: var(--hl-com); font-style: italic; }

/* Tables */
.tbl { overflow-x: auto; }
.tbl table, table.plain { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tbl th, .tbl td, table.plain th, table.plain td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl th, table.plain th { font-weight: 600; font-size: 0.9rem; color: var(--ink-2); border-bottom-width: 2px; }

/* Notes */
.note, .tip { padding: 0.8rem 1rem; border-radius: 6px; font-size: 0.97rem; max-width: 68ch; }
.note { background: var(--loss-wash); border: 1px solid color-mix(in srgb, var(--loss) 35%, transparent); }
.tip { background: var(--proof-wash); border: 1px solid color-mix(in srgb, var(--proof) 30%, transparent); }

/* Side contents, shared by the docs and the clients pages */
.rail { position: sticky; top: 0; align-self: start; padding-block: 2.4rem; max-height: 100vh; overflow-y: auto; font-size: 0.93rem; }
.rail .rail-title { display: block; font-weight: 650; color: var(--ink); text-decoration: none; margin-bottom: 0.6rem; }
.rail ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.05rem; }
.rail li a { display: block; padding: 0.28rem 0 0.28rem 0.8rem; border-left: 2px solid var(--rule); color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.rail li a:hover { color: var(--ink); }
.rail li a.on { color: var(--ink); border-left-color: var(--brand); font-weight: 550; }
