/**** Reset ****/

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

a {
    text-decoration: none;
}

/**** body ****/

body {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 70px 70px 30px;
    font-family: "Poppins", sans-serif;
    background-color: #fafafa;
}

/**** header ****/

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: auto;
    margin-bottom: 80px;
}

.main__title {
    font-family: PT Serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.045em;
    margin-bottom: 38px;
}

.description__title {
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
}

.description__text {
    max-width: 333px;
    margin-top: 10px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7;
}

header,
.cards__container {
    max-width: 900px;
    width: 100%;
}

.main__title,
.description__title,
.description__text,
.card__title,
.card__role {
    color: #000000;
}

/**** main ****/

.main__content {
    flex-grow: 1;
}

/**** section ****/

.cards__container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 100px;
}

.card {
    position: relative;
    width: 25%;
    margin: 0 16px 8px 5px;
    transition: transform 0.3s ease-in-out;
    opacity: 0;
    animation: fade-in 0.5s forwards;
    animation-delay: calc(0.3s * var(--i));
}

/**** Animation fade-in ****/

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.card__image {
    width: 100%;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card:nth-child(2),
.card:nth-child(5) {
    margin-top: 100px;
}

.card__title {
    font-weight: 600;
    font-size: 16px;
    padding-top: 10px;
}

.card__role {
    position: absolute;
    top: 0;
    right: -20px;
    writing-mode: vertical-rl;
    text-transform: uppercase;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

/**** footer ****/

.dev__challenges__link {
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #a9a9a9;
    transition: all 0.3s ease-in-out;
}

.dev__challenges__link:hover {
    text-decoration: underline;
}

/**** Responsive design tablette ****/

@media screen and (max-width: 991px) {

    body {
        padding: 70px 20px 30px;
    }

    header {
        flex-direction: column;
        align-items: start;
    }

    .description__text {
        max-width: none;
    }
}

/**** Responsive design version mobile ****/

@media screen and (max-width: 572px) {

    body {
        padding: 50px 12px;
    }

    .card {
        width: 40%;
    }

    .card:nth-child(even) {
        margin-top: 40px;
    }

    .card:nth-child(5) {
        margin-top: 0;
    }

    .card__title {
        padding-top: 6px;
        font-size: 14px;
    }
}