/* Reset and element defaults: what plain HTML looks like before any component styles. */

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

    * {
        margin: 0;
    }

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

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

    img {
        height: auto;
    }

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

    ul[class],
    ol[class] {
        padding: 0;
        list-style: none;
    }

    dialog {
        padding: 0;
        border: 0;
        max-width: none;
        max-height: none;
    }
}

@layer base {
    html {
        scroll-behavior: smooth;
        scroll-padding-top: calc(var(--header-height) + var(--space-lg));
        scrollbar-gutter: stable;
    }

    /* The page behind an open pop-up, menu or enlarged photograph stays where it is. */
    html:has(dialog[open]) {
        overflow: hidden;
    }

    body {
        font-family: var(--font-body);
        font-size: var(--text-md);
        line-height: 1.65;
        color: var(--text);
        background: var(--white);
        -webkit-font-smoothing: antialiased;
    }

    h1,
    h2,
    h3,
    h4 {
        font-family: var(--font-display);
        font-weight: 600;
        line-height: 1.22;
        color: var(--navy);
        text-wrap: balance;
    }

    h1 {
        font-size: var(--text-3xl);
        font-weight: 700;
    }

    h2 {
        font-size: var(--text-2xl);
    }

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

    h4 {
        font-size: var(--text-lg);
    }

    p {
        text-wrap: pretty;
    }

    a {
        color: var(--sand-ink);
        text-decoration-thickness: 1px;
        text-underline-offset: 0.2em;
        transition: color var(--quick) var(--ease);
    }

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

    strong {
        font-weight: 500;
        color: var(--navy);
    }

    :focus-visible {
        outline: 2px solid var(--sand-ink);
        outline-offset: 3px;
    }

    ::selection {
        color: var(--white);
        background: var(--sand-ink);
    }

    .icon {
        width: 1.25em;
        height: 1.25em;
        flex: none;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

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

@layer utilities {
    .visually-hidden {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .skip-link {
        position: absolute;
        top: var(--space-xs);
        left: var(--space-xs);
        z-index: 100;
        padding: var(--space-sm) var(--space-lg);
        color: var(--white);
        background: var(--navy);
        transform: translateY(-200%);
    }

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