/* =========================================
   LUMA KINETIC DARK TRANSFORMATION
   ========================================= */

/* The Timeline Container */
.lifecycle-section {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 120px;
    /* Large spacing for scroll breathing room */
    padding: 100px 20px;
    background-color: var(--void-bg);
    overflow: hidden;
    min-height: 100vh;
}

/* The Connecting Thread */
.digital-thread-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--glass-border-dark), transparent);
    transform: translateX(-50%);
    z-index: 0;
}

/* The Card (Glassmorphism 2.0) */
.node-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border-dark);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    position: relative;
    z-index: 1;
    transition: transform 0.4s var(--ease-spring), border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;

    /* Initial State for Scroll Animation */
    opacity: 0;
    transform: translateY(40px) scale(0.95);
}

/* Active State (Triggered by JS) */
.node-card.in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.node-card:hover {
    border-color: var(--accent-glow);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Spotlight Effect */
.node-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    padding: 1px;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
            rgba(255, 255, 255, 0.15),
            transparent 40%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.node-card:hover::before {
    opacity: 1;
}

/* Alternating Layout (Zig-Zag) */
.lifecycle-node {
    display: flex;
    justify-content: center;
    width: 100%;
    position: relative;
}

.node-marker {
    position: absolute;
    font-family: 'Inter', sans-serif;
    font-size: 12rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.02);
    z-index: -1;
    line-height: 1;
    pointer-events: none;
}

.card-content h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    letter-spacing: -0.03em;
    color: var(--text-primary-dark);
    margin-bottom: 0.5rem;
}

.card-content p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
    color: var(--text-secondary-dark);
    line-height: 1.5;
}

.mono-tag {
    display: inline-block;
    font-family: 'Courier New', Courier, monospace;
    /* Fallback to mono */
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* Glow Orb Placeholder */
.glow-orb {
    width: 100%;
    height: 200px;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.2), transparent 70%);
    border-radius: 12px;
    margin-top: 20px;
    position: relative;
}

.glow-orb::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    filter: blur(20px);
    opacity: 0.5;
    animation: pulseGlow 4s infinite ease-in-out;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Desktop: Zig-Zag around the center line */
@media (min-width: 1024px) {
    .lifecycle-node:nth-child(odd) {
        justify-content: flex-end;
        padding-right: 55%;
    }

    .lifecycle-node:nth-child(even) {
        justify-content: flex-start;
        padding-left: 55%;
    }

    .lifecycle-node:nth-child(odd) .node-marker {
        right: 20px;
        top: -40px;
    }

    .lifecycle-node:nth-child(even) .node-marker {
        left: 20px;
        top: -40px;
    }

    /* Connector Dot on the line */
    .lifecycle-node::before {
        content: '';
        position: absolute;
        left: 50%;
        top: 50%;
        width: 8px;
        height: 8px;
        background: var(--text-primary-dark);
        border-radius: 50%;
        transform: translate(-50%, -50%);
        box-shadow: 0 0 15px var(--text-primary-dark);
        z-index: 2;
        opacity: 0;
        /* Hidden initially, shown via JS */
        transition: opacity 0.5s ease;
    }

    .lifecycle-node.active-stage::before {
        opacity: 1;
    }
}

/* Scrollytelling Services Section */
.scrolly-services {
    position: relative;
    background-color: var(--bg-color);
    padding-bottom: 10vh;
    width: 100%;
    max-width: 100%;
}

.service-scrolly-section {
    position: relative;
    /* Remove min-height to allow natural flow, but ensure enough scroll space */
    margin-bottom: 0;
    transition: margin-bottom 0.5s ease;
}

.service-scrolly-section:not(:last-child) {
    margin-bottom: 0;
}

/* Add small gap between sections when features are collapsed */
.service-scrolly-section.features-collapsed:not(:last-child) {
    margin-bottom: 2vh;
}

.scrolly-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem 0 3rem;
    display: grid;
    grid-template-columns: 0.85fr 1.6fr;
    align-items: start;
    gap: 3rem;
    position: relative;
}

