.services {
    position: relative;
    isolation: isolate;
    overflow: clip;
    padding: clamp(32px, 2.85vw, 48px) 0 clamp(42px, 4vw, 68px);
    scroll-margin-top: calc(var(--site-header-offset, 0px) + 80px);
    background: linear-gradient(to bottom, transparent 85%, #f1dfd0), #e9ddcf url("../images/services/services-plaster-sunlight.webp") center / cover no-repeat;
    color: var(--color-navy);
    --services-gap: clamp(14px, 1.22vw, 20px);
}
.services::before,
.services::after,
.services__leaves {
    position: absolute;
    z-index: -1;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: cover;
}
.services::before {
    content: "";
    top: 0;
    right: 0;
    width: min(25%, 400px);
    aspect-ratio: 2;
    background-image: url("../images/services/branch-shadow.webp");
    opacity: .4;
    mix-blend-mode: multiply;
}
.services::after {
    content: "";
    right: 0;
    bottom: 0;
    width: min(25%, 410px);
    aspect-ratio: .82;
    background-image: url("../images/services/window-olive.webp");
    background-position: 84% bottom;
    mask-image: linear-gradient(to right, transparent, #000 65%), linear-gradient(to bottom, transparent, #000 45%);
    mask-composite: intersect;
}
.services__leaves {
    left: 0;
    bottom: 0;
    width: min(10%, 154px);
    aspect-ratio: 154/225;
    background-image: url("../images/services/leaves-left.webp");
}
.services__inner {
    width: min(var(--home-width), calc(100% - 2 * var(--home-gutter)));
    margin-inline: auto;
    padding-inline: 0;
}
.services__heading {
    margin-bottom: clamp(19px, 1.65vw, 30px);
}
.services__heading p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    font-size: clamp(12px, 1vw, 15px);
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.services__heading p::before {
    content: "";
    width: clamp(24px, 3vw, 42px);
    height: 2px;
    background: var(--color-orange);
}
.services__heading h2 {
    margin: 0;
    font-size: var(--home-title);
    font-weight: 780;
    line-height: 1.06;
    letter-spacing: -.04em;
    text-wrap: balance;
}
.services__heading h2 span {
    color: #b94f00;
}
.services__grid,
.services__top,
.services__side,
.services__list {
    display: grid;
    gap: var(--services-gap);
}
.services__top {
    grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr);
}
.services__side {
    grid-template-rows: repeat(3, minmax(0, 1fr));
}
.services__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
    --card-surface: #fcf9f6;
    --card-height: clamp(178px, 12.2vw, 213px);
    --card-padding: clamp(15px, 1.55vw, 26px);
    --photo-start: 21%;
    --photo-position: 66% center;
    --fade-solid: 26%;
    --fade-text: 40%;
    --fade-end: 69%;
    min-width: 0;
}
.service-card--featured {
    --card-height: clamp(388px, 28vw, 439px);
    --card-padding: clamp(25px, 2.35vw, 40px);
    --photo-start: 16%;
    --photo-position: 72% center;
    --fade-solid: 19%;
    --fade-text: 33%;
    --fade-end: 61%;
}
.service-card--horizontal {
    --card-height: clamp(112px, 8vw, 135px);
    --card-padding: clamp(12px, 1.3vw, 22px);
    --photo-start: 19%;
    --photo-position: 70% center;
    --fade-solid: 25%;
    --fade-text: 37%;
    --fade-end: 62%;
}
.service-card__surface {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: stretch;
    height: 100%;
    min-height: var(--card-height);
    overflow: hidden;
    border: 3px solid #ffffffed;
    border-radius: clamp(19px, 1.55vw, 24px);
    background: var(--card-surface);
    color: var(--color-navy);
    box-shadow: 0 5px 16px rgb(64 38 17 / 11%), 0 1px 3px rgb(64 38 17 / 5%);
    text-decoration: none;
}
.service-card__surface::before {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    content: "";
    background: linear-gradient(90deg, var(--card-surface) var(--fade-solid),
        rgb(252 249 246 / 94%) var(--fade-text), rgb(252 249 246 / 0%) var(--fade-end));
}
.service-card__photo {
    position: absolute;
    inset: 0 0 0 var(--photo-start);
    display: block;
    width: calc(100% - var(--photo-start));
    height: 100%;
    object-fit: cover;
    object-position: var(--photo-position);
}
.service-card__body {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-content: center;
    align-items: start;
    gap: 8px clamp(8px, 1vw, 16px);
    width: 60%;
    padding: var(--card-padding);
    pointer-events: none;
}
.service-card h3 {
    margin: 0;
    align-self: center;
    font-size: clamp(18px, 1.43vw, 24px);
    font-weight: 780;
    line-height: 1.12;
    letter-spacing: -.035em;
    overflow-wrap: break-word;
}
.service-card__icon,
.service-card__arrow {
    display: grid;
    place-items: center;
    width: clamp(32px, 2.6vw, 45px);
    aspect-ratio: 1;
    align-self: start;
}
.service-card__icon {
    border-radius: 11px;
    color: #c55300;
    background: #ff810e19;
}
.service-card__icon svg {
    width: 76%;
    height: 76%;
}
.service-card__arrow {
    align-self: end;
    grid-column: 1;
    border-radius: 50%;
    color: #fff;
    background: #bc4f00;
}
.service-card__arrow svg {
    width: 51%;
    height: 51%;
}
.service-card--featured .service-card__body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 11px;
    width: 48%;
}
.service-card--featured h3 {
    max-width: 12ch;
    font-size: clamp(27px, 2.5vw, 38px);
    line-height: 1.06;
}
.service-card--featured .service-card__icon {
    width: clamp(49px, 4vw, 61px);
    border-radius: 14px;
}
.service-card--featured .service-card__arrow {
    width: clamp(46px, 3.4vw, 54px);
    margin-top: 10px;
}
.service-card--horizontal .service-card__body {
    grid-template-rows: auto 1fr;
    align-items: center;
    width: 60%;
    row-gap: 5px;
}
.service-card--horizontal h3 {
    max-width: 11ch;
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: start;
    font-size: clamp(20px, 1.65vw, 26px);
}
.service-card--standard .service-card__body {
    width: 68%;
}
.service-card__surface:focus-visible {
    outline: 3px solid #075797;
    outline-offset: 3px;
}
@media (hover: hover) {
    a.service-card__surface:hover {
        color: var(--color-navy);
        box-shadow: 0 10px 24px rgb(64 38 17 / 17%), 0 1px 3px rgb(64 38 17 / 7%);
    }
    .service-card__surface:hover .service-card__arrow {
        background: #a34300;
    }
}
@media (prefers-reduced-motion: no-preference) {
    .service-card__surface,
    .service-card__photo,
    .service-card__arrow,
    .service-card__arrow svg {
        transition: transform 280ms ease, box-shadow 280ms ease, background-color 280ms ease;
    }
    .services-enter {
        animation: services-in 300ms cubic-bezier(.22, 1, .36, 1) var(--entry-delay, 0ms) backwards;
    }
    @keyframes services-in {
        from { opacity: 0; translate: 0 10px; }
    }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    a.service-card__surface:hover { transform: translateY(-3px); }
    .service-card__surface:hover .service-card__photo { transform: scale(1.035); }
    .service-card__surface:hover .service-card__arrow svg { transform: translateX(2px); }
}

