/* ==========================================================================
   Base: reset, typography, layout primitives, accessibility
   ========================================================================== */

*, *::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-height) + var(--space-16));
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-canvas);
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--color-text-link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
table { border-collapse: collapse; }
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--color-text-primary);
  font-weight: var(--weight-bold);
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }

/* ---------- Type scale (mobile first, scaled up at md / lg) ---------- */
.t-display1 { font-size: 36px; line-height: 44px; font-weight: var(--weight-extrabold); letter-spacing: var(--tracking-display1); }
.t-hero { font-size: 32px; line-height: 40px; font-weight: var(--weight-extrabold); letter-spacing: var(--tracking-display2); }
.t-display2 { font-size: 32px; line-height: 40px; font-weight: var(--weight-bold); letter-spacing: var(--tracking-display2); }
.t-h1 { font-size: 28px; line-height: 36px; font-weight: var(--weight-bold); letter-spacing: var(--tracking-h1); }
.t-headline { font-size: 22px; line-height: 30px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-headline); }
.t-h3 { font-size: 18px; line-height: 26px; font-weight: var(--weight-semibold); }
.t-body-lg { font-size: 16px; line-height: 26px; }
.t-body { font-size: var(--text-body); line-height: var(--leading-body); }
.t-body-sm { font-size: var(--text-body-sm); line-height: var(--leading-body-sm); }
.t-caption { font-size: var(--text-caption); line-height: var(--leading-caption); font-weight: var(--weight-medium); }

@media (min-width: 768px) {
  .t-display1 { font-size: 44px; line-height: 52px; }
  .t-hero { font-size: 40px; line-height: 48px; }
  .t-display2 { font-size: 36px; line-height: 44px; }
  .t-h1 { font-size: 30px; line-height: 38px; }
  .t-headline { font-size: 24px; line-height: 32px; }
  .t-h3 { font-size: var(--text-h3); line-height: var(--leading-h3); }
  .t-body-lg { font-size: var(--text-body-lg); line-height: var(--leading-body-lg); }
}
@media (min-width: 1024px) {
  .t-display1 { font-size: 48px; line-height: 56px; }
  .t-hero { font-size: 42px; line-height: 50px; }
  .t-display2 { font-size: var(--text-display2); line-height: var(--leading-display2); }
  .t-h1 { font-size: var(--text-h1); line-height: var(--leading-h1); }
  .t-headline--lg { font-size: 32px; line-height: 40px; letter-spacing: var(--tracking-h1); }
}
@media (min-width: 1280px) {
  .t-display1 { font-size: var(--text-display1); line-height: var(--leading-display1); }
  .t-hero { font-size: 46px; line-height: 54px; }
}

.text-highlight { color: var(--color-text-highlight); }
.text-primary { color: var(--color-text-primary); }
.text-muted { color: var(--color-text-muted); }
.eyebrow {
  display: inline-block;
  color: var(--color-text-highlight);
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.num { font-variant-numeric: tabular-nums; }

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

.section { padding-block: var(--section-gap); }
.section--muted { background: var(--color-canvas-muted); }
.section--surface { background: var(--color-surface); }
.section--tight { padding-block: calc(var(--section-gap) * 0.66); }

.stack > * + * { margin-top: var(--stack-gap, var(--space-16)); }

/* ---------- Accessibility ---------- */
.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;
  left: var(--space-16);
  top: -100px;
  z-index: 200;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-button);
  background: var(--color-surface-raised);
  color: var(--color-text-primary);
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-raised);
}
.skip-link:focus { top: var(--space-12); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--color-border-focused);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@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;
  }
}
