@font-face {
    font-family: "Fredoka";
    src: url("../../fonts/Fredoka-VariableFont_wdth\,wght.woff2") format("woff2")
}

*, *::before, *::after {
    box-sizing: border-box;
}

: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;
}

header {
    background-color: oklch(0.3069 0.1472 231.18);
    color: var(--bg)
}

nav ul {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin-inline-start: -2rem;
}

nav a {
    display: inline-block;
    padding-block: 1rem;
    padding-inline: 2rem;
    color: inherit;
    text-decoration: none;
}

.row {
    display: flex;
    gap: 2rem;

    > * {
        border: dashed 1px oklch(0.7216 0.162 69.18);
        padding: 1rem;
    }

    > :first-child {
        flex: 2;
    }

    > :nth-child(2) {
        flex: 1;
    }
}

.visually-hidden {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    margin: 0;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

main {

    nav {
        --text: oklch(0.99 0.003 325);
        --bg: oklch(0.45 0.32 40)
    }

    nav {
        a {
        color: var(--text);
        background-color: var(--bg);
        transition: color .2s ease-in-out, background-color .1s ease-in-out;

            &:hover,
            &:focus-visible {
                color: var(--bg);
                background-color: var(--text);
            }
        }

        li:first-child {
            margin-inline-end: auto;
        }

        li:first-child a{
            background-color: var(--text);
            color: var(--primary);
            font-weight: bold;
        }
    }
}

.cards {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 0;
    margin: 0;

    > li {
        display: flex;
        flex-direction: column;
        position: relative;
        background-color: oklch(0.3069 0.1472 231.18 / 0.2);
        border-radius: 1rem;
        overflow: hidden;        
        box-shadow: 0 0 .2rem oklch(0 0 0 / .2), 0 0 2rem oklch(0 0 0 / .1);
        flex-basis: 18rem;        
        transition: background-color 0.3s ease-in-out;

        .content a:not(.overlay-link) {
            z-index: 1;
        }


        &:hover {
            background-color: oklch(0.3069 0.1472 231.18);
            color: var(--bg);

            a {
                color: var(--bg);
            }
        }

        .content :first-of-type:hover {        
            color: black;
            background-color: green;
        }
    }

    img {
        order: -1;
    }

    .content {
        margin: 1rem;

        .overlay-link {
            position: absolute;
            inset: 0;
            text-indent: 100%;
            white-space: nowrap;
            overflow: hidden;
        }

        a:not(.overlay-link) {
            z-index: 1;
        }
    }
}