/* base.css — Resets, global styles, typography foundation */

/* ─── Fonts ──────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=JetBrains+Mono:wght@400&display=swap');

/* ─── Reset ──────────────────────────────────────── */

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

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

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── Typography ─────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-medium);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
}

p {
  max-width: 68ch;
  color: var(--color-text-secondary);
  line-height: 1.75;
}

strong {
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
}

/* ─── Links ──────────────────────────────────────── */

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

a:hover {
  color: var(--color-accent-hover);
}

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

/* ─── Interactive ────────────────────────────────── */

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
  color: inherit;
}

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

input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
}

textarea {
  resize: vertical;
}

/* ─── Canvas ─────────────────────────────────────── */

canvas {
  display: block;
}

/* ─── Reduced motion ─────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
