/* Reset, element defaults, typography, layout primitives, utilities. Reads tokens only. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--fs-body); font-weight: var(--wt-body); line-height: var(--lh-body);
  font-feature-settings: 'tnum' 1, 'lnum' 1; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.has-pocbar { padding-bottom: var(--pocbar-h); }
img, svg, video { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--primary-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary); }
h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
b, strong { font-weight: var(--wt-strong); }
hr { border: 0; border-top: var(--rule); margin: var(--s-5) 0; }
table { border-collapse: collapse; }
code, kbd { font-family: var(--font-mono); font-size: .88em; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display); font-weight: var(--wt-head); font-stretch: var(--stretch-head);
  letter-spacing: var(--tracking-heading); line-height: var(--lh-snug); text-transform: var(--case-head); text-wrap: balance;
}
p { text-wrap: pretty; }

/* The browser surfaces carry the design too. */
::selection { background: var(--primary-soft-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
input, textarea { caret-color: var(--primary); accent-color: var(--primary); }

/* Type helpers */
.display { font-family: var(--font-display); font-size: var(--fs-display); font-weight: 600; font-stretch: var(--stretch-display); letter-spacing: var(--tracking-display); line-height: var(--lh-tight); }
.h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
.h2 { font-size: var(--fs-h2); line-height: 1.06; }
.h3 { font-size: var(--fs-h3); }
.lead { font-size: var(--fs-lead); color: var(--ink-2); font-weight: 320; max-width: var(--measure); }
.small { font-size: var(--fs-small); }
.xs { font-size: var(--fs-xs); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums lining-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Layout primitives */
.wrap { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { width: 100%; max-width: var(--container-wide); margin-inline: auto; padding-inline: var(--gutter); }
.stack { display: grid; gap: var(--gap, var(--s-4)); align-content: start; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 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(100%, var(--min, 280px)), 1fr)); }
.section { padding-block: var(--section); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
