/* Reset + typographic base. */

@font-face {
    font-family: "Work Sans";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url(../font/WorkSans-Regular.woff2) format("woff2"),
         url(../font/WorkSans-Regular.woff) format("woff");
}

@font-face {
    font-family: "Work Sans";
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    src: url(../font/WorkSans-Medium.woff2) format("woff2"),
         url(../font/WorkSans-Medium.woff) format("woff");
}

@font-face {
    font-family: "Work Sans";
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url(../font/WorkSans-Bold.woff2) format("woff2"),
         url(../font/WorkSans-Bold.woff) format("woff");
}

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

* {
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font);
    font-size: var(--step-0);
    font-weight: 400;
    line-height: 1.5;
    color: var(--c-text);
    background-color: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Nothing may cause sideways scroll on a phone. */
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { text-wrap: pretty; }

a {
    color: var(--c-brand);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

ul, ol { list-style: none; }

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

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

button { cursor: pointer; background: none; border: none; }

table {
    border-collapse: collapse;
    width: 100%;
}

/* Visible, consistent keyboard focus everywhere. */
:focus-visible {
    outline: 3px solid var(--c-brand);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* Screen-reader-only, still focusable. */
.visually-hidden:not(:focus):not(:active) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: var(--sp-2);
    top: -100px;
    z-index: 200;
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-brand);
    color: var(--c-text-on-brand);
    border-radius: var(--r-sm);
    transition: top 0.15s var(--ease);
}

.skip-link:focus { top: var(--sp-2); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
