/* SECTION: Reset */

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

html {
    -webkit-text-size-adjust: 100%;
    color-scheme: dark;
}

:root[data-theme="light"] {
    color-scheme: light;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

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

a {
    color: inherit;
}

ul[class],
ol[class] {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* SECTION: Typography */

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    line-height: var(--leading-tight);
    margin: 0 0 var(--space-4);
    letter-spacing: -0.01em;
}

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

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

h3 {
    font-size: var(--text-xl);
}

h4 {
    font-size: var(--text-lg);
}

p {
    margin: 0 0 var(--space-4);
    max-width: 68ch;
}

p:last-child {
    margin-bottom: 0;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-faint {
    color: var(--color-text-faint);
}

code,
.mono {
    font-family: var(--font-mono);
}

/* SECTION: Focus visibility */

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* SECTION: Skip link */

.skip-link {
    position: absolute;
    left: var(--space-3);
    top: -3rem;
    background: var(--color-brand);
    color: var(--color-brand-ink);
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    border-radius: var(--radius-sm);
    z-index: var(--z-toast);
    transition: top var(--duration-base) var(--ease-out);
}

.skip-link:focus {
    top: var(--space-3);
}

/* SECTION: Reduced motion */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* SECTION: Selection */

::selection {
    background: var(--color-brand);
    color: var(--color-brand-ink);
}
