﻿.services-parallax {
    --sp-progress: 0;
    --sp-card-w: 26rem;
    --sp-card-h: 8.1rem;
    --sp-target-opacity: 1;
    position: relative;
    isolation: isolate;
    background: #000;
}

.services-parallax__hero {
    position: relative;
    min-height: calc(135vh - 5rem);
    overflow: hidden;
    background: radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.08), transparent 28%), radial-gradient(circle at 82% 64%, rgba(255, 255, 255, 0.055), transparent 32%), linear-gradient(180deg, rgba(0, 0, 0, 0.98), rgba(4, 4, 5, 1));
}

.services-parallax__hero-inner {
    position: relative;
    z-index: 8;
    width: min(100%, 96rem);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 4rem);
    padding-top: clamp(5rem, 12vh, 8rem);
}

.services-parallax__bg,
.services-parallax__mesh,
.services-parallax__floor,
.services-parallax__glow {
    position: absolute;
    pointer-events: none;
}

.services-parallax__bg {
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.services-parallax__mesh {
    inset: -12% -8%;
    opacity: 0.52;
    background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 58px 58px;
    transform: translate3d(0, calc(var(--sp-progress) * -38px), -120px) rotateX(58deg) scale(1.35);
    transform-origin: center 18%;
    mask-image: radial-gradient(ellipse at center, black 34%, transparent 74%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 34%, transparent 74%);
}

.services-parallax__floor {
    left: -10%;
    right: -10%;
    bottom: -12%;
    height: 42%;
    opacity: calc(0.22 + (var(--sp-progress) * 0.32));
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.16), transparent 58%), linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.045), transparent);
    filter: blur(18px);
    transform: translate3d(0, calc(var(--sp-progress) * 20px), 0);
}

.services-parallax__glow {
    width: 28rem;
    height: 28rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    filter: blur(96px);
    opacity: 0.48;
}

.services-parallax__glow--left {
    left: -12rem;
    top: 8%;
}

.services-parallax__glow--right {
    right: -13rem;
    bottom: 10%;
}

.services-parallax__hero-copy {
    position: relative;
    z-index: 12;
    max-width: 43rem;
    pointer-events: none;
}

.services-parallax__eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.2rem;
    padding: 0.42rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.028)), rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 14px 28px -22px rgba(255, 255, 255, 0.25);
}

.services-parallax__title {
    margin-top: 1.75rem;
    max-width: 12ch;
    font-family: Space Grotesk, system-ui, sans-serif;
    font-size: clamp(3rem, 6vw, 6.1rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.065em;
    color: hsl(var(--foreground));
    text-wrap: balance;
}

.services-parallax__subtitle {
    margin-top: 1.75rem;
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: clamp(1rem, 1.3vw, 1.22rem);
    line-height: 1.75;
}

/* Animated moving layer */
.services-parallax__cards {
    position: fixed;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s linear;
}

.services-parallax.is-ready .services-parallax__cards {
    opacity: 1;
}

.services-parallax.is-finished .services-parallax__cards {
    opacity: 0;
}

.services-parallax__card {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--sp-card-w);
    height: var(--sp-card-h);
    transform-style: preserve-3d;
    transform-origin: center center;
    opacity: 0;
    will-change: transform, opacity, filter, width, height;
}

/* Real next section */
.services-parallax__settle {
    position: relative;
    z-index: 4;
    min-height: 100vh;
    padding: clamp(5rem, 10vh, 8rem) 0 clamp(6rem, 12vh, 9rem);
    margin-top: -12vh;
    background: radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.075), transparent 42%), linear-gradient(180deg, rgba(3, 3, 4, 0.35), #000 34%, #000 100%);
}

.services-parallax__settle-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: radial-gradient(ellipse at center, black 28%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 28%, transparent 78%);
}

.services-parallax__settle-inner {
    position: relative;
    z-index: 2;
}

.services-parallax__settle-panel {
    position: relative;
    overflow: visible;
    width: min(100%, 86rem);
    margin-inline: auto;
    padding: clamp(3rem, 5vw, 5rem) clamp(1.25rem, 5vw, 5rem) clamp(3.5rem, 5vw, 5rem);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: clamp(1.3rem, 2vw, 2.4rem);
    background: radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.08), transparent 42%), linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.012));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 34px 80px -58px rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
}

.services-parallax__capability-heading {
    text-align: center;
}

    .services-parallax__capability-heading h2 {
        margin-top: 1.2rem;
        font-family: Space Grotesk, system-ui, sans-serif;
        font-size: clamp(2.15rem, 4vw, 3.4rem);
        font-weight: 800;
        line-height: 1;
        letter-spacing: -0.05em;
        color: hsl(var(--foreground));
    }

