/*
 * base.css: fonts, reset, element defaults, focus ring, skip link, view-transition opt-in.
 * Load order on a page: tokens.css, base.css, motion.css, components/*.css, pages/<page>.css.
 * Pages link each file with its own <link>; there are no @import chains (one request each, cached).
 */

/* Self-hosted, subset to Latin + Latin-1 Supplement, no CDN (D-004). Paths are relative to this file. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/inter-variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Display only: h1, h2, hero, large numbers. Never body text. */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('../fonts/nunito-variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Cross-document View Transitions: navigation between pages cross-fades without a client router.
   Browsers without support ignore the rule and navigate normally. */
@view-transition {
  navigation: auto;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Anchors and focused elements land below the sticky header (also WCAG 2.4.11 focus not obscured). */
  scroll-padding-block-start: calc(var(--md-header-height) + var(--md-space-4));
}

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--md-font-family);
  font-size: var(--md-font-size-base);
  line-height: var(--md-leading-body);
  color: var(--md-color-ink);
  background: var(--md-color-surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

/* Headlines: Nunito black, tight. Two lines or fewer at every width: write short headlines. */
h1,
h2 {
  font-family: var(--md-font-display);
  font-weight: var(--md-weight-black);
  line-height: var(--md-leading-tight);
  letter-spacing: var(--md-tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--md-font-size-display);
}

h2 {
  font-size: clamp(var(--md-font-size-xl), 1rem + 3vw, var(--md-font-size-3xl));
}

h3,
h4 {
  font-size: var(--md-font-size-lg);
  font-weight: var(--md-weight-bold);
  line-height: var(--md-leading-snug);
  text-wrap: balance;
}

h4 {
  font-size: var(--md-font-size-base);
}

p {
  text-wrap: pretty;
}

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

small {
  font-size: var(--md-font-size-sm);
}

a {
  color: var(--md-color-primary);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.2em;
}

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

img {
  height: auto;
}

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

hr {
  border: 0;
  height: var(--md-border-width);
  background: var(--md-color-divider);
  margin: var(--md-space-6) 0;
}

::selection {
  background: var(--md-color-action);
  color: var(--md-color-on-action);
}

/* Focus ring: always visible for keyboard users, never removed. Dark fields switch to the yellow. */
:focus-visible {
  outline: var(--md-focus-width) solid var(--md-color-primary);
  outline-offset: var(--md-focus-offset);
}

[data-surface='dark'] :focus-visible,
[data-surface='dark']:focus-visible,
.c-section--dark :focus-visible,
.c-footer :focus-visible,
.c-header--brand :focus-visible {
  outline-color: var(--md-color-action);
}

/* A heading that receives focus after a route change is not a control: no ring. */
[tabindex='-1']:focus-visible {
  outline: none;
}

/* Skip link: first focusable element on every page. */
.c-skip-link {
  position: absolute;
  inset-block-start: var(--md-space-2);
  inset-inline-start: var(--md-space-2);
  z-index: var(--md-z-toast);
  min-height: var(--md-target);
  display: inline-flex;
  align-items: center;
  padding: 0 var(--md-space-5);
  border-radius: var(--md-radius-full);
  background: var(--md-color-action);
  color: var(--md-color-on-action);
  font-weight: var(--md-weight-bold);
  text-decoration: none;
  transform: translateY(-200%);
}

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

/* Hidden to the eye, present for assistive tech (labels of icon buttons, search labels). */
.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion: the content stays, the movement goes. No animation runs at all; transitions are
   removed so state changes are instant. Scroll-driven reveals are also disabled in motion.css. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
