/* Scroll-Jacking Layout */

/* The tall container that creates the scroll distance */
.process-scroll-trigger {
    height: 250vh;
    /* 4 slides * 100vh approx, or enough to feel like a journey */
    position: relative;
    /* Ensure it overlays correctly if needed, but usually natural flow is fine */
}

/* The sticky viewport that locks in place */
.process-sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    /* Occupy full viewport to ensure sticky works */
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: transparent;
    /* Allow background blobs to show through */
    z-index: 800;
    /* Below header (1000) but above standard content */
}

/* Navigation Bar (Reusing rs-grid style) */
.process-nav-header {
    flex: 0 0 auto;
    /* Don't shrink */
    padding-top: 130px;
    /* Increased spacing to prevent active tab touching header */
    padding-bottom: 20px;
    background: transparent;
    /* Transparent to match wrapper */
    z-index: 20;
    transition: all 0.3s ease;
}

/* Ensure the nav items look good in this context */
.process-nav-header .rs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    /* Connected look like the screenshot */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.process-nav-header .rs-item {
    padding: 20px;
    text-align: center;
    color: white;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0.4;
    /* Default to semi-transparent/inactive */
    position: relative;
    /* Reset some default margins if necessary */
    margin: 0;
    border-radius: 0;
    /* Remove potential border radius for connected look */
}

.process-nav-header .rs-item:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.process-nav-header .rs-item:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Active State */
.process-nav-header .rs-item.active {
    opacity: 1;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    /* Pop out a bit */
}

/* Horizontal Track for Content */
.process-track {
    display: flex;
    flex: 1;
    /* Fill remaining space below nav */
    height: auto;
    width: max-content;
    /* Allow content to dictate width */
    padding: 0 17.5vw;
    /* Padding to center the first/last items (Width 65vw -> Padding 17.5vw) */
    will-change: transform;
}

/* Individual Slide/Card */
.process-slide {
    width: 65vw;
    /* Balanced width to see neighbors */
    height: calc(100vh - 220px);
    /* More breathing room top/bottom */
    max-height: 600px;
    /* Cap height to prevent it becoming massive on tall screens */
    flex: 0 0 65vw;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center vertically within the slide area */
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    opacity: 0.8;
    /* High visibility for neighbors (was 0.6) */
    transform: scale(0.9);
    /* Slightly smaller inactive */
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.process-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 5;
}

/* Customize the inner card to fit the available space */
.process-slide .section-card {
    width: 100%;
    /* Fill slide width */
    max-width: none;
    /* Let 65vw control max width */
    height: 100%;
    /* Fill slide height */
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    /* Match standard radius */
    background: rgba(255, 255, 255, 0.6);
    /* Transparent background */
    backdrop-filter: blur(10px);
    /* Add blur for glassmorphism */
    padding: 0;
    /* Remove padding from card to let video flush */
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 0;
    align-items: stretch;
    /* Stretch to fill height */
    overflow: hidden;
    /* Clip video corners */
}

/* Text Column Wrapper (Left) */
.process-text-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center text vertically */
    text-align: left;
    padding: 40px;
    /* Internal padding for text */
    height: 100%;
    /* Full height */
    box-sizing: border-box;
    overflow-y: auto;
    /* Scroll if text is too long on short screens */
}

.process-slide .r-project-title {
    margin-top: 0;
    margin-bottom: 15px;
    /* Reduced slightly */
    font-size: clamp(1.8rem, 4vh, 2.5rem);
    /* Fluid typography for titles:
       - Min: 1.8rem
       - Preferred: 4vh
       - Max: 2.5rem
    */
    text-align: left;
    color: var(--dark-gray);
    line-height: 1.2;
}

.process-slide .r-project-intro {
    font-size: clamp(0.9rem, 2vh, 1.2rem);
    /* Fluid typography: 
       - Min: 0.9rem (readable on small screens)
       - Preferred: 2vh (scales with viewport height context)
       - Max: 1.2rem (current perfect size) 
    */
    line-height: 1.5;
    /* Slightly tighter to save vertical space */
    color: var(--gray-600);
    text-align: left;
    max-width: 100%;
    margin-bottom: 0;
}

