.projects-section {
    padding: 60px 0 100px;
    position: relative;
}

/* Filter Buttons */
.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: #fff;
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px -5px rgba(56, 189, 248, 0.4);
}

.projects-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.project-card-modern {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    height: 400px;
    /* Fixed height for consistency */
    display: flex;
    flex-direction: column;
}

/* 1. Image Area */
.project-image-box {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.project-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card-modern:hover .project-image-box img {
    transform: scale(1.05);
    filter: brightness(0.4) blur(2px);
    /* Darken & Blur on hover */
}

/* Category Tag */
.project-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(56, 189, 248, 0.9);
    /* Primary color */
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 2. Content Overlay (Hover Reveal) */
.project-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(13, 19, 33, 0.95) 10%, transparent 100%);
    opacity: 0;
    /* Hidden by default */
    transform: translateY(20px);
    transition: all 0.4s ease;
}

/* Show content on hover */
.project-card-modern:hover .project-content-overlay {
    opacity: 1;
    transform: translateY(0);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.project-desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    /* Light gray */
    margin-bottom: 20px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tech Stack Tags */
.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.tech-tag {
    font-size: 0.8rem;
    color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Action Buttons */
.project-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-view {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
}

.btn-view:hover {
    background: transparent;
    color: var(--primary);
}

.btn-github {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-github:hover {
    background: #fff;
    color: var(--bg-color);
    /* Dark text on white */
}

/* Responsive */
@media (max-width: 768px) {
    .projects-grid-modern {
        grid-template-columns: 1fr;
    }

    .project-card-modern {
        height: auto;
        min-height: 450px;
    }

    /* On mobile, show content always or partially? For simplicity, we keep hover behavior or slight overlay. 
       Better for UX: Show content partially. But for now matching desktop hover request. */
    .project-content-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(13, 19, 33, 1) 40%, transparent 100%);
        transform: translateY(0);
    }

    .project-image-box img {
        filter: brightness(0.6);
    }
}

/* Sticky Title on Image Bottom */
.project-sticky-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 20px;
    background: linear-gradient(to top, rgba(13, 19, 33, 0.95), transparent);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    z-index: 3;
    transition: opacity 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.project-card-modern:hover .project-sticky-title {
    opacity: 0;
}