/* Base layer: reset, typography, layout primitives. */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

@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;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

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

a { color: var(--link); text-underline-offset: 0.16em; transition: color 150ms var(--ease); }
a:hover { color: var(--brand-deep); }

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--brand-deep);
  color: var(--white);
  padding: 0.6rem 1rem;
  z-index: 1000;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 150ms var(--ease);
}
.skip-link:focus { top: 0.75rem; color: var(--white); }

/* Type ------------------------------------------------------------------ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.6em;
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem); }
h4 { font-size: 1.0625rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: clamp(1.1rem, 1.04rem + 0.3vw, 1.28rem);
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 44ch;
  text-wrap: pretty;
}
.muted { color: var(--ink-muted); }
.eyebrow {
  font: 600 0.8125rem/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 0.9rem;
}
.h-note {
  font: 400 0.75em/1 var(--font-mono);
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  vertical-align: 0.15em;
}
code { font-family: var(--font-mono); font-size: 0.9em; }

.note {
  font-size: 0.95rem;
  color: var(--ink-muted);
  border-left: 3px solid var(--brand-soft);
  padding: 0.15rem 0 0.15rem 1rem;
  margin-top: 1.5rem;
  max-width: 60ch;
}

.opt { font-weight: 400; color: var(--ink-faint); font-size: 0.85em; }

/* Layout ---------------------------------------------------------------- */

.container { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }
@media (max-width: 30rem) { .container { width: min(100% - 1.75rem, var(--max)); } }

.section { padding-block: var(--space-section); }
.section--tight { padding-block: var(--space-section-tight); }
.section--tint { background: var(--bg-tint); }
.section + .section--tint, .section--tint + .section { border-top: 1px solid var(--line-soft); }

.section__head { max-width: 46rem; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.section__head h2 { margin-bottom: 0.4em; }
.section__head p { color: var(--ink-muted); margin-bottom: 0; }
.section__aside { margin-top: 1.75rem; }

.prose { max-width: 58rem; }
.prose--narrow { max-width: var(--max-text); }
.prose__intro { font-size: 1.1rem; line-height: 1.6; }
.prose h2 { margin-top: 2.25rem; }
.prose__block { margin-top: 2.25rem; }
.prose__block h2 { margin-top: 0; }
.prose p { max-width: 68ch; }

.two-col {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  align-items: start;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }
.actions:first-child { margin-top: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.num { text-align: right; font-variant-numeric: tabular-nums; }
