/* Ordinate 2D docs (business/build_docs.mjs). The site's colours and fonts (site/site.css), light and dark by the system. */
:root {
    --bg: #faf9f6; --surface: #ffffff; --ink: #141821; --dim: #596273; --line: #e4e1da; --code: #f1efe9;
    --accent: #1e40af; --accent-weak: #e8edfb; --ok: #166534; --warn: #92400e;
    --serif: "STIX Two Text", "Times New Roman", Times, serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --logo-blue: #1E40AF; --logo-orange: #C2410C;
    --top: 56px;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #0f1218; --surface: #171b23; --ink: #eceff4; --dim: #9aa4b4; --line: #272d38; --code: #1d222c;
            --accent: #8fb0ff; --accent-weak: #1b2542; --ok: #4ade80; --warn: #fbbf24; --logo-blue: #8FB0FF; --logo-orange: #F59E5B; }
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- top bar */
.top { position: sticky; top: 0; z-index: 10; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 20px;
       background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.brand .docs-word { color: var(--dim); font-weight: 500; padding-left: 8px; border-left: 1px solid var(--line); }
.menu { display: none; font-size: 20px; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 4px 6px; }
.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search input { width: 100%; height: 36px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
                border: 1px solid var(--line); border-radius: 8px; }
.results { position: absolute; top: 42px; left: 0; right: 0; max-height: 70vh; overflow: auto; background: var(--surface); 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; text-decoration: none; color: var(--ink); }
.results a:hover, .results a.active { background: var(--accent-weak); }
.results a strong { display: block; font-size: 14px; }
.results a span { display: block; font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .none { padding: 10px; font-size: 14px; color: var(--dim); }
.community { white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--dim, #596273); text-decoration: none; }
.community:hover { text-decoration: underline; }
.studio { white-space: nowrap; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; }
@media (prefers-color-scheme: dark) { .studio { color: #0f1218; } }

/* ---- layout */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; max-width: 1360px; margin: 0 auto; }
.side { position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); overflow: auto; padding: 24px 12px 40px 20px; border-right: 1px solid var(--line); }
.nav-group { margin-bottom: 18px; }
.nav-title { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); margin: 0 0 6px 8px; }
.side a, .toc a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.side a:hover, .toc a:hover { background: var(--accent-weak); }
.side a[aria-current="page"] { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.toc { position: sticky; top: var(--top); align-self: start; padding: 28px 16px; max-height: calc(100vh - var(--top)); overflow: auto; }
.toc a { font-size: 13px; color: var(--dim); }
main { min-width: 0; padding: 28px 48px 60px; }
article { max-width: 780px; }

/* ---- content */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 40px; margin: 8px 0 18px; }
h2 { font-size: 27px; margin: 42px 0 12px; padding-top: 4px; }
h3 { font-size: 20px; margin: 28px 0 8px; }
h4 { font-size: 16px; margin: 22px 0 6px; }
.anchor { float: left; margin-left: -22px; width: 22px; color: var(--dim); text-decoration: none; opacity: 0; font-family: var(--sans); font-size: .8em; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
p, ul, ol { margin: 0 0 14px; }
li { margin: 4px 0; }
li > ul { margin: 4px 0 0; }
code { font: .88em var(--mono); background: var(--code); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--code); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; overflow: auto; font-size: 13.5px; line-height: 1.55; margin: 0 0 16px; }
pre code { background: none; padding: 0; font-size: inherit; }
kbd { font: 12.5px var(--mono); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); white-space: nowrap; }
blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--accent-weak); border-radius: 0 8px 8px 0; }
blockquote p:last-child { margin-bottom: 0; }
img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.dim { color: var(--dim); font-size: 14px; }
.table { overflow-x: auto; margin: 0 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--dim); font-weight: 700; }
td code { white-space: nowrap; }
table.validation td:nth-child(n+3) { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.validation td.err { font-weight: 600; }
table.validation td.ok { color: var(--ok); }
p.run { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
details { margin: 0 0 16px; }
summary { cursor: pointer; color: var(--accent); }
.api { margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.api .sig { display: block; background: none; padding: 0; margin-bottom: 4px; font-size: 13.5px; white-space: pre-wrap; color: var(--ink); font-weight: 600; }
.api p { margin: 0; font-size: 15px; }
ul.examples { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
ul.examples li { margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14.5px; }
ul.examples li span { color: var(--dim); font-size: 13.5px; }
.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 4px; background: var(--accent-weak); color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 20px; }
.cards a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; }
.cards a:hover { border-color: var(--accent); }
.cards a strong { display: block; margin-bottom: 4px; }
.cards a span { color: var(--dim); font-size: 14px; }
.pager { display: flex; justify-content: space-between; gap: 12px; max-width: 780px; margin-top: 48px; }
.pager a { flex: 1; max-width: 48%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--surface); }
.pager a span { display: block; font-size: 12.5px; color: var(--dim); }
.pager .next { text-align: right; margin-left: auto; }
footer { max-width: 780px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }

/* ---- narrow windows */
@media (max-width: 1100px) { .layout { grid-template-columns: 230px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 760px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .menu { display: block; }
    .side { display: none; position: fixed; inset: var(--top) 0 0 0; z-index: 9; height: auto; background: var(--bg); border-right: 0; }
    body.nav-open .side { display: block; }
    .brand span:not(.docs-word) { display: none; }
    .studio, .community { display: none; }
    main { padding: 20px 16px 48px; }
    h1 { font-size: 32px; }
    .anchor { display: none; }
}
