/* ── PORTFOLIO HERO ────────────────────────────────────── */
.portfolio-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 100px;
    z-index: 2;
}

.portfolio-title {
    font-size: clamp(4rem, 12vw, 8rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
    font-weight: 900;
}

.portfolio-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0.6;
}

.mouse-icon {
    width: 24px;
    height: 38px;
    border: 2px solid #fff;
    border-radius: 12px;
    position: relative;
}

.mouse-icon::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: #fff;
    border-radius: 2px;
    animation: scrollMouse 1.5s infinite;
}

@keyframes scrollMouse {
    0% { top: 6px; opacity: 1; }
    100% { top: 18px; opacity: 0; }
}

/* ── PORTFOLIO TRACK ARCHITECTURE ──────────────────────── */
.portfolio-track-container {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    /* This container will be pinned by GSAP */
}

/* Morphing Background Layer */
.portfolio-bg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-main); /* Default before morph */
    z-index: 0;
    transition: background-color 0.8s ease;
}

/* Add a subtle vignette over the changing background */
.portfolio-bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(5,5,5,0.7) 100%);
    pointer-events: none;
}

.portfolio-track {
    display: flex;
    height: 100%;
    width: max-content;
    position: relative;
    z-index: 1;
}

.port-slide {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5vw;
    position: relative;
}

.end-spacer {
    width: 100vw;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── SLIDE CONTENT ─────────────────────────────────────── */
.port-slide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.port-content {
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active class added by JS ScrollTrigger */
.port-slide.is-active .port-content {
    opacity: 1;
    transform: translateY(0);
}

.port-meta {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary); /* Will be overridden by JS for accent color */
    margin-bottom: 1rem;
}

.port-project-title {
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.port-desc {
    font-size: 1.15rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
}

.port-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.port-tags span {
    padding: 0.4rem 1rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 30px;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
}

.port-tags span.status-badge {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 0.75rem;
}

.port-tags span.status-badge.live {
    background: rgba(0, 230, 118, 0.1);
    border-color: rgba(0, 230, 118, 0.4);
    color: #00E676;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}

.port-tags span.status-badge.wip {
    background: rgba(255, 189, 46, 0.1);
    border-color: rgba(255, 189, 46, 0.4);
    color: #ffbd2e;
}

.port-btn.btn-outline {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}
.port-btn.btn-outline:hover {
    background: #fff;
    color: #000;
}

/* ── 3D VISUAL MOCKUPS ─────────────────────────────────── */
.port-visual {
    perspective: 1200px;
    width: 100%;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9) translateY(40px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.2s; /* Lag behind text */
}

.port-slide.is-active .port-visual {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.mockup-window {
    width: 100%;
    max-width: 800px; /* Widened for full desktop feeling */
    aspect-ratio: 16/9; /* Standard desktop ratio */
    background: rgba(10, 10, 10, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
    transition: box-shadow 0.8s ease, border-color 0.8s ease;
}

.mockup-header {
    height: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 6px;
}

.mockup-header span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444;
}
.mockup-header span:nth-child(1) { background: #ff5f56; }
.mockup-header span:nth-child(2) { background: #ffbd2e; }
.mockup-header span:nth-child(3) { background: #27c93f; }

.mockup-body {
    width: 100%;
    height: calc(100% - 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.mockup-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.port-slide:hover .mockup-screenshot {
    transform: scale(1.05);
}

/* ── VA INTRO SLIDE ─────────────────────────────────────── */
.va-intro-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    grid-template-columns: 1fr; /* override grid */
}
.va-intro-content {
    max-width: 800px;
    padding: 2rem;
}

/* VA track: always show content, not gated by .is-active */
#vaTrack .port-content {
    opacity: 1;
    transform: none;
}
/* Still animate on active, but never hide */
#vaTrack .port-slide.is-active .port-content {
    opacity: 1;
    transform: translateY(0);
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 992px) {
    .portfolio-track-container {
        height: auto;
        overflow: visible;
    }

    .portfolio-track {
        flex-direction: column;
        width: 100%;
        height: auto;
    }

    .port-slide {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        height: auto; 
        min-height: 100vh;
        overflow-y: visible; 
        overflow-x: hidden;
        padding: 5rem 1rem 3rem;
        gap: 1.5rem;
    }

    .port-visual {
        order: -1;
        flex-shrink: 0;
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        opacity: 1 !important;
        transform: none !important;
    }

    .port-content {
        flex-shrink: 0;
        padding-bottom: 2rem;
        opacity: 1 !important;
        transform: none !important;
    }

    .mockup-window {
        max-width: 260px;
        margin: 0 auto;
    }

    .portfolio-title { font-size: 3rem; }
    .port-project-title { font-size: 2.2rem; margin-bottom: 0.5rem; }
}

@media (max-width: 480px) {
    .port-slide {
        padding-top: 5.5rem;
    }
    .portfolio-title { font-size: 2.2rem; }
    .port-project-title { font-size: 2rem; }
    .mockup-window { max-width: 220px; aspect-ratio: 4/3; }
}
