/* ==========================================================================
   Base: reset, typography defaults, layout primitives, utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

/* Components set their own display; [hidden] must still win. */
[hidden] {
  display: none !important;
}

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

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

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

a {
  color: inherit;
}

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

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

/* Headings focused by script (tabindex="-1") to move screen readers along */
[tabindex="-1"]:focus {
  outline: none;
}

::selection {
  background: var(--brass-300);
  color: var(--navy-950);
}

/* ---- Typography --------------------------------------------------------- */

.display-xl,
.display-l,
.display-m,
.display-s {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  color: var(--color-text-strong);
  letter-spacing: var(--tracking-display);
  font-optical-sizing: auto;
  text-wrap: balance;
}

.display-xl {
  font-size: var(--text-display-xl);
  line-height: var(--leading-tight);
  font-weight: var(--weight-light);
}
.display-l {
  font-size: var(--text-display-l);
  line-height: 1.08;
  font-weight: var(--weight-light);
}
.display-m {
  font-size: var(--text-display-m);
  line-height: 1.12;
}
.display-s {
  font-size: var(--text-display-s);
  line-height: var(--leading-snug);
}

/* Italic serif emphasis — the one sanctioned way to highlight words.
   (No second-color highlights.) */
.display-xl em,
.display-l em,
.display-m em,
.display-s em {
  font-style: italic;
}

.title {
  font-family: var(--font-sans);
  font-size: var(--text-title);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-strong);
}

.lead {
  font-size: var(--text-lead);
  line-height: 1.55;
  color: var(--color-text);
  max-width: var(--measure);
  text-wrap: pretty;
}

.body {
  max-width: var(--measure);
  text-wrap: pretty;
}

.small {
  font-size: var(--text-small);
  line-height: 1.55;
}

.muted {
  color: var(--color-text-muted);
}

.numeric {
  font-variant-numeric: tabular-nums lining-nums;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--text-small);
  letter-spacing: 0;
}

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

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

.container--narrow {
  max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.section + .section:not([data-surface]) {
  border-top: var(--border-hairline);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, var(--space-5));
}

/* Two columns from 960px (7:5), stacked below. For content + aside pairs. */
.split {
  display: grid;
  gap: var(--space-7);
  align-items: start;
}

@media (min-width: 60rem) {
  .split {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-9);
  }
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-3));
}

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

.sr-only {
  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;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--navy-950);
  color: var(--stone-0);
  font-size: var(--text-small);
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-4);
}

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