/* ============================================
   Self-hosted fonts
   ============================================ */

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

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

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

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

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

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


/* ============================================
   Design tokens
   ============================================ */

:root {
    --font-sans: "Source Sans 3", system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

    --color-text: #1f2937;
    --color-text-muted: #4b5563;
    --color-background: #ffffff;
    --color-border: #e5e7eb;
    --color-link: #1d4ed8;
    --color-link-hover: #1e40af;

    --content-width: 72rem;
    --page-gutter: 1rem;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
}


/* ============================================
   Basic reset
   ============================================ */

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

html {
    font-family: var(--font-sans);
    line-height: 1.5;
    scroll-padding-top: 6rem;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--color-text);
    background: var(--color-background);
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.25rem, 6vw, 4.5rem);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    color: var(--color-text-muted);
}

a {
    color: var(--color-link);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.15em;
}

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

a:focus-visible {
    outline: 0.1875rem solid currentColor;
    outline-offset: 0.1875rem;
}

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

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


/* ============================================
   Shared layout
   ============================================ */

header,
main,
footer {
    width: min(
        calc(100% - (var(--page-gutter) * 2)),
        var(--content-width)
    );
    margin-inline: auto;
}

main {
    min-height: 70vh;
    padding-block: var(--space-16);
}

main > :last-child {
    margin-bottom: 0;
}

article {
    max-width: 48rem;
}

article p,
article li {
    font-size: 1.0625rem;
    line-height: 1.7;
}

footer {
    padding-block: var(--space-8);
    border-top: 1px solid var(--color-border);
}


/* ============================================
   Responsive navigation
   ============================================ */

@media (max-width: 48rem) {
    main {
        padding-block: var(--space-12);
    }
}

