/* Reset, element defaults and browser surfaces */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s-4));
  scrollbar-color: var(--ink-2) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

p { text-wrap: pretty; }

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

a {
  color: var(--accent-ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--t) var(--ease), text-decoration-color var(--t) var(--ease);
}
a:hover { color: var(--ink); }

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

table { border-collapse: collapse; }
table, .num { font-variant-numeric: tabular-nums; }

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

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible { outline-color: var(--on-dark); }

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  z-index: 100;
  padding: var(--s-3) var(--s-4);
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:hover { color: var(--bg); }
.skip-link:focus-visible { transform: none; color: var(--bg); }

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

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