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

html {
    min-width: 320px;
    background: var(--bg-primary);
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    margin: 0;
    overflow-x: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body[data-menu-open="true"] {
    overflow: hidden;
}

::selection {
    background: var(--accent);
    color: var(--text-inverse);
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--text-primary);
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

main {
    overflow: clip;
}

button {
    color: inherit;
}

body,
button,
a {
    -webkit-tap-highlight-color: rgba(200, 241, 53, 0.18);
}

img,
svg {
    display: block;
}

img {
    max-width: 100%;
}

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

button,
a {
    touch-action: manipulation;
}

button {
    font: inherit;
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
}

[id] {
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.75rem 1rem;
    transform: translateY(-180%);
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--text-inverse);
    font-weight: 700;
    transition: transform 180ms var(--ease-out);
}

.skip-link:focus {
    transform: translateY(0);
}

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

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