/* copyied some of the codes from previous exercise. made changes to make it somewhat more responsive */
body {
    font-family: 'Afacad', sans-serif;
    padding: 0;
    margin: 0;
    align-items: center;
}

nav {
    width: 100%;
    display: flex;
    justify-content: center;
    background-image: linear-gradient(to right, black, gray);
}

nav ul {
    display: flex;
}

li {
    list-style: none;
    margin: 0.5rem 3rem;
    font-size: 1.5rem;
}

a {
    text-decoration: none;
    color: azure;
}

/* hero section */
.hero {
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to bottom, rgba(200, 200, 200, 0.8), rgba(50, 50, 50, 0.5)), url('../images/bailey-zindel-NRQV-hBF10M-unsplash.jpg');
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* texts */
h1 {
    font-size: 10rem;
    margin: 0;
    color: azure;
}

.subheader {
    font-size: 2.5rem;
    margin: 0;
    color: azure;
}

h2 {
    font-size: 2.5rem;
    margin: 0;
}

h3 {
    font-size: 5rem;
    margin: 0;
}

/* about */
.about {
    width: 100%;
    display: flex;
}

.image {
    width: 50%;
}

img {
    width: 100%;
}

.text {
    width: 50%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.description {
    font-size: 1.5rem;
    line-height: 3rem;
    font-weight: 500;
}

.button {
    color: black;
    border: 2px solid black;
    padding: 1.25rem;
    border-radius: 8px;
    text-align: center;
    font-size: 1.25rem;
}

/* image gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    grid-gap: 10px;
    text-align: center;
}

.recentworks {
    font-size: 2.5rem;
    margin-bottom: 50px;
    margin-top: 100px;
    text-align: center;
}

.gallery div {
    position: relative;
    overflow: hidden;
}

.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* previous works */
.experience {
    text-align: center;
}

.workedwith {
    font-size: 2.5rem;
    margin-bottom: 50px;
    margin-top: 100px;
}

.experience div {
    display: inline-block;
    width: 40%;
    margin: 0;
}

.experience img {
    width: 40%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 35px;
}

/* footer */
footer {
    text-align: center;
    justify-content: center;
    background-image: linear-gradient(to right, black, gray);
    padding: 20px;
    color: azure;
}

footer div {
    margin-bottom: 20px;
}

.footer {
    font-size: 2rem;
    margin: 0;
}

.contact {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

/* Media Query for Tablet */
@media screen and (max-width: 768px) {
    h1 {
        font-size: 6rem;
    }

    .about {
        flex-direction: column-reverse;
        align-items: center;
    }

    .text {
        width: 80%;
        padding: 2rem;
        text-align: center;
    }

    .image {
        width: 100%;
    }

    /* used grid-template-columns which made it easier */
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .recentworks {
        margin-bottom: 30px;
        margin-top: 70px;
    }

    .experience div {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Media Query for Mobile */
@media screen and (max-width: 540px) {

    li {
        list-style: none;
        margin: 0.5rem 2rem;
        font-size: 1rem;
    }

    h1 {
        font-size: 6rem;
    }

    .about {
        flex-direction: column-reverse;
        align-items: center;
    }

    .text {
        width: 80%;
        padding: 2rem;
        text-align: center;
    }

    .image {
        width: 100%;
    }

    .gallery {
        grid-template-columns: repeat(1, 1fr);
    }

    .experience div {
        width: 100%;
        margin: 0;
    }
}