/* ============================================================
   Modern CSS Reset
   Based on Andy Bell's modern reset with additions for
   accessibility and reduced-motion support.
   ============================================================ */

/* Box sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margins and padding */
* {
  margin: 0;
  padding: 0;
}

/* Prevent font-size inflation on mobile */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height, 72px);
  overflow-x: hidden;
  width: 100%;
}

/* Core body defaults */
body {
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  line-height: var(--leading-normal);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  color: var(--color-body);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word; /* Prevent long text from breaking layout */
  word-wrap: break-word;
  text-rendering: optimizeLegibility;
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  color: var(--color-heading);
  line-height: var(--leading-tight);
  font-weight: var(--weight-semibold);
}

/* Paragraph */
p {
  overflow-wrap: break-word;
}

/* Anchors */
a {
  color: inherit;
  text-decoration: none;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* Images and media */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  font-style: italic; /* alt text styling */
}

/* Form elements */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

textarea {
  resize: vertical;
}

/* Table */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove animations for 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;
  }
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

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