/* HERO SECTION */
.hero-portfolio {
    position: relative;
    height: 600px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background-color: var(--color-bg-slate);
}

.hero-portfolio .hero-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    z-index: 1;
}

.hero-portfolio .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 12, 0.95) 0%, 
    rgba(10, 10, 12, 0.3) 40%, transparent 80%);
    z-index: 2;
}

.hero-content-layer {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem 1.5rem;
}

.hero-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-kicker {
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* GALLERY SECTION */
.gallery-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 1.5rem 7rem 1.5rem;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3rem;
}

.gallery-title {
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
    letter-spacing: -0.02em;
}

.gallery-link {
    color: var(--ruby-main);
    font-size: 1.25rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.gallery-link:hover {
    color: var(--ruby-hover);
}

/* GRID SYSTEM */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1.5rem;
}

/* CARD SYSTEM */
.portfolio-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
    will-change: transform, opacity;
}

/* 1. SHRINK CARD THUMBNAILS */
.card-thumb-wrapper {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 20px;
    overflow: hidden;
    background-color: #e5e5ea;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    will-change: transform;
    position: relative;
}

/* Hover elevation effect */
.portfolio-card:hover .card-thumb-wrapper {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* 2. IMAGE CONTAINMENT */
.card-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card-thumb-wrapper img.is-loaded {
    opacity: 1;
}

/* 3. CARD TEXT TYPOGRAPHY & DARK COLORS */
.card-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.25rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.3;
}

.card-tagline {
    font-size: 0.875rem;
    font-weight: 400;
    color: #515154;
    margin: 0;
    line-height: 1.4;
}

.card-meta {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ruby-main, #a11d21);
    margin-top: 0.15rem;
}

/* PLACEHOLDER SKELETONS */
.gallery-section .skeleton {
    background-color: #e8e8ed;
    background-image: linear-gradient(
        90deg,
        #e8e8ed 0%,
        #f5f5f7 50%,
        #e8e8ed 100%
    );
    background-size: 200% 100%;
}

.skeleton-text {
    border-radius: 4px;
}

.skeleton-title {
    height: 18px;
    width: 70%;
    margin-bottom: 2px;
}

.skeleton-tagline {
    height: 14px;
    width: 90%;
}

.skeleton-meta {
    height: 12px;
    width: 50%;
    margin-top: 4px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 734px) {
    .hero-portfolio{
        height: 500px;
    }
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .portfolio-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 1.5rem 1rem; 
    }
    .hero-title { 
        font-size: 1.75rem;
        font-weight: 600;
    }
    .gallery-section{
        padding: 2rem 1.5rem 5rem 1.5rem;
    }
    .gallery-title { 
        font-size: 1.75rem;
        font-weight: 600;
    }
    .gallery-link { 
        font-size: 1.25rem; 
    }
}

@media (max-width: 480px) {
    .portfolio-grid { 
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem 0.75rem;
    }

    .card-thumb-wrapper {
        border-radius: 8px;
    }
}