/* ============================================
   PORTFOLIO MAJESTIC GRID
   ============================================*/

.portfolio-grid-section {
    position: relative;
    padding: var(--space-20) 0;
    z-index: 10;
}

/* Category Filters styling */
.portfolio-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-12);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(147, 51, 234, 0.5);
    color: white;
}

.filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.4);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    /* 20px spacing on all sides effectively */
    position: relative;
    transition: all 0.5s ease;
}

/* Filter Animation Classes */
.project-card.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* --------------------------------
   CARD DESIGN — Premium & Glassy
   -------------------------------- */
.project-card {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(147, 51, 234, 0.3);
}

.project-image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.project-card:hover .project-image {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    inset: 0;
    /* Extra Strong dramatic shadow: Dense at bottom, fading upwards */
    background: linear-gradient(to top,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 0.7) 40%,
            rgba(0, 0, 0, 0) 90%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: var(--space-8);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-4);
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.project-links {
    display: flex;
    gap: var(--space-6);
    justify-content: center;
    width: 100%;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Primary "Visit Live" with Purple Gradient & Glow */
.project-card .project-link:not(.project-details-btn) {
    background: linear-gradient(135deg, #9333EA 0%, #7C3AED 100%);
    color: white;
    border: none;
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.4);
}

.project-card:hover .project-link:not(.project-details-btn) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 25px rgba(147, 51, 234, 0.7);
    filter: brightness(1.1);
}

/* Secondary "Details" — Majestic Matte Style */
.project-details-btn {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.project-details-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* --------------------------------
   MAJESTIC BRIEF (PROJECT MODAL)
   -------------------------------- */
.project-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 0, 20, 0.92);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s var(--ease-out);
}

.project-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sophisticated Background Glow for Modal */
.project-modal-overlay::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.15) 0%, transparent 70%);
    filter: blur(120px);
    z-index: -1;
    opacity: 0.4;
    animation: glowPulse 8s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
}

.project-modal {
    width: 100%;
    max-width: 580px;
    background: rgba(10, 5, 20, 0.8);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    position: relative;
    padding: var(--space-16) var(--space-10) var(--space-12);
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(147, 51, 234, 0.1);
    transform: translateY(40px) scale(0.9);
    transition: all 0.6s var(--ease-spring);
    text-align: center;
    overflow: hidden;
}

.project-modal-overlay.active .project-modal {
    transform: translateY(0) scale(1);
}

.project-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    transition: all 0.3s var(--ease-out);
    z-index: 10;
}

.project-modal-close:hover {
    background: var(--color-primary);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.project-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-10);
    position: relative;
    z-index: 2;
}

/* Reveal Animations */
.modal-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.project-modal-overlay.active .modal-reveal {
    opacity: 1;
    transform: translateY(0);
}

.modal-reveal:nth-child(1) {
    transition-delay: 0.2s;
}

.modal-reveal:nth-child(2) {
    transition-delay: 0.35s;
}

.modal-reveal:nth-child(3) {
    transition-delay: 0.5s;
}

.project-modal-title {
    font-size: 3rem;
    font-weight: 850;
    color: white;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(to bottom, #FFFFFF 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.project-modal-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
    max-width: 100%;
}

.project-modal-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 48px;
    background: linear-gradient(135deg, #9333EA 0%, #7C3AED 100%);
    color: white !important;
    border-radius: var(--radius-full);
    font-weight: 800;
    text-decoration: none;
    transition: all 0.4s var(--ease-spring);
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.4);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

.project-modal-link:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 0 35px rgba(147, 51, 234, 0.6);
}

@media (max-width: 576px) {
    .portfolio-filters {
        gap: var(--space-2);
        margin-bottom: var(--space-8);
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .project-links {
        flex-direction: column;
        gap: 12px;
    }

    .project-link {
        width: 100%;
        justify-content: center;
    }

    .project-modal-title {
        font-size: 2.25rem;
    }

    .project-modal {
        padding: var(--space-20) var(--space-6) var(--space-12);
    }
}