/*
 * Modern CSS Reset
 * Opinionated reset for better cross-browser consistency
 * Based on modern best practices
 */

/* ===================================
   Box Sizing & Inheritance
   ================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===================================
   Document & Root
   ================================= */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

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

body {
  min-height: 100vh;
  line-height: 1.5;
  text-rendering: optimizeSpeed;
}

/* ===================================
   Typography Reset
   ================================= */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

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

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

/* ===================================
   Media Elements
   ================================= */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img,
picture {
  font-style: italic;
  background-repeat: no-repeat;
  background-size: cover;
  shape-margin: 0.75rem;
}

/* ===================================
   Forms & Interactive Elements
   ================================= */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button,
[role="button"],
[type="button"],
[type="reset"],
[type="submit"] {
  cursor: pointer;
  background: transparent;
  border: none;
  -webkit-appearance: button;
}

button:disabled,
[type="button"]:disabled,
[type="reset"]:disabled,
[type="submit"]:disabled {
  cursor: not-allowed;
}

/* Remove default button styles in Safari */
button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
}

/* ===================================
   Links
   ================================= */
a {
  color: inherit;
  text-decoration: inherit;
}

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

/* ===================================
   Accessibility
   ================================= */

/* Remove all animations and transitions for users who prefer 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;
  }
}

/* Improve text rendering */
body {
  text-rendering: optimizeSpeed;
}

h1, h2, h3, h4, h5, h6 {
  text-rendering: optimizeLegibility;
}

/* ===================================
   Focus Styles
   ================================= */
:focus-visible {
  outline: 2px solid var(--color-teal-500, #2D7D8E);
  outline-offset: 2px;
}

/* Remove outline for mouse users, keep for keyboard users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ===================================
   Other Resets
   ================================= */
address {
  font-style: normal;
}

abbr[title] {
  text-decoration: underline dotted;
}

b, strong {
  font-weight: bolder;
}

small {
  font-size: 80%;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* ===================================
   Hidden Attribute
   ================================= */
[hidden] {
  display: none !important;
}

/* ===================================
   Selection Styling
   ================================= */
::selection {
  background-color: var(--color-teal-200, #99D3DB);
  color: var(--color-teal-900, #09181B);
}

::-moz-selection {
  background-color: var(--color-teal-200, #99D3DB);
  color: var(--color-teal-900, #09181B);
}
