/* Universal Selector Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Visibility Reset */
:where([hidden]:not([hidden='until-found'])) {
  display: none !important;
}

/* HTML and Body Defaults */
:where(html) {
  -webkit-text-size-adjust: none;
  scroll-behavior: smooth;
  font-size: 62.5%;
}
@supports not (min-block-size: 100dvb) {
  :where(html) {
    block-size: 100%;
  }
}
:where(body) {
  block-size: 100%;
  block-size: 100dvb;
  min-block-size: 100%;
  line-height: 1;
  font-family: system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeSpeed;
}

/* Media and Inline Elements */
:where(video, canvas, audio, iframe, embed, object, main) {
  display: block;
  max-width: 100%;
}
:where(img, picture, svg, video) {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
  height: auto;
}

/* Form Elements */
:where(input, button, textarea, select) {
  color: inherit;
  font: inherit;
}
:where(textarea) {
  resize: block;
}
:where(button, label, select, summary, [role='button'], [role='option']) {
  cursor: pointer;
}
:where(:disabled), :where(label:has(> input:disabled), label:has(+ input:disabled)) {
  cursor: not-allowed;
}
:where(input[type="file"]) {
  cursor: auto;
}
:where(input[type="file"])::-webkit-file-upload-button,
:where(input[type="file"])::file-selector-button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}
:where(button, button[type], input[type="button"], input[type="submit"], input[type="reset"])[disabled] {
  cursor: not-allowed;
}
input[class], button[class], textarea[class] {
  appearance: none;
}
/* Form Elements All Reset */
:where(input, button, textarea, select) {
  appearance: none;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

/* Lists and Tables */
:where(ul, ol) {
  list-style: none;
}
table {
  border-collapse: collapse;
}

/* Text Styling */
:where(h1, h2, h3, h4, h5, h6, p, span, th, td) {
  overflow-wrap: break-word;
}
:where(h1, h2, h3, h4, h5, h6) {
  line-height: calc(1em + 0.5rem);
}
:where(p, dt, dd, li, th, td) {
  line-height: 1.5;
}
:where(a) {
  text-underline-offset: 0.2ex;
  word-break: break-word;
}
:where(p, span) {
  word-break: break-word;
}

/* Visual Adjustments */
hr {
  border: none;
  border-block-start: 1px solid;
  color: inherit;
  block-size: 0;
  overflow: visible;
}
sub, sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}
sub {
  bottom: -0.25em;
}
sup {
  top: -0.5em;
}
em, b, strong {
  background: none;
  font-weight: bold;
  font-style: normal;
}

/* Accessibility Enhancements */
:where(:focus-visible) {
  outline: 2px solid var(--focus-color, Highlight);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  :focus-visible {
    transition: outline-offset 145ms cubic-bezier(0.25, 0, 0.4, 1);
  }
  :where(:not(:active)):focus-visible {
    transition-duration: 0.25s;
  }
}
:where(.visually-hidden:not(:focus, :active, :focus-within, .not-visually-hidden)) {
  clip-path: inset(50%) !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden !important;
  position: absolute !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  :where(html:focus-within) {
    scroll-behavior: smooth;
  }
}

/* Modern Enhancements */
@supports (resize: block) {
  :where(textarea) {
    resize: block;
  }
}
