/* Services / Sticky Cards Section */
.services {
    padding: var(--spacing-xxl) 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

.services-title {
    text-align: center;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    color: #0f2e4a;
    max-width: 940px;
    margin: 0 auto;
    letter-spacing: -2.08px;
    font-weight: 500;
    font-family: var(--font-secondary);
    margin-bottom: var(--spacing-xxl);
}

.services-title span {
    font-weight: 300;
    font-style: italic;
}

.services-cards-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 1016px;
    margin: 0 auto;
    padding-bottom: 50px;
}

.service-card {
    position: sticky;
    top: 120px;
    /* Offset to stack below header */
    min-height: 480px;
    background-color: var(--color-white);
    border-radius: 32px;
    border: 1px solid var(--color-border);
    box-shadow: 0px 5px 10px 2px rgba(0, 0, 0, 0.05);
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 59px;
}

/* Creating stacking effect visually by adding slight top margin variation dynamically or through structural stacking */
.service-card:nth-child(1) {
    top: 0;
}

.service-card:nth-child(2) {
    top: 240px;
}

.service-card:nth-child(3) {
    top: 80px;
}


.service-card-image {
    position: relative;
    flex-shrink: 0;
    width: 448px;
    height: 420px;
    background-color: var(--color-blue-brand);
    border-radius: 10px;
    overflow: hidden;
}

.service-image-vectors {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    z-index: 1;
}

.service-image-vectors img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-image-main {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.services::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 480px; /* Adjust height based on how much of the bottom should be covered */
    background-image: url('../../assets/icons/bg-pattern-grey.svg');
    background-repeat: repeat;
    background-position: center bottom;
    background-size: 352px;
    z-index: -1;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, transparent, black 40%);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%);
}

.service-card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    flex: 1;
}

.service-card-title {
    font-size: 38px;
    color: #0f2e4a;
    font-family: var(--font-secondary);
    letter-spacing: -0.8px;
    margin-bottom: 20px;
    font-weight: 400;
}

.service-card-desc {
    color: #616161;
    font-size: 16.5px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.service-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #f1f1f2;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 14.5px;
    color: var(--color-text);
    font-family: var(--font-secondary);
}

.service-tag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary-hover);
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.service-tag-icon img {
    /* If img needs filter to true white color over hover */
    width: 10px;
    height: 10px;
}

.services-action {
    display: flex;
    justify-content: center;
}

@media (max-width: 900px) {
    .service-card {
        flex-direction: column;
        height: auto;
        min-height: auto;
        padding: 24px;
        gap: 24px;
        border-radius: 24px;
    }

    /* Sticky stacking on mobile — each card sits slightly lower */
    .service-card:nth-child(1) {
        top: 16px;
    }

    .service-card:nth-child(2) {
        top: 32px;
    }

    .service-card:nth-child(3) {
        top: 48px;
    }

    .service-card-image {
        width: 100%;
        height: 250px;
    }
}