.services-parallax__target-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1.15rem, 1.8vw, 1.7rem);
    margin-top: clamp(2.5rem, 4vw, 4rem);
}

.services-parallax__target-card {
    min-height: 8.1rem;
    opacity: var(--sp-target-opacity, 1);
    transition: opacity 0.12s linear;
}

.services-parallax.is-js .services-parallax__target-card {
    opacity: var(--sp-target-opacity, 0);
}

/* Shared card design */
.services-parallax__card-inner {
    position: relative;
    display: flex;
    height: 100%;
    min-height: inherit;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 1.45rem 1.65rem;
    border: 1px solid rgba(255, 255, 255, 0.115);
    border-radius: 1.15rem;
    background: radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.11), transparent 38%), linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)), rgba(13, 13, 15, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 28px 70px -42px rgba(0, 0, 0, 0.92), 0 10px 36px -32px rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(14px);
}

    .services-parallax__card-inner::before {
        content: "";
        position: absolute;
        inset: 0;
        opacity: calc(0.18 + (var(--sp-progress) * 0.4));
        background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.085) 42%, transparent 72%);
        transform: translateX(calc(-58% + (var(--sp-progress) * 104%)));
        pointer-events: none;
    }

    .services-parallax__card-inner::after {
        content: "";
        position: absolute;
        left: 1.2rem;
        right: 1.2rem;
        bottom: 0;
        height: 1px;
        opacity: 0.78;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
        pointer-events: none;
    }

.services-parallax__card-icon {
    width: 1.35rem;
    height: 1.35rem;
    color: rgba(255, 255, 255, 0.72);
}

.services-parallax__card h3,
.services-parallax__target-card h3 {
    position: relative;
    z-index: 1;
    margin-top: 1.1rem;
    max-width: 18rem;
    font-family: Space Grotesk, system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.95rem, 1.05vw, 1.08rem);
    font-weight: 650;
    line-height: 1.28;
    letter-spacing: -0.02em;
}

.services-parallax__target-card:hover .services-parallax__card-inner {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 34px 80px -48px rgba(255, 255, 255, 0.18), 0 20px 55px -42px rgba(0, 0, 0, 0.96);
}

.services-parallax__scroll-hint {
    position: absolute;
    z-index: 12;
    left: 50%;
    bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    opacity: var(--sp-hint-opacity, 1);
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    pointer-events: none;
}

    .services-parallax__scroll-hint span {
        display: block;
        width: 2.8rem;
        height: 1px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.14);
    }

        .services-parallax__scroll-hint span::after {
            content: "";
            display: block;
            width: 45%;
            height: 100%;
            background: rgba(255, 255, 255, 0.75);
            animation: servicesParallaxHint 2.4s ease-in-out infinite;
        }

@keyframes servicesParallaxHint {
    0% {
        transform: translateX(-120%);
    }

    55%, 100% {
        transform: translateX(250%);
    }
}

@media (max-width: 1180px) {
    .services-parallax {
        --sp-card-w: 20.5rem;
        --sp-card-h: 7.45rem;
    }

    .services-parallax__title {
        font-size: clamp(2.75rem, 5.5vw, 4.8rem);
    }

    .services-parallax__target-grid {
        gap: 1rem;
    }
}

@media (max-width: 899px) {
    .services-parallax__hero {
        min-height: auto;
        padding-bottom: 5rem;
    }

    .services-parallax__hero-inner {
        padding-inline: 1.5rem;
        padding-top: 5.5rem;
    }

    .services-parallax__cards {
        display: none;
    }

    .services-parallax__scroll-hint {
        display: none;
    }

    .services-parallax__settle {
        min-height: auto;
        margin-top: 0;
        padding: 2rem 0 5rem;
    }

    .services-parallax__settle-panel {
        padding: 2.25rem 1.25rem;
        border-radius: 1.35rem;
    }

    .services-parallax__target-grid {
        grid-template-columns: 1fr;
    }

    .services-parallax__target-card,
    .services-parallax.is-js .services-parallax__target-card {
        opacity: 1 !important;
        min-height: 7rem;
    }
}

@media (min-width: 640px) and (max-width: 899px) {
    .services-parallax__target-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .services-parallax__cards,
    .services-parallax__scroll-hint {
        display: none;
    }

    .services-parallax.is-js .services-parallax__target-card,
    .services-parallax__target-card {
        opacity: 1 !important;
    }

    .services-parallax__hero {
        min-height: auto;
        padding-bottom: 5rem;
    }

    .services-parallax__settle {
        min-height: auto;
        margin-top: 0;
    }

    .services-parallax__scroll-hint span::after {
        animation: none;
    }
}
