/* Reset, element defaults, typography, layout primitives, utilities. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + var(--s-4)); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--t-15); line-height: var(--lh-body);
  font-weight: var(--wt-body); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.has-pocbar { padding-bottom: var(--pocbar-h); }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--accent); }
p, h1, h2, h3, h4, h5, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; }
hr { border: 0; border-top: var(--rule); margin: var(--s-5) 0; }

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
  font-family: var(--font-display); font-weight: var(--wt-head); letter-spacing: var(--tracking-heading);
  text-transform: var(--case-head); line-height: var(--lh-snug); text-wrap: balance;
}
h1, .h1 { font-size: var(--t-32); line-height: var(--lh-tight); }
h2, .h2 { font-size: var(--t-22); }
h3, .h3 { font-size: var(--t-18); }
h4, .h4 { font-size: var(--t-16); }
p { text-wrap: pretty; }
small, .small { font-size: var(--t-13); }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.92em; font-weight: 420; letter-spacing: -0.01em; }
kbd {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 0.35em;
  border: var(--rule); border-bottom-color: var(--muted-2); border-radius: var(--r-ctl);
  font-size: var(--t-11); color: var(--muted); background: var(--surface);
}

/* Browser surfaces carry the design too */
::selection { background: var(--hl); color: var(--ink); }
:root { caret-color: var(--accent); accent-color: var(--ink); scrollbar-color: var(--muted-2) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border: 3px solid var(--bg); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
:focus-visible { outline: 2px solid var(--npb-ink); outline-offset: 2px; }
::placeholder { color: var(--muted); opacity: 1; }

/* Layout primitives */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.container-wide { width: min(100% - 2 * var(--gutter), var(--container-wide)); margin-inline: auto; }
.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster, var(--s-3)); }
.split { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.grid-auto { display: grid; gap: var(--gap-grid); grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 260px), 100%), 1fr)); }
.measure { max-width: var(--measure); }

/* Utilities */
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label {
  font-family: var(--font-mono); font-size: var(--t-11); font-weight: 450; letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--muted);
}
.ico { flex: none; }
[hidden] { display: none !important; }
