.projects-page {
    background: var(--color-bg);
}

.projects-intro {
    padding: 6rem 0 3rem;
    background: var(--color-bg);
}

.projects-intro h1 {
    font-size: clamp(3rem, 7vw, 5.8rem);
    margin-bottom: 1rem;
}

.projects-intro p {
    max-width: 680px;
    color: var(--color-text-muted);
    font-size: 1.125rem;
}

.project-section {
    padding: 5rem 0;
    border-top: 1px solid rgba(19, 40, 71, 0.08);
}

.project-section:nth-child(even) {
    background: #f7f7f7;
}

.project-section-header {
    display: grid;
    grid-template-columns: minmax(240px, 0.45fr) minmax(280px, 0.55fr);
    gap: 2rem;
    align-items: end;
    margin-bottom: 2rem;
}

.project-section h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 0;
}

.project-section p {
    max-width: 560px;
    margin-bottom: 0;
    color: var(--color-text-muted);
}

.project-carousel {
    position: relative;
}

.carousel-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(320px, 42%);
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    height: 360px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--color-surface);
    scroll-snap-align: start;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.07);
    transition: 0.7s;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.carousel-empty {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-weight: 700;
    text-align: center;
    padding: 2rem;
}

.carousel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid var(--color-alt);
    background: transparent;
    color: var(--color-alt);
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.carousel-btn:hover {
    background: var(--color-alt);
    color: #fff;
    transform: translateY(-3px);
}

#mediaViewer{
    background-color: #000a;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    z-index: 1500;
    backdrop-filter: blur(7px);
    display: flex;
    justify-content: center;
    align-items: center;
    display: none;
}

#mediaViewer img,
#mediaViewer video{
    width: 80vw;
    height: calc(100vh - 20px);
    border-radius: 10px;
    object-fit: contain;
}

#mediaViewer svg{
    background-color: #fff;
    border-radius: 50%;
    padding: 5px;
    width:  30px;
    height: 30px;
    position: absolute;
    top: 10px;
    right: 10px;
}

@media (max-width: 992px) {
    .project-section-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .carousel-track {
        grid-auto-columns: minmax(280px, 78%);
    }

    .carousel-slide {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .projects-intro {
        padding: 4rem 0 2rem;
    }

    .project-section {
        padding: 3.5rem 0;
    }

    .carousel-track {
        grid-auto-columns: 88%;
    }

    .carousel-slide {
        height: 240px;
        border-radius: 16px;
    }
}