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

* { margin: 0; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.62;
  font-weight: 400;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

button { background: none; border: 0; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: var(--tracking-head);
  text-wrap: balance;
}

h1 { font-size: var(--step-6); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: 1.25; letter-spacing: var(--tracking-tight); }
h4 { font-size: var(--step-1); line-height: 1.3; letter-spacing: var(--tracking-tight); }

p { text-wrap: pretty; }

.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0;
  font-size: 1.1em;
  line-height: 0.98;
}

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

a:hover { color: var(--accent-deep); text-decoration-color: currentColor; }

:focus { outline: none; }

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

[data-scroll-target]:focus,
[data-scroll-target]:focus-visible { outline: none; }

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -110%);
  z-index: 200;
  padding: 0.7rem 1.25rem;
  background: var(--ink);
  color: var(--ink-inv);
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-size: var(--step--1);
  font-weight: 500;
  transition: transform var(--t-med) var(--ease);
}

.skip-link:focus-visible { transform: translate(-50%, 0); color: var(--ink-inv); }

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

@supports (scrollbar-width: thin) {
  html { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
}

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

[hidden] { display: none !important; }

@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;
    scroll-behavior: auto !important;
  }
}
