/* ============================================================
   BASE
   Fonts, a small reset, and default styles for plain elements.
   Section-specific styling never goes here.
   ============================================================ */

/* ---- Fonts (self-hosted) ---- */
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Creato Display";
  src: url("../fonts/creato-display-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--nav-offset); /* anchor links stop below the sticky nav */
  /* Nothing may widen the page. Needed on <html> as well as <body>: with it on
     body alone, phones still grew the page sideways while items slid in from the
     right (white strip on the right, nav stretched). `clip` (not `hidden`) keeps
     position: sticky working. */
  overflow-x: clip;
}

/* Touch screens run without Lenis (js/modules/smooth-scroll.js),
   so anchor links glide with native smooth scrolling instead */
@media (hover: none) and (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  overflow-x: clip;   /* see html above */
  background-color: var(--color-white);
  color: var(--color-gray);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-l);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--color-text);
  font-weight: var(--fw-medium);
  line-height: var(--lh-l);
}

p {
  margin: 0;
}

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

a {
  color: var(--color-text);
  text-decoration: none;
}

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

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid #0050bd;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Visually hidden but readable by screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link: first focusable element on the page */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--color-black);
  color: var(--color-white);
  border-radius: var(--radius-pill);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}
