/* =============================================================
   PORTFOLIO SECTION — v2
   Changes:
   - Section header: < project 01 /> style (matches resume/skills)
   - Blue-gray real glass cards with blur
   - Larger mockup image (visual first on desktop)
   - Short description + "Read More" expand
   - Tech stack bubble pills (like skills section)
   - Mobile: clean flow, no stacking animation bugs
   ============================================================= */

/* ─── SECTION WRAPPER ─── */
.project-wrapper {
    width: 100%;
    padding: 5rem 5%;
    overflow: hidden;
}

/* ─── SECTION HEADER: < project 01 /> style ─── */
.portfolio-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 8%;
    margin-bottom: 50px;
    font-family: 'Fira Code', 'Courier New', monospace;
}

.portfolio-section-header .ps-tag {
    color: #00d4ff;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 400;
    opacity: 0.85;
}

.portfolio-section-header .ps-title {
    color: #ffffff;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 500;
    letter-spacing: -0.5px;
    font-family: 'Fira Code', 'Courier New', monospace;
}

.portfolio-section-header .ps-num {
    color: rgba(0, 212, 255, 0.55);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

@media (max-width: 768px) {
    .portfolio-section-header { margin-left: 20px; }
}

/* ─── STACK CONTAINER ─── */
.project-container.stack-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding-bottom: 50vh;
}

/* ─── GLASS CARD ─── */
.project-card.stack-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 88%;
    max-width: 1050px;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 10vh;
    will-change: filter, transform;
    filter: brightness(1);

    /* Real glass effect — blue-gray palette */
    background:
        linear-gradient(
            135deg,
            rgba(8, 18, 38, 0.82) 0%,
            rgba(12, 28, 55, 0.75) 40%,
            rgba(5, 15, 32, 0.88) 100%
        );
    backdrop-filter: blur(24px) saturate(1.6) brightness(1.1);
    -webkit-backdrop-filter: blur(24px) saturate(1.6) brightness(1.1);
    border: 1px solid rgba(100, 160, 220, 0.22);
    box-shadow:
        0 2px 0 rgba(120, 180, 255, 0.18) inset,    /* top glass edge */
        0 -1px 0 rgba(0, 0, 0, 0.5) inset,          /* bottom depth */
        1px 0 0 rgba(80, 140, 200, 0.1) inset,       /* left edge */
        -1px 0 0 rgba(0, 0, 0, 0.3) inset,           /* right depth */
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 100, 200, 0.06);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Top shimmer line */
.project-card.stack-card::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100, 200, 255, 0.5), transparent);
    pointer-events: none;
    z-index: 2;
}

/* Subtle inner glow */
.project-card.stack-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 20% -10%,
        rgba(0, 150, 255, 0.07) 0%,
        transparent 55%
    );
    pointer-events: none;
    z-index: 1;
}

.project-card.stack-card:hover {
    border-color: rgba(0, 212, 255, 0.38);
    box-shadow:
        0 2px 0 rgba(120, 180, 255, 0.25) inset,
        0 -1px 0 rgba(0, 0, 0, 0.5) inset,
        1px 0 0 rgba(80, 140, 200, 0.15) inset,
        -1px 0 0 rgba(0, 0, 0, 0.3) inset,
        0 35px 80px rgba(0, 0, 0, 0.6),
        0 0 50px rgba(0, 150, 255, 0.12);
}

/* z-index stacking order */
.project-card.stack-card:nth-child(1)  { z-index: 1; }
.project-card.stack-card:nth-child(2)  { z-index: 2; }
.project-card.stack-card:nth-child(3)  { z-index: 3; }
.project-card.stack-card:nth-child(4)  { z-index: 4; }
.project-card.stack-card:nth-child(5)  { z-index: 5; }
.project-card.stack-card:nth-child(6)  { z-index: 6; }
.project-card.stack-card:nth-child(7)  { z-index: 7; }
.project-card.stack-card:nth-child(8)  { z-index: 8; }
.project-card.stack-card:nth-child(9)  { z-index: 9; }
.project-card.stack-card:nth-child(10) { z-index: 10; }

/* ─── CARD INNER LAYOUT ─── */
.project-card__inner {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}


/* Desktop: image right, content left */
@media (min-width: 1024px) {
    .project-card__inner {
        flex-direction: row;
        min-height: 55vh;
    }
}

