/* =========================================================
   Services Grid — static homepage layout (replaces marquee)
   ========================================================= */

.services-grid-section {
    position: relative;
    padding: 100px 0;
    background-color: #F5F5F7;
    width: 100%;
}

.services-grid-section .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ---------- Header ---------- */

.services-grid-header {
    text-align: center;
    margin-bottom: 56px;
}

.services-grid-eyebrow {
    display: block;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
}

.services-grid-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--btn-color);
    background: linear-gradient(135deg, var(--btn-color) 0%, #e5920d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Grid ---------- */
/* Flex rather than CSS grid so an incomplete final row centres itself
   instead of leaving a lone card stranded on the left. */

.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.svc-card {
    flex: 0 0 calc(25% - 18px);
    max-width: calc(25% - 18px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 26px 26px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 22px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
}

/* Accent bar that sweeps across the top on hover */
.svc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--btn-color) 0%, var(--btn-hover) 100%);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.svc-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
    border-color: rgba(254, 214, 0, 0.55);
}

.svc-card:hover::before {
    transform: scaleX(1);
}

.svc-card:focus-visible {
    outline: 3px solid var(--btn-hover);
    outline-offset: 3px;
}

/* ---------- Card internals ---------- */

/* A rounded square, not a circle: the icons sit on a square grid, and a
   circular plate around square artwork was leaving lopsided gaps at the
   corners. The radius echoes the card's own 22px. */
.svc-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-shrink: 0;
    background: #f1f5f9;
    color: #334155;
    transition: background 0.35s ease, color 0.35s ease;
}

/* The plate lights up in the brand yellow on hover and the stroke goes
   near-black, which keeps contrast well above AA either way round. */
.svc-card:hover .svc-card-icon {
    background: var(--btn-color);
    color: #0f172a;
}

.svc-card-icon .svc-icon-svg {
    width: 30px;
    height: 30px;
    display: block;
}

/* Fallback path: a service the drawn set does not cover still shows its
   uploaded image. */
.svc-card-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

/* Fallback bubble when a service has no icon attached */
.svc-card-icon.is-empty {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--btn-hover);
}

.svc-card-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: #0f172a;
    margin: 0 0 10px;
}

.svc-card-desc {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    color: #64748b;
    margin: 0 0 22px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.svc-card-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--btn-hover);
}

.svc-card-link .svc-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.svc-card:hover .svc-card-link .svc-arrow {
    transform: translateX(5px);
}

/* ---------- Footer CTA ---------- */

.services-grid-footer {
    text-align: center;
    margin-top: 52px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
    .svc-card {
        flex: 0 0 calc(33.333% - 16px);
        max-width: calc(33.333% - 16px);
    }
}

@media (max-width: 900px) {
    .svc-card {
        flex: 0 0 calc(50% - 12px);
        max-width: calc(50% - 12px);
    }
}

@media (max-width: 560px) {
    .services-grid-section {
        padding: 70px 0;
    }

    .services-grid-section .container {
        padding: 0 1.25rem;
    }

    .services-grid {
        gap: 16px;
    }

    .svc-card {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 24px 22px;
    }

    .svc-card-icon {
        width: 54px;
        height: 54px;
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .svc-card-icon .svc-icon-svg {
        width: 27px;
        height: 27px;
    }

    .svc-card-icon img {
        width: 36px;
        height: 36px;
    }
}

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
    .svc-card,
    .svc-card::before,
    .svc-card-icon,
    .svc-card-link .svc-arrow {
        transition: none;
    }

    .svc-card:hover {
        transform: none;
    }

    /* The icon plate only changes colour now, which is not motion, so it
       stays — only the transition is dropped above. */
}
