/* =========================================================
   Base
   Fonts, reset, element defaults, typography and layout utilities.
   ========================================================= */

/* ---- Fonts (self-hosted) -------------------------------- */
/* Baloo 2 and Outfit are variable fonts: one file per family covers every
   weight the site uses. Hosting them here, not on Google Fonts, keeps a
   second server off the critical path. Both are SIL Open Font License.
   Latin subset only; anything outside it falls back to the system font. */
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("../fonts/baloo-2-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: "Outfit";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/outfit-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;
}

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

html {
  color-scheme: light;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));  /* keeps anchored headings clear of the sticky header */
  scroll-padding-bottom: var(--space-4);                        /* room for focus rings when Tab scrolls down */
  -webkit-text-size-adjust: 100%;
}

/* Phones have the shorter header (short windows override this in sections.css) */
@media (max-width: 640px) {
  html {
    scroll-padding-top: calc(var(--header-h-sm) + var(--space-4));
  }
}

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

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

img {
  height: auto;
}

/* The logos are dark artwork on transparent backgrounds. Dark high-contrast
   themes (Windows "forced colours") turn the page black behind them, so give
   images a paper backing there. Normal rendering is unaffected. */
@media (forced-colors: active) {
  img {
    forced-color-adjust: none;
    padding: 3px;
    border-radius: var(--radius-focus);
    background-color: var(--paper);
  }
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ---- Typography ----------------------------------------- */
/* .display-text gives non-heading text the heading look (the hero tagline) */
h1,
h2,
h3,
.display-text {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Focus ---------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--radius-focus);
}

/* ---- Layout utilities ----------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Parked just above the page (whatever its height with enlarged text) until focused */
.skip-link {
  position: absolute;
  bottom: 100%;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
  bottom: auto;
}

/* Text for screen readers only (e.g. "opens in a new tab") */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Keeps a compound word such as "high-quality" from breaking at its hyphen */
.nowrap {
  white-space: nowrap;
}

/* Holds the <symbol>s for <use> and takes up no space. Hidden by size rather
   than display:none, so a gradient or clip path added to a symbol later still renders. */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---- Motion --------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
