/* =========================================================
   BASE — fonts, reset and default text styles
   ========================================================= */

/* ---------- Fonts (self-hosted, no external requests) ----------
   Each block tells the browser: "this font name lives in this file
   and covers these weights". Weight ranges match the actual files.
   font-display: swap = show text right away in a fallback font,
   then switch once the real font has loaded. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;   /* the "width" dial */
  font-style: normal;
  font-display: swap;
}

@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: "Geist";
  src: url("../fonts/geist-italic-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

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

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-italic-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- Reset: remove browser quirks ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Smooth scrolling for nav links — only if the visitor hasn't asked for less motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; height: auto; }

/* ---------- Default text styles ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: -0.02em;
  text-wrap: balance;      /* evens out line lengths in headlines */
}

h1 {
  font-size: var(--text-display);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

h2 {
  font-size: var(--text-2xl);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

h3 { font-size: var(--text-lg); }

p {
  max-width: var(--measure);
  text-wrap: pretty;       /* avoids a single lonely word on the last line */
}

strong { font-weight: 600; }

a {
  color: var(--cobalt);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

/* Visible focus ring for keyboard users */
:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

::selection { background: var(--cobalt); color: var(--white); }

/* ---------- Small shared text styles ---------- */

/* Mono label: "01 / The Main Project" — shown in capitals */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.label__num { color: var(--cobalt); }

/* "Skip to content": hidden until a keyboard user presses Tab */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: var(--space-1);
  z-index: 100;
  padding: var(--space-1) var(--space-2);
  background: var(--ink);
  color: var(--white);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Respect "reduce motion" settings everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
