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

@font-face {
    font-family: "Fredoka";
    src: url("fonts/Fredoka-VariableFont_wdth,wght.woff2") format("woff2");
    font-display: swap;
}

:root {
    font-family: "Fredoka", sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;

    --bg: oklch(0.99 0.003 325);
    --primary: oklch(0.25 0.01 325);

    background-color: var(--bg);
    color: var(--primary);
}

body {
    margin: 0;
}

.container {
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

a {
    transition: color 0.3s, background-color 0.3s;
}

a:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}


header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    flex-wrap: wrap;
}

header nav a {
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 1rem;
}

header nav a:hover,
header nav a:focus-visible {
    background-color: var(--primary);
    color: var(--bg);
}


.row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;

    > div {
        flex-grow: 1;
        flex-basis: 0;

        padding: 1rem;
        border: 1px dashed var(--primary);
    }

    > div:first-child {
        flex-grow: 2;
    }
}


.visually-hidden {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}


main nav {
    --nav-bg: darkblue;
    --nav-color: white;

    ul {
        list-style: none;
        margin: 0;
        padding: 0;

        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    li:first-child {
        margin-inline-end: auto;
    }

    a {
        display: block;
        padding: 1rem;
        text-decoration: none;

        background-color: var(--nav-bg);
        color: var(--nav-color);
    }

    a:hover,
    a:focus-visible {
        background-color: var(--nav-color);
        color: var(--nav-bg);
    }

    li:first-child a {
        background-color: var(--bg);
        color: var(--primary);
        font-weight: bold;
    }

    li:first-child a:hover,
    li:first-child a:focus-visible {
        background-color: var(--primary);
        color: var(--bg);
    }
}


.cards {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    flex-wrap: wrap;
    gap: 2rem;

    > li {
        flex-basis: 18rem;
        flex-grow: 1;
        min-inline-size: 0;

        display: flex;
        flex-direction: column;
        position: relative;

        border-radius: 0.5em;
        overflow: hidden;

        box-shadow:
            0 0 0.2rem oklch(0 0 0 / 0.2),
            0 0 2rem oklch(0 0 0 / 0.1);

        transition: box-shadow 0.3s;
    }

    > li:hover,
    > li:has(a:focus-visible) {
        box-shadow:
            0 0 0.4rem oklch(0 0 0 / 0.4),
            0 0 2rem oklch(0 0 0 / 0.2);
    }

    > li:has(a:focus-visible) {
        outline: 3px solid var(--primary);
        outline-offset: 4px;
    }

    img {
        order: -1;
        inline-size: 100%;
        display: block;
    }

    .content {
        padding: 1rem;
    }

    h3 {
        margin-block-start: 0;
    }

    a {
        color: inherit;
    }

    .overlay-link::after {
        content: "";
        position: absolute;
        inset: 0;
    }

    a:not(.overlay-link) {
        position: relative;
        z-index: 1;
    }
}