@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

*, *:after, *:before {
    box-sizing: border-box;
}

.projects-container {
    width: 90%;
    justify-self: center;
    padding: 4rem 0;
}

.projects-container h2 {
    color: #000;
    font-size: 4rem;
    text-align: left;
    margin-bottom: 3rem;
    font-weight: 800;
    margin-left: 10%;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    justify-content: center;
}

.stack {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    transition: .25s ease;
}

.stack:hover {
    transform: rotate(5deg);
}

.stack:hover .card:before {
    transform: translatey(-2%) rotate(-4deg);
}

.stack:hover .card:after {
    transform: translatey(2%) rotate(4deg);
}

.card {
    aspect-ratio: 4 / 5;
    border: 4px solid #000;
    background-color: #fff;
    position: relative;
    transition: .15s ease;
    cursor: pointer;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card:before, .card:after {
    content: "";
    display: block;
    position: absolute;
    height: 100%;
    width: 100%;
    border: 4px solid #000;
    background-color: #fff;
    transform-origin: center center;
    z-index: -1;
    transition: .15s ease;
    top: 0;
    left: 0;
}

.card:before {
    transform: translatey(-2%) rotate(-6deg);
}

.card:after {
    transform: translatey(2%) rotate(6deg);
}

.image {
    width: 100%;
    border: 4px solid #000;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
}

.image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.project-info p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.project-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #000;
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    margin-top: auto;
    align-self: flex-start;
    transition: transform 0.2s ease;
}

.project-link:hover {
    transform: translateY(-2px);
}

.browser-warning {
    margin-bottom: 4rem;
}

@supports (aspect-ratio: 1 / 1) {
    .browser-warning {
        display: none;
    }
}

@media (max-width: 768px) {
    #projects-container h2 {
        font-size: 2.5rem;
        text-align: center;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}