/* Fonts: self-hosted variable WOFF2, latin subset */
@font-face {
    font-family: "Lora";
    font-style: normal;
    font-weight: 500 600;
    font-display: swap;
    src: url("../assets/fonts/lora-latin.woff2") format("woff2");
}

@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../assets/fonts/source-sans-3-latin.woff2") format("woff2");
}

/* Reset and base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    padding-top: var(--header-height);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--line-body);
    overflow-x: hidden;
}

body.nav-locked {
    overflow: hidden;
}

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

h1,
h2,
h3 {
    margin: 0 0 var(--space-4);
    font-family: var(--font-heading);
    font-weight: var(--weight-medium);
    line-height: var(--line-heading);
    color: var(--color-text-primary);
}

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

p {
    margin: 0 0 var(--space-4);
}

ul {
    margin: 0 0 var(--space-4);
    padding-left: var(--space-5);
}

a {
    color: var(--color-accent);
    text-underline-offset: 0.2em;
}

a:hover {
    color: var(--color-accent-hover);
}

:focus-visible {
    outline: var(--focus-width) solid var(--color-focus);
    outline-offset: var(--space-1);
}

.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 300;
    padding: var(--space-3) var(--space-4);
    background: var(--color-accent);
    color: var(--color-text-inverted);
    font-weight: var(--weight-semibold);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
    color: var(--color-text-inverted);
}

/* Layout */
.container {
    width: 100%;
    max-width: calc(var(--container-max) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow {
    max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

.section {
    padding-block: var(--section-space);
}

.section--alt {
    background: var(--color-bg-secondary);
}

.section--first {
    padding-top: calc(var(--section-space) * 0.75);
}

.lead {
    font-size: var(--text-lead);
    color: var(--color-text-primary);
}

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

.stack > * + * {
    margin-top: var(--space-5);
}

.grid-3 {
    display: grid;
    gap: var(--space-5);
}

@media (min-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

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