/* Modern CSS Reset */
/* Based on modern reset principles for consistent cross-browser styling */

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

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

/* Root stacking context */
#root,
#__next {
    isolation: isolate;
}

/* Set core root defaults */
html {
    font-size: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Set core body defaults */
body {
    min-height: 100vh;
    line-height: 1.5;
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis: none;
}

/* Make images easier to work with */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

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

/* Remove default link styles */
a {
    text-decoration: none;
    color: inherit;
}

/* Remove list styles on ul, ol elements with a list role */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

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

/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4, h5, h6,
button, input, label {
    line-height: 1.1;
}

/* Balance text wrapping on headings */
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

/* Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* Improve media defaults */
img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    vertical-align: middle;
}

/* Remove built-in form typography styles */
input, button, textarea, select {
    font: inherit;
}

/* Fix textarea resize */
textarea {
    resize: vertical;
}

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

th, td {
    text-align: left;
    vertical-align: top;
}

/* Remove default focus styles and add custom ones */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Ensure text remains visible during webfont load */
@font-face {
    font-display: swap;
}

/* Create a root stacking context */
#root, #__next {
    isolation: isolate;
}

/* Remove animations and transitions for people who prefer not to see them */
@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;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :focus-visible {
        outline: 3px solid;
        outline-offset: 2px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :focus-visible {
        outline-color: #66b3ff;
    }
}