/*
  Element-level styling. Only bare selectors — no classes.
  HTML with zero classes should still look presentable.
*/

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

/* Progressive enhancement: animate same-origin navigations in supporting browsers. */
@view-transition { navigation: auto; }

body {
  font-family: var(--font-serif);
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--ink-body);
  background: var(--bg-page);
  overflow-x: hidden;
}

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

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

a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 3px;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); color: var(--brand); }
h3 { font-size: var(--text-h3); }

p { margin-block: 0 .75rem; }
p:last-child { margin-bottom: 0; }

ol, ul { padding-left: 1.25rem; }

blockquote {
  border-left: 3px solid var(--border);
  padding-left: var(--space-md);
  color: var(--ink-muted);
  font-style: italic;
}

figure { margin-block: var(--space-md); }
figcaption { color: var(--ink-faint); font-size: var(--text-small); margin-top: var(--space-2xs); }

hr { border: 0; border-top: 1px solid var(--border-light); margin-block: var(--space-lg); }

/*
  Reduced motion: disable transitions and smooth scrolling globally.
*/
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
