.home-services-grid {
    gap: clamp(1rem, 2.2vw, 1.6rem);
}

.home-service-card {
    --arrival-distance: 24px;
    --arrival-duration: 580ms;
    --arrival-easing: cubic-bezier(0.22, 0.68, 0.26, 1);
    display: flex;
    min-width: 0;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--primary) 12%, white);
    border-radius: 1.125rem;
    background: #fffefa;
    box-shadow: 0 7px 22px rgb(13 39 62 / 6%);
}

@media (min-width: 901px) {
    .home-service-card:nth-child(3n + 2) { --arrival-delay: 45ms; }
    .home-service-card:nth-child(3n + 3) { --arrival-delay: 90ms; }
}

@media (min-width: 601px) and (max-width: 900px) {
    .home-service-card:nth-child(even) { --arrival-delay: 45ms; }
}

.home-service-link {
    display: block;
    flex: 1;
    min-width: 0;
    color: var(--primary);
}

.home-service-link:is(:hover, :focus-visible) {
    color: var(--primary);
    text-decoration: none;
}

.home-service-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -3px;
    border-radius: inherit;
}

.home-service-media {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    margin: 0.5rem 0.5rem 0;
    border-radius: 0.78rem;
    aspect-ratio: 2.1;
    background: var(--primary);
}

.home-service-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-service-icon {
    position: absolute;
    inset-block-end: 0.55rem;
    inset-inline-start: 0.55rem;
    display: grid;
    place-items: center;
    width: 2.35rem;
    aspect-ratio: 1;
    border: 1px solid rgb(255 255 255 / 48%);
    border-radius: 0.65rem;
    background: color-mix(in srgb, var(--primary) 91%, transparent);
    color: color-mix(in srgb, var(--accent) 80%, white);
    font-size: 1.02rem;
}

.home-service-copy {
    display: grid;
    justify-items: start;
    gap: 0.45rem;
    padding: 0.95rem clamp(0.9rem, 1.8vw, 1.35rem) 1.2rem;
}

.home-service-copy h3 {
    margin: 0;
    color: var(--primary);
    font-size: clamp(1.06rem, 1.65vw, 1.25rem);
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.rtl .home-service-copy h3 {
    line-height: 1.6;
}

.home-service-copy p {
    margin: 0;
    color: #495b68;
    font-size: 0.875rem;
    line-height: 1.75;
    overflow-wrap: anywhere;
    text-wrap: pretty;
}

.home-service-action {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-block-start: 0.25rem;
    padding: 0.36rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--accent) 44%, white);
    border-radius: 0.55rem;
    background: color-mix(in srgb, var(--accent) 20%, white);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 670;
    line-height: 1.55;
}

.home-service-link:is(:hover, :focus-visible) .home-service-action {
    border-color: var(--accent);
    background: var(--accent);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .home-service-card {
        transition: border-color 230ms ease, box-shadow 230ms ease;
    }

    .home-service-card:hover {
        border-color: color-mix(in srgb, var(--accent) 78%, white);
        box-shadow: 0 14px 34px rgb(13 39 62 / 12%);
    }

    .home-service-media img {
        transition: transform 520ms ease;
    }

    .home-service-link:hover img {
        transform: scale(1.045);
    }
}
