/* ============================================================
   MODERN CSS RESET
   Opinionated but minimal — preserves accessibility
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-1);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  min-height: 100vh;
  overflow-x: hidden;
}

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

img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

p, h1, h2, h3, h4, h5, h6, li, blockquote {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
}

ul, ol {
  list-style: none;
}

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

table {
  border-collapse: collapse;
}

/* Focus visible — only for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip to content — accessibility */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--s-4);
  background: var(--color-accent);
  color: #fff;
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  z-index: 9999;
  border-radius: var(--radius-md);
  transition: top var(--t-fast);
}

.skip-link:focus {
  top: var(--s-4);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
