/* Fonts, element defaults and accessibility helpers. */
@font-face {
    font-family: 'Space Grotesk Variable';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
    font-family: 'Inter Variable';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}

@font-face {
    font-family: 'JetBrains Mono Variable';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url('/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations');
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-height) + 16px);
    background: var(--color-bg);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

body.nav-open {
    overflow: hidden;
}

main {
    flex: 1 0 auto;
    /* Grid and flex children of main must be able to shrink below their content width. */
    min-width: 0;
}

/* The header overlays the first section, so that section makes room for it. */
.site-header ~ main > :first-child {
    padding-top: calc(var(--section-space) + var(--header-height));
}

/* The router and the skip link move focus here on purpose; neither is an interactive control. */
main:focus,
h1:focus {
    outline: none;
}

h1, h2, h3, h4 {
    margin: 0 0 .6em;
    color: var(--color-text-strong);
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.12;
    text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 1.45rem + 3.9vw, 4.1rem); line-height: 1.06; }
h2 { font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 1.1rem + .5vw, 1.45rem); letter-spacing: -.01em; line-height: 1.25; }
h4 { font-size: 1.05rem; letter-spacing: 0; line-height: 1.3; }

p {
    margin: 0 0 1em;
}

a {
    color: var(--color-bronze-light);
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

a:hover {
    color: var(--color-text-strong);
}

img, svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid var(--color-line);
}

button, input, select, textarea {
    font: inherit;
}

:focus-visible {
    outline: 2px solid var(--color-bronze-light);
    outline-offset: 3px;
    border-radius: 2px;
}

::selection {
    background: var(--color-bronze);
    color: var(--color-on-bronze);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: .7rem 1.1rem;
    border-radius: var(--radius);
    background: var(--color-text-strong);
    color: var(--color-on-bronze);
    font-weight: 600;
    transform: translateY(-200%);
}

.skip-link:focus {
    color: var(--color-on-bronze);
    transform: none;
}