.scrolly-text-col {
    padding-top: 10vh;
    padding-bottom: 20vh;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    z-index: 20;
    /* Increased gap space between text and card views */
    padding-right: 1.5rem;
    max-width: 100%;
    /* Prevent text from being covered */
    isolation: isolate;
    transition: padding-bottom 0.5s ease;
}

/* Reduce padding when features are collapsed */
.service-scrolly-section.features-collapsed .scrolly-text-col {
    padding-bottom: 8vh;
}

.scrolly-visual-col {
    /* Match hero ratio */
    position: sticky;
    top: 8vh;
    height: fit-content;
    max-height: calc(100vh - 12vh);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: visible;
    padding: 0;
    z-index: 5;
    /* Ensure visuals don't overlap text */
    isolation: isolate;
}

/* Sticky wrapper for main video - stays at top */
.scrolly-visual-col > .sticky-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    z-index: 1;
    flex-shrink: 0;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0s linear 0s, transform 0.3s ease;
    max-height: calc(100vh - 12vh);
    overflow: hidden;
    display: block;
    height: auto;
}

/* Feature visual items - positioned relative to viewport, aligned with text */
.feature-visual-item {
    position: fixed;
    right: calc((100% - 1600px) / 2 + 1.5rem);
    width: calc(1.6 / (0.85 + 1.6) * 1600px - 1.5rem);
    max-width: calc(1.6 / (0.85 + 1.6) * 100vw - 3rem);
    /* Remove aspect-ratio constraint - let content determine size */
    min-height: 400px;
    max-height: calc(100vh - 20vh);
    border-radius: 0;
    overflow: visible;
    /* No card effect - transparent background */
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* No border or shadow - container is invisible */
    border: none;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.5s ease-in, visibility 0s linear 0.5s, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), top 0.3s ease-out;
    display: flex;
    flex-direction: column;
    /* Lower z-index to prevent overlapping with text */
    z-index: 5;
    pointer-events: none;
    will-change: transform, opacity, top;
    backface-visibility: hidden;
}

@media (max-width: 1300px) {
    .scrolly-container {
        gap: 3rem;
        padding: 0 1.5rem 0 3rem;
    }
    
    .scrolly-text-col {
        padding-right: 1.5rem;
        padding-left: 0;
    }
    
    .feature-visual-item {
        right: 2rem;
        width: calc(1.2 / (1 + 1.2) * 100vw - 4rem);
    }
}

/* Responsive adjustments for feature visual items */
@media (max-width: 1024px) {
    .scrolly-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .scrolly-text-col {
        z-index: 10;
        padding-right: 0;
        /* Ensure text doesn't overlap on mobile */
        padding-left: 0;
        max-width: 100%;
    }
    
    .scrolly-visual-col {
        position: relative;
        top: 0;
        height: auto;
        z-index: 5;
    }
    
    .sticky-wrapper {
        min-height: 400px;
        max-height: 70vh;
    }
    
    .feature-visual-item {
        position: relative;
        right: auto;
        width: 100%;
        max-width: 100%;
        min-height: 350px;
    }
    
    .feature-images {
        gap: 16px;
        padding: 0;
    }
    
    .feature-images img,
    .feature-images video,
    .feature-images .feature-media {
        border-radius: 16px;
        object-fit: contain;
    }
}

@media (max-width: 768px) {
    .scrolly-container {
        padding: 0 1rem;
    }
    
    .feature-visual-item {
        position: relative;
        right: auto;
        width: 100%;
        max-width: 100%;
        min-height: 300px;
    }
    
    .feature-images {
        gap: 12px;
        padding: 0;
    }
    
    .feature-images img,
    .feature-images video,
    .feature-images .feature-media {
        border-radius: 12px;
        /* Card view effect maintained on mobile */
        box-shadow: 
            0 8px 24px rgba(0, 0, 0, 0.12),
            0 2px 8px rgba(0, 0, 0, 0.08);
        object-fit: contain;
    }
    
    .feature-visual-item.visible:hover {
        transform: translateY(0) scale(1) !important;
    }
    
    .feature-images img:hover,
    .feature-images video:hover,
    .feature-images .feature-media:hover {
        transform: translateY(-4px) scale(1.02) !important;
    }
}


