/* WORK SECTION: REWRITTEN - "THE CINEMA WALL" */
.work-section {
    position: relative;
    padding: 100px 5%;
    background-color: #030303;
    z-index: 20;
    min-height: 100vh;
}

/* SECTION HEADER */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.header-title-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    align-items: flex-start;
}

.subtitle {
    font-family: var(--font-mono);
    color: var(--color-primary);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subtitle::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-primary);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: #fff;
    line-height: 0.9;
    text-transform: uppercase;
}

/* FILM STRIP DECORATION */
.film-strip-deco {
    display: flex;
    gap: 5px;
    opacity: 0.3;
}

.film-hole {
    width: 20px;
    height: 30px;
    background: #222;
    border-radius: 2px;
}

/* PROJECT GRID - ROBUST LAYOUT */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    width: 100%;
}

/* PROJECT CARD */
.project-card {
    position: relative;
    background: #0a0a0a;
    border-radius: 4px;
    /* Slight roundness */
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Aspect Ratio Enforcer */
.card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    /* Standard Video Format */
    background: #111;
    overflow: hidden;
}

/* Placeholder Gradient if no image */
.media-placeholder {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.6s ease;
}

.project-card:hover .media-placeholder {
    transform: scale(1.05);
}

.placeholder-text {
    font-family: var(--font-heading);
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.03);
    font-weight: 900;
}

/* OVERLAY INFO (Hidden until hover) */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .card-overlay {
    opacity: 1;
}

.project-meta {
    transform: translateY(20px);
    transition: transform 0.3s ease 0.1s;
}

.project-card:hover .project-meta {
    transform: translateY(0);
}

.project-category {
    font-family: var(--font-mono);
    color: var(--color-primary);
    font-size: 0.8rem;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.project-name {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 2rem;
    margin: 0;
    line-height: 1;
}

/* CINEMA FOCUS HOVER EFFECT */
.project-grid:hover .project-card {
    opacity: 0.3;
    filter: grayscale(100%) blur(2px);
    transition: all 0.5s ease;
}

.project-grid .project-card:hover {
    opacity: 1;
    filter: grayscale(0%) blur(0px);
    transform: scale(1.05) translateY(-10px);
    z-index: 10;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--color-primary);
}

/* PLAY BUTTON ICON ANIMATION */
.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    width: 70px;
    height: 70px;
    background: rgba(var(--color-primary-rgb), 0.9);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.play-icon-overlay svg {
    width: 30px;
    height: 30px;
    fill: #000;
    margin-left: 4px;
    /* Optical center */
}

.project-card:hover .play-icon-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .section-title {
        font-size: 2.5rem;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    /* Disable focus effect on touch devices */
    .project-grid:hover .project-card {
        opacity: 1;
        filter: none;
    }

    .card-overlay {
        opacity: 1;
        /* Always show info on mobile */
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
        padding: 1.5rem;
    }

    .play-icon-overlay {
        display: none;
    }
}

/* LIGHTBOX MODAL */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease;
    padding: 2rem;
}

.project-modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    max-width: 90%;
    max-height: 80vh;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    background: transparent;
}

.modal-close:hover {
    background: var(--color-primary);
    color: #000;
    border-color: var(--color-primary);
}