/**
 * Base layer: font-face, reset, typography, and global utilities.
 */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-variable.woff2") format("woff2-variations"),
       url("../fonts/instrument-sans-variable.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Sans";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-italic-variable.woff2") format("woff2-variations"),
       url("../fonts/instrument-sans-italic-variable.woff2") format("woff2");
}

*,
*::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;
  min-height: 100vh;
  /* The About section's full-bleed image (.about-split) breaks out to
     100vw, which on some browsers/platforms is very slightly wider
     than the visible viewport once a scrollbar is present — this is
     what causes the page to scroll horizontally by a few pixels. */
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

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

img {
  border-style: none;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--lh-heading);
  color: var(--color-heading);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  font-weight: 700;
}

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

h3 {
  font-size: var(--fs-h3);
}

h4 {
  font-size: var(--fs-h4);
}

h5 {
  font-size: var(--fs-h5);
}

h6 {
  font-size: var(--fs-h6);
}

p {
  margin: 0;
}

p + p {
  margin-top: var(--space-sm);
}

/* ---- Focus visibility (WCAG 2.2 AA) ---- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-sm);
  z-index: 100;
  padding: var(--space-2xs) var(--space-sm);
  background: var(--color-ink);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  transition: top var(--duration-base) var(--ease-standard);
}

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

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

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

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

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

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

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

.section--dark {
  background: var(--color-ink);
  color: var(--color-text-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-text-on-dark);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  font-size: var(--fs-body-lg);
  font-weight: 700;
  color: var(--color-primary-600);
}

.section--dark .eyebrow {
  color: var(--color-secondary);
}

.section-head {
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-head--left {
  text-align: left;
  margin-inline: 0;
}

.section-head .eyebrow {
  margin-bottom: var(--space-xs);
}

.section-head p {
  margin-top: var(--space-sm);
  color: var(--color-text-muted);
  font-size: var(--fs-body-lg);
}

.section--dark .section-head p {
  color: var(--color-text-on-dark-muted);
}

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

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