@import url('https://fonts.googleapis.com/css?family=Inconsolata|Merriweather');
body {
    font-family: 'Inconsolata', monospace;
    margin: 0;
}

.hero {
    height: 400px !important;
    text-align: center;
    background-color: #1b7bab;
}

.hero h1 {
    padding-top: 150px;
    color: #fff;
    font-size: 40px;
    font-weight: 900;
}


/* gallery */

.g_heading {
    text-align: center;
    margin: 50px 0;
}

.g_heading h1 {
    font-size: 40px;
    color: #1b7bab;
    font-weight: 900;
}

button {
    cursor: pointer;
}

#portfolio {
    width: 100%;
    min-height: 100vh;
    background: #ffffff;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 1fr));
    grid-template-rows: 1fr 1fr;
    grid-gap: 2px;
    padding: 0 15px;
}

.project {
    position: relative;
    background: #fff;
    overflow: hidden;
    /* Fix aspect ratio to keep consistent height */
    aspect-ratio: 4 / 3;
    height: auto;
}

.project img {
    position: absolute;
    opacity: 0.9;
    width: 100%;
    height: 100%;
    object-fit: cover;
    top: 0;
    left: 0;
}

.project p {
    position: absolute;
    text-align: center;
    width: 100%;
    padding: 1em 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 3;
}

.project .grid__title {
    position: absolute;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    bottom: 0;
    font-weight: 100;
    font-size: 0.8em;
    z-index: 3;
    text-transform: uppercase;
    color: #474545;
    letter-spacing: 2px;
}

.project:hover .grid__overlay {
    transform: translateY(0%);
}

.grid__overlay {
    background: #1b7bab;
    /* darken(#1b7bab, 10%) = #DAA6A0 */
    height: 100%;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    position: relative;
    display: grid;
    justify-items: center;
    align-items: center;
    transform: translateY(101%);
    transition: all 0.3s ease-in-out;
}

.grid__overlay button {
    background: none;
    outline: none;
    font-weight: 100;
    letter-spacing: 2px;
    border: 1px solid #ffffff;
    color: #ffffff;
    text-transform: uppercase;
    padding: 10px;
}

.grid__overlay button:hover {
    transition: all 0.3s ease-in-out;
    background: #ffffff;
    color: #1b7bab;
    transform: scale(1.05);
}

.overlay {
    position: fixed;
    background: rgba(71, 69, 69, 0.7);
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    z-index: 3;
}

.overlay.open {
    display: grid;
    align-items: center;
    justify-items: center;
}

.overlay__inner {
    background: #ffffff;
    width: 700px;
    padding: 20px;
    position: relative;
    opacity: 1;
}

.close {
    position: absolute;
    top: 3px;
    right: 10px;
    background: none;
    outline: 0;
    color: #474545;
    border: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.close:hover {
    color: #1b7bab;
}

.project__image {
    margin-left: 0;
    /* removed problematic negative margin */
}


/* Responsive Grid */


/* Tablets and small laptops */

@media (max-width: 992px) {
    #portfolio {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Mobile devices */

@media (max-width: 576px) {
    #portfolio {
        grid-template-columns: 1fr;
    }
    .overlay__inner {
        width: 90%;
    }
}


/* Additional media queries you had */

@media (max-width: 768px) {
    .carousel-item img {
        max-height: 300px;
    }
    .gal {
        height: 1200px;
    }
    h1 {
        font-size: 40px;
        font-weight: 900;
    }
    h2 {
        font-size: 30px;
        text-align: left;
        font-weight: 900;
    }
}

@media (max-width: 576px) {
    .carousel-item img {
        max-height: 200px;
    }
}