/* Services Parallax Section - Layered Scene with Flying Bird */

.services-parallax-section {
    position: relative;
    min-height: auto; /* Let content determine height */
    padding-bottom: 40px; /* 40px below cards */
    background: linear-gradient(180deg, #1a2a4a 0%, #0d1525 50%, #0a0e1a 100%);
    overflow: hidden;
}

/* FORCE ALL TEXT WHITE - high specificity */
.services-parallax-section .service-card-text strong,
.services-parallax-section .service-card-text b,
.services-parallax-section p.service-card-text strong,
.services-parallax-section p.service-card-text b,
.services-parallax-section .service-card p strong,
.services-parallax-section .service-card p b {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* ============================================
   LAYERED PARALLAX SCENES
   ============================================ */

/* Mountains Scene - Upper Left (75% larger for bird to fly through) */
.parallax-mountains-scene {
    position: absolute;
    top: 70px;
    left: 0;
    width: 1575px; /* 900 * 1.75 */
    height: 875px; /* 500 * 1.75 */
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

/* Trees Scene - Center-Right Section (reduced 60% from original) */
.parallax-trees-scene {
    position: absolute;
    top: calc(45% - 680px);
    left: calc(60% + 100px);
    transform: translateX(-50%);
    width: 700px;
    height: 385px;
    pointer-events: none;
    z-index: 6;
    overflow: visible;
    opacity: 0;
}

/* Mountain Layers */
.parallax-layer {
    position: absolute;
    bottom: 0;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    will-change: transform, opacity;
}

.parallax-mountains-left {
    left: 0;
    width: 55%;
    background-position: left bottom;
    background-image: url('../img/parallax/mountains_snowbird_left.svg');
}

.parallax-mountains-right {
    right: 0;
    width: 55%;
    background-position: right bottom;
    background-image: url('../img/parallax/mountains_snowbird_right.svg');
}

/* Tree Layers */
.parallax-trees-left {
    left: 200px;
    width: 55%;
    height: 100%;
    background-position: left bottom;
    background-image: url('../img/parallax/trees_snowbird_left.svg');
}

.parallax-trees-right {
    right: 0;
    width: 55%;
    height: 100%;
    background-position: right bottom;
    background-image: url('../img/parallax/trees_snowbird_right.svg');
}

/* Flying Bird Video - FIXED Y position (viewport center), X controlled by scroll */
.flying-bird-video {
    position: fixed;
    top: 50%;
    left: 80px;
    transform: translateY(-50%);
    width: 280px;
    height: 280px;
    z-index: 4; /* Behind mountains (z-index: 5) */
    opacity: 0; /* Hidden until section is in view */
    pointer-events: none;
    overflow: visible;
}

.flying-bird-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   CONTENT CONTAINER
   ============================================ */

.services-parallax-content {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 24px 120px;
}

/* Header */
.services-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 80px;
    gap: 40px;
}

.services-header-left {
    max-width: 600px;
}

.services-subtitle {
    color: #336DFF;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.services-title {
    color: #ffffff;
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease 0.1s;
}

.services-title span {
    color: #336DFF;
}

.services-header-cta {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.2s;
}

.services-header-cta .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #336DFF;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 18px 36px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.services-header-cta .btn-primary:hover {
    background: #1a4fd6;
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(51, 109, 255, 0.4);
}

.services-header-cta .btn-primary svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.services-header-cta .btn-primary:hover svg {
    transform: translateX(4px);
}

/* Animated state - header */
.services-parallax-section.in-view .services-subtitle,
.services-parallax-section.in-view .services-title,
.services-parallax-section.in-view .services-header-cta {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   STACKING CARDS LAYOUT - Fan Out Left
   ============================================ */

.services-grid {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 500px;
    padding: 60px 5% 0 0;
    margin-bottom: 0;
    perspective: 1500px;
}

/* Service Card - Stacked */
.service-card {
    position: absolute;
    right: 5%;
    width: 420px;
    height: 380px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px 36px;
    backdrop-filter: blur(10px);
    transform-origin: center center;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
    cursor: pointer;
}

/* Clickable card - entire card is a link */
.service-card[data-href] {
    cursor: pointer;
}

/* Initial stacked position - all cards overlapped on right */
.service-card:nth-child(1) {
    z-index: 3;
    transform: translateX(0);
}

.service-card:nth-child(2) {
    z-index: 2;
    transform: translateX(0);
}

.service-card:nth-child(3) {
    z-index: 1;
    transform: translateX(0);
}

/* Fan out state - triggered by scroll via JS */
.services-grid.fanned .service-card:nth-child(1) {
    transform: translateX(-880px);
}

.services-grid.fanned .service-card:nth-child(2) {
    transform: translateX(-440px);
}

.services-grid.fanned .service-card:nth-child(3) {
    transform: translateX(0);
}

/* Hover effect when fanned */
.services-grid.fanned .service-card:hover {
    z-index: 10;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(51, 109, 255, 0.4);
}

/* Card Number */
.service-card-number {
    position: absolute;
    top: 24px;
    right: 28px;
    font-size: 72px;
    font-weight: 800;
    color: rgba(51, 109, 255, 0.1);
    line-height: 1;
}

/* Card Icon */
.service-card-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(51, 109, 255, 0.2) 0%, rgba(51, 109, 255, 0.1) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    transition: all 0.3s ease;
}

.service-card:hover .service-card-icon {
    background: linear-gradient(135deg, #336DFF 0%, #1a4fd6 100%);
    transform: scale(1.1);
}

.service-card-icon img {
    width: 32px;
    height: 32px;
    filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(1352%) hue-rotate(213deg) brightness(100%) contrast(103%);
    transition: filter 0.3s ease;
}

.service-card:hover .service-card-icon img {
    filter: brightness(0) invert(1);
}

/* Card Content - ALL TEXT WHITE (including bold) */
.service-card-title {
    color: #ffffff !important;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.3;
}

.service-card-text,
.service-card-text p,
.service-card-text strong,
.service-card-text b,
.service-card-text span,
.service-card p,
.service-card strong,
.service-card b,
.service-card .text,
.service-card span,
.service-card * {
    color: #ffffff !important;
    opacity: 1 !important;
}

.service-card-text {
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 24px;
}

.service-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #336DFF;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.service-card-link:hover {
    color: #ffffff;
    gap: 12px;
}

.service-card-link svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.service-card-link:hover svg {
    transform: translateX(4px);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1400px) {
    .service-card {
        width: 380px;
        height: 360px;
    }

    .services-grid.fanned .service-card:nth-child(1) {
        transform: translateX(-780px);
    }

    .services-grid.fanned .service-card:nth-child(2) {
        transform: translateX(-390px);
    }
}

@media (max-width: 1024px) {
    .parallax-mountains-scene {
        width: 1000px;
        height: 560px;
    }

    .parallax-trees-scene {
        width: 550px;
        height: 300px;
    }

    .services-parallax-content {
        padding: 80px 24px;
    }

    .services-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 60px;
    }

    .service-card {
        width: 340px;
        height: 340px;
    }

    .services-grid.fanned .service-card:nth-child(1) {
        transform: translateX(-700px);
    }

    .services-grid.fanned .service-card:nth-child(2) {
        transform: translateX(-350px);
    }

    .flying-bird-video {
        width: 220px;
    }
}

