/* =========================================
   Premium Projects Page Architecture
   ========================================= */

/* Cursor Overrides to stay above Modals */
#cursor-dot { z-index: 99999 !important; }
#cursor-outline { z-index: 99998 !important; }

.projects-page {
    padding-top: 120px;
    min-height: 100vh;
    background-color: var(--bg-dark);
    position: relative;
    overflow-x: hidden;
}

/* Ambient Background Lighting */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}
.glow-1 {
    top: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 70%);
}
.glow-2 {
    bottom: -10%;
    left: -10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.1) 0%, transparent 70%);
}

.projects-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 8% 8rem 8%;
    position: relative;
    z-index: 2;
}

/* Header Styling */
.projects-header {
    text-align: center;
    margin-bottom: 5rem;
}

.projects-header .subtitle {
    color: var(--accent-primary);
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.projects-header h1 {
    font-size: clamp(3rem, 6vw, 5.5rem);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.text-accent {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.projects-header .description {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Category Filters */
.project-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 5rem;
}

.filter-btn {
    background: rgba(20, 20, 20, 0.5);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: none; 
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 240, 255, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.filter-btn.active {
    background: var(--text-primary);
    color: var(--bg-dark);
    border-color: var(--text-primary);
    box-shadow: var(--glow-primary);
}

/* Projects Grid - Asymmetrical Editorial Layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2.5rem;
}

/* Base Card Architecture */
.project-card {
    grid-column: span 6; /* Default half width */
    height: 450px;
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden; 
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-end; 
    padding: 2rem;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.5s;
    cursor: none;
}

/* Featured Card overrides */
.project-card.featured {
    grid-column: span 12; /* Full width */
    height: 600px;
    padding: 3rem;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), var(--glow-secondary);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Image Background Setup */
.card-image-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.card-image-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.project-card:hover .card-image-bg img {
    transform: scale(1.08);
}

/* Cinematic Gradient Overlay */
.card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(3, 3, 3, 0.95) 0%, rgba(3, 3, 3, 0.4) 50%, transparent 100%);
    transition: background 0.5s ease;
}

.project-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(3, 3, 3, 0.98) 0%, rgba(3, 3, 3, 0.6) 60%, rgba(0, 240, 255, 0.1) 100%);
}

/* Glassmorphism Content Box */
.card-content-glass {
    position: relative;
    z-index: 2;
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-md);
    padding: 2rem;
    width: 100%;
    max-width: 600px; 
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), background 0.5s ease, opacity 0.5s ease;
    transform: translateY(10px);
}

.project-card:hover .card-content-glass {
    transform: translateY(0);
    background: rgba(20, 20, 20, 0.8);
    border-color: rgba(0, 240, 255, 0.2);
}

/* -------------------------------------------------------------
   SPECIAL FX: Full Page Scroll Hover (for Prime Advert)
   ------------------------------------------------------------- */
.full-page-scroll-card .card-image-bg img {
    object-position: top center;
    transition: object-position 4s ease-in-out, filter 0.5s ease, transform 1s ease;
}

.full-page-scroll-card:hover .card-image-bg img {
    transform: scale(1.02); 
    object-position: bottom center; 
    filter: brightness(0.9); 
}

.full-page-scroll-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 20%);
}

.full-page-scroll-card:hover .card-content-glass {
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
}

/* -------------------------------------------------------------
   MODAL POP-UP STYLES
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 10000; /* NOTE: Cursor z-index is higher */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-darker);
    border: 1px solid var(--surface-border);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 3.5rem;
    position: relative;
    transform: translateY(50px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 40px 80px rgba(0,0,0,0.9), 0 0 40px rgba(0, 240, 255, 0.1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: var(--text-muted);
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer !important;
    transition: all 0.3s;
}

.modal-close:hover {
    color: var(--accent-error);
    border-color: var(--accent-error);
    background: rgba(255, 51, 102, 0.1);
    transform: rotate(90deg);
}

.modal-badge {
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.8rem;
}

.modal-header h2 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.1;
}

.modal-role {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-family: 'Space Grotesk', sans-serif;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 2rem;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.modal-body h4 {
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 1.2rem;
    font-size: 1.3rem;
}

.modal-body ul {
    list-style: none;
    margin-bottom: 2rem;
}

.modal-body ul li {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-left: 1.8rem;
    position: relative;
    line-height: 1.6;
}

.modal-body ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-size: 1.2rem;
    top: -2px;
}

.modal-body ul li strong {
    color: var(--text-primary);
}

.modal-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--surface-border);
}

.modal-tech-stack span {
    background: rgba(0, 240, 255, 0.05);
    color: var(--accent-primary);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(0, 240, 255, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* ------------------------------------------------------------- */

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.card-tags span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-primary);
    background: rgba(0, 240, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    font-weight: 600;
}

.card-content-glass h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.featured .card-content-glass h3 {
    font-size: 2.5rem;
}

.card-content-glass p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Action Buttons inside Card */
.card-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-fancy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.8rem 1.5rem;
    background: var(--text-primary);
    color: var(--bg-dark);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: none; 
    outline: none;
    transition: all 0.3s ease;
}

.btn-fancy:hover {
    background: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}

.btn-fancy.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
}

.btn-fancy.secondary:hover {
    border-color: var(--text-primary);
    box-shadow: none;
}

.btn-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
    transform: translateY(-3px) scale(1.05);
}

/* Nav Back Link Adjustment */
.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary) !important;
    font-family: 'Space Grotesk', sans-serif;
}
.back-link:hover {
    color: var(--accent-primary) !important;
}

/* Base CSS Animations for Entry */
.animate-fade-up {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeUp 1s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   COMPREHENSIVE MOBILE RESPONSIVENESS
   ========================================= */

@media (pointer: coarse) {
    .cursor-dot, .cursor-outline {
        display: none !important;
    }
    * {
        cursor: auto !important;
    }
    .filter-btn, .project-card, .btn-fancy {
        cursor: pointer !important;
    }
}

@media (max-width: 1024px) {
    .project-card, .project-card.featured {
        grid-column: span 12; 
        height: auto;
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .projects-container {
        padding: 1rem 5% 5rem 5%;
    }
    .projects-header {
        margin-bottom: 3rem;
    }
    .projects-header h1 {
        font-size: 2.8rem;
    }
    .project-filters {
        gap: 0.5rem;
        margin-bottom: 3rem;
    }
    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    .projects-grid {
        gap: 1.5rem;
    }
    .project-card, .project-card.featured {
        padding: 1rem;
        min-height: 450px;
    }
    .card-content-glass {
        padding: 1.5rem;
        max-width: 100%;
    }
    .featured .card-content-glass h3 {
        font-size: 1.8rem;
    }
    
    .full-page-scroll-card:hover .card-content-glass {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        background: rgba(20, 20, 20, 0.9); 
    }

    .card-actions {
        flex-direction: column;
        width: 100%;
    }
    .btn-fancy {
        width: 100%;
        justify-content: center;
    }
    .btn-icon {
        width: 100%;
        border-radius: 50px;
        height: auto;
        padding: 0.8rem 1.5rem;
        justify-content: center;
    }
    .btn-icon::after {
        content: attr(title); 
        margin-left: 10px;
        font-family: 'Inter', sans-serif;
        font-size: 0.9rem;
        font-weight: 600;
    }

    /* Modal Mobile Adjustments */
    .modal-content {
        padding: 2.5rem 1.5rem;
        width: 95%;
    }
    .modal-header h2 {
        font-size: 2rem;
    }
    .modal-role {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .projects-header h1 {
        font-size: 2.2rem;
    }
    .projects-header .subtitle {
        font-size: 0.75rem;
    }
    .card-content-glass h3 {
        font-size: 1.5rem;
    }
    .card-content-glass p {
        font-size: 0.9rem;
    }
    .card-tags span {
        font-size: 0.65rem;
        padding: 0.3rem 0.8rem;
    }
}