/* Modern CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

/* Remove default margin and padding from elements */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

html {
  height: 100%;
  font-size: 62.5%; /* 10px base for easy rem calculations */
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: $font-family-base;
  font-size: $font-size-base;
  line-height: $line-height-normal;
  color: $text-color;
  background-color: $bg-color;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

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

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}

legend {
  display: table;
}

textarea {
  resize: vertical;
}

details {
  cursor: pointer;
}

details summary {
  outline: none;
}

[hidden] {
  display: none !important;
}

[disabled] {
  cursor: not-allowed;
}

/* Enhanced focus styles */
:focus-visible {
  outline: 0.2rem solid $primary-color;
  outline-offset: 0.2rem;
}

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

/* Modern display adjustments */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
  display: block;
}

/* Improved image handling */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Form elements reset */
input, button, textarea, select {
  font: inherit;
  border: none;
  background: none;
}

/* Remove default button styles */
button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
}

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

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

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

ul[role='list'], ol[role='list'] {
  list-style: none;
}

/* Table improvements */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* Fieldset improvements */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

legend {
  display: table;
  max-width: 100%;
  padding: 0;
  color: inherit;
  white-space: normal;
}

/* Textarea improvements */
textarea {
  resize: vertical;
  font-family: inherit;
}

/* Details/Summary improvements */
details {
  cursor: pointer;
}

details summary {
  outline: none;
  cursor: pointer;
}

details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* Accessibility improvements */
[hidden] {
  display: none !important;
}

[disabled] {
  cursor: not-allowed;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 0.1rem;
  height: 0.1rem;
  padding: 0;
  margin: -0.1rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}