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

* {
  margin: 0;
  padding: 0;
}

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

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

body {
  font-family: var(--font-base);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--surface-canvas);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-weight: 700;
}

h2,
h3,
h4 {
  font-weight: 600;
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-s);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--space-l);
  }
}

section[id] {
  scroll-margin-top: 84px; /* clears the sticky header when jumped to via anchor links */
}

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

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

.section--dark {
  background: var(--footer-bg);
  color: var(--ink-inverse);
}

.grid {
  display: grid;
  gap: var(--space-m);
}

@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Typography utilities */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-eyebrow);
  line-height: var(--lh-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--ink-secondary);
  margin-bottom: var(--space-2xs);
}

.section--dark .eyebrow {
  color: rgba(255, 255, 255, 0.75);
}

h1,
.h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
}

h2,
.h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  margin-bottom: var(--space-s);
}

h3,
.h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}

.section-intro {
  max-width: 62ch;
  margin-bottom: var(--space-l);
}

.text-secondary {
  color: var(--ink-secondary);
}

.text-subtle {
  color: var(--ink-subtle);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
}

/* The muted ink colours are tuned for light surfaces; on a dark section they fall below a
   readable contrast, so they step up to translucent white instead. */
.section--dark .text-secondary {
  color: rgb(255 255 255 / 75%);
}

.section--dark .text-subtle {
  color: rgb(255 255 255 / 62%);
}

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

/* Skip link */
.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-s);
  z-index: 1000;
  background: var(--brand-blue);
  color: var(--ink-inverse);
  padding: var(--space-2xs) var(--space-s);
  border-radius: var(--radius-s);
  transition: top var(--duration-standard) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-s);
}

/* Focus visibility (matches product's own focus color) */
:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}
