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

html {
    scroll-behavior: smooth;
}

body {
    position: relative;
    display: flex;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    flex-direction: column;
    align-items: flex-start;
    color: var(--color-text);
    background: var(--color-background);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

main,
section,
article,
aside,
nav,
form {
    min-width: 0;
}

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

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
    margin-block-start: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--color-text);
    font-weight: 700;
    line-height: var(--line-height-tight);
    text-wrap: balance;
}

h1 {
    font-size: var(--font-size-2xl);
}

h2 {
    font-size: var(--font-size-xl);
}

h3 {
    font-size: var(--font-size-lg);
}

a {
    color: var(--color-primary-600);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--color-primary-700);
}

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

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

button,
select {
    cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
}

:focus-visible {
    outline: 0.1875rem solid var(--color-primary-500);
    outline-offset: 0.1875rem;
}

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

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

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

    /* Accessibility preference must override animations defined by components. */
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