/* Hide empty feature visual items */
.feature-visual-item:has(.feature-images:empty),
.feature-visual-item .feature-images:empty {
    display: none;
}

.feature-visual-item.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto;
    /* No card effect - no shadow on container */
    box-shadow: none;
    animation: none;
    transition: opacity 0.5s ease-in, visibility 0s linear 0s, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* No hover effect on container - only on individual images */
.feature-visual-item.visible:hover {
    transform: translateY(0) scale(1) !important;
    box-shadow: none;
}

/* Show feature images when container is visible */
.feature-visual-item.visible .feature-images {
    display: grid !important;
}

.feature-visual-item.visible .feature-images img {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

.sticky-wrapper {
    position: relative;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    display: block;
    /* Card view effect for video wrapper - matching image cards */
    background: #ffffff;
    border: none;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.06);
    transition: opacity 0.5s ease, visibility 0s linear 0s, transform 0.3s ease, box-shadow 0.3s ease;
    /* Container adapts to video aspect ratio */
    line-height: 0;
    will-change: opacity, transform;
}

.sticky-wrapper:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 24px 70px rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.1);
}

.visual-item {
    position: relative;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98);
    transition: opacity 0.5s ease, visibility 0s linear 0.5s, transform 0.5s ease;
    pointer-events: none;
    z-index: 1;
    display: block;
    line-height: 0;
    height: auto;
    will-change: opacity, transform;
}

.visual-item.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
    z-index: 10;
    transition: opacity 0.5s ease, visibility 0s linear 0s, transform 0.5s ease;
}

.visual-video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 20px;
    max-width: 100%;
}

.sticky-wrapper:hover .visual-video {
    transform: scale(1.02);
}

/* Text Content Styles */
.scrolly-intro {
    margin-bottom: 50vh;
    /* Space for main video */
    opacity: 0.8;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), margin-bottom 0.5s ease;
    transform: translateY(30px);
    will-change: opacity, transform;
    position: relative;
    z-index: 10;
    /* Prevent text from being overlapped */
    background: transparent;
    padding-right: 0;
    padding-bottom: 0;
}

/* Reduce margin when features are collapsed */
.service-scrolly-section.features-collapsed .scrolly-intro {
    margin-bottom: 30vh;
}

.scrolly-feature {
    margin-bottom: 45vh;
    /* Space for feature images to appear */
    opacity: 0.8;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(30px);
    will-change: opacity, transform;
    position: relative;
    z-index: 10;
    /* Prevent text from being overlapped */
    background: transparent;
    padding-right: 0;
}

.scrolly-intro.active,
.scrolly-feature.active {
    opacity: 1;
    transform: translateY(0);
}

.service-header-small {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    color: #d97706;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-size: 0.8125rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.08) 100%);
    border-radius: 50px;
    border: 1.5px solid rgba(217, 119, 6, 0.25);
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.1);
    transition: all 0.3s ease;
}

.service-header-small i {
    font-size: 0.875rem;
}

.scrolly-intro h3 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 2rem;
    /* Premium gradient for title */
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 30%, #334155 60%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.scrolly-intro p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: #1e293b;
    line-height: 1.8;
    max-width: 100%;
    font-weight: 400;
    letter-spacing: -0.005em;
    /* Ensure text doesn't overlap */
    word-wrap: break-word;
    overflow-wrap: break-word;
    opacity: 0.95;
    margin-bottom: 0;
    padding-bottom: 0;
}

.scrolly-feature h4 {
    font-size: clamp(1.375rem, 2.8vw, 1.875rem);
    margin-bottom: 1rem;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scrolly-feature p {
    font-size: clamp(0.9375rem, 1.8vw, 1.125rem);
    color: #1e293b;
    line-height: 1.7;
    font-weight: 400;
    letter-spacing: -0.005em;
    /* Ensure text doesn't overlap */
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    opacity: 0.9;
}

.scrolly-cta {
    margin-top: 16rem;
    margin-bottom: 12vh;
    opacity: 0.8;
    transition: opacity 0.6s ease, transform 0.6s ease, margin-bottom 0.5s ease;
    transform: translateY(10px);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-top: 5rem;
    position: relative;
}

/* Reduce margin-bottom when features are collapsed */
.service-scrolly-section.features-collapsed .scrolly-cta {
    margin-bottom: 4vh;
}

.scrolly-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.2), transparent);
    border-radius: 2px;
}