/* Media Column Wrapper (Right) */
.process-media-col {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background: #000;
    position: relative;
}

.process-media-col .youtube-player,
.process-media-col .image-placeholder {
    width: 100%;
    height: 100%;
    aspect-ratio: unset;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
}

/* Ensure iframe fills too */
.process-media-col iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide unwanted elements specific to this view */
.process-slide .r-project-header,
.process-slide .r-project-logo,
.process-slide .project-testimonial,
.process-slide .image-placeholder.logo,
.process-slide .r-badge {
    display: none !important;
}

/* Breakpoint for Laptop / Medium Screens (Increased to 1600px to catch more screens) */
/* Fixes "Tiles too large on small monitor" */
@media (max-width: 1600px) {

    /* Reduce track padding to keep things centered with smaller cards */
    .process-track {
        padding: 0 22.5vw;
        /* Center 55vw card (100 - 55 = 45 / 2 = 22.5) */
    }

    .process-slide {
        width: 55vw;
        /* Significantly narrower */
        flex: 0 0 55vw;
        /* Reduce Max Height for shorter screens/laptops */
        max-height: 480px;
        /* Hard cap to ensuring "breathing room" */
        height: calc(100vh - 250px);
        /* Ensure it doesn't touch edges */
    }

    /* Adjust font sizes for compact view */
    .process-slide .r-project-title {
        font-size: 1.8rem;
    }

    .process-slide .r-project-intro {
        font-size: 1rem;
        line-height: 1.5;
    }

    .process-slide .section-card {
        padding: 0;
    }

    .process-text-col {
        padding: 30px;
    }
}

/* Responsive Mobile */
/* Responsive Mobile & Small Laptops (Increased from 768px to 1100px) */
/* Switch to vertical stack earlier to prevent cramp */
@media (max-width: 1100px) {

    /* Lower breakpoint to prevent stacking on laptops */
    .process-scroll-trigger {
        height: auto;
    }

    .process-sticky-wrapper {
        position: static;
        height: auto;
        display: block;
        background: white;
        /* Resume white background on mobile if needed */
    }

    .process-track {
        width: 100%;
        height: auto;
        flex-direction: column;
        padding: 0;
        /* Reset padding */
        transform: none !important;
    }

    .process-slide {
        width: 100%;
        height: auto;
        max-height: none;
        /* Auto height on mobile */
        flex: 0 0 auto;
        padding: 40px 0;
        opacity: 1;
        /* Always opaque on mobile */
        transform: none;
    }

    .process-nav-header {
        position: sticky;
        top: 80px;
        padding-top: 20px;
        background: white;
        /* Nav needs background on mobile */
    }

    .process-nav-header .rs-grid {
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-rows: 1fr;
        /* Force equal height */
        gap: 10px;
        padding-bottom: 10px;
    }

    .process-nav-header .rs-item {
        width: 100%;
        min-width: 0;
        opacity: 1 !important;
        /* Override JS opacity/haze */
        transform: none !important;
        /* Override JS scale */
        border-radius: 8px !important;
        text-align: left;
        display: flex;
        flex-direction: column;
        /* Stack Heading above Text */
        align-items: flex-start;
        /* Align left */
        justify-content: center;
    }

    .process-nav-header .rs-item h4 {
        margin-bottom: 4px;
        /* Space between heading and text */
    }

    /* Stack content on mobile */
    .process-slide .section-card {
        height: auto;
        /* Auto height on mobile */
        grid-template-columns: 1fr;
        padding: 30px;
        gap: 20px;
        max-width: 100%;
        margin: 0 20px;
        text-align: left;
    }

    /* Re-enable headers on mobile cards */
    .process-slide .r-project-header,
    .process-slide .r-badge {
        display: flex !important;
        /* Show the R badge */
        margin-bottom: 16px;
    }

    .process-slide .r-project-title {
        font-size: 2rem;
        margin-top: 0;
        /* Remove top margin since header is back */
    }
}