/* Base — reset, typography, layout primitives.
 *
 * Shared by every site. Holds nothing site-specific: no colours beyond the
 * tokens, no content assumptions, no page-specific layout.
 *
 * A site should be able to produce a decent page using only this plus content.
 */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Type */

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p, li { text-wrap: pretty; }
p + p { margin-top: var(--s-4); }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

code, kbd, pre { font-family: var(--font-mono); font-size: 0.9em; }
code {
  background: var(--bg-sunken);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
pre {
  background: var(--bg-sunken);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-4);
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

strong { font-weight: 620; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-12) 0; }

blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--s-2) 0 var(--s-2) var(--s-6);
  max-width: var(--measure);
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--ink-muted);
}
blockquote footer {
  margin-top: var(--s-3);
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--ink-faint);
}

figure { margin: 0; }
figure img, figure svg { display: block; width: 100%; height: auto; }
figcaption { margin-top: var(--s-2); font-size: var(--step--1); color: var(--ink-muted); }

img { max-width: 100%; height: auto; }

/* Two-column definition list; collapses on narrow screens. */
dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-6); }
dt { color: var(--ink-muted); }
dd { margin: 0; }
@media (max-width: 32rem) {
  dl { grid-template-columns: 1fr; gap: 0; }
  dd { margin-bottom: var(--s-3); }
}

/* Layout primitives */

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--s-6);
}
.prose { max-width: var(--measure); }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-8); }

.section { padding-block: var(--s-24); }
.section + .section { border-top: 1px solid var(--rule); }

.grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
}

/* Small shared pieces */

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.lede {
  font-size: var(--step-1);
  color: var(--ink-muted);
  max-width: var(--measure);
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--accent);
  color: var(--bg);
  font-weight: 550;
  padding: var(--s-3) var(--s-6);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s ease;
}
.button:hover { background: var(--accent-hover); color: var(--bg); }

.button-quiet {
  background: none;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.button-quiet:hover { background: var(--bg-sunken); color: var(--ink); }

table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
th, td { text-align: left; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--rule); }
th { font-weight: 600; color: var(--ink-muted); }

.scroll-x { overflow-x: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
