.motion-hero-grid { display: grid; align-items: center; gap: clamp(24px, 4vw, 64px); grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
.site-page-hero .motion-hero-grid h1 { hyphens: manual; text-wrap: balance; }

.motion-demo {
    min-width: 0;
    border: 1px solid #49606d;
    border-radius: 16px;
    overflow: hidden;
    color: #fff;
    background: #20343f;
    scroll-margin-block-start: 6rem;
}
.motion-demo-head { padding: clamp(.875rem, 2vw, 1.25rem); }
.site-home .motion-demo .motion-demo-head h2 {
    color: #fff;
    font-size: 1.075rem;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -.02em;
    margin: 0 0 .625rem;
}
.motion-choices, .motion-fallback { display: flex; flex-wrap: wrap; gap: .35rem; }
.motion-choices button, .motion-fallback a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: .38rem .65rem;
    border-radius: 99px;
    border: 1px solid #738995;
    color: #f0f4f5;
    background: #243943;
    font: 600 .8125rem/1.3 var(--font-body, sans-serif);
    text-decoration: none;
    cursor: pointer;
}
.motion-choices button:hover, .motion-fallback a:hover { background: #334d5a; border-color: #b1c2ca; }
.motion-choices button[aria-pressed="true"] { color: #482416; border-color: #ffbc98; background: #ffbc98; }
.motion-choices button:active { box-shadow: inset 0 0 0 2px currentColor; }
@media (prefers-reduced-motion: no-preference) {
    .motion-choices button { transition: transform .14s ease-out, background-color .16s ease-out; }
    .motion-choices button:active { transform: scale(.96); transition-duration: .06s; }
}
.motion-demo :is(a, button):focus-visible, .service-motion button:focus-visible { outline: 3px solid #d15b2a; outline-offset: 2px; }
.motion-demo-head :is(a, button):focus-visible { outline-color: #ffe1b5; }
.service-motion { --motion-duration: 6s; margin: 0; min-width: 0; overflow: hidden; border: 1px solid #bbc9cb; border-radius: 16px; background: #fff; color: #1a3440; }
.motion-stage { width: 100%; aspect-ratio: 12 / 5; position: relative; overflow: hidden; isolation: isolate; background: #e9f0ef; }
.service-motion figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #d8e1df; padding: 10px 14px; min-height: 68px; font-size: .92rem; line-height: 1.5; text-align: left; }
.service-motion figcaption > span { min-width: 0; max-width: 48ch; }
.service-motion [data-playback-label] { display: none; }
.service-motion[data-playback="playing"] [data-playback-label="playing"],
.service-motion[data-playback="paused"] [data-playback-label="paused"],
.service-motion[data-playback="idle"] [data-playback-label="idle"] { display: inline; }
.motion-stage::after {
    content: ""; position: absolute; inset: auto 0 0; height: 3px; pointer-events: none;
    background: #31827a; transform: scaleX(0); transform-origin: left;
}
@keyframes service-motion-clock { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.service-motion.is-playing .motion-stage::after {
    animation: service-motion-clock var(--motion-duration) linear both;
}
.service-motion:is([data-playback="paused"], .is-suspended) .motion-stage::after,
.service-motion:is([data-playback="paused"], .is-suspended) .motion-stage *,
.service-motion:is([data-playback="paused"], .is-suspended) .motion-stage *::before,
.service-motion:is([data-playback="paused"], .is-suspended) .motion-stage *::after { animation-play-state: paused !important; }
.service-motion[hidden], .service-motion [hidden], .motion-choices[hidden], .motion-fallback[hidden] { display: none; }
@media (max-width: 820px) {
    .motion-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    .service-motion { width: 100%; max-width: 660px; }
}
@media (max-width: 440px) {
    .service-motion figcaption { flex-wrap: wrap; gap: 5px; padding: 10px 12px; }
}

/* The homepage demo includes a next step. Service-page figures keep their own lighter layout. */
.motion-demo .service-motion { width: 100%; max-width: none; border: 0; border-radius: 0; }
.motion-demo .service-motion figcaption {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .2rem .75rem;
    padding: .8rem clamp(.875rem, 2vw, 1.25rem) .55rem;
    background: #fcfaf7;
    color: #273c47;
}
.motion-demo figcaption > span { grid-column: 1 / -1; max-width: none; }
.motion-next {
    display: inline-flex; align-items: center; justify-self: start; gap: .5rem; min-height: 44px;
    font-weight: 650; line-height: 1.3; color: #9d391a; text-decoration: none;
}
.motion-next:hover, .motion-next:focus-visible { color: #742c13; text-decoration: underline; text-underline-offset: .2em; }
.motion-next [aria-hidden] { flex: none; }
@media (pointer: coarse) {
    .motion-choices button, .motion-fallback a { min-height: 44px; }
}
