/* Layer 1: reset + typography + element defaults. */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    margin: 0;
    padding-top: var(--header-h);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    word-break: keep-all;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

h1, h2, h3, h4 {
    margin: 0 0 .5em;
    line-height: var(--lh-tight);
    font-weight: 700;
    letter-spacing: -.015em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

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

ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
li { margin-bottom: .35em; }

a {
    color: inherit;
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color var(--dur) var(--ease);
}
a:hover { color: var(--accent-ink); }

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

hr { border: 0; border-top: var(--hair); margin: var(--sp-5) 0; }

strong { font-weight: 700; }
small { font-size: var(--fs-small); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }

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

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}
/* Scroll/focus targets that receive focus programmatically, not by user intent. */
main:focus, #main-navigation:focus { outline: none; }

.skip-link {
    position: absolute;
    top: -48px;
    left: var(--sp-3);
    z-index: 200;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--paper);
    font-size: var(--fs-small);
    transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-2); color: var(--paper); }

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

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