
#portfolio {
    min-height: 100vh;
    padding: var(--section-padding) 0;
    background: linear-gradient(135deg, var(--bg-color) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

#portfolio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(var(--primary-color-rgb), 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(var(--accent-color-rgb), 0.05) 0%, transparent 50%);
    pointer-events: none;
}

#portfolio .portfolio-title {
    font-family: var(--font-special);
    background: linear-gradient(to right, var(--text-color), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.portfolio-title span {
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#portfolio .portfolio-text {
    color: var(--text-light);
    font-size: 1.1rem;
    margin: 1.5rem auto 0;
    text-align: center;
    font-family: var(--font-body);
    line-height: 1.6;
    max-width: 700px;
    font-weight: 500;
    position: relative;
    z-index: 2;
}







/* Project Filter */
.project-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin: 4rem 0 3rem;
    position: relative;
    z-index: 2;
}

.filter-item {
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    color: var(--text-light);
    background: rgba(var(--bg-color-rgb), 0.8);
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    font-family: var(--font-body);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.filter-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-color-rgb), 0.1), transparent);
    transition: left 0.5s ease;
}

.filter-item:hover::before {
    left: 100%;
}

.active-filter {
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: 1px solid var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    animation: activeFilterPulse 2s ease-in-out infinite;
}

@keyframes activeFilterPulse {
    0%, 100% {
        box-shadow: var(--shadow-md);
    }
    50% {
        box-shadow: var(--shadow-lg), 0 0 20px rgba(var(--primary-color-rgb), 0.3);
    }
}

.filter-item:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #FFFFFF;
    border: 1px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}



/* Project Grid */
.project {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 0 auto;
    max-width: var(--content-max-width);
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.project-box {
    background: rgba(var(--bg-color-rgb), 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(var(--primary-color-rgb), 0.1);
    border-radius: 20px;
    height: 320px;
    transition: var(--transition-normal);
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.project-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.05), rgba(var(--accent-color-rgb), 0.05));
    opacity: 0;
    transition: var(--transition-normal);
    z-index: 1;
}

.project-box:hover {
    box-shadow: var(--shadow-2xl);
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(var(--primary-color-rgb), 0.2);
}

.project-box:hover::before {
    opacity: 1;
}

.project-box.show {
    display: block;
    animation: projDisplay 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.project-box.hide {
    animation: projHide 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes projDisplay {
    0% {
        transform: translateY(30px) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes projHide {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
        display: none;
    }
}






.project-preview {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    border-radius: 20px;
    z-index: 2;
}

.project-preview .project-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: var(--transition-slow);
    border-radius: 20px;
}

.project-preview:hover .project-img {
    transform: scale(1.1);
}

.project-preview .info-hover {
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(var(--primary-color-rgb), 0.3));
    backdrop-filter: blur(10px);
    z-index: 3;
    height: 100%;
    width: 100%;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 20px;
}

.project-preview:hover .info-hover {
    opacity: 1;
}



.info-hover .field {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-light);
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateY(-20px);
    transition: var(--transition-normal);
    opacity: 0;
    margin-bottom: 0.5rem;
}

.info-hover .project-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
    font-family: var(--font-heading);
    text-transform: capitalize;
    transform: translateY(20px);
    transition: var(--transition-normal);
    opacity: 0;
    line-height: 1.3;
}

.info-hover .link {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    height: 60px;
    width: 60px;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-normal);
    opacity: 0;
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.link .icon {
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #FFFFFF;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: var(--shadow-xl);
}

.link:hover .icon {
    transform: scale(1.1);
}

.project-preview:hover .info-hover .field {
    transform: translateY(0);
    opacity: 1;
}

.project-preview:hover .info-hover .project-name {
    transform: translateY(0);
    opacity: 1;
}

.project-preview:hover .info-hover .link {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}











@media screen and (max-width: 1200px) {
    #portfolio {
        padding: 4rem 0;
    }

    #portfolio .portfolio-title {
        font-size: 2.2rem;
    }

    #portfolio .portfolio-text {
        font-size: 1rem;
        margin: 1.2rem auto 0;
        max-width: 600px;
        padding: 0 1rem;
    }

    .project {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 0 1.5rem;
    }

    .project-box {
        height: 280px;
    }
}

@media screen and (max-width: 768px) {
    #portfolio {
        padding: 3rem 0;
    }

    #portfolio .portfolio-title {
        font-size: 2rem;
    }

    #portfolio .portfolio-text {
        font-size: 0.9rem;
        margin: 1rem auto 0;
        padding: 0 1rem;
    }

    .project-filter {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin: 1.5rem 0 2rem;
        padding: 0 1rem;
    }

    .filter-item {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .project {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .project-box {
        height: 250px;
    }

    .info-hover {
        padding: 1rem;
    }

    .info-hover .project-name {
        font-size: 1.1rem;
    }

    .link {
        height: 50px;
        width: 50px;
    }

    .link .icon {
        font-size: 1rem;
    }
}

@media screen and (max-width: 480px) {
    #portfolio {
        padding: 2rem 0;
    }

    #portfolio .portfolio-title {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }

    #portfolio .portfolio-text {
        font-size: 0.85rem;
        margin: 1rem auto 0;
        padding: 0 0.75rem;
    }

    .project-filter {
        gap: 0.375rem;
        margin: 1rem 0 1.5rem;
        padding: 0 0.75rem;
    }

    .filter-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
        border-radius: 8px;
    }

    .project {
        gap: 1rem;
        padding: 0 0.75rem;
    }

    .project-box {
        height: 220px;
        border-radius: 16px;
    }

    .project-preview,
    .project-preview .project-img,
    .info-hover {
        border-radius: 16px;
    }

    .info-hover {
        padding: 0.75rem;
    }

    .info-hover .field {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .info-hover .project-name {
        font-size: 1rem;
    }

    .link {
        height: 45px;
        width: 45px;
    }

    .link .icon {
        font-size: 0.9rem;
    }
}