/* Mobile - Static Vertical Stack (No Animation) */
@media (max-width: 900px) {
    .services-parallax-section {
        min-height: auto !important;
        padding: 40px 0 60px !important;
    }

    /* Hide parallax elements on mobile */
    .parallax-mountains-scene,
    .parallax-trees-scene,
    .flying-bird-video {
        display: none !important;
    }

    .services-parallax-content {
        padding: 0 20px !important;
    }

    .services-header {
        margin-bottom: 32px !important;
    }

    .services-header-left {
        max-width: 100% !important;
    }

    .services-title {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    .services-subtitle {
        opacity: 1 !important;
        transform: none !important;
    }

    .services-title {
        opacity: 1 !important;
        transform: none !important;
    }

    .services-header-cta {
        display: none !important;
    }

    /* Static flexbox layout - no absolute positioning */
    .services-grid {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        min-height: auto !important;
        height: auto !important;
        padding: 0 !important;
        gap: 20px !important;
        perspective: none !important;
    }

    /* Remove fanned state on mobile */
    .services-grid.fanned {
        min-height: auto !important;
    }

    /* Cards as static block elements - FORCE override all states */
    .service-card,
    .service-card:nth-child(1),
    .service-card:nth-child(2),
    .service-card:nth-child(3),
    .service-card:nth-child(4),
    .services-grid .service-card,
    .services-grid.fanned .service-card,
    .services-grid.fanned .service-card:nth-child(1),
    .services-grid.fanned .service-card:nth-child(2),
    .services-grid.fanned .service-card:nth-child(3),
    .services-grid.fanned .service-card:nth-child(4) {
        position: static !important;
        position: relative !important;
        right: auto !important;
        left: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        padding: 25px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        z-index: 1 !important;
    }

    .service-card-number {
        font-size: 48px !important;
        top: 16px !important;
        right: 20px !important;
    }

    .service-card-icon {
        width: 56px !important;
        height: 56px !important;
        margin-bottom: 16px !important;
    }

    .service-card-icon img {
        width: 28px !important;
        height: 28px !important;
    }

    .service-card-title {
        font-size: 20px !important;
        margin-bottom: 12px !important;
    }

    .service-card-text {
        font-size: 14px !important;
        line-height: 1.6 !important;
        margin-bottom: 16px !important;
    }

    .service-card-link {
        font-size: 14px !important;
    }
}