@media (max-width: 1023px) {
    .services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .services__top,
    .services__side,
    .services__list { display: contents; }
    .services::after,
    .services__leaves { display: none; }
    .service-card--featured {
        grid-column: 1 / -1;
        --card-height: clamp(245px, 38vw, 350px);
    }
    .service-card--horizontal,
    .service-card--standard { --card-height: 157px; }
    .service-card--horizontal .service-card__body,
    .service-card--standard .service-card__body { width: 71%; }
}
@media (max-width: 639px) {
    .services__grid { grid-template-columns: minmax(0, 1fr); }
    .services__heading h2 { font-size: clamp(31px, 7.4vw, 43px); }
    .service-card__surface { border-width: 2px; }
    .service-card--featured {
        --card-height: clamp(230px, 58vw, 300px);
        --card-padding: clamp(15px, 4vw, 24px);
        --fade-solid: 22%;
        --fade-text: 37%;
        --fade-end: 70%;
    }
    .service-card--featured .service-card__body { width: 61%; }
    .service-card--featured h3 { font-size: clamp(23px, 5.9vw, 32px); }
    .service-card--featured .service-card__arrow { margin-top: 2px; }
    .service-card--horizontal,
    .service-card--standard {
        --card-height: 124px;
        --fade-solid: 29%;
        --fade-text: 47%;
        --fade-end: 76%;
    }
    .service-card--horizontal h3,
    .service-card--standard h3 { max-width: 15ch; font-size: 18px; }
}
