@font-face {
    font-family: "Fredoka";
    src: url("../../fonts/Fredoka-VariableFont_wdth,wght.woff2") format("woff2");
}

*,*::before,*::after {
    box-sizing: border-box;
}

:root {
    line-height: 1.6;
    font-family: "Fredoka", sans-serif;
    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;
}

header nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

header nav a {
    display: block;
    padding: 1rem 2rem;
    color: inherit;
    text-decoration: none;
}

.row {
    display: flex;
    gap: 2rem;

    > * {
        padding: 1rem;
        border: 1px dashed steelblue;
    }

    > :first-child {
        flex: 2;
    }

    > :last-child {
        flex: 1;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

main {
    nav {
        --text: oklch(0.99 0.003 325);
        --bg: oklch(0.45 0.32 40);

        ul {
            display: flex;
            flex-wrap: wrap;
            list-style: none;
            margin: 0;
            padding: 0;
        }

        li:first-child {
            margin-inline-end: auto;
        }

        a {
            display: block;
            padding: 1rem 2rem;
            color: var(--text);
            background-color: var(--bg);
            text-decoration: none;

            transition:
                    color 0.25s ease,
                    background-color 0.25s ease;

            &:hover,
            &:focus-visible {
                color: var(--bg);
                background-color: var(--text);
            }
        }

        li:first-child a {
            color: inherit;
            background: none;
            font-weight: bold;

            &:hover,
            &:focus-visible {
                color: inherit;
                background: none;
            }
        }
    }
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;

    list-style: none;
    margin: 0;
    padding: 0;

    > li {
        flex: 1 1 18rem;

        display: flex;
        flex-direction: column-reverse;

        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 .25s ease;
    }

    > li:hover {
        box-shadow:
                0 0 .3rem oklch(0 0 0 / .35),
                0 0 3rem oklch(0 0 0 / .2);
    }

    img {
        display: block;
        width: 100%;
        height: auto;
    }

    .content {
        padding: 1.25rem;

        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }

    h3 {
        margin-top: 0;
    }

    a {
        margin-top: auto;
    }
}

.cards {
    > li {
        position: relative;
        overflow: hidden;
        isolation: isolate;

        &::before {
            content: "";
            position: absolute;
            z-index: -1;

            inset: auto;
            width: 4rem;
            aspect-ratio: 1;

            top: -2rem;
            right: -2rem;

            background: oklch(0.7 0.2 25 / 0.5);
            border-radius: 50%;

            scale: 1;

            transition:
                    scale .4s ease,
                    border-radius .2s ease .15s;

            mix-blend-mode: multiply;
        }

        &:hover::before,
        &:has(a:focus-visible)::before {
            scale: 18;
            border-radius: 0;
        }
    }
}

.cards li:nth-child(1)::before {
    background: oklch(0.7 0.2 25 / 0.5);
}

.cards li:nth-child(2)::before {
    background: oklch(0.75 0.18 140 / 0.5);
}

.cards li:nth-child(3)::before {
    background: oklch(0.72 0.2 250 / 0.5);
}

.cards li:nth-child(4)::before {
    background: oklch(0.75 0.22 320 / 0.5);
}