/*
  base.css: fonts, reset, element defaults, utilities.
  Load order: tokens, base, components, pages.
*/

/* ------------------------------------------------------------------
   Fonts. Self-hosted, woff2 only, split into latin and latin-ext so the
   extended file loads only when a page uses those characters.
   Bricolage Grotesque: weight 800, variable opsz 12 to 96 (weight pinned and unused
   OpenType features dropped to keep each file under 40 KB; CSS asking for 700 gets 800).
   Source Serif 4: variable roman, wght 400 to 600; italic at 400.
   Licences: /fonts/OFL-*.txt. Files are cached as immutable, so a
   changed font must ship under a new file name.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-v5.3.0-w800-latin.woff2") format("woff2");
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-v5.3.0-w800-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-v5.3.1-latin.woff2") format("woff2");
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-v5.3.1-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/source-serif-4-italic-v5.3.1-latin.woff2") format("woff2");
  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+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/source-serif-4-italic-v5.3.1-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------------
   Metric-matched fallbacks. Local fonts only, never downloaded.
   size-adjust matches the average glyph width of the web font over an
   English sample; the overrides match its ascent and descent, so the swap
   moves text as little as possible.
   Weight 800 is tuned to the hero (opsz 96); the weight 700 faces stand in for
   buttons and labels, which render as 800 at opsz 18, and are tuned to that. Values come from fontTools measurements; see
   docs/decisions.md before changing them.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Bricolage Fallback Archivo";
  font-weight: 800;
  src: local("Archivo Black"), local("ArchivoBlack-Regular");
  size-adjust: 80.16%;
  ascent-override: 116.02%;
  descent-override: 33.68%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Bricolage Fallback Archivo";
  font-weight: 700;
  src: local("Archivo Black"), local("ArchivoBlack-Regular");
  size-adjust: 88.45%;
  ascent-override: 105.15%;
  descent-override: 30.53%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Bricolage Fallback Impact";
  font-weight: 800;
  src: local("Impact");
  size-adjust: 110.72%;
  ascent-override: 84%;
  descent-override: 24.39%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Bricolage Fallback Impact";
  font-weight: 700;
  src: local("Impact");
  size-adjust: 122.17%;
  ascent-override: 76.12%;
  descent-override: 22.1%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Bricolage Fallback Arial";
  font-weight: 800;
  src: local("Arial Black"), local("Arial-Black");
  size-adjust: 80.15%;
  ascent-override: 116.04%;
  descent-override: 33.69%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Bricolage Fallback Arial";
  font-weight: 700;
  src: local("Arial Black"), local("Arial-Black");
  size-adjust: 88.44%;
  ascent-override: 105.16%;
  descent-override: 30.53%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Serif Fallback Georgia";
  font-style: normal;
  font-weight: 400;
  src: local("Georgia");
  size-adjust: 107.37%;
  ascent-override: 96.49%;
  descent-override: 31.2%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Serif Fallback Georgia";
  font-style: normal;
  font-weight: 600;
  src: local("Georgia Bold"), local("Georgia-Bold");
  size-adjust: 93.56%;
  ascent-override: 110.73%;
  descent-override: 35.8%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Serif Fallback Georgia";
  font-style: italic;
  font-weight: 400;
  src: local("Georgia Italic"), local("Georgia-Italic");
  size-adjust: 97.71%;
  ascent-override: 106.03%;
  descent-override: 34.29%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Serif Fallback Times";
  font-style: normal;
  font-weight: 400;
  src: local("Times New Roman"), local("TimesNewRomanPSMT");
  size-adjust: 117.6%;
  ascent-override: 88.09%;
  descent-override: 28.49%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Serif Fallback Times";
  font-style: normal;
  font-weight: 600;
  src: local("Times New Roman Bold"), local("TimesNewRomanPS-BoldMT");
  size-adjust: 111.71%;
  ascent-override: 92.74%;
  descent-override: 29.99%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Source Serif Fallback Times";
  font-style: italic;
  font-weight: 400;
  src: local("Times New Roman Italic"), local("TimesNewRomanPS-ItalicMT");
  size-adjust: 108.49%;
  ascent-override: 95.49%;
  descent-override: 30.88%;
  line-gap-override: 0%;
}

/* ------------------------------------------------------------------
   Reset
   ------------------------------------------------------------------ */

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

* {
  margin: 0;
}

html {
  color-scheme: only light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--paper);
}

body {
  min-block-size: 100vh;
  min-block-size: 100dvh;
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

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

button {
  cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------
   Elements
   ------------------------------------------------------------------ */

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: var(--leading-body);
  font-optical-sizing: auto;
  font-kerning: normal;
  text-align: start;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: var(--tracking-head);
  line-height: var(--leading-heading);
  text-align: start;
  text-wrap: balance;
}

/* The page headline is the hero sentence: placard size, ragged right, never balanced. */
h1 {
  font-size: var(--step-hero);
  line-height: var(--leading-hero);
  text-wrap: wrap;
}

h2 {
  font-size: var(--step-h2);
}

h3 {
  font-size: var(--step-h3);
}

h4,
h5,
h6 {
  font-size: var(--step-body);
}

p,
li,
dd,
blockquote,
figcaption {
  max-inline-size: var(--measure);
}

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--step-caption);
}

a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: var(--rule);
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness var(--duration-ui) var(--ease);
}

a:hover {
  text-decoration-thickness: calc(var(--rule) * 2);
}

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

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

/* ------------------------------------------------------------------
   Utilities
   ------------------------------------------------------------------ */

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

@media (min-width: 48em) {
  .container {
    padding-inline: var(--space-6);
  }
}

.visually-hidden {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ------------------------------------------------------------------
   Reduced motion: nothing moves. Animations jump straight to their end
   state, so anything animated must end in its settled look.
   ------------------------------------------------------------------ */

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