/* Full Screen Scroll FX - Vanilla Implementation */
/* Based on GSAP ScrollTrigger pinning technique */

/* Scroll Wrapper */
.fx-scroll-wrapper {
    width: 100%;
    position: relative;
    min-height: 100vh;
}

.works-page {
    min-height: 600vh;
}

/* Pinned Section - This stays fixed while scrolling */
.fx-pinned-section {
    height: 500vh; /* Creates scroll space for 5 sections */
    position: relative;
    pointer-events: none;
}

.fx-pinned-container {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: visible;
    pointer-events: auto;
}

/* Grid Layout: Left | Center | Right */
.fx-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    width: 100%;
    height: 30vh;
    align-items: flex-start;
    padding: 0 3rem;
    padding-top: 2vh;
    gap: 2rem;
    position: relative;
    z-index: 100;
    pointer-events: none;
}

/* Left Column - Project Menu */
.fx-left-column {
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: visible;
    position: relative;
    pointer-events: auto;
}

.fx-arrow-indicator {
    position: absolute;
    left: -1.5rem;
    top: 0;
    font-size: 0.8rem;
    color: #000;
    transform: translateY(0);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10;
}

.fx-left-track {
    position: relative;
}

.fx-left-item {
    margin: 0.3rem 0;
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
}

.fx-left-item span {
    font-family: 'Sk-Modernist', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #d0d0d0;
    transition: color 0.1s ease, font-weight 0.1s ease;
    display: inline-block;
    pointer-events: auto;
}

.fx-left-item.active span {
    color: #000;
    font-weight: 575;
}

.fx-left-item:hover span {
    color: #000;
}

