.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 300px;
    gap: 24px;
    grid-auto-flow: dense;
}

.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.35s ease, box-shadow 0.35s ease, filter 0.35s ease, opacity 0.35s ease;
}

.bento-col-2 {
    grid-column: span 2;
}

.bento-row-2 {
    grid-row: span 2;
}

.projects-grid:hover .project-card:not(:hover) {
    opacity: 0.6;
    filter: blur(2px) grayscale(0.3);
    transform: scale(0.98);
}

.projects-grid .project-card:hover {
    opacity: 1;
    filter: none;
    transform: scale(1.02);
    z-index: 10;
}

@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 260px;
    }

    .bento-col-2 {
        grid-column: span 2;
    }

    .bento-row-2 {
        grid-row: span 2;
    }
}

@media (max-width: 768px) {
    .projects-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .project-card {
        height: 300px;
    }

    .projects-grid:hover .project-card:not(:hover) {
        opacity: 1;
        filter: none;
        transform: none;
    }

    .projects-grid .project-card:hover {
        transform: none;
    }
}

.project-card-content {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    padding: 24px;
    background: rgba(18, 27, 35, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transform: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.project-card:hover .project-card-content {
    background: rgba(18, 27, 35, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
}

.lumina-mini-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 99px;
    
    /* Hidden State (Default) */
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 10px;
    padding-right: 10px;
    border-width: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-card:hover .lumina-mini-tag {
    max-height: 30px;
    opacity: 1;
    margin-bottom: 8px;
    padding-top: 4px;
    padding-bottom: 4px;
    border-width: 1px;
}

.project-card-content p {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-card:hover .project-card-content p {
    max-height: 60px;
    opacity: 1;
    margin-top: 8px;
}

.btn-lumina-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #121B23;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-lumina-circle:hover {
    transform: scale(1.1);
    background: #daff73;
}

.btn-lumina-circle i {
    font-size: 20px;
    transition: transform 0.4s ease;
}

.btn-lumina-circle:hover i {
    transform: rotate(45deg);
}

/* Portfolio Background Effects */
.portfolio-grid-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 80 0 L 0 0 0 80' fill='none' stroke='white' stroke-opacity='0.02' stroke-width='1'/%3E%3Crect x='0' y='0' width='5' height='5' fill='white' fill-opacity='0.05'/%3E%3C/svg%3E");
    background-size: 80px 80px;
    background-repeat: repeat;
    opacity: 0;
    transition: opacity 0.3s ease;
    /* Masking for flashlight effect */
    mask-image: radial-gradient(circle 300px at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle 300px at var(--mouse-x, 50%) var(--mouse-y, 50%), black 0%, transparent 100%);
}

.portfolio-mouse-light {
    background: radial-gradient(circle, rgba(218, 255, 115, 0.12) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: left, top;
}
