/* ==========================================================================
   Base: reset, element defaults, accessibility floor, layout primitives.
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets clear the sticky header instead of hiding under it. */
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-4xl);
  font-weight: 800;
}

h2 {
  font-size: var(--fs-3xl);
}

h3 {
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
}

h4 {
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-flat);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--red-deep);
}

strong,
b {
  font-weight: 600;
}

ul,
ol {
  padding-left: 1.15em;
}

li + li {
  margin-top: var(--s-2);
}

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

/* --- Accessibility ------------------------------------------------------- */

/* Visible focus everywhere. Never remove this without a replacement. */
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
  border-radius: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100%;
  z-index: 200;
  background: var(--ink-900);
  color: #fff;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--t-fast);
}

.skip-link:focus {
  top: var(--s-4);
  color: #fff;
}

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

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

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

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

.container--wide {
  max-width: var(--container-wide);
}

.container--text {
  max-width: var(--container-text);
}

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

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

.section--alt {
  background: var(--bg-alt);
}

.section--deep {
  background: var(--bg-deep);
  color: var(--text-on-deep);
}

.section--deep h1,
.section--deep h2,
.section--deep h3,
.section--deep h4 {
  color: #fff;
}

.section--deep .lede,
.section--deep p {
  color: var(--text-on-deep-muted);
}

/* Auto-fitting grid. Set --min per instance to change the breakpoint. */
.grid {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 260px), 100%), 1fr));
}

.stack > * + * {
  margin-top: var(--flow, var(--s-4));
}

/* --- Shared text utilities ----------------------------------------------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--s-4);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--red);
  flex: none;
}

.section--deep .eyebrow {
  color: #fff;
}

.lede {
  font-size: var(--fs-lg);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 60ch;
}

.measure {
  max-width: var(--container-text);
}

.text-center {
  text-align: center;
}

.text-center .eyebrow {
  justify-content: center;
}

.text-center .lede {
  margin-inline: auto;
}
