/*
 * Mandate D2 base layer: reset, typography, layout primitives, focus, and the accessibility floor.
 *
 * D2.6 requirements handled here:
 *  - keyboard focus is always visible (:focus-visible ring on every interactive element);
 *  - interactive hit targets >= 44px;
 *  - media carries intrinsic aspect-ratio so nothing reflows on load (CLS = 0).
 */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--sp-16);
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-64);
}
h2 {
  font-size: var(--fs-48);
}
h3 {
  font-size: var(--fs-24);
  line-height: var(--lh-snug);
}
h4 {
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
}

p {
  margin: 0 0 var(--sp-16);
  max-width: var(--measure);
  color: var(--ink-2);
  text-wrap: pretty;
}

a {
  color: var(--brand-600);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--brand-500);
}

/* Focus is never removed, only shaped. A keyboard user must always see where they are. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-12);
}

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

ul,
ol {
  margin: 0 0 var(--sp-16);
  padding-left: var(--sp-24);
  color: var(--ink-2);
}

li {
  margin: var(--sp-4) 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--sp-48) 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

/* ── Layout primitives ────────────────────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--sp-24);
}

@media (max-width: 640px) {
  .wrap {
    padding-inline: var(--sp-16);
  }
}

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

@media (max-width: 900px) {
  .section {
    padding-block: var(--sp-64);
  }
}

/* 12 -> 6 -> 1 responsive grid (D2.1). */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--sp-32);
}

@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-24);
  }
}

.eyebrow {
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin: 0 0 var(--sp-12);
}

.lede {
  font-size: var(--fs-20);
  color: var(--muted);
  max-width: var(--measure);
}

.tnum {
  font-family: var(--ff-numeric);
  font-variant-numeric: tabular-nums;
  font-feature-settings: var(--fv-tabular);
}

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

.skip-link {
  position: absolute;
  left: var(--sp-16);
  top: -100px;
  z-index: 100;
  background: var(--surface);
  color: var(--ink);
  padding: var(--sp-12) var(--sp-16);
  border-radius: var(--r-12);
  box-shadow: var(--shadow-md);
  transition: top var(--dur-fast) var(--ease-standard);
}

.skip-link:focus {
  top: var(--sp-16);
}
