* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

:root {
    font-size: 62.5%;
    --ff-heading: 'Epilogue', sans-serif;
    --ff-body: 'open-sans', sans-serif;
    --hue: 250;
    --bc-color: hsl(var(--hue), 22%, 20%);
    --primary-color: hsl(var(--hue), 50%, 80%);
    --second-color: hsl(var(--hue), 0%, 100%);
    --sencond-color-dark: hsl(var(--hue), 100%, 11%);
    --fs-size: 1.6rem;
    --fs-size-second: clamp(4rem, 1rem + 5vw, 5.6rem);
    --fs-size-third: clamp(3rem, 0.5rem + 4vw, 4rem);
}

body {
    font-size: var(--fs-size);
    color: var(--second-color);
    background-color: var(--bc-color);
    font-family: var(--ff-body);
    max-width: clamp(33rem, 40rem + 70vw, 125rem);
    margin: 0 auto 10.5rem;
    font-weight: 400;
    padding: 0 5rem;
}

header {
    margin: 106px 0px 80px;
    font-family: var(--ff-heading);
    text-align: center;
}

header p {
    color: var(--primary-color);
    text-transform: uppercase;
    line-height: 3.2rem;
    letter-spacing: 3px;
    font-weight: 400;
    margin-bottom: 1.7rem;
    animation: topdown 700ms;
}

header h1 {
    font-size: var(--fs-size-second);
    font-weight: 800;
    line-height: 4.8rem;
    animation: topdown 700ms 350ms backwards;
}

main {
    display: grid;
    gap: 3.2rem;
    animation: downtop 700ms 350ms backwards;
}

.card {
    position: relative;
}

.card img {
    border-radius: 6px;
    height: 41.6rem;
    object-fit: cover;
    width: 100%;
    transition: all 0.2s;
    filter: brightness(0.7) saturate(0.7);
}

.card img:hover {
    transform: scale(1.1);
    opacity: 0.4;
}

.card h2 {
    position: absolute;
    bottom: 5rem;
    left: 4.8rem;
    display: flex;
    flex-direction: column;
    gap: 2.3rem;
    font-size: var(--fs-size-third);
    font-weight: 800;
    line-height: 4.8rem;
   
}

.card h2 span {
    font-size: var(--fs-size);
    color: var(--sencond-color-dark);
    background: var(--second-color);
    border-radius: 1.9rem;
    width: fit-content; 
    display: inline-flex;
    align-items: center;
    height: 3.8rem;
    padding: 0rem 1.6rem;
    line-height: 3.2rem;
    font-weight: 400;
}

@keyframes topdown {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0px);
    }
}

@keyframes downtop {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0px);
    }
}

@media (min-width: 700px) {
    main {
        grid-template-columns: 1.2fr 1fr;
    }
}

@media (min-width: 1160px) {
    main {
        grid-template-areas: "A B B" "C C D";
    }

    main .card:nth-child(1) {
        grid-area: A;
    }

    main .card:nth-child(2) {
        grid-area: B;
    }

    main .card:nth-child(3) {
        grid-area: C;
    }

    main .card:nth-child(4) {
        grid-area: D;
    }
}
