@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

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

html {
    font-size: 16px;
    font-family: "roboto", sans-serif;
    --backing-color: #498aeb;
}

.main-content {
    display: grid;
    grid-template-rows: min-content 1fr min-content;
    grid-auto-flow: column;
}

header {
    min-height: 300px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 2rem;
    margin-bottom: 3rem;
}

.backing {
    width: 100%;
    height: 240px;
    background-color: var(--backing-color);
    transform: skewY(-5deg) translateY(-50px);
    position: absolute;
    box-shadow: 0px 2px 5px 0px gray;
    top: 0;
    z-index: -1;
}

.backing-patch {
    width: 50%;
    height: 3vw;
    background-color: var(--backing-color);
    position: absolute;
    top:0;
    left: 0;
    z-index: -1;
}

.img {
    max-width: 400px;
    z-index: 2;
    flex-shrink: 1;
    position: relative;
}

.img-text {
    position: absolute;
    font-family: "Playfair Display", sans-serif;
    font-size: 2.75rem;
    color: white;
    bottom: 0;
    left: 0;
    right: 0;
    width: fit-content;
    margin: 0 auto;
    margin-bottom: 4px;
}

.img img {
    width: 100%;
    box-shadow: 0px 0px 1px 0px black;
}

h2, h3 {
    font-family: "Playfair Display", sans-serif;
    font-weight: 400;
}

header h2 {
    margin-bottom: 1rem;
}

.info-card {
    background-color: white;
    width: fit-content;
    box-shadow: 0px 0px 5px 0px gray;
    padding: 1rem;
    transform: perspective(500px);
    transition: transform .5s ease-in-out;
    will-change: transform;
}

.info-card:hover {
    transform: perspective(600px) translateZ(100px);
    z-index: 4;
}

.info-card p {
    max-width: 40ch;
}

.links {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: flex-end;
    margin-top: 1rem;
}

.links a {
    max-width: 25px;
}

.links img {
    width: 100%;
}

main {
    width: 100%;
    padding: 0 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projects-title {
    display: flex;
    min-width: min(1000px, 100%);
    margin-bottom: 1rem;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 350px;
    justify-content: center;
    gap: 3rem;
    max-width: min(1000px, 100%);
}

.grid-item {
    min-width: 200px;
    min-height: 300px;
    box-shadow: 0px 0px 10px 0px gray;
    background-color: white;
    transition: transform .5s ease-in-out;
    will-change: transform;
}

.grid-item:hover {
    transform: scale(1.2);
}

.project-pic {
    width: 100%;
    height: 50%;
    background-color: crimson;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.project-pic > h2 {
    max-width: 10ch;
    color: white;
}

.project-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 1rem;
}

.project-links {
    display: flex;
    align-items: end;
    gap: 1rem;
}

.project-links > a {
    width: 25px;
}

.project-links > a > img {
    width: 100%;
}

.grid-item > p {
    padding: .5rem 1rem 0 1rem;
}

.purple {
    background-color: #ba32cc;
}

.green {
    background-color: #019901;
}

.pink {
    background-color: #df78df;
}

.orange {
    background-color: #eec50d;
}

.blue {
    background-color: #24ceec;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    max-width: 25px;
}

.footer-links img {
    width: 100%;
}

.footer-img {
    max-width: 400px;
}

.footer-img img {
    width: 100%;
}

footer {
    padding: 3rem;
    background-color: var(--backing-color);
    margin-top: 10rem;
    color: white;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}

footer p {
    max-width: 28ch;
}

.personal-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.personal-info > p > img {
    width: 25px;
    filter: invert();
}

.phone-number, .email {
    display: flex;
    align-items: center;
    gap: .6rem;
}


@media screen and (640px <= width <= 1000px) {
    .info-card {
        transform: translateX(5vw);
    }

    .info-card:hover {
        transform: translateX(5vw) perspective(600px) translateZ(100px);
    }
}

@media screen and (500px < width <= 1000px) {
    .info-card {
        position: absolute;
        left: 25%;
        top: 65%;
        z-index: 3;
        margin-right: 3rem;
    }

    .img {
        position: relative;
        left: 0%;
    }

    .img-text {
        top: 0;
    }

    header {
        margin-bottom: 10rem;
    }

    .projects-title {
        justify-content: center;
    }

    .footer-img {
        max-width: 200px;
    }
}

@media screen and (max-width: 500px) {
    header h2 {
        text-align: center;
    }

    .links {
        justify-content: center;
    }

    .info-card {
        box-shadow: none;
    }

    .projects-title {
        justify-content: center;
    }
}