/* Reset, typography and layout helpers. Components live in components.css. */

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-padding-block-start: calc(var(--header-height) + var(--space-4));
}
body {
  min-block-size: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
main {
  flex: 1;
}
img,
picture,
svg,
video {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}
/* Components set display on their class; [hidden] must still win. */
.btn[hidden],
.tab-list[hidden],
.tab-panel[hidden] {
  display: none;
}
ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

/* Faint noise over the whole page, as on the legacy site */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/images/noise.svg');
  opacity: 0.035;
  pointer-events: none;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
h1 {
  font-size: var(--text-3xl);
  font-weight: 900;
  line-height: var(--leading-tight);
  text-transform: uppercase;
}
h2 {
  font-size: var(--text-2xl);
  text-transform: uppercase;
}
h3 {
  font-size: var(--text-xl);
}
p {
  text-wrap: pretty;
}
a {
  color: var(--color-accent);
  text-underline-offset: 0.2em;
  transition: color var(--duration);
}
a:hover {
  color: var(--color-accent-hover);
}
strong {
  font-weight: 700;
}

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

/* --- Layout helpers --- */
.container {
  inline-size: 100%;
  max-inline-size: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-block: var(--space-section);
}
.container--text {
  max-inline-size: calc(var(--container-text) + 2 * var(--gutter));
}
.prose {
  max-inline-size: var(--container-text);
}
.prose > * + * {
  margin-block-start: var(--space-4);
}
.muted {
  color: var(--color-muted);
}
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Motion ---
   Components animate with var(--duration), which drops to 0 for people who ask for less motion.
   Longer effects (Phase 4) check prefers-reduced-motion themselves. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration: 0s;
  }
}
