/* ==========================================================================
   Base — reset, typography, accessibility
   ========================================================================== */

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

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

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul, ol {
    list-style: none;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
}

h1 { font-size: var(--font-size-hero); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }

p + p { margin-top: var(--space-md); }

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

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

.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-sm);
    z-index: calc(var(--z-header) + 1);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-text);
    color: var(--color-white);
    font-size: var(--font-size-sm);
}

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

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