/* ============================================
   ACCESSIBILITY-FIRST CSS RESET
   ============================================ */

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

html {
  font-size: 100%; /* Respect user font-size preference */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* Respect reduced motion preference */
@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;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.32), transparent 280px),
    var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body.dark-mode {
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.14), transparent 320px),
    var(--color-bg);
}

/* Images */
img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Links */
a {
  color: var(--color-info);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-info-dark);
}

/* Buttons */
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Forms */
input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Lists */
ul, ol {
  list-style: none;
}

/* Tables */
table {
  border-collapse: collapse;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-base); }

/* Remove default focus, we apply our own */
:focus {
  outline: none;
}

/* Keyboard-only focus indicators */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

/* Selection */
::selection {
  background-color: var(--color-primary-light);
  color: var(--color-text-primary);
}
