/*!
 * Homepage "Featured Services" — 3D card section. Shree Umiya Structure Pvt. Ltd.   v1.3.0
 * v1.3 — card backs: original SUSPL logo on a white plate + the service name (replaces the SVG emblem).
 * Scoped to .sfx-services. Plain CSS values only (no clamp(), calc() or var()).
 * v1.2 — Lusion-style sequence: stacked deck → separate → turn 1 (flip to front) → turn 2 (face flat).
 *        No grid lines; brand watermark behind the cards; full-height cards (3:2 photos);
 *        each card has its own 3D space (no card can cut through another); open cards float.
 * Layout: phones = swipe carousel · 768–991 = 2 + 1 · ≥992 = three in a row.
 * Motion: js/suspl-services.js (GSAP + ScrollTrigger already on the page) — the card stage is pinned
 *         below the fixed header and the four stages follow the scroll (reverses when scrolling back);
 *         windows too short to pin play the same four stages once by time; phones: simple rise-in.
 * No JS / reduced motion: the finished row of cards is shown as is.
 */

/* ======================================================================
   Section + background
   ====================================================================== */
section.sfx-services {
    position: relative;
    z-index: 1;
    overflow: hidden;
    padding: 100px 0 110px;
    background:
        radial-gradient(60% 55% at 50% 62%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
        linear-gradient(180deg, #ffffff 0%, #f2f5f9 38%, #eef2f7 100%);
}

.sfx-services *,
.sfx-services *::before,
.sfx-services *::after {
    box-sizing: border-box;
}

.sfx-services__wrap {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
}

/* ======================================================================
   Heading (existing content and classes)
   ====================================================================== */
.sfx-services__head {
    max-width: 860px;
    margin: 0 auto 48px;
    text-align: center;
}

.sfx-services .sfx-services__title {
    margin-bottom: 14px;
}

.sfx-services .sfx-services__lead {
    max-width: 640px;
    margin: 0 auto;
    color: #5d6570;
    text-align: center;
}

/* ======================================================================
   Cards
   ====================================================================== */
.sfx-services__stage {
    position: relative;
    z-index: 0;
    perspective: 1600px;
    perspective-origin: 50% 40%;
}

/* brand watermark: the real transparent logo, original colours, very light, behind the cards */
.sfx-services .sfx-services__mark {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    display: block;
    width: 560px;
    max-width: 62%;
    height: auto;
    margin: 0;
    border: 0;
    background: none;
    box-shadow: none;
    opacity: 0.07;
    transform: translate(-50%, -50%);
    pointer-events: none;
    user-select: none;
}

/* the row is flat: every card is drawn in its own 3D space and stacked by z-index,
   so a card that turns can never slice through (or clip) its neighbour */
.sfx-services ul.sfx-services__row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    list-style: none;
    transform-style: flat;
}

.sfx-services .sfx-card {
    position: relative;
    display: flex;
    width: 31.5%;
    margin: 0;
    padding: 0;
    list-style: none;
    perspective: 1600px;
    transform-style: flat;
}

/* card 1 lies on top of the deck, card 3 at the bottom */
.sfx-services .sfx-card--1 { z-index: 3; }
.sfx-services .sfx-card--2 { z-index: 2; }
.sfx-services .sfx-card--3 { z-index: 1; }

/* gentle float once the cards are open (the translate property adds to the transforms) */
@keyframes sfx-float {
    0%,
    100% { translate: 0 0; }
    50% { translate: 0 -9px; }
}

.sfx-services.is-dealt .sfx-card__lift,
.sfx-services.is-static .sfx-card__lift {
    animation: sfx-float 5.6s ease-in-out infinite;
}

.sfx-services .sfx-card--2 .sfx-card__lift { animation-delay: -1.9s; }
.sfx-services .sfx-card--3 .sfx-card__lift { animation-delay: -3.7s; }

.sfx-card__lift {
    display: flex;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.sfx-card__inner {
    position: relative;
    display: flex;
    width: 100%;
    transform-style: preserve-3d;
}

.sfx-card__face {
    border-radius: 14px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ---------- front ---------- */
.sfx-card__front {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    border: 1px solid #dde4ec;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(16, 37, 61, 0.10), 0 2px 6px rgba(16, 37, 61, 0.05);
    transition: box-shadow 0.5s ease, border-color 0.5s ease;
}

.sfx-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    background: #dfe6ee;
}

.sfx-card__img-wrap {
    position: absolute;
    top: -6%;
    right: 0;
    bottom: -6%;
    left: 0;
    display: block;
}

.sfx-card__img-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* soft charcoal gradient at the bottom of the photo */
.sfx-card__media::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(20, 30, 42, 0) 0%, rgba(20, 30, 42, 0.38) 100%);
    pointer-events: none;
}

