/* ==========================================================================
   base.css — reset, document base, typography defaults
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;            /* safety net against horizontal overflow */
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  overflow-x: clip;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

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

button { cursor: pointer; background: none; border: none; }

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  color: var(--c-ink);
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

p { text-wrap: pretty; }

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

::selection {
  background: var(--c-accent);
  color: #fff;
}

::placeholder { color: var(--c-muted); opacity: 0.8; }

:target { scroll-margin-top: calc(var(--header-h) + 1rem); }

.skip-link {
  position: absolute;
  left: var(--sp-sm);
  top: -100%;
  z-index: 200;
  background: var(--c-ink);
  color: #fff;
  padding: var(--sp-2xs) var(--sp-md);
  border-radius: var(--r-md);
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: var(--sp-sm); }
