/* Static Text Overlay - Hidden on mobile, subtle on desktop */
.scrolling-text {
    position: fixed;
    bottom: 15%;
    left: 0;
    width: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
    text-align: center;
}

.scrolling-text-track {
    display: inline-block;
    white-space: nowrap;
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 700;
    color: rgba(0, 0, 0, 0.04);
}

/* Dark mode: Make text visible on dark background */
[data-theme="dark"] .scrolling-text-track {
    color: rgba(255, 255, 255, 0.04);
}

/* Image Columns Background */
.image-columns {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: 0 2rem;
    z-index: 1;
    opacity: 1;
    pointer-events: none;
}

.image-column {
    flex: 0 0 clamp(280px, 20vw, 400px);
    height: 100vh;
    overflow: hidden;
    position: relative;
    contain: layout style;
}

.image-track {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 2vw, 2.5rem);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Left column scrolls down */
.image-column.left .image-track {
    animation: scrollDown 12s linear infinite;
}

/* Right column scrolls up */
.image-column.right .image-track {
    animation: scrollUp 12s linear infinite;
}

.image-wrapper {
    /* Fixed aspect ratio 3:4 (portrait) - scales with viewport */
    aspect-ratio: 3 / 4;
    height: clamp(380px, 32vh, 560px);
    border-radius: clamp(20px, 1.8vw, 32px);
    overflow: hidden;
    flex-shrink: 0;
    contain: strict;
    /* Shadow removed for cleaner gallery appearance */
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: translateZ(0);
}

/* Image Loading States */
.image-wrapper,
.mobile-img {
    /* Shimmer loading skeleton */
    background: linear-gradient(
        90deg,
        rgba(240, 240, 240, 0.6) 0%,
        rgba(250, 250, 250, 0.8) 50%,
        rgba(240, 240, 240, 0.6) 100%
    );
    background-size: 200% 100%;
}

/* Dark mode shimmer */
[data-theme="dark"] .image-wrapper,
[data-theme="dark"] .mobile-img {
    background: linear-gradient(
        90deg,
        rgba(30, 30, 30, 0.6) 0%,
        rgba(50, 50, 50, 0.8) 50%,
        rgba(30, 30, 30, 0.6) 100%
    );
}

/* Lazy-loaded images: start hidden with shimmer animation */
.lazy-image {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

/* Shimmer animation only for lazy images while loading */
.image-wrapper:has(.lazy-image:not(.loaded)),
.mobile-img:has(.lazy-image:not(.loaded)) {
    animation: shimmer 1.5s ease-in-out infinite;
}

/* When image loads, fade in */
.lazy-image.loaded {
    opacity: 1;
}

/* Stop shimmer when image loads */
.image-wrapper:has(.lazy-image.loaded),
.mobile-img:has(.lazy-image.loaded) {
    animation: none;
    background: transparent;
}

/* Eager-loaded images don't need shimmer */
.image-wrapper:has(img:not(.lazy-image)),
.mobile-img:has(img:not(.lazy-image)) {
    animation: none;
    background: transparent;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .lazy-image {
        transition: none;
        opacity: 1;
    }
    .image-wrapper,
    .mobile-img {
        animation: none !important;
    }
}

/* Scroll Animations */
@keyframes scrollDown {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(0, -50%, 0);
    }
}

@keyframes scrollUp {
    from {
        transform: translate3d(0, -50%, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

/* Mobile/Tablet: Hide desktop galleries, use inline galleries instead */
@media (max-width: 768px) {
    .image-columns {
        display: none;
    }
}

/* Horizontal scroll animations for mobile */
@keyframes scrollLeft {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-50%, 0, 0);
    }
}

@keyframes scrollRight {
    from {
        transform: translate3d(-50%, 0, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

/* Hide static text on mobile - not useful */
@media (max-width: 768px) {
    .scrolling-text {
        display: none;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    .scrolling-text-track {
        font-size: clamp(2rem, 12vw, 4rem);
    }
}

/* Pause animation on hover (desktop only) */
@media (hover: hover) {
    .image-column:hover .image-track {
        animation-play-state: paused;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .image-track {
        animation-duration: 120s;
    }
}