/* Center Column */
.fx-center-column {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.fx-center-title {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transform: translateY(50px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.7s;
}

.fx-center-title.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fx-center-title h2 {
    font-family: 'FogtwoNo5', serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    color: #000;
    letter-spacing: -0.02em;
    line-height: 0.9;
    margin: 0;
}

/* Right Column */
.fx-right-column {
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    overflow: visible;
    pointer-events: auto;
}

.fx-right-track {
    text-align: right;
}

.fx-right-item {
    font-family: 'Sk-Modernist', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    margin: 0.3rem 0;
    opacity: 0.3;
    transition: opacity 0.4s ease, transform 0.4s ease;
    cursor: pointer;
    user-select: none;
    position: relative;
    pointer-events: auto;
}

.fx-right-item a {
    color: #000;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    pointer-events: auto;
    cursor: pointer;
}

.fx-right-item a::after {
    content: '↗';
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.fx-right-item.active {
    opacity: 1;
    transform: translateX(-10px);
}

.fx-right-item:hover {
    opacity: 1;
}

.fx-right-item a:hover {
    opacity: 0.6;
}

.fx-right-item a:hover::after {
    transform: translate(3px, -3px);
}

/* Progress Indicator */
.fx-progress-wrapper {
    position: fixed;
    top: 2rem;
    right: 3rem;
    transform: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.8rem;
    z-index: 10001;
}

.fx-progress-numbers {
    display: flex;
    gap: 0.5rem;
    font-family: 'Sk-Modernist', sans-serif;
    font-size: 0.85rem;
    color: #000;
}

.fx-progress-bar {
    width: 200px;
    height: 2px;
    background: rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.fx-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 20%;
    background: #000;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollable Image Sections */
.fx-scroll-sections {
    position: absolute;
    top: 15vh;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 5;
}

.fx-image-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    padding-top: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.fx-image-section.active {
    opacity: 1;
    visibility: visible;
}

/* Slideshow Container */
.fx-slideshow-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    gap: 2rem;
}

/* Navigation Arrows */
.fx-arrow {
    background: transparent;
    border: none;
    font-size: 3rem;
    color: #000;
    cursor: pointer;
    padding: 1rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
    user-select: none;
    opacity: 0.3;
    flex-shrink: 0;
    pointer-events: auto;
    z-index: 10;
}

/* Initial state for arrows when page is not active */
.works-page:not(.active) .fx-arrow {
    opacity: 0;
    transform: translateY(100px);
}

.fx-arrow:hover {
    opacity: 1;
    transform: scale(1.1);
}

.fx-arrow:active {
    transform: scale(0.95);
}

/* Images Grid - Single Image Display */
.fx-images-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 500px;
    min-height: 500px;
}

.fx-image-item {
    position: absolute;
    width: 100%;
    max-width: 900px;
    height: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s ease;
    pointer-events: none;
}

.fx-image-item.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.fx-image-section.active .fx-image-item.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.fx-image-item img,
.fx-image-item video {
    width: 100%;
    height: auto;
    max-height: 500px;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.fx-image-item:hover img,
.fx-image-item:hover video {
    transform: scale(1.03);
}

/* Description */
.fx-description {
    font-family: 'Sk-Modernist', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 12vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: 0.5s;
}

.fx-image-section.active .fx-description {
    opacity: 1;
    transform: translateY(0);
}

/* End Spacer */
.fx-end-spacer {
    height: 100vh;
}

/* Responsive Breakpoints - Master Level Adaptive Design */

/* Large Desktops (1920px+) - Current perfect layout preserved */
@media (min-width: 1920px) {
    .fx-grid {
        max-width: 1920px;
        margin: 0 auto;
    }
}

/* Standard Desktop (1440px - 1919px) - Slight scaling */
@media (max-width: 1919px) and (min-width: 1440px) {
    .fx-grid {
        padding: 0 2.5rem;
        gap: 1.8rem;
    }

    .fx-left-item span,
    .fx-right-item {
        font-size: 0.95rem;
    }

    .fx-slideshow-container {
        max-width: 1100px;
    }

    .fx-images-grid {
        max-width: 850px;
        height: 450px;
        min-height: 450px;
    }

    .fx-image-item {
        max-width: 850px;
    }
}

/* Laptop (1024px - 1439px) - Comfortable scaling */
@media (max-width: 1439px) and (min-width: 1025px) {
    .fx-grid {
        padding: 0 2rem;
        gap: 1.5rem;
        height: 28vh;
    }

    .fx-left-item span,
    .fx-right-item {
        font-size: 0.9rem;
    }

    .fx-slideshow-container {
        max-width: 1000px;
        gap: 1.5rem;
    }

    .fx-images-grid {
        max-width: 750px;
        height: 450px;
        min-height: 450px;
    }

    .fx-image-item {
        max-width: 750px;
    }

    .fx-arrow {
        font-size: 2.5rem;
        padding: 0.8rem;
    }

    .fx-image-item img,
    .fx-image-item video {
        max-height: 450px;
    }

    .fx-description {
        font-size: 0.95rem;
        max-width: 550px;
    }

    .fx-progress-bar {
        width: 180px;
    }
}

/* Tablet Portrait & Small Laptops (768px - 1024px) - Vertical stack */
@media (max-width: 1024px) and (min-width: 768px) {
    .fx-pinned-section {
        height: auto !important;
    }

    .fx-pinned-container {
        position: static !important;
        height: auto !important;
    }

    .fx-grid {
        display: none !important;
    }

    .fx-scroll-sections {
        position: static;
        top: auto;
        padding-top: 4vh;
    }

    .fx-image-section {
        min-height: auto;
        height: auto;
        padding: 3rem 2rem;
        padding-top: 2rem;
        padding-bottom: 15vh;
        margin-bottom: 0;
        border-bottom: 2px solid rgba(0, 0, 0, 0.15);
        opacity: 1;
        visibility: visible;
    }

    .fx-image-section:first-child {
        padding-top: 0;
    }

    .fx-image-section:last-child {
        border-bottom: none;
        padding-bottom: 10vh;
    }

    .fx-slideshow-container {
        max-width: 700px;
        gap: 1rem;
    }

    .fx-images-grid {
        max-width: 550px;
        height: 400px;
        min-height: 400px;
    }

    .fx-image-item {
        max-width: 550px;
    }

    .fx-arrow {
        font-size: 2rem;
        padding: 0.5rem;
    }

    .fx-image-item img,
    .fx-image-item video {
        max-height: 400px;
    }

    .fx-description {
        font-size: 0.95rem;
        max-width: 550px;
        padding-bottom: 0;
        margin-top: 2rem;
    }

    .fx-progress-wrapper {
        top: auto;
        bottom: 2vh;
        right: 50%;
        transform: translateX(50%);
        flex-direction: column;
        gap: 0.5rem;
    }

    .fx-progress-numbers {
        font-size: 1.1rem;
        font-weight: 600;
    }
}

/* Mobile Landscape & Small Tablets (481px - 767px) - Clean vertical */
@media (max-width: 767px) and (min-width: 481px) {
    .fx-pinned-section {
        height: auto !important;
    }

    .fx-pinned-container {
        position: static !important;
        height: auto !important;
    }

    .fx-grid {
        display: none !important;
    }

    .fx-scroll-sections {
        position: static;
        top: auto;
        padding-top: 3vh;
    }

    .fx-image-section {
        min-height: auto;
        height: auto;
        padding: 2.5rem 1.5rem;
        padding-top: 1.5rem;
        padding-bottom: 18vh;
        margin-bottom: 0;
        border-bottom: 2px solid rgba(0, 0, 0, 0.12);
        opacity: 1;
        visibility: visible;
    }

    .fx-image-section:first-child {
        padding-top: 0;
    }

    .fx-image-section:last-child {
        border-bottom: none;
        padding-bottom: 12vh;
    }

    .fx-slideshow-container {
        max-width: 500px;
        gap: 0.8rem;
    }

    .fx-images-grid {
        max-width: 380px;
        height: 350px;
        min-height: 350px;
    }

    .fx-image-item {
        max-width: 380px;
    }

    .fx-arrow {
        font-size: 1.8rem;
        padding: 0.4rem;
    }

    .fx-image-item img,
    .fx-image-item video {
        max-height: 350px;
    }

    .fx-description {
        font-size: 0.88rem;
        max-width: 340px;
        padding: 0 1rem;
        padding-bottom: 0;
        margin-top: 2rem;
    }

    .fx-progress-wrapper {
        top: auto;
        bottom: 2vh;
        right: 50%;
        transform: translateX(50%);
        flex-direction: column;
        gap: 0.5rem;
    }

    .fx-progress-bar {
        width: 150px;
    }

    .fx-progress-numbers {
        font-size: 1rem;
        font-weight: 600;
    }
}

/* Mobile Portrait (320px - 480px) - Optimized for small screens */
@media (max-width: 480px) {
    .fx-pinned-section {
        height: auto !important;
    }

    .fx-pinned-container {
        position: static !important;
        height: auto !important;
    }

    .fx-grid {
        display: none !important;
    }

    .fx-scroll-sections {
        position: static;
        top: auto;
        padding-top: 2vh;
    }

    .fx-image-section {
        min-height: auto;
        height: auto;
        padding: 2rem 1rem;
        padding-top: 1rem;
        padding-bottom: 20vh;
        margin-bottom: 0;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
        opacity: 1;
        visibility: visible;
    }

    .fx-image-section:first-child {
        padding-top: 0;
    }

    .fx-image-section:last-child {
        border-bottom: none;
        padding-bottom: 15vh;
    }

    .fx-slideshow-container {
        max-width: 400px;
        gap: 0.5rem;
    }

    .fx-images-grid {
        max-width: 320px;
        height: 320px;
        min-height: 320px;
    }

    .fx-image-item {
        max-width: 320px;
    }

    .fx-arrow {
        font-size: 1.5rem;
        padding: 0.3rem;
    }

    .fx-image-item img,
    .fx-image-item video {
        max-height: 320px;
    }

    .fx-description {
        font-size: 0.82rem;
        line-height: 1.5;
        max-width: 300px;
        padding: 0 0.8rem;
        padding-bottom: 0;
        margin-top: 2rem;
    }

    .fx-progress-wrapper {
        top: auto;
        bottom: 2vh;
        right: 50%;
        transform: translateX(50%);
        flex-direction: column;
        gap: 0.5rem;
    }

    .fx-progress-bar {
        width: 120px;
    }

    .fx-progress-numbers {
        font-size: 0.95rem;
        font-weight: 600;
    }
}

/* Extra Small Mobile (< 320px) - Maximum compatibility */
@media (max-width: 319px) {
    .fx-pinned-section {
        height: auto !important;
    }

    .fx-pinned-container {
        position: static !important;
        height: auto !important;
    }

    .fx-grid {
        display: none !important;
    }

    .fx-scroll-sections {
        position: static;
        top: auto;
        padding-top: 2vh;
    }

    .fx-image-section {
        min-height: auto;
        height: auto;
        padding: 1.5rem 0.8rem;
        padding-top: 0.8rem;
        padding-bottom: 18vh;
        margin-bottom: 0;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
        opacity: 1;
        visibility: visible;
    }

    .fx-image-section:first-child {
        padding-top: 0;
    }

    .fx-image-section:last-child {
        border-bottom: none;
        padding-bottom: 12vh;
    }

    .fx-slideshow-container {
        max-width: 350px;
        gap: 0.5rem;
    }

    .fx-images-grid {
        max-width: 280px;
        height: 280px;
        min-height: 280px;
    }

    .fx-image-item {
        max-width: 280px;
    }

    .fx-arrow {
        font-size: 1.3rem;
        padding: 0.2rem;
    }

    .fx-image-item img,
    .fx-image-item video {
        max-height: 280px;
    }

    .fx-description {
        font-size: 0.78rem;
        max-width: 260px;
        padding-bottom: 0;
        margin-top: 1.5rem;
    }

    .fx-progress-wrapper {
        top: auto;
        bottom: 2vh;
        right: 50%;
        transform: translateX(50%);
        flex-direction: column;
        gap: 0.5rem;
    }

    .fx-progress-bar {
        width: 100px;
    }

    .fx-progress-numbers {
        font-size: 0.9rem;
        font-weight: 600;
    }
}

/* Disable transitions on page navigation */
.works-page:not(.active) .fx-scroll-wrapper * {
    transition: none !important;
}
