/* ═══ PROJECT CARD ANIMATIONS ═══ */

/* 1. Scroll Reveal - Initial state */
.rv {
    opacity: 0;
    transform: translateY(50px);
}

/* 2. Category Card & Project Card */
.proj-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    aspect-ratio: 3/4;
}

.proj-card .proj-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: transform 0.6s ease-out;
}

.proj-card .proj-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 45%, transparent 100%);
    transition: background 0.5s ease;
}

.proj-card .proj-card-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 28px 24px;
    transition: justify-content 0.5s cubic-bezier(.16,1,.3,1), align-items 0.5s cubic-bezier(.16,1,.3,1);
}

.proj-card .proj-card-title {
    color: #fff;
    font-size: clamp(2.2rem, 2.8vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    transform: scale(1);
    transform-origin: bottom left;
    text-align: left;
    transition: transform 0.5s cubic-bezier(.16,1,.3,1), text-shadow 0.5s ease, text-align 0.3s;
    line-height: 1.1;
}

.proj-card .proj-card-desc {
    color: rgba(255,255,255,.85);
    font-size: .82rem;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(16px);
    margin-top: 0;
    transition: opacity 0.45s ease 0.1s, transform 0.45s ease 0.1s, margin-top 0.45s ease 0.1s;
}

.proj-card .proj-card-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.proj-card .proj-card-badge {
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: .04em;
}

.proj-card .proj-card-details {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: rgba(255,255,255,.7);
    font-size: .78rem;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.2);
    justify-content: flex-start;
    transition: justify-content 0.4s ease, border-color 0.4s ease;
}

/* Desktop Hover Only */
@media (hover: hover) and (pointer: fine) {
    .proj-card:hover .proj-card-img {
        transform: scale(1.08);
    }

    .proj-card:hover .proj-card-overlay {
        background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.45) 50%, rgba(0,0,0,.20) 100%);
    }

    .proj-card:hover .proj-card-content {
        justify-content: center;
        align-items: center;
    }

    .proj-card:hover .proj-card-title {
        transform: scale(1.1);
        font-weight: 900;
        text-align: center;
        text-shadow: 0 2px 16px rgba(0,0,0,.5), 0 6px 30px rgba(0,0,0,.4);
    }

    .proj-card:hover .proj-card-desc {
        opacity: 1;
        transform: translateY(0);
        margin-top: 10px;
        text-align: center;
    }

    .proj-card:hover .proj-card-badges {
        opacity: 0;
        position: absolute;
    }

    .proj-card:hover .proj-card-details {
        justify-content: center;
        border-top-color: rgba(45,110,181,.4);
    }
}

/* Mobile: no hover effects */
@media (pointer: coarse) {
    .proj-card .proj-card-desc {
        display: none;
    }
    .proj-card .proj-card-content {
        justify-content: flex-end !important;
        align-items: flex-start !important;
    }
}

/* ═══ GALLERY SLIDER ANIMATIONS ═══ */

.gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 0;
    transition: opacity 0.7s ease;
}
.gallery-slide.active {
    opacity: 1;
    z-index: 1;
}

.gallery-bg {
    position: absolute;
    inset: -20px;
    filter: blur(30px) brightness(0.7);
    transform: scale(1.1);
    background-size: cover;
    background-position: center;
    transition: opacity 0.7s ease;
}

.gallery-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    filter: grayscale(1);
    transition: all 0.4s cubic-bezier(.16,1,.3,1);
}
.gallery-thumb:hover {
    filter: grayscale(0);
    transform: scale(1.05);
}
.gallery-thumb.active {
    border-color: #2D6EB5;
    opacity: 1;
    transform: scale(1.1);
    filter: grayscale(0);
    box-shadow: 0 4px 20px rgba(45,110,181,.4);
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(0,0,0,.3);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-arrow:hover {
    background: #2D6EB5;
    border-color: #2D6EB5;
}
.gallery-arrow.left { left: 16px; }
.gallery-arrow.right { right: 16px; }

.gallery-progress {
    height: 3px;
    background: #2D6EB5;
    width: 0%;
    transition: width 0.3s linear;
}
.gallery-progress.animating {
    transition: width 4s linear;
    width: 100%;
}

/* Responsive */
@media (max-width: 1024px) {
    .proj-card .proj-card-title { font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
}
@media (max-width: 768px) {
    .proj-card { aspect-ratio: 4/5; }
    .proj-card .proj-card-title { font-size: clamp(1.1rem, 4vw, 1.5rem); }
    .proj-card .proj-card-badges .proj-card-badge { font-size: .62rem; }
    .proj-card .proj-card-details { font-size: .72rem; }
    .gallery-thumb { width: 56px; height: 40px; }
}
@media (max-width: 480px) {
    .proj-card { aspect-ratio: 3/4; }
    .proj-card .proj-card-title { font-size: clamp(.9rem, 3.5vw, 1.1rem); }
}
