*, *::before, *::after {
    box-sizing: border-box;
}

@font-face {
    font-family: "Fredoka";
    src: url("./fonts/Fredoka-VariableFont_wdth,wght.woff2") format("woff2");
}

:root {
    font-family: "Fredoka", sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
    --bg: oklch(0.99 0.003 325);
    --text: oklch(0.25 0.01 325);
    background-color: var(--bg, oklch(0.9307 0.0168 56.58));
    color: var(--text, oklch(0.0676 0.0168 56.58));
}

body {
    margin: 0;
}

.container {
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

nav {
    ul {
        list-style: none;
        margin: 0;
        padding: 0;
        margin-inline: -2rem;
        display: flex;
        justify-content: flex-start;
    }

    a {
        display: inline-block;
        padding-block: 1rem;
        padding-inline: 2rem;
        color: inherit;
        text-decoration-line: none;
    }

    a:hover, a:focus-visible {
        background-color: oklch(0.7 0.1613 17.83);
    }
}

main {
    nav {
        --bg: oklch(0.7784 0.1145 187.88);
        --text: oklch(0.1983 0.0543 254.58);

        ul {
            display: flex;
            flex-wrap: wrap;

            a {
                background-color: var(--bg, oklch(0.9307 0.0168 56.58));
                color: var(--text, oklch(0.0676 0.0168 56.58));
                transition: background-color 0.1s ease-in-out 0.1s,
                color 0.1s ease-in-out 0.1s;

                &:hover, &:focus-visible {
                    background-color: var(--text, oklch(0.9307 0.0168 56.58));
                    color: var(--bg, oklch(0.0676 0.0168 56.58));
                }
            }

            li:first-child {
                margin-inline-end: auto;

                a {
                    --bg: oklch(0.99 0.003 325);
                    --text: oklch(0.25 0.01 325);
                    font-weight: bold;
                }
            }
        }
    }
}

.row {
    display: flex;
    gap: 2rem;

    > * {
        padding: 1rem;
        border-style: dashed;
        flex-grow: 1;
    }

    > *:first-child {
        flex-grow: 2;
    }
}

.visually-hidden {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    margin: 0;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;

    li {
        display: flex;
        flex-direction: column;
        position: relative;
        isolation: isolate;
        margin: 0;
        background-color: oklch(1 0 0);
        border-radius: .5em;
        overflow: hidden;
        box-shadow: 0 0 .2rem oklch(0 0 0 / .2), 0 0 2rem oklch(0 0 0 / .1);
        transition: box-shadow .3s ease-in-out;

        &::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: 2;
            mix-blend-mode: overlay;
            background-color: oklch(.2 .2 264 / .6);
            scale: 0;
            border-radius: 50%;
            transition: scale .8s ease-in-out .5s, border-radius 1s ease-out .5s;
            pointer-events: none;
        }

        img {
            order: -1;
            z-index: 1;
            width: 100%;
            height: auto;
            display: block;
        }

        .content {
            z-index: 3;
            padding: 1rem;
            position: relative;
        }

        .overlay-link::after {
            content: "";
            position: absolute;
            inset: 0;
            z-index: 4;
        }

        &:hover {
            box-shadow: 0 0 .4rem oklch(0 0 0 / 40%), 0 0 2rem oklch(0 0 0 / 20.2%);

            &::before {
                scale: 1;
                border-radius: 0;
                transition: scale .2s ease-in-out, border-radius .2s ease-in-out .05s;
            }
        }
    }
}
