/* ==========================================================================
   Foreground — base
   Reset, element defaults, focus, accessibility utilities.
   Knows nothing about components; depends only on tokens.css.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* WCAG 2.2 SC 2.4.11 Focus Not Obscured. The header is sticky, so without
     this a keyboard user tabbing to a link just below it lands underneath the
     bar. --header-height is measured from the built page, not assumed. */
  scroll-padding-top: calc(var(--header-height) + var(--space-7));
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-prose);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

a { color: var(--link); }

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

/* Headings inherit their scale from the components that use them; the design
   has no default heading sizes, only role-specific ones. */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

strong { font-weight: var(--weight-semibold); }

/* --- Focus -------------------------------------------------------------- *
 * A 3px ring at 2px offset, never removed. :focus-visible so pointer users
 * don't see it, but it is never gated behind a media query.
 * ----------------------------------------------------------------------- */
:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

/* --- Accessibility utilities -------------------------------------------- */
.fg-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.fg-skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 200;
  padding: var(--space-3) var(--space-6);
  background: var(--surface-card);
  color: var(--accent-text);
  font-size: var(--fs-nav);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  border: var(--border-width-input) solid var(--border-subtle);
  border-radius: 0 0 var(--radius-card) 0;
  transform: translateY(-120%);
  transition: transform var(--duration-fast) var(--ease-standard);
}
.fg-skip-link:focus-visible { transform: translateY(0); }

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

/* --- Print -------------------------------------------------------------- */
@media print {
  .fg-skip-link,
  .fg-header__nav,
  .fg-footer__nav { display: none; }
  body { background: #fff; color: #000; }
  .fg-motif::before { display: none; }
  /* The halo exists to lift text off the motif; with the motif gone it is just ink. */
  .fg-hero__lead { text-shadow: none; }
}
