/** ========================================
 ** Services Hero — headline + one jump card per service outcome
 ** = Faithful port of the designer's custom/services_hero. Words rise and the
 ** = copy / cards fade in once module.js adds .dsh-in. Size, weight and color
 ** = of the eyebrow, title, intro and card text come from Style-tab utilities.
 ** ======================================== */

.dsh {
    --plum: var(--color-burgundy);
    --coral: var(--color-coral);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--plum);
    color: var(--color-white);
    font-family: var(--font-body);
    min-height: min(100svh, 920px);
    display: flex;
    align-items: flex-end;
    padding: 180px 0 88px;
}

.dsh * {
    box-sizing: border-box;
}

.dsh-inner {
    position: relative;
    width: 100%;
}

/*- Eyebrow */
.dsh .dsh-eyebrow {
    font-family: var(--font-mono);
    line-height: 21px;
    margin: 0 0 20px;
}

/*- Title — word-by-word rise */
.dsh .dsh-title {
    margin: 0;
    font-family: var(--font-heading);
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: 0;
    max-width: 13em;
    text-wrap: balance;
}

.dsh-w {
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
    padding-bottom: 0.04em;
}

.dsh-w > span {
    display: inline-block;
    transform: translateY(105%);
    transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0s);
}

.dsh.dsh-in .dsh-w > span {
    transform: none;
}

/*- Intro */
.dsh-sub {
    margin: 26px 0 0;
    max-width: 560px;
    font-size: clamp(18px, 1.4vw, 21px);
    line-height: 1.5;
}

.dsh-sub p {
    margin: 0 0 0.6em;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.dsh-sub p:last-child {
    margin-bottom: 0;
}

/*~ Fade-ins */
.dsh-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0s), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0s);
}

.dsh.dsh-in .dsh-fade {
    opacity: 1;
    transform: none;
}

/*+ Jump cards */
.dsh-opts {
    margin-top: 64px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dsh-opt {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: 196px;
    padding: 22px 22px 20px;
    border-radius: 0 16px 16px 16px;
    border: 2px solid color-mix(in srgb, var(--color-white) 16%, transparent);
    color: var(--color-white);
    text-decoration: none;
    transition: border-color 0.35s, color 0.35s;
}

/*= Designer's translucent panel, unless a Style-tab card color is picked */
.dsh-opt:not(.dsh-opt--solid) {
    background: color-mix(in srgb, var(--color-white) 7%, transparent);
}

/*- White fill sweeps up from the bottom on hover / focus */
.dsh-opt::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -1;
    border-radius: inherit;
    background: var(--color-white);
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.55s cubic-bezier(0.7, 0, 0.2, 1);
}

.dsh-opt:hover,
.dsh-opt:focus-visible {
    border-color: var(--color-white);
    color: var(--plum);
}

.dsh-opt:hover::before,
.dsh-opt:focus-visible::before {
    clip-path: inset(0 0 0 0);
}

.dsh-opt-n {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--coral);
}

.dsh-opt-t {
    margin-top: auto;
    padding-top: 28px;
    font-family: var(--font-heading);
    line-height: 1.05;
    text-transform: uppercase;
    text-wrap: balance;
    transition: color 0.35s;
}

.dsh-opt-s {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.4;
    opacity: 0.85;
    transition: color 0.35s;
}

/*= Title / text carry Style-tab color classes, so restate the hover color (faded in step) */
.dsh-opt:hover .dsh-opt-t,
.dsh-opt:focus-visible .dsh-opt-t,
.dsh-opt:hover .dsh-opt-s,
.dsh-opt:focus-visible .dsh-opt-s {
    color: var(--plum);
}

.dsh-opt-a {
    position: absolute;
    right: 18px;
    top: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--coral);
    color: var(--color-white);
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dsh-opt-a svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dsh-opt:hover .dsh-opt-a {
    transform: translateY(4px);
}

/*~ Focus ring — the global burgundy outline vanishes on the burgundy hero */
.dsh a:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 4px;
}

@media (max-width: 1024px) {
    .dsh-opts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .dsh {
        min-height: 0;
        padding: 128px 0 48px;
    }

    .dsh-opts {
        margin-top: 40px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dsh-opt {
        min-height: 0;
        padding: 16px 64px 16px 18px;
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 14px;
        align-items: baseline;
    }

    .dsh-opt-t {
        margin: 0;
        padding: 0;
    }

    .dsh-opt-s {
        grid-column: 2;
        margin-top: 4px;
        padding: 0;
        font-size: 14px;
    }

    .dsh-opt-a {
        top: 50%;
        bottom: auto;
        margin-top: -18px;
    }
}

/*+ Phones — the hero copy is the LCP, so it paints at first paint instead of
    waiting for module.js; desktop keeps the word-by-word reveal. */
@media (max-width: 860px) {
    .dsh .dsh-w > span,
    .dsh .dsh-fade {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/*~ No-JS safety — the reveal states above only hide content when JS can undo them
/*= html.js is set in <head> by module.html. Without JS everything shows at once;
/*= if this module's script never boots, the failsafe reveals it after 2.5s. */
html:not(.js) .dsh .dsh-w > span,
html:not(.js) .dsh .dsh-fade {
    opacity: 1;
    transform: none;
    transition: none;
}

.js .dsh:not([data-services-hero-ready]) .dsh-w > span,
.js .dsh:not([data-services-hero-ready]) .dsh-fade {
    animation: dsh-failsafe 0s 2.5s forwards;
}

@keyframes dsh-failsafe {
    to {
        opacity: 1;
        transform: none;
    }
}

/*~ Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .dsh *,
    .dsh *::before {
        transition: none !important;
    }

    .dsh .dsh-w > span,
    .dsh .dsh-fade {
        opacity: 1;
        transform: none;
        animation: none;
    }
}
