/* ==========================================================
   Base: reset, typography, layout primitives
   ========================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  background: var(--bg-primary);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 300;
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out);
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
:where(ul[class], ol[class]) { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

h1, h2, h3, h4 { font-weight: 400; line-height: var(--lh-tight); text-wrap: balance; }
p { text-wrap: pretty; }

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

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

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }

.display {
  font-size: var(--fs-2xl);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.18;
  max-width: 18ch;
}
.display--md { font-size: var(--fs-xl); max-width: 22ch; }
.display--sm { font-size: var(--fs-xl); max-width: 24ch; }

.lead {
  font-size: var(--fs-md);
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 56ch;
}

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

.skip-link {
  position: fixed;
  inset-inline-start: var(--space-4);
  top: calc(env(safe-area-inset-top, 0px) + var(--space-4));
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: none; }

[lang="en"] { font-feature-settings: "kern" 1; }
