/* Self-hosted fonts (OFL — licenses in fonts/). Variable weight files. */
@font-face {
  font-family: "Domine";
  src: url("/static/fonts/domine-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Logo only (HeaderLogo). Single weight. */
@font-face {
  font-family: "Marcellus";
  src: url("/static/fonts/marcellus-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Jost";
  src: url("/static/fonts/jost-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

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

html {
  color-scheme: light;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  color: var(--color-heading);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 var(--size-3);
  text-wrap: balance;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 3.2vw + 1.2rem, 3.75rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 1.8vw + 1rem, 2.75rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.375rem;
  font-weight: 500;
}

p {
  margin: 0 0 var(--size-4);
}

a {
  color: var(--color-link);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--color-link-hover);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

img {
  max-width: 100%;
  display: block;
}

/* Component display rules (e.g. .btn's inline-block) must not override
   the hidden attribute. */
[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--size-5);

  @media (max-width: 40rem) {
    padding-inline: 1rem;
  }
}

/* Every public page sits below the fixed nav. */
main {
  padding-top: var(--nav-height);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  padding: var(--size-2) var(--size-3);

  &:focus {
    left: var(--size-3);
    top: var(--size-3);
  }
}

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