/* ── Base layer: reset, typography, layout primitives ─────────────────────
   Loaded after tokens.css and before site.css. Nothing here is component
   specific; if a rule needs a class to make sense, it belongs in site.css.
   ───────────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The masthead is sticky, so an anchor target must clear it or the heading
     you jumped to sits underneath the nav bar. */
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16.5px/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

/* ── Headings ───────────────────────────────────────────────────────────
   Source Serif 4 across the board. The serif is what makes this read as a
   public document rather than a product launch page. */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.012em;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: clamp(2.05rem, 1.3rem + 2.7vw, 3.15rem); line-height: 1.1; letter-spacing: -.018em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.25vw, 2.15rem); letter-spacing: -.014em; }
h3 { font-size: 1.24rem; }
h4 { font-size: 1.05rem; }
h5, h6 { font-size: 1rem; }

p { margin: 0 0 1.1em; color: var(--text-soft); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; color: var(--text-soft); }
li { margin-bottom: .38em; }
li:last-child { margin-bottom: 0; }

/* Prose links only. Any rule that colours links inside a container must
   exclude .btn — on the last site a footer link rule beat .btn-primary on
   specificity (0,1,1 against 0,1,0) and washed the CTA text out to a genuine
   contrast violation. Every link rule below carries the exclusion. */
a:not(.btn) {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:not(.btn):hover { color: var(--link-hover); }

strong, b { font-weight: 600; color: var(--text); }

em { font-style: italic; }

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

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

blockquote { margin: 0; }

abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; }

/* A component rule like `.tablist { display: flex }` overrides the plain
   attribute selector, so this needs the !important to be reliable. */
[hidden] { display: none !important; }

::selection { background: var(--accent); color: #fff; }

/* ── Focus ─────────────────────────────────────────────────────────────── */

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}
/* On dark bands the light-surface ring would nearly vanish. */
:is(.section-ink, .hero, .page-header, .cta-band, .masthead, .site-footer) :focus-visible {
  outline-color: var(--focus-ink);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: top .12s ease-out;
}
.skip-link:focus { top: 12px; color: #fff; }

/* Visually hidden but available to assistive technology. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}
.narrow { max-width: var(--narrow); margin-inline: auto; }

/* Explicit column counts per breakpoint, never auto-fit: a six-card set has
   to land as 3 + 3, and `repeat(auto-fit, minmax(260px, 1fr))` will happily
   give you 4 + 2 at a width you did not test. */
.grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 660px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.section { padding: clamp(52px, 6.5vw, 84px) 0; }
.section-soft { background: var(--bg-soft); }
.section-tint { background: var(--surface-2); }

/* ── Ink bands ───────────────────────────────────────────────────────────
   A flat fill, never a gradient — see the rule at the top of tokens.css.
   Anything that inherits a light-surface colour needs an override here or it
   renders near-black on navy.

   ⚠ THE LIST BELOW IS THE ONE PLACE DARK SURFACES ARE ENUMERATED.

   There are four of them — .section-ink, .hero, .page-header and .cta-band —
   and every on-ink override in this file and in site.css matches against the
   same :is() list. Scoping an override to .section-ink alone is how the hero's
   eyebrow ended up at 1.63:1 against the navy: the token was right, the
   selector simply did not reach. If a fifth dark surface is ever added, add it
   here and to the matching lists in site.css, and audit before shipping. */

.section-ink, .hero, .page-header, .cta-band { background: var(--ink); color: var(--on-ink); }

:is(.section-ink, .hero, .page-header, .cta-band) :is(h1, h2, h3, h4, h5, h6) { color: var(--on-ink); }
:is(.section-ink, .hero, .page-header, .cta-band) :is(p, li) { color: var(--on-ink-soft); }
:is(.section-ink, .hero, .page-header, .cta-band) :is(strong, b) { color: var(--on-ink); }
:is(.section-ink, .hero, .page-header, .cta-band) hr { border-top-color: var(--ink-border); }

/* Scoped to prose deliberately. A blanket descendant `a` rule would also
   recolour breadcrumbs and buttons living inside the band. */
:is(.section-ink, .hero, .page-header, .cta-band) :is(p, li) a:not(.btn) { color: var(--accent-bright); }
:is(.section-ink, .hero, .page-header, .cta-band) :is(p, li) a:not(.btn):hover { color: var(--focus-ink); }

/* Spacing utility, for the handful of places where a component follows
   another component directly rather than following prose. */
.mt-lg { margin-top: clamp(26px, 3.5vw, 40px); }

.lead { font-size: 1.12rem; line-height: 1.6; color: var(--text-soft); }
:is(.section-ink, .hero, .page-header, .cta-band) .lead { color: var(--on-ink-soft); }

/* ── Motion ────────────────────────────────────────────────────────────── */

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