.scrolly-cta.active {
    opacity: 1;
    transform: translateY(0);
}

/* Feature Toggle Button */
.feature-toggle-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.04);
    border: 2px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    font-size: 1.1rem;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.feature-toggle-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

.feature-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.feature-toggle-btn i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.feature-toggle-btn.expanded i {
    transform: rotate(180deg);
}

/* Responsive adjustments for toggle button */
@media (max-width: 1024px) {
    .scrolly-cta {
        margin-top: 14rem;
        padding-top: 4rem;
    }
}

@media (max-width: 768px) {
    .scrolly-cta {
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-top: 8rem;
        padding-top: 3rem;
    }
    
    .feature-toggle-btn {
        width: 48px;
        height: 48px;
        font-size: 1rem;
    }
    
    .service-btn {
        height: 48px;
        min-width: 180px;
        padding: 0 1.75rem;
        font-size: 0.95rem;
    }
    
    .scrolly-intro h3 {
        margin-bottom: 1.5rem;
    }
    
    .scrolly-intro p {
        margin-bottom: 0;
    }
}

/* Collapsible Features Container */
.features-collapsible {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s ease 0.1s,
                margin-bottom 0.6s ease;
    margin-bottom: 0;
    will-change: max-height, opacity;
}

.features-collapsible.expanded {
    max-height: 5000px;
    opacity: 1;
    margin-bottom: 0;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s ease 0.2s,
                margin-bottom 0.6s ease;
}

.features-collapsible .scrolly-feature {
    transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
    will-change: opacity, transform;
}

.features-collapsible:not(.expanded) .scrolly-feature {
    opacity: 0;
    transform: translateY(-15px);
    pointer-events: none;
}

.features-collapsible.expanded .scrolly-feature {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Feature Images Layout - Simple Grid */
.feature-images {
    width: 100%;
    height: auto;
    min-height: 400px;
    display: grid;
    gap: 20px;
    padding: 0;
    box-sizing: border-box;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: min-content;
    align-items: start;
    background: transparent;
    position: relative;
    /* Allow flexible sizing based on content */
    flex: 1 1 auto;
}

/* Single image - full width with enhanced styling */
.feature-images.layout-single,
.feature-images:has(img:only-child) {
    grid-template-columns: 1fr;
    padding: 0;
}

.feature-images.layout-single img,
.feature-images.layout-single video,
.feature-images.layout-single .feature-media,
.feature-images:has(img:only-child) img,
.feature-images:has(video:only-child) video {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 24px;
    /* Card view effect for individual image/video */
    box-shadow: 
        0 16px 50px rgba(0, 0, 0, 0.15),
        0 6px 20px rgba(0, 0, 0, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.06);
    border: none;
    background: #ffffff;
    object-fit: contain;
    object-position: center;
}

/* Two images - side by side */
.feature-images.layout-double,
.feature-images:has(img:nth-child(2):last-child) {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.feature-images.layout-double img,
.feature-images.layout-double video,
.feature-images.layout-double .feature-media,
.feature-images:has(img:nth-child(2):last-child) img,
.feature-images:has(video:nth-child(2):last-child) video {
    width: 100%;
    height: auto;
    border-radius: 20px;
    object-fit: contain;
    object-position: center;
}

/* Three images - main + two smaller */
.feature-images.layout-triple,
.feature-images:has(img:nth-child(3):last-child) {
    grid-template-columns: 1.3fr 0.9fr;
    grid-template-rows: min-content min-content;
    gap: 20px;
}

.feature-images.layout-triple img:first-child,
.feature-images.layout-triple video:first-child,
.feature-images.layout-triple .feature-media:first-child,
.feature-images:has(img:nth-child(3):last-child) img:first-child,
.feature-images:has(video:nth-child(3):last-child) video:first-child {
    width: 100%;
    height: auto;
    grid-row: 1 / span 2;
    border-radius: 24px;
    object-fit: contain;
    object-position: center;
}

.feature-images.layout-triple img:not(:first-child),
.feature-images.layout-triple video:not(:first-child),
.feature-images.layout-triple .feature-media:not(:first-child),
.feature-images:has(img:nth-child(3):last-child) img:not(:first-child),
.feature-images:has(video:nth-child(3):last-child) video:not(:first-child) {
    width: 100%;
    height: auto;
    border-radius: 18px;
    object-fit: contain;
    object-position: center;
}

/* Four or more images - masonry-like grid */
.feature-images:has(img:nth-child(4)) {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 20px;
}

.feature-images:has(img:nth-child(4)) img,
.feature-images:has(video:nth-child(4)) video,
.feature-images:has(.feature-media:nth-child(4)) .feature-media {
    width: 100%;
    height: auto;
    border-radius: 18px;
    object-fit: contain;
    object-position: center;
}

.feature-images img,
.feature-images video,
.feature-images .feature-media {
    width: 100%;
    height: auto;
    max-height: 100%;
    /* Keep original aspect ratio - fit exactly in card */
    object-fit: contain;
    border-radius: 20px;
    /* Card view effect for individual images/videos - enhanced shadow */
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.06);
    transition: opacity 0.6s ease, transform 0.6s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    display: block;
    position: relative;
    z-index: 1;
    /* No border - clean, borderless design */
    border: none;
    background: #ffffff;
    overflow: hidden;
    /* Ensure media fits exactly without constraints */
    object-position: center;
    will-change: opacity, transform;
}

/* Hover effect for images/videos - enhanced card view effect */
.feature-images img:hover,
.feature-images video:hover,
.feature-images .feature-media:hover {
    transform: translateY(-8px) scale(1.03) !important;
    box-shadow: 
        0 24px 70px rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.15),
        0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Show images/videos in feature-visual-item when visible */
.feature-visual-item.visible .feature-images img,
.feature-visual-item.visible .feature-images video,
.feature-visual-item.visible .feature-images .feature-media {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    transition: opacity 0.6s ease, transform 0.6s ease !important;
}

/* Staggered animation for images/videos */
.feature-visual-item.visible .feature-images img:nth-child(1),
.feature-visual-item.visible .feature-images video:nth-child(1),
.feature-visual-item.visible .feature-images .feature-media:nth-child(1) {
    transition-delay: 0.1s;
}

.feature-visual-item.visible .feature-images img:nth-child(2),
.feature-visual-item.visible .feature-images video:nth-child(2),
.feature-visual-item.visible .feature-images .feature-media:nth-child(2) {
    transition-delay: 0.2s;
}

.feature-visual-item.visible .feature-images img:nth-child(3),
.feature-visual-item.visible .feature-images video:nth-child(3),
.feature-visual-item.visible .feature-images .feature-media:nth-child(3) {
    transition-delay: 0.3s;
}

.feature-visual-item.visible .feature-images img:nth-child(4),
.feature-visual-item.visible .feature-images video:nth-child(4),
.feature-visual-item.visible .feature-images .feature-media:nth-child(4) {
    transition-delay: 0.4s;
}

/* Ensure feature images are always visible when container is visible */
.feature-visual-item.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Feature images always use grid when visible */
.visual-item.active .feature-images,
.feature-visual-item .feature-images {
    display: grid !important;
    width: 100%;
    height: 100%;
    opacity: 1;
}

/* Active State - Images fade in */
.visual-item.active .feature-images img {
    opacity: 1;
    transform: translateY(0) scale(1);
}/* Stagger animation for multiple images */
.visual-item.active .feature-images img:nth-child(1) {
    transition-delay: 0.1s;
}.visual-item.active .feature-images img:nth-child(2) {
    transition-delay: 0.2s;
}
.visual-item.active .feature-images img:nth-child(3) {
    transition-delay: 0.3s;
}





