/* xsi.here — one stylesheet for the site and the platform pages. A drafting sheet: paper, ink, hairline rules, one acid accent. */
@font-face { font-family: archivo; src: url(/fonts/archivo-100-900.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: plexMono; src: url(/fonts/plexmono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: plexMono; src: url(/fonts/plexmono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #eeede8; --surface: #f8f8f3; --ink: #171816; --concrete: #696b65; --concrete-light: #9a9c94; --rule: #b9bbb2;
  --acid: #d7ff3f; --grid-major: #1718161a; --grid-minor: #1718160b; --danger: #b3261e;
  --sans: archivo, "Helvetica Neue", Arial, sans-serif; --mono: plexMono, ui-monospace, "SFMono-Regular", Menlo, monospace;
  --margin: clamp(1rem, 3.2vw, 3rem); --gutter: clamp(.75rem, 1.6vw, 1.5rem); --section: clamp(4rem, 8vw, 8.5rem);
  --ease: cubic-bezier(.2, .75, 0, 1); --header-h: 3.75rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--sans); font-stretch: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--concrete-light); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--acid); color: var(--ink); }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.025em; line-height: 1.02; }
p { margin: 0; }
.wrap { width: 100%; max-width: 92rem; margin: 0 auto; padding: 0 var(--margin); }
.mono { font-family: var(--mono); font-size: .8125rem; letter-spacing: 0; }
.muted { color: var(--concrete); }
.faint { color: var(--concrete-light); }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--acid); padding: .5rem .75rem; z-index: 99; }
.skip:focus { left: .5rem; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--ink); }
.top .wrap { height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 650; font-size: 1.125rem; letter-spacing: -.02em; text-decoration: none; }
.brand svg { width: 1.6rem; height: 1.6rem; }
.brand small { font: 500 .6875rem/1 var(--mono); color: var(--concrete); letter-spacing: .02em; padding: .25rem .4rem; border: 1px solid var(--rule); }
.nav { display: flex; gap: 1.4rem; margin-left: auto; font-size: .9375rem; font-weight: 500; }
.nav a { text-decoration: none; padding: .35rem 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.top .actions { display: flex; gap: .5rem; align-items: center; }
@media (max-width: 760px) { .nav { display: none; } .top .actions { margin-left: auto; } }

/* buttons, chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: .6rem 1.05rem; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font: 600 .9375rem/1 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s var(--ease), transform .15s var(--ease); border-radius: 0; }
.btn:hover { background: var(--surface); }
.btn:active { transform: translateY(1px); }
.btn.acid { background: var(--acid); }
.btn.acid:hover { background: #cbf52c; }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.ink:hover { background: #2a2b28; }
.btn.sm { min-height: 2.25rem; padding: .45rem .8rem; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.chip { display: inline-block; font: 500 .6875rem/1 var(--mono); padding: .28rem .45rem; border: 1px solid var(--rule); color: var(--concrete); text-transform: lowercase; vertical-align: middle; }
.chip.now { background: var(--acid); border-color: #b5d92a; color: var(--ink); }
.chip.ok::before, .chip.down::before { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .35rem; background: #4c9a2a; border-radius: 50%; vertical-align: 0; }
.chip.down::before { background: var(--danger); }

/* layout */
.section { padding: var(--section) 0; border-top: 1px solid var(--rule); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }
.grid > *, .panels > *, .gate > * { min-width: 0; }   /* a long code line must scroll inside its box, never widen the page */
.kicker { font: 500 .75rem/1 var(--mono); color: var(--concrete); display: flex; gap: .75rem; align-items: center; margin-bottom: 1.5rem; }
.kicker b { color: var(--ink); font-weight: 500; }
.h1 { font-size: clamp(3.25rem, 9vw, 8.5rem); font-weight: 650; letter-spacing: -.045em; line-height: .92; }
.h2 { font-size: clamp(2.25rem, 5.2vw, 4.75rem); letter-spacing: -.04em; line-height: .98; }
.h3 { font-size: 1.25rem; letter-spacing: -.015em; line-height: 1.2; }
.lead { font-size: clamp(1.125rem, 1.7vw, 1.5rem); line-height: 1.35; letter-spacing: -.012em; }
.prose { max-width: 38rem; color: #2d2e2b; }
.prose p + p { margin-top: 1rem; }
figure { margin: 0; }
figcaption { font: 400 .75rem/1.5 var(--mono); color: var(--concrete); margin-top: .65rem; }
figcaption b { color: var(--ink); font-weight: 500; margin-right: .4rem; }
.sheet { position: relative; border: 1px solid var(--ink); background-color: var(--paper);
  background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px), linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px; background-position: -1px -1px; }

/* code */
.code { position: relative; background: var(--ink); color: #e9e9e2; font: 400 .875rem/1.7 var(--mono); padding: 1.1rem 1.25rem; overflow-x: auto; border: 1px solid var(--ink); }
.code .c { color: #8d8f87; }
.code .p { color: var(--acid); user-select: none; }
.code pre { margin: 0; font: inherit; white-space: pre; }
.copybtn { position: absolute; top: .55rem; right: .55rem; font: 500 .6875rem/1 var(--mono); color: #e9e9e2; background: transparent; border: 1px solid #4a4b47; padding: .4rem .55rem; cursor: pointer; }
.copybtn:hover { border-color: var(--acid); color: var(--acid); }
code { font: 400 .875em/1 var(--mono); background: var(--surface); border: 1px solid var(--rule); padding: .1em .35em; }

/* forms */
label { display: block; font: 500 .75rem/1 var(--mono); color: var(--concrete); margin-bottom: .45rem; }
input, textarea { width: 100%; font: 400 1rem/1.4 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); padding: .7rem .8rem; border-radius: 0; }
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
textarea { resize: vertical; min-height: 5.5rem; }
.field + .field { margin-top: 1rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note { font-size: .875rem; color: var(--concrete); }
.err { color: var(--danger); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th { text-align: left; font: 500 .6875rem/1 var(--mono); color: var(--concrete); text-transform: lowercase; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--ink); }
td { padding: .8rem .75rem .8rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* footer */
.foot { border-top: 1px solid var(--ink); padding: 2.5rem 0 3rem; font-size: .875rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; align-items: baseline; }
.foot nav { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-left: auto; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* reveal: only when JS is on, so a page without JS (or a crawler) sees everything */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }
