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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

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

iframe {
    max-width: 100%;
}

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

button,
select {
    text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
}

hr {
    height: 1px;
    margin-block: var(--space-5);
    border: 0;
    background: var(--color-border);
}

::selection {
    background: var(--color-primary);
    color: var(--color-primary-contrast);
}

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    position: fixed;
    z-index: 100000;
    top: 1rem;
    left: 1rem;
    width: auto;
    height: auto;
    clip: auto;
    padding: .75rem 1rem;
    background: var(--color-background);
    color: var(--color-text);
    box-shadow: var(--shadow-md);
}

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
