@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(1 0 0);
    --primary: oklch(0 0 0);
    --overlaycolor: oklch(0.437 0.115 284.346 / 0.6)
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--primary);
}

.container {
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

.visually-hidden {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: 0;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
}

.cards {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: -1.5rem;
    padding: 1rem;

    li {
        display: flex;

        flex-direction: column;
        flex-basis: 18rem;
        position: relative;
        border-radius: 0.5rem;
        box-shadow: 0 0 .2rem oklch(0 0 0 / .2), 0 0 2rem oklch(0 0 0 / .1);
        overflow: hidden;
        transition: box-shadow .2s ease-in-out;

        &:hover, &:has(.overlay-link:focus-visible) {
            box-shadow: 0 0 .2rem oklch(0 0 0 / 1), 0 0 2rem oklch(0 0 0 / 1);
        }

        &::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: 2;
            mix-blend-mode: overlay;
            background-color: var(--overlaycolor);
            scale: 0;
            border-radius: 50%;
            transition: scale .4s ease-in-out, border-radius 1s ease-in-out .5s;;
        }

        &:hover::before, &:has(.overlay-link:focus-visible)::before {
            scale: 1;
            border-radius: 0;
            transition: scale .2s ease-in-out, border-radius .2s ease-in-out .05s;

        }
        a{
            display:block;
        }
    }

    .content {
        z-index: 3;
        background-color: var(--bg);
        padding: 1.25rem;
    }

    img {
        order: -1;
        width: 100%;
        aspect-ratio: 3/2;
        object-fit: cover;
        object-position: center 50%;
    }

    .overlay-link::after {
        content: "";
        position: absolute;
        inset: 0;
    }

    a:not(.overlay-link) {
        position: relative;
        z-index: 1;
    }
}

nav {
    ul {
        list-style: none;
        padding: 0;
        margin: 0 0 0 -2rem;
        display: flex;
        flex-wrap: wrap;

        a{
            display: block;
            color: var(--primary);
            padding-block: 1rem;
            text-decoration: none;
            padding-inline: 2rem;
            transition: color 0.2s ease-in-out 0.1s, background-color 0.2s ease-in-out 0.1s;

            &:hover, &:focus-visible{
                background-color: var(--primary);
                color: var(--bg)
            }
        }
        > :nth-child(1){
            margin-right: auto
        }
    }

}

