/* Reset and base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.03em; }
h3 { font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.01em; }

strong, b { font-weight: 500; }

a { color: inherit; text-decoration-color: var(--hairline-strong); text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

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

.skip-link {
  position: absolute; left: var(--gutter); top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: var(--paper); }

.wrap { width: min(100% - 2 * var(--gutter), var(--col-wide)); margin-inline: auto; }
.narrow { max-width: var(--col-text); }

.mono { font-size: var(--fs-small); color: var(--muted); }

.section { padding-block: clamp(72px, 11vw, 150px); }
.section-head { display: grid; gap: calc(var(--space) * 2); margin-bottom: clamp(32px, 5vw, 56px); }

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

/* In-page anchors clear the sticky header */
[id] { scroll-margin-top: 80px; }

/* Cross-document View Transitions: no JS, unsupported browsers just navigate normally */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.22s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
