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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Fine film grain over everything: takes the flat digital edge off large dark areas. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 300;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("../assets/grain.svg");
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.045em; line-height: 1; }
h1 { font-size: clamp(3.1rem, 8vw, 7rem); }
h2 { font-size: clamp(2.3rem, 5vw, 4.1rem); }
h3 { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
em { font-style: normal; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
  border-radius: 6px;
}

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

.visually-hidden {
  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: absolute; left: 16px; top: -56px; z-index: 400;
  padding: 10px 16px;
  background: var(--text); color: #000;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

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