@font-face {
    font-family: "DM Sans";
    src: url("../fonts/dm-sans-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 1000;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Source Serif 4";
    src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

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

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-strong) transparent;
    scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-md);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
}

/* One rule for type: headings 1 and 2 are the editorial serif, everything that works (labels, cards, controls) is the sans. */
h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: var(--leading-tight);
}

h1,
h2 {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    letter-spacing: -0.02em;
    font-optical-sizing: auto;
}

h3,
h4 {
    font-weight: var(--weight-semibold);
    letter-spacing: -0.005em;
}

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

p {
    margin: 0;
}

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

a:hover {
    color: var(--color-primary-text-hover);
}

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

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

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

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

.muted { color: var(--color-text-muted); }
.small { font-size: var(--text-sm); }
.numeric { font-variant-numeric: tabular-nums; }

.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;
}

.skip-link {
    position: absolute;
    left: var(--space-3);
    top: -4rem;
    z-index: var(--z-tooltip);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: var(--weight-semibold);
    text-decoration: none;
}

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

.sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

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