/* ==========================================================================
   BASE — reset, typography, layout utilities
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@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; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: 600; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-600);
  font-weight: 600;
}

.text-muted { color: var(--color-muted); }
.text-small { font-size: var(--fs-small); }
.text-caption { font-size: var(--fs-caption); color: var(--color-muted-soft); }
.font-mono { font-family: var(--font-mono); }

/* Visible, accessible focus ring everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

.sr-only {
  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 {
  position: absolute; left: 12px; top: -48px;
  background: var(--color-ink); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm);
  z-index: 1000; transition: top var(--dur-fast) var(--ease-standard);
}
.skip-link:focus { top: 12px; }

/* ---- Layout ---- */
.container {
  max-width: var(--container-max);      /* 1240px */
  margin-inline: auto;                  /* centers it */
  padding-inline: var(--container-pad); /* clamp(16px, 4vw, 32px) */
}

.section { padding-block: var(--space-16); }
.section--tight { padding-block: var(--space-10); }
.section--sunken { background: var(--color-bg-sunken); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap;
}
.section-head h2 { margin-top: var(--space-1); }

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

.hstack { display: flex; align-items: center; gap: var(--space-3); }
.vstack { display: flex; flex-direction: column; gap: var(--space-3); }
.spread { display: flex; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }

.hide-mobile { display: initial; }
.show-mobile { display: none; }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: initial !important; }
}

.divider { height: 1px; background: var(--color-border); border: 0; margin: var(--space-6) 0; }

.visually-scroll { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }

/* Row of cards that scrolls horizontally on mobile instead of wrapping */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: var(--space-5);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scroll-snap-type: x proximity;
}
.rail > * { scroll-snap-align: start; }

/* Skip-to-content + main landmark spacing */
main { display: block; }
