/* =====================================================
   base.css
   Element resets, typography defaults, and global body.
   ===================================================== */

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

html {
  scroll-behavior: smooth;
  /* Offset for fixed nav when jumping to anchors */
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent any overflowing child (long URLs, code blocks) from
     triggering a horizontal scrollbar on narrow viewports. */
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--text);
  line-height: 1.1;
}

h1 {
  font-size: clamp(36px, 5vw, 52px);
  margin-bottom: 20px;
}

h2 {
  font-size: 28px;
  margin-bottom: 36px;
  font-weight: 400;
}

p {
  line-height: 1.65;
}

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

img {
  max-width: 100%;
  display: block;
}

/* Focus states — visible across all interactive elements */
:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .fade { opacity: 1 !important; transform: none !important; }
}
