/* ----- reset ------ */

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

*,
h1,
h2,
h3,
h4,
h5,
h6,
p,
strong,
span {
    margin: 0;
    padding: 0;
    font-family: "poppins", sans-serif;
}

p {
    font-size: 18px;
    font-weight: 400;
}

body,
main,
nav,
footer,
header,
section {
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1;
}


/* ----- styling ----- */

:root {
    --purple-light: #dacffcff;
    --purple: #7650dcff;
    --yellow-light: #f9eee1ff;
    --yellow: #ffcb6bff;
    --white: #ffffffff;
    --black: #121212ff;
}

/* ----- text formatting ----- */

.yellow-text {
    color: var(--yellow);
}

.italic {
    font-style: italic;
}

.purple-text {
    color: var(--purple);
    font-style: italic;
}

p {
    font-weight: 300;
    font-size: 15px;
}

h1 {
    font-size: 43px;
    font-weight: 500;
    line-height: 1;
}

h2 {
    font-size: 25px;
    font-weight: 500;
}


/* ---------------------------- */

.attribution {
    font-size: 11px;
    text-align: center;
    margin-top: 40px;
}

.attribution a {
    color: hsl(228, 45%, 44%);
}


main {
    padding: 10px;
    min-height: 100vh;
}

#box-1 {
    background: var(--purple);
    color: var(--white);
}

#box-2 {
    background: var(--yellow);
    color: var(--black);

}

#box-3 {
    background: var(--white);
    color: var(--black);
}

#box-4 {
    background: var(--yellow);
    color: var(--black);
}

#box-5 {
    background: var(--purple-light);
    color: var(--black);
}

#box-6 {
    background: var(--purple);
    color: var(--white);
}

#box-7 {
    background: var(--white);
    color: var(--black);
}

#box-8 {

    background: var(--yellow-light);
    color: var(--black);
}

.grid-container {
    display: grid;
    gap: 1.5rem;
    max-width: 1000px;
    height: 90vh;
    margin: auto;

    grid-template-columns: repeat(auto-fit, min-max(240px, 1fr));
    grid-template-rows: 1fr 1.5fr 0.5fr 1.3fr 0.7fr 1fr;
    grid-template-areas:
        "b8 b1 b1 b5"
        "b8 b1 b1 b5"
        "b8 b3 b4 b5"
        "b2 b3 b4 b5"
        "b2 b7 b6 b6"
        "b2 b7 b6 b6";

}

.box {
    border-radius: 20px;
    padding: 20px;
    overflow: hidden;
    position: relative;
}


#box-1 {
    grid-area: b1;
}

/**/
#box-2 {
    grid-area: b2;
}

#box-3 {
    grid-area: b3;
}

#box-4 {
    grid-area: b4;
}

#box-5 {
    grid-area: b5;
}

#box-6 {
    grid-area: b6;
}

#box-7 {
    grid-area: b7;
}

#box-8 {
    grid-area: b8;
}


#box-1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#box-1 img {
    width: 200px;
    margin: 10px;
}

#box-5 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 30px;
    padding-top: 30px;
}

#box-5 p {
    font-size: 13px;
    font-weight: 400;
}

#box-5 img {
    width: 300px;
    margin: 10px 0px 10px 0px;
}

#box-6 {
    display: flex;
    align-items: center;
}

#box-6 img {
    width: 200px;
    margin-left: 20px;
}

#box-6 h2 {
    font-size: 30px;
    font-weight: 400;
}

#box-4 {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#box-4 h2 {
    font-size: 25px;
    font-weight: 500;
}

#box-4 img {
    width: 200px;
    align-self: center;
    margin-top: 20px;
}

#box-7 {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#box-7 h1 {
    font-size: 70px;
}

#box-7 img {
    width: 200px;
    margin-top: 20px;
}

#box-3 img {
    width: 300px;
    margin-left: -13px;
}

#box-8 h2 {
    font-size: 30px;
}

#box-8 {
    display: flex;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
}

#box-8 img {
    width: 200px;
    align-self: center;
}

#box-2 {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

#box-2 h2 {
    font-size: 30px;
}

#box-2 img {
    align-self: center;
    width: 200px;
    margin-left: 10px;
}

button {
    background: var(--yellow);
    color: var(--black);
    border: none;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
}

/* ------ responsiveness ------- */

@media(max-width: 980px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(8, 1fr);
        grid-template-areas:
            "b1 b1 b5"
            "b1 b1 b5"
            "b3 b4 b5"
            "b3 b4 b5"
            "b2 b6 b6"
            "b2 b6 b6"
            "b2 b8 b7"
            "b2 b8 b7";
        height: auto;
    }
}

@media(max-width: 715px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        grid-template-areas:
            "b1 b1"
            "b2 b5"
            "b2 b5"
            "b3 b4"
            "b7 b8"
            "b6 b6";
    }

    #box-1 {
        height: 300px;
    }
}

@media(max-width: 470px) {
    .grid-container {
        grid-template-columns: repeat(1, 1fr);
        grid-template-rows: auto;
        grid-template-areas:
            "b1"
            "b3"
            "b4"
            "b5"
            "b6"
            "b7"
            "b8"
            "b2";
    }

    #box-6 {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    #box-6 img {
        max-width: 300px;
        width: 100%;
    }

    #box-6 h2 {
        width: 300px;
    }

    #box-4 img {
        margin-bottom: -20px;
    }

    #box-5 {
        gap: 2rem;
    }

    #box-5 h2 {
        font-size: 30px;
    }
}