/* base.css — the font face, element defaults, the focus ring and the global
   reduced-motion rule. No component styles. See docs/02-design-system.md. */

/* ---- The one web font -------------------------------------------------- */
/* Public Sans 2.001, variable weight axis, subset to Latin. SIL OFL 1.1 —
   licence in public/assets/fonts/. See docs/02b-type.md for the subset
   command and why this family. */
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/public-sans-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
                 U+FEFF, U+FFFD;
}

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

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

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: var(--text-3);
  line-height: var(--leading-3);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1, h2, h3, h4, p, figure, blockquote, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }

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

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

table { border-collapse: collapse; width: 100%; }

/* ---- Headings ---------------------------------------------------------- */
/* Sizes come from the seven-step scale and nowhere else. Sentence case is a
   copy rule, not a CSS one — there is no text-transform here. */
h1 {
  font-size: var(--text-6);
  line-height: var(--leading-6);
  letter-spacing: var(--track-6);
  font-weight: var(--weight-semibold);
}

h2 {
  font-size: var(--text-5);
  line-height: var(--leading-5);
  letter-spacing: var(--track-5);
  font-weight: var(--weight-semibold);
}

h3 {
  font-size: var(--text-4);
  line-height: var(--leading-4);
  font-weight: var(--weight-medium);
}

/* ---- Links ------------------------------------------------------------- */
/* --fg-1 with a --fg-3 underline that resolves to --fg-1 on hover. Never a
   colour change: a green or red link would collide with the semantics. */
a {
  color: var(--fg-1);
  text-decoration: underline;
  text-decoration-color: var(--fg-3);
  text-decoration-thickness: var(--border);
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--dur-1) var(--ease);
}

a:hover { text-decoration-color: var(--fg-1); }

/* ---- Focus ------------------------------------------------------------- */
/* :focus-visible only, never removed, never restyled per component.
   docs/07-accessibility.md. */
:focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
  border-radius: inherit;
}

:focus:not(:focus-visible) { outline: none; }

/* ---- Reduced motion ---------------------------------------------------- */
/* Global and not opt-out. Every component still reaches its end state — it
   just arrives instantly. docs/02c-space-motion.md. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