.sfx-card__num {
    position: absolute;
    left: 18px;
    bottom: 14px;
    z-index: 1;
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.16em;
}

.sfx-card__num::before {
    content: "";
    display: inline-block;
    width: 22px;
    height: 2px;
    margin: 0 10px 3px 0;
    background: #e99022;
    vertical-align: middle;
}

.sfx-card__body {
    flex: 1 1 auto;
    padding: 26px 30px 22px;
}

.sfx-services .sfx-card__title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.sfx-services .sfx-card__title a {
    color: #1d2733;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sfx-services .sfx-card__title a:hover {
    color: #2d5174;
}

.sfx-services p.sfx-card__text {
    margin: 0;
    color: #5d6570;
    font-size: 15.5px;
    line-height: 1.6;
    text-align: left;
}

.sfx-card__foot {
    padding: 16px 30px 20px;
    border-top: 1px solid #e6ebf1;
}

.sfx-services .sfx-card__more {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    color: #2d5174;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sfx-card__arrow {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border: 1px solid rgba(45, 81, 116, 0.3);
    border-radius: 50%;
    font-size: 13px;
    transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.sfx-card__arrow i {
    position: absolute;
    transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.sfx-card__arrow i + i {
    transform: translateX(-30px);
}

.sfx-services .sfx-card__more:hover,
.sfx-services .sfx-card__more:focus-visible {
    color: #e99022;
}

.sfx-card__more:hover .sfx-card__arrow,
.sfx-card__more:focus-visible .sfx-card__arrow {
    border-color: #e99022;
    background: #e99022;
    color: #ffffff;
}

.sfx-card__more:hover .sfx-card__arrow i,
.sfx-card__more:focus-visible .sfx-card__arrow i {
    transform: translateX(30px);
}

.sfx-card__more:hover .sfx-card__arrow i + i,
.sfx-card__more:focus-visible .sfx-card__arrow i + i {
    transform: translateX(0);
}

.sfx-services a:focus-visible {
    outline: 2px solid #e99022;
    outline-offset: 3px;
}

/* ---------- back (blueprint card back, seen while the deck is dealt) ---------- */
.sfx-card__back {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    border: 1px solid #1b3854;
    background-color: #24476b;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, rgba(255, 255, 255, 0) 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, rgba(255, 255, 255, 0) 1px),
        linear-gradient(160deg, #2d5174 0%, #1d3a58 100%);
    background-size: 24px 24px, 24px 24px, 100% 100%;
    background-position: 50% 50%;
    color: #ffffff;
    transform: rotateY(180deg);
    box-shadow: 0 18px 40px rgba(16, 37, 61, 0.18);
}

.sfx-card__back::before,
.sfx-card__back::after {
    content: "";
    position: absolute;
    border-radius: 9px;
    pointer-events: none;
}

.sfx-card__back::before {
    top: 14px;
    right: 14px;
    bottom: 14px;
    left: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
}

.sfx-card__back::after {
    top: 22px;
    right: 22px;
    bottom: 22px;
    left: 22px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background:
        linear-gradient(35deg, rgba(255, 255, 255, 0) 49.6%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0) 50.4%),
        linear-gradient(-35deg, rgba(255, 255, 255, 0) 49.6%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 255, 255, 0) 50.4%);
}

/* centre of the card back: the original SUSPL logo on a white rounded plate + the service name */
.sfx-back__brand {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 64%;
    transform: translate(-50%, -50%);
}

.sfx-back__plate {
    display: block;
    width: 100%;
    padding: 12% 11%;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(5, 18, 35, 0.35), 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.sfx-services .sfx-back__plate img {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
}

.sfx-back__name {
    display: block;
    margin-top: 18px;
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.16em;
    text-align: center;
    text-transform: uppercase;
}

/* thin orange rule between logo and name, as on the old emblem */
.sfx-back__name::before {
    content: "";
    display: block;
    width: 36px;
    height: 2px;
    margin: 0 auto 12px;
    background: #e99022;
}

.sfx-back__corner {
    position: absolute;
    z-index: 1;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.12em;
}

.sfx-back__corner--tl {
    top: 34px;
    left: 34px;
}

.sfx-back__corner--br {
    right: 34px;
    bottom: 34px;
    transform: rotate(180deg);
}

/* carousel dots (phones only) */
.sfx-services__dots {
    display: none;
}

/* ======================================================================
   Hover (fine pointers, once the cards are dealt)
   ====================================================================== */
@media (hover: hover) and (pointer: fine) {
    .sfx-services.is-dealt .sfx-card:hover .sfx-card__lift,
    .sfx-services.is-static .sfx-card:hover .sfx-card__lift,
    .sfx-services.is-dealt .sfx-card:focus-within .sfx-card__lift {
        transform: translateY(-10px) translateZ(40px) rotateX(3deg);
        animation-play-state: paused;
    }

    .sfx-services .sfx-card:hover .sfx-card__front {
        border-color: #b9c9da;
        box-shadow: 0 34px 60px rgba(16, 37, 61, 0.18), 0 0 0 1px rgba(45, 81, 116, 0.08);
    }

    .sfx-services .sfx-card:hover .sfx-card__img-wrap img {
        transform: scale(1.08);
    }
}

/* ======================================================================
   Sizes and layouts per screen range
   ====================================================================== */

/* desktop: the heading sits below the fixed header */
@media (min-width: 1200px) {
    section.sfx-services { padding: 108px 0 64px; }
}

/* pinned (JS): the heading scrolls away normally, then the card stage — one window high — is held
   while the cards go through their four stages. Its top padding clears the fixed header; the cards
   are centred in the room below it. The photos keep 3:2; JS scales the row only if it must. */
section.sfx-services.is-pinned { padding-bottom: 0; }

section.sfx-services.is-pinned .sfx-services__head { margin-bottom: 10px; }

section.sfx-services.is-pinned .sfx-services__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 92px 0 28px;
}

section.sfx-services.is-pinned ul.sfx-services__row {
    flex: 0 0 auto;
    width: 100%;
}

@media (min-width: 1600px) {
    section.sfx-services.is-pinned .sfx-services__stage { padding-top: 108px; }
}

@media (min-width: 1920px) {
    section.sfx-services.is-pinned .sfx-services__stage { padding: 120px 0 36px; }
}

@media (min-width: 2560px) {
    section.sfx-services.is-pinned .sfx-services__stage { padding: 160px 0 48px; }
}

@media (min-width: 3840px) {
    section.sfx-services.is-pinned .sfx-services__stage { padding: 240px 0 72px; }
}

@media (min-width: 1600px) {
    .sfx-services__wrap { max-width: 1440px; }
}

@media (min-width: 1920px) {
    section.sfx-services { padding: 128px 0 80px; }
    .sfx-services__wrap { max-width: 1640px; }
    .sfx-services__head { max-width: 980px; margin-bottom: 60px; }
    .sfx-services .sfx-services__lead { max-width: 720px; font-size: 18px; }
    .sfx-services .sfx-card__title { font-size: 26px; }
    .sfx-services p.sfx-card__text { font-size: 17px; }
    .sfx-card__body { padding: 30px 36px 26px; }
    .sfx-card__foot { padding: 18px 36px 24px; }
    .sfx-services .sfx-card__more { font-size: 16.5px; }
    .sfx-card__arrow { width: 38px; height: 38px; font-size: 14px; }
    .sfx-back__name { font-size: 17px; }
    .sfx-services .sfx-services__mark { width: 680px; }
}

@media (min-width: 2560px) {
    section.sfx-services { padding: 170px 0 110px; }
    .sfx-services__wrap { max-width: 2200px; }
    .sfx-services__head { max-width: 1300px; margin-bottom: 80px; }
    .sfx-services .sfx-services__lead { max-width: 960px; font-size: 24px; }
    .sfx-services .sfx-card__title { font-size: 34px; }
    .sfx-services p.sfx-card__text { font-size: 22px; }
    .sfx-card__face { border-radius: 18px; }
    .sfx-card__body { padding: 40px 48px 34px; }
    .sfx-card__foot { padding: 24px 48px 32px; }
    .sfx-services .sfx-card__more { font-size: 21px; gap: 16px; }
    .sfx-card__arrow { width: 50px; height: 50px; font-size: 18px; }
    .sfx-card__num { left: 26px; bottom: 22px; font-size: 17px; }
    .sfx-back__corner { font-size: 19px; }
    .sfx-back__plate { border-radius: 18px; }
    .sfx-back__name { margin-top: 24px; font-size: 21px; }
    .sfx-back__name::before { width: 50px; height: 3px; margin-bottom: 16px; }
    .sfx-services .sfx-services__mark { width: 920px; }
    .sfx-services .sfx-card { perspective: 2400px; }
}

@media (min-width: 3840px) {
    section.sfx-services { padding: 250px 0 160px; }
    .sfx-services__wrap { max-width: 3300px; }
    .sfx-services__head { max-width: 1950px; margin-bottom: 120px; }
    .sfx-services .sfx-services__lead { max-width: 1440px; font-size: 36px; }
    .sfx-services .sfx-card__title { font-size: 51px; }
    .sfx-services p.sfx-card__text { font-size: 33px; }
    .sfx-card__face { border-radius: 26px; }
    .sfx-card__body { padding: 60px 72px 50px; }
    .sfx-card__foot { padding: 36px 72px 48px; }
    .sfx-services .sfx-card__more { font-size: 31px; gap: 24px; }
    .sfx-card__arrow { width: 74px; height: 74px; font-size: 26px; }
    .sfx-card__num { left: 40px; bottom: 34px; font-size: 25px; }
    .sfx-card__num::before { width: 40px; height: 3px; }
    .sfx-back__corner { font-size: 28px; }
    .sfx-back__plate { border-radius: 26px; }
    .sfx-back__name { margin-top: 36px; font-size: 31px; }
    .sfx-back__name::before { width: 74px; height: 4px; margin-bottom: 24px; }
    .sfx-services .sfx-services__mark { width: 1380px; }
    .sfx-services .sfx-card { perspective: 3600px; }
}

@media (min-width: 5120px) {
    .sfx-services__wrap { max-width: 4400px; }
    .sfx-services .sfx-services__lead { max-width: 1900px; font-size: 48px; }
    .sfx-services .sfx-card__title { font-size: 68px; }
    .sfx-services p.sfx-card__text { font-size: 44px; }
    .sfx-card__body { padding: 80px 96px 66px; }
    .sfx-card__foot { padding: 48px 96px 64px; }
    .sfx-services .sfx-card__more { font-size: 41px; }
    .sfx-card__arrow { width: 98px; height: 98px; font-size: 34px; }
    .sfx-services .sfx-services__mark { width: 1840px; }
    .sfx-services .sfx-card { perspective: 4800px; }
}

/* small laptops / tablet landscape: three columns, slightly smaller */
@media (max-width: 1199px) {
    section.sfx-services { padding: 80px 0 90px; }
    .sfx-services__wrap { width: 92%; }
    .sfx-services__head { margin-bottom: 40px; }
    .sfx-services .sfx-card { width: 32%; }
    .sfx-card__body { padding: 22px 22px 18px; }
    .sfx-card__foot { padding: 14px 22px 16px; }
    .sfx-services .sfx-card__title { font-size: 20px; }
    .sfx-services p.sfx-card__text { font-size: 15px; }
    .sfx-services__stage { perspective: 1200px; }
    .sfx-back__name { margin-top: 14px; font-size: 13px; letter-spacing: 0.14em; }
    .sfx-back__plate { border-radius: 12px; }
    .sfx-services .sfx-card { perspective: 1300px; }
    .sfx-services .sfx-services__mark { width: 460px; max-width: 58%; }
}

/* tablets: two cards + the third centred below */
@media (max-width: 991px) {
    .sfx-services ul.sfx-services__row {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 30px;
        column-gap: 4%;
    }
    .sfx-services .sfx-card,
    .sfx-services .sfx-card--3 { width: 48%; }
    .sfx-services .sfx-services__mark { width: 400px; max-width: 64%; }
}

/* phones: swipe carousel, one card per view with the next one peeking */
@media (max-width: 767px) {
    section.sfx-services { padding: 64px 0 64px; }
    .sfx-services__wrap { width: 100%; }
    .sfx-services__head { width: 88%; margin-bottom: 30px; }
    .sfx-services__stage { perspective: none; }
    .sfx-services .sfx-services__mark { top: 46%; width: 240px; max-width: 70%; opacity: 0.08; }
    .sfx-services .sfx-card { perspective: none; }
    .sfx-services.is-dealt .sfx-card__lift { animation: none; }
    .sfx-services ul.sfx-services__row {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 14px;
        padding: 6px 6% 26px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 6%;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        transform-style: flat;
    }
    .sfx-services ul.sfx-services__row::-webkit-scrollbar { display: none; }
    .sfx-services .sfx-card,
    .sfx-services .sfx-card--3 {
        flex: 0 0 84%;
        width: 84%;
        scroll-snap-align: start;
        transform-style: flat;
    }
    .sfx-card__lift,
    .sfx-card__inner { transform-style: flat; }
    .sfx-card__back { display: none; }
    .sfx-card__body { padding: 20px 20px 16px; }
    .sfx-card__foot { padding: 10px 20px 12px; }
    .sfx-services .sfx-card__title { font-size: 19px; }
    .sfx-services p.sfx-card__text { font-size: 15px; }
    .sfx-services .sfx-card__more { min-height: 44px; }
    .sfx-card__front { box-shadow: 0 12px 28px rgba(16, 37, 61, 0.10), 0 2px 6px rgba(16, 37, 61, 0.05); }
    .sfx-services__dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 4px;
    }
    .sfx-services__dots span {
        display: block;
        width: 8px;
        height: 8px;
        border-radius: 8px;
        background: #c3cfdc;
        transition: width 0.3s ease, background-color 0.3s ease;
    }
    .sfx-services__dots span.is-on {
        width: 24px;
        background: #2d5174;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .sfx-services .sfx-card,
    .sfx-services .sfx-card--3 { flex: 0 0 64%; width: 64%; }
}

@media (max-width: 374px) {
    .sfx-services .sfx-card,
    .sfx-services .sfx-card--3 { flex: 0 0 88%; width: 88%; }
    .sfx-services ul.sfx-services__row { padding-left: 6%; padding-right: 6%; }
    .sfx-card__body { padding: 18px 16px 14px; }
    .sfx-card__foot { padding: 8px 16px 10px; }
    .sfx-services .sfx-card__title { font-size: 18px; }
    .sfx-services p.sfx-card__text { font-size: 14.5px; }
}

/* ======================================================================
   Reduced motion: no 3D, no zoom
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
    .sfx-services.is-dealt .sfx-card__lift,
    .sfx-services.is-static .sfx-card__lift { animation: none !important; }
    .sfx-card__lift,
    .sfx-card__img-wrap img,
    .sfx-card__front,
    .sfx-card__arrow,
    .sfx-card__arrow i,
    .sfx-services__dots span { transition: none !important; }
    .sfx-services .sfx-card:hover .sfx-card__lift { transform: none !important; }
    .sfx-services .sfx-card:hover .sfx-card__img-wrap img { transform: scale(1.02); }
}
