@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

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

:root {
    --Purple-100: hsl(254, 88%, 90%);
    --Purple-500: hsl(256, 67%, 59%);
    --Yellow-100: hsl(31, 66%, 93%);
    --Yellow-500: hsl(39, 100%, 71%);
    --White: hsl(0, 0%, 100%);
    --Black: hsl(0, 0%, 7%);
}

img {
    max-width: 100%;
    display: block;
}

body {
    background-color: #f2f2f2;
    min-height: 100vh;
    font-family: "DM Sans", sans-serif;
    font-size: 18px;
    line-height: 1;
    display: grid;
    place-content: center;
}

.xlg-text {
    font-size: 4rem;
    font-weight: 500;
}

.lg-text {
    font-size: 2.75rem;
    font-weight: 500;
}

.med-text {
    font-size: 1.35rem;
    font-weight: 500;
}

.sm-text {
    font-size: 1.5rem;
    font-weight: 400;
}

.bento-grid {
    max-width: 1200px;
    margin: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: 75px;
    gap: 2rem;
    grid-template-areas:
        'box1 box2 box2 box3'
        'box1 box2 box2 box3'
        'box1 box2 box2 box3'
        'box1 box2 box2 box3'
        'box1 box5 box6 box3'
        'box4 box5 box6 box3'
        'box4 box5 box6 box3'
        'box4 box7 box8 box8'
        'box4 box7 box8 box8'
        'box4 box7 box8 box8';
}

.bento-grid .item {
    border-radius: .5rem;
    overflow: hidden;
}

.bento-grid .item:nth-child(1) {
    background-color: var(--Yellow-100);
}

.bento-grid .item:nth-child(2),
.bento-grid .item:nth-child(8) {
    background-color: var(--Purple-500);
    color: var(--White);
}

.bento-grid .item:nth-child(3) {
    background-color: var(--Purple-100);
}

.bento-grid .item:nth-child(4),
.bento-grid .item:nth-child(6) {
    background-color: var(--Yellow-500);
}

.bento-grid .item:nth-child(5),
.bento-grid .item:nth-child(7) {
    background-color: var(--White);
}

.bento-grid .item:nth-child(1){
    grid-row: box1;
    padding: 6rem 9rem 0 3.5rem;
}

.bento-grid .item:nth-child(1) em {
    color: var(--Purple-500);
}

.bento-grid .item:nth-child(1) img {
    margin-top: 1rem;
}

.bento-grid .item:nth-child(2) {
    grid-area: box2;
    padding: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.bento-grid .item:nth-child(2) .emphasis {
    color: var(--Yellow-500);
}

.bento-grid .item:nth-child(2) img {
    width: 250px;
    margin: 1rem 0 .5rem;
}

.bento-grid .item:nth-child(3) {
    grid-area: box3;
    padding: 2.75rem 2rem 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.bento-grid .item:nth-child(3) img {
    position: absolute;
    height: 410px;
    object-fit: cover;
    object-position: left;
    top: 150px;
}

.bento-grid .item:nth-child(4) {
    grid-area: box4;
    padding: 1.75rem 2.25rem;
}

.bento-grid .item:nth-child(4) p {
    margin-bottom: 2rem;
}

.bento-grid .item:nth-child(5) {
    grid-area: box5;
    padding: 1rem 2rem 1rem 2rem;
    position: relative;
}

.bento-grid .item:nth-child(5) p {
    margin-top: 6rem;
}

.bento-grid .item:nth-child(5) img {
    position: absolute;
}

.bento-grid .item:nth-child(6) {
    grid-area: box6;
    position: relative;
    padding: 1rem 1.75rem;
}

.bento-grid .item:nth-child(6) p {
    margin-bottom: 1rem;
}

.bento-grid .item:nth-child(7) {
    grid-area: box7;
    padding: 1.5rem;
}

.bento-grid .item:nth-child(4) span {
    display: block;
    margin-bottom: 1rem;
}

.bento-grid .item:nth-child(7) img {
    margin-top: 1.5rem;
}

.bento-grid .item:nth-child(8) {
    grid-area: box8;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1.75fr 2fr;
    align-items: center;
    gap: 1rem;
}

@media (max-width:1000px) {
    .bento-grid{
        grid-auto-rows: initial;
        grid-template-areas:
            'box1 box1 box2 box2'
            'box1 box1 box2 box2'
            'box3 box3 box4 box4'
            'box3 box3 box4 box4'
            'box5 box5 box6 box6'
            'box5 box5 box6 box6'
            'box7 box7 box8 box8'
            'box7 box7 box8 box8';
    }
    .bento-grid .item:nth-child(8){
        grid-template-columns: 1fr;
    }
    .bento-grid .item:nth-child(1){
        grid-row: box1;
        padding: 6rem 10rem 0 3.5rem;
    }
}


@media (max-width:768px) {
    .bento-grid .item{
        text-align: center;
    }
    .bento-grid{
        grid-template-areas:
        'box2'
        'box5'
        'box6'
        'box3'
        'box8'
        'box7'
        'box1'
        'box4';
    }
    .bento-grid .item:nth-child(4),
    .bento-grid .item:nth-child(5),
    .bento-grid .item:nth-child(6),
    .bento-grid .item:nth-child(7){
        text-align: left;
    }
    .bento-grid .item:nth-child(1){
        padding: 2rem;
        text-align: center;
    }
    .bento-grid .item:nth-child(1) .lg-text{
        font-size: 2.5rem;
    }
    .bento-grid .item:nth-child(1) img{
        width: 250px;
    }
    .bento-grid .item:nth-child(3){
        padding: 2.75rem 1rem 2.5rem 1rem;
    }
    .bento-grid .item:nth-child(3) .lg-text{
        font-size: 2.25rem;
    }
    .bento-grid .item:nth-child(3) img{
        margin: 1rem 0;
        position: initial;
        height: initial;
    }
}