#projects {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20vh;
}

#projects-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
    width: 80%;
}

#projects-container div {
    aspect-ratio: 16 / 9;
    position: relative;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    overflow: hidden;
    border: 1px solid var(--borderColor);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1em;
}

#projects-container div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(14, 14, 14, 0.844); /* Base state background */
    opacity: 0;
    transition: opacity 0.3s ease-in-out, background 0.3s ease-in-out;
    z-index: 1;
}

#projects-container div:nth-child(1) {
    background: url('/images/shrimphony.PNG') center center / cover no-repeat;
}
#projects-container div:nth-child(2) {
    background: url('/images/aquarisoft.PNG') center center / cover no-repeat;
}
#projects-container div:nth-child(3) {
    background: url('/images/wesleysway.PNG') center center / cover no-repeat;
}
#projects-container div:nth-child(4) {
    background: url('/images/brycehaynesold.PNG') center center / cover no-repeat;
}
#projects-container div:nth-child(5) {
    background: url('/images/webstralis.PNG') center center / cover no-repeat;
}

#projects-container div h2, #projects-container div p {
    /* position: absolute; */
    /* left: 50%; */
    /* transform: translateX(-50%); */
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    text-align: left;
}

#projects-container div h2 {
    /* top: 35%; */ /* Adjusted for visual balance with the paragraph */
    font-weight: 600;
}

#projects-container div p {
    /* top: 50%; */ /* Positioning the paragraph slightly below the h2 */
    font-size: 1em; /* Smaller font size for the paragraph */
    color: var(--font-white); /* Ensuring the text color matches the theme */
    max-width: 60%; /* Restricting the maximum width for better readability */
}

#projects-container div:hover::before {
    opacity: 1; /* Makes the overlay visible */
    background: rgba(14, 14, 14, 0.9); /* Darkens the background slightly more */
}

#projects-container div:hover h2, #projects-container div:hover p {
    opacity: 1; /* Ensuring both elements become visible on hover */
}

#projects-container div:hover {
    transform: scale(0.98);
    cursor: pointer;
    animation: pulsate 1s infinite;
}

.github-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 2;
}

#projects-container div:hover .github-icon {
    opacity: 1;
}
