/*
  Base styles, v1: the face, a reset, the type scale, layout primitives,
  the focus ring and reduced motion. Load after tokens.css and before
  components.css. Every value comes from tokens.css.
*/

/* ---------- Faces ---------- */

@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/LibreFranklin-Roman-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Franklin";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/LibreFranklin-Italic-latin.woff2") format("woff2");
}

/* Arial stretched to Libre Franklin's measured widths and line metrics
   (2026-10-09), so the swap moves no line on the hero. */
@font-face {
  font-family: "Libre Franklin Fallback";
  font-weight: 400 500;
  src: local("Arial");
  size-adjust: 102.9%;
  ascent-override: 93.9%;
  descent-override: 23.9%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Libre Franklin Fallback";
  font-weight: 600 800;
  src: local("Arial Bold"), local("Arial-BoldMT");
  size-adjust: 99.1%;
  ascent-override: 97.5%;
  descent-override: 24.8%;
  line-gap-override: 0%;
}

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

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
}

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

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

button {
  cursor: pointer;
}

p,
li,
h1,
h2,
h3,
h4,
dd {
  overflow-wrap: break-word;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

/* ---------- Type scale ---------- */

h1,
.t-display {
  font-size: var(--size-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  font-weight: var(--weight-bold);
  text-wrap: balance;
}

h2,
.t-title {
  font-size: var(--size-title);
  line-height: var(--leading-title);
  letter-spacing: var(--tracking-title);
  font-weight: var(--weight-bold);
  text-wrap: balance;
}

h3,
.t-heading {
  font-size: var(--size-heading);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  font-weight: var(--weight-bold);
  text-wrap: balance;
}

.t-lede {
  font-size: var(--size-lede);
  line-height: var(--leading-lede);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
}

.t-body {
  font-size: var(--size-body);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
}

.t-ui {
  font-size: var(--size-ui);
  line-height: var(--leading-ui);
  font-weight: var(--weight-medium);
}

.t-small {
  font-size: var(--size-small);
  line-height: var(--leading-small);
  font-weight: var(--weight-regular);
}

.t-muted {
  color: var(--ink-muted);
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: var(--weight-bold);
}

/* Dates, counts and prices never shift as digits change. */
time,
data,
.t-figures {
  font-variant-numeric: tabular-nums;
}

/* A date never breaks at its hyphens. */
time {
  white-space: nowrap;
}

/* ---------- Links ---------- */

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-skip-ink: auto;
  transition: text-decoration-thickness var(--duration-fast) var(--ease-out);
}

@media (hover: hover) {
  a:hover {
    text-decoration-thickness: 2px;
  }
}

/* ---------- Focus ---------- */

:focus-visible {
  outline: var(--focus-width) solid var(--focus);
  outline-offset: var(--focus-offset);
}

/* Radius-less elements get a soft corner on the ring; shaped ones keep their own. */
:where(a, summary, [tabindex]):focus-visible {
  border-radius: 2px;
}

/* ---------- Layout primitives ---------- */

/* The page column: centred, capped at --page-max, with side gutters. */
.l-page {
  width: 100%;
  max-width: calc(var(--page-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Vertical space between page sections. */
.l-section {
  padding-block: var(--section-gap);
}

.l-section + .l-section {
  padding-top: 0;
}

/* Even vertical flow between siblings; set --stack to change the step. */
.l-stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack, var(--space-4));
}

/* Reading width for running text. */
.l-measure {
  max-width: var(--measure);
}

/* A row that wraps, for buttons and short items. */
.l-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster, var(--space-4));
}

/* Heading beside its content on desktop, above it on a phone. */
.l-split {
  container-type: inline-size;
}

/* One column as wide as the section, never wider: an automatic column grows to
   the longest word, and with large text one word widened the page (HY-324). */
.l-split > .l-split__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
}

/* 54rem: the 960px screen less its two gutters (components.css, top). */
@container (min-width: 54rem) {
  .l-split > .l-split__inner {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--space-12);
  }
}

/* ---------- Accessibility helpers ---------- */

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

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--size-ui);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}

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

[id] {
  scroll-margin-top: var(--space-6);
}

/* ---------- Motion ---------- */

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