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

:root {
    line-height: 1.6;
    background-color: oklch(0.99 0.003 325);
    color: oklch(0.25 0.01 325);
    font-family: "Fredoka", sans-serif;
    scroll-behavior: smooth;
}

body {
    margin: 0;
}

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

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

    nav a {
        display: inline-block;
        padding-bottom: 1rem;
        padding-top: 1rem;
        padding-left: 2rem;
        padding-right: 2rem;
        margin-left: -2rem;
        color: inherit;
        text-decoration: none;
    }
}

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


    >* {
        padding: 1rem;
        border: 1px dashed oklch(0.3576 0.0365 227.22);
        flex: 1;
    }

    >*:first-child {
        flex: 2;
    }
}

.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 ul {
        display: flex;
        flex-wrap: wrap;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    nav a {
        display: inline-block;
        padding: 1rem 2rem;
        color: var(--text);
        background-color: var(--bg);
        transition: color 2s ease-in-out, background-color .2s ease-in-out;
        text-decoration: none;

        &:hover,
        &:focus-visible {
            color: var(--bg);
            background-color: var(--text);
        }
    }

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

    nav li:first-child a {
        font-weight: bold;
        color: inherit;
        background-color: transparent;
    }
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cards li {
    display: flex;
    flex-direction: column;
    flex: 1 1 18rem;
    position: relative;
    isolation: isolate;  
    background-color:oklch(0.99 0.003 325);
    border: 1px solid oklch(0.9067 0 0);
    box-shadow: 0 0 .2rem oklch(0 0 0 / .2), 0 0 2rem oklch(0 0 0 / .1);
    transition: box-shadow 0.3s ease;
    border-radius: .5rem;  
    overflow: hidden;  
    z-index: 1;
}
.cards li:hover,
.cards li:has(a:focus-visible) {
    box-shadow: 0 0 .2rem #0006, 0 0 2rem #0003; 
}

.cards li:hover::before,
.cards li:has(a:focus-visible)::before {
    scale: 1;
    border-radius: 0;
    transition: scale .2s ease-in-out, border-radius .2s ease-in-out .05s;
}

.cards img {
    order: -1;
    width: 100%;
    height: 160px;         
    object-fit: cover; 
    z-index: 1;
}

.cards a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
}

.cards .content{
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
    background-color: oklch(0.99 0.003 325);
    z-index: 3;
}

.cards h3, .cards p {
    margin: 0;
}

.cards h3 {
    font-weight: 700;       
}

.cards li::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 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;
}
