/* Reset, element defaults, and the fonts.
 *
 * Both families are variable and latin-subset, 66 KB for the pair, served from
 * this binary. A font CDN would be a second origin the Content Security Policy
 * has to allow and a request that blocks first paint; embedding them is smaller
 * than the argument for not embedding them.
 */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

h1,
h2,
h3,
h4 {
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 800;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
}
h2 {
  font-size: var(--text-2xl);
}
h3 {
  font-size: var(--text-lg);
  font-weight: 700;
}

p {
  text-wrap: pretty;
  color: var(--body);
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--signal-deep);
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

::selection {
  background: var(--signal);
  color: var(--ink);
}

/* One focus style everywhere. A square outline rather than a soft ring: the
 * brand has no rounded corners. */
:focus-visible {
  outline: 2px solid var(--signal-deep);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- layout */

.page {
  max-width: var(--content-width);
  margin-inline: auto;
  padding: var(--space-6) clamp(16px, 4vw, 32px) var(--space-9);
}

.page--wide {
  max-width: var(--wide-width);
}

.center-screen {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--space-4);
}

/* A deliberately closed set of utilities. If a spacing need is not covered
 * here it belongs in page CSS — that is how a utility layer stops turning into
 * a second, worse stylesheet. */
.stack-2 > * + * {
  margin-top: var(--space-2);
}
.stack-3 > * + * {
  margin-top: var(--space-3);
}
.stack-4 > * + * {
  margin-top: var(--space-4);
}
.stack-5 > * + * {
  margin-top: var(--space-5);
}
.stack-6 > * + * {
  margin-top: var(--space-6);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.row--tight {
  gap: var(--space-2);
}
.row--between {
  justify-content: space-between;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: var(--space-4);
}
.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Mono is not decoration: it marks a value as a checkable fact. */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--fog);
}
.faint {
  color: var(--dash);
}
.small {
  font-size: var(--text-sm);
}
.xs {
  font-size: var(--text-xs);
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.nowrap {
  white-space: nowrap;
}
.signal {
  color: var(--signal-deep);
}
.evidence {
  color: var(--evidence);
}

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-8));
  z-index: var(--z-modal);
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus {
  top: var(--space-4);
}

/* The bracketed mono label that opens a section: [ 01 ] HOW IT WORKS */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--fog);
}
.eyebrow--signal {
  color: var(--signal-deep);
}
.eyebrow--evidence {
  color: var(--evidence);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