@media (min-width: 1024px) {
    .project-card__visual {
        flex: 1; /* Give the text side more room, shrinking the image side */
    }
    .mockup-img {
        object-fit: contain; /* Shows the full image instead of cropping/zooming */
        background-color: #081226; /* Add a background color if the image doesn't fill the box */
    }
}

/* ─── VISUAL (Image side) ─── */
.project-card__visual {
    flex: 1.4;
    overflow: hidden;
    position: relative;
    min-height: 240px;
}

.mockup-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.6s ease;
    border-radius: 0;
}

.project-card.stack-card:hover .mockup-img {
    transform: scale(1.04);
}

/* Glass overlay on image edge */
.project-card__visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(8, 18, 38, 0.6) 0%,
        transparent 50%
    );
    pointer-events: none;
}

@media (max-width: 1023px) {
    .project-card__visual {
        min-height: 220px;
        max-height: 300px;
    }
    .project-card__visual::after {
        background: linear-gradient(
            180deg,
            transparent 40%,
            rgba(8, 18, 38, 0.7) 100%
        );
    }
}

/* ─── CONTENT (Text side) ─── */
.project-card__content {
    flex: 1;
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

@media (max-width: 1023px) {
    .project-card__content { padding: 28px 24px; }
}

/* Project number label — < project 01 /> style */
.project-card__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.8rem;
    color: #00d4ff;
    opacity: 0.8;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

.project-card__label .pl-tag { opacity: 0.6; }

/* Title */
.project-card__title {
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    color: #ffffff;
    margin-bottom: 14px;
    line-height: 1.15;
    font-weight: 700;
}

/* Description — truncated, expandable */
.project-card__description {
    color: rgba(180, 210, 240, 0.72);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 0;
    /* Clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.4s ease;
}

.project-card__description.is-expanded {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

/* Read More button */
.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #00d4ff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin-top: 10px;
    transition: color 0.3s ease, gap 0.3s ease;
    font-family: inherit;
}

.read-more-btn:hover { color: #ffffff; gap: 10px; }
.read-more-btn .rm-arrow { transition: transform 0.3s ease; }
.read-more-btn.is-expanded .rm-arrow { transform: rotate(180deg); }

/* ─── TECH STACK BUBBLES ─── */
.project-card__tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.tech-bubble {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(0, 100, 200, 0.15);
    border: 1px solid rgba(0, 180, 255, 0.2);
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(150, 210, 255, 0.9);
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.tech-bubble:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.45);
    color: #ffffff;
}

.tech-bubble img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    filter: drop-shadow(0 0 3px rgba(0,212,255,0.3));
}

/* ─── CTA LINK ─── */
.project-card__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #00d4ff;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 24px;
    transition: all 0.35s ease;
    width: fit-content;
}

.project-card__link::after {
    content: '↗';
    transition: transform 0.35s ease;
}

.project-card__link:hover {
    gap: 16px;
    color: #ffffff;
}

.project-card__link:hover::after {
    transform: translate(3px, -3px);
}

/* ─── Z-INDEX fix on card children ─── */
.project-card__content,
.project-card__visual {
    position: relative;
    z-index: 3;
}

/* ─── MOBILE: clean vertical cards ─── */
@media (max-width: 768px) {
    .project-container.stack-container {
        padding-bottom: 50px !important;
        gap: 20px !important;
    }

    .project-card.stack-card {
        width: 93% !important;
        min-height: auto !important;
        margin-bottom: 20px !important;
        transform: none !important;
        filter: none !important;
        border-radius: 18px;
    }

    .project-card__visual {
        max-height: 240px !important;
        min-height: 200px !important;
    }

    .project-card__content {
        padding: 22px 20px !important;
    }

    .project-card__title {
        font-size: 1.3rem !important;
    }

    .project-card__description {
        font-size: 0.88rem !important;
        -webkit-line-clamp: 2;
    }

    .portfolio-section-header {
        margin-left: 20px !important;
    }
}

/* ─── MOBILE ANIMATION: slide up reveal ─── */
@media (max-width: 768px) {
    .project-card.stack-card {
        opacity: 0;
        transform: translateY(40px) !important;
        transition: opacity 0.55s ease, transform 0.55s ease !important;
    }

    .project-card.stack-card.is-visible {
        opacity: 1;
        transform: translateY(0) !important;
    }
}