body {
    background-color: rgb(151, 174, 179);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.profile {
    background-color: rgb(196, 203, 255);
    width: 100%;
    max-width: 1200px; /* Increased max-width significantly */
    margin: 20px auto;
    padding: 40px;
    box-sizing: border-box;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto 30px;
    display: block;
    border: 4px solid black;
    object-fit: cover;
}

.name {
    font-size: 2.5rem;
    margin: 20px 0 10px;
    text-align: center;
}

.role {
    font-size: 1.25rem;
    margin: 0 0 30px;
    text-align: center;
}

.work .worktitle {
    font-size: 2rem;
    text-align: center;
    margin: 40px 0;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
    gap: 40px;
    padding: 20px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grid-item img {
    width: 100%;
    height: auto; /* Allow height to adjust automatically */
    max-height: 300px; /* Set a maximum height */
    object-fit: contain; /* Ensure entire image is visible */
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.grid-item img:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(225, 16, 16, 0.9);
}

.image-caption {
    font-family: 'Lucida Sans', sans-serif;
    font-weight: bold;
    font-style: oblique;
    font-size: 1rem;
    margin-top: 15px;
    text-align: center;
}

.contact-text {
    font-size: 1rem;
    font-style: normal;
    text-align: center;
    margin: 30px 0;
}

.contact-button {
    display: flex;
    border: solid 2px;
    border-radius: 10px;
    background-color: rgb(179, 223, 245);
    margin: 20px auto;
    font-size: 1.25rem;
    padding: 12px 24px;
    transition: all 0.3s ease;
    flex-direction: column;
}

.contact-button:hover {
    cursor: pointer;
    transform: translateY(-5px);
    background-color: #bab3f5;
}

a {
    text-decoration: none;
    color: inherit;
}

.footer {
    margin-top: 40px;
}

.footer-box {
    display: flex;
    width: 100%;
    background-color: rgba(0, 0, 0, .88);
    padding: 20px 0;
}

.footer-text {
    color: white;
    margin: 0 auto;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .profile {
        padding: 20px;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .grid-item img {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .profile {
        padding: 15px;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .grid-item img {
        max-height: 200px;
    }
}