/* Projects Section Container */
#projects-fan {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: transparent;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 80px;
    font-family: 'Google Sans', sans-serif;
    color: #fff;
}

/* Grid Background Effect */
/* Grid Background Effect removed to match homepage */
#projects-fan::before {
    display: none;
}

/* Header */
.projects-header {
    text-align: center;
    z-index: 2;
    margin-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease-out forwards;
}

.projects-header h2 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, #a5a5a5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    padding-bottom: 0.1em;
    padding-top: 0.1em;
}

.projects-header .subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Cards Container (The Fan) */
.cards-container {
    position: relative;
    width: 100%;
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    /* Crucial for 3D effect */
    z-index: 2;
    margin-top: 40px;
}

/* Individual Card */
.project-card {
    position: absolute;
    width: 320px;
    height: 480px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
}

/* Card Content interactions */
.project-card .card-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
    z-index: 2;
    opacity: 1;
    transition: opacity 0.3s;
}

/* Active/Hover States */
.project-card.active {
    z-index: 10 !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.project-card:not(.active) {
    /* Styles handled by JS for transform, but here defining fade */
    filter: brightness(0.6) blur(1px);
}

.playdate-inner {
    background-size: 150% !important;
    background-position: calc(50% + 25px) center !important;
    /* Scale up the gaming console image to match reference */
}

/* Hover Glint/Glow */
.project-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

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

/* Card Text */
.card-content {
    transform: translateY(10px);
    transition: transform 0.3s ease-out;
}

.project-card.active .card-content {
    transform: translateY(0);
}

.category-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.project-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.1;
}

.punchline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    margin: 0;
    line-height: 1.4;
    max-width: 90%;
}

/* Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.project-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 80%;
    max-width: 1000px;
    height: 80%;
    background: #111;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 40px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    z-index: 10;
}

.modal-close:hover {
    color: #fff;
}

/* Modal Details */
.modal-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-image-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.modal-img-placeholder {
    width: 100%;
    height: 300px;
    background: #222;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.modal-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.modal-subtitle {
    font-size: 1.25rem;
    color: #aaa;
    margin-bottom: 2rem;
    font-weight: 300;
}

.modal-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.tag {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 0.9rem;
}

.modal-desc {
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 2rem;
}

.view-project-btn {
    padding: 15px 30px;
    background: #fff;
    color: #000;
    text-align: center;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s;
    align-self: start;
}

.view-project-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cards-container {
        height: 50vh;
        perspective: 800px;
    }

    .project-card {
        width: 260px;
        height: 380px;
    }

    .projects-header h2 {
        font-size: 2.5rem;
    }

    .modal-content {
        grid-template-columns: 1fr;
        padding: 20px;
        width: 95%;
        height: 90%;
    }

    .modal-image-gallery {
        order: 2;
    }

    .modal-right {
        order: 1;
    }
}

/* View All Button */
.view-all-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.view-all-btn:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* Navigation Buttons */
.projects-nav-wrapper {
    position: relative;
    width: 100%;
    margin-top: 40px;
}

.projects-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border-radius: 50%;
    /* Circle for this section */
}

.projects-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.projects-nav-btn.prev {
    left: 40px;
}

.projects-nav-btn.next {
    right: 40px;
}

/* Ensure container doesn't overflow buttons too much */
.cards-container {
    width: calc(100% - 200px);
    margin: 0 auto;
}

@media (max-width: 768px) {
    .projects-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .projects-nav-btn.prev {
        left: 10px;
    }

    .projects-nav-btn.next {
        right: 10px;
    }

    .cards-container {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}