/* Reset + base element styles. Keep this generic — component-specific
   rules belong in components.css, not here. */

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

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

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  /* Fraunces sets loose by default at display sizes; pulling the
     tracking in keeps large headings from looking gappy. */
  letter-spacing: -0.015em;
  /* Fraunces is an optical-size variable font — letting it track the
     rendered size means large headings get the high-contrast display
     cut and small ones get the sturdier text cut, automatically. */
  font-optical-sizing: auto;
}

h1 {
  font-size: var(--fs-3xl);
}
h2 {
  font-size: var(--fs-2xl);
}
h3 {
  font-size: var(--fs-xl);
}
h4 {
  font-size: var(--fs-lg);
}

p {
  margin: 0 0 var(--space-sm);
  color: var(--color-text);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul,
ol {
  margin: 0 0 var(--space-sm);
  padding-left: 1.25em;
}

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

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

::selection {
  background: var(--color-accent-soft);
  color: var(--color-text);
}

/* Heading sizes used to step up at 900px. They don't need to any more:
   --fs-2xl and up are clamp()-based in tokens.css, so they scale
   continuously with the viewport rather than jumping at a breakpoint. */

/* Every transition and animation in this project is decorative. Honor
   the OS-level "reduce motion" setting globally rather than remembering
   to guard each one individually. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    /* Staggered entrances hold their first keyframe through the delay
       (animation-fill-mode: backwards), so zeroing only the duration
       would leave content invisible for the length of the stagger.
       Zero the delay too and it's simply there on load. */
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
