/* =========================================================
   UBS Current Homepage — Media Rich
   Matches homepage-media-rich.html
   ========================================================= */

/* Local video hero */

.ubs-local-video-hero {
    --ubs-home-hero-poster: url("https://utbilling.com/wp-content/uploads/2026/07/homepage_static_background.png");
    --ubs-home-hero-fade-duration: 900ms;

    display: flex;
    width: 100%;
    min-height: max(
            760px,
            calc(
                    100svh - var(--ubs-scroll-stack-top) +
                    var(--ubs-scroll-stack-overlap)
            )
    );
    align-items: center;
    overflow: hidden;
    background: var(--ubs-color-primary);
    isolation: isolate;
}

.ubs-local-video-hero .ubs-video-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: var(--ubs-color-primary);
    background-image: var(--ubs-home-hero-poster);

    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.ubs-local-video-hero .ubs-hero-video {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: none !important;
    object-fit: cover;
    object-position: var(
            --ubs-home-hero-focus-desktop,
            50% 50%
    );
    opacity: 0;
    transition: opacity var(--ubs-home-hero-fade-duration) ease;
}

.ubs-local-video-hero .ubs-hero-video-active {
    opacity: 1;
}

/*
 * The incoming video fades above the still-visible
 * outgoing video.
 */
.ubs-local-video-hero .ubs-hero-video-incoming {
    z-index: 2;
}

.ubs-local-video-hero .ubs-video-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.12) 0%,
            transparent 24%,
            transparent 72%,
            rgba(0, 0, 0, 0.22) 100%
    ),
    linear-gradient(
            90deg,
            rgba(18, 20, 54, 0.82) 0%,
            rgba(37, 39, 94, 0.72) 34%,
            rgba(37, 39, 94, 0.48) 62%,
            rgba(18, 20, 54, 0.28) 100%
    ),
    radial-gradient(
            circle at 78% 36%,
            rgba(184, 215, 52, 0.2),
            transparent 30%
    ),
    radial-gradient(
            circle at 50% 100%,
            rgba(0, 0, 0, 0.18),
            transparent 42%
    );
}

.ubs-local-video-hero .ubs-video-hero-content {
    position: relative;
    z-index: 2;
    width: min(1440px, calc(100% - 96px));
    max-width: none;
    margin: 0 auto;
    padding: 132px 0 150px;
}

.ubs-local-video-hero h1 {
    max-width: 980px;
    margin: 0 0 24px;

    color: var(--ubs-color-white);

    font-size: clamp(48px, 5.2vw, 78px);
    line-height: 1.03;
    font-weight: var(--ubs-font-weight-heading);
    letter-spacing: -0.03em;

    text-wrap: balance;
    text-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.ubs-local-video-hero .ubs-video-hero-content > p:not(.ubs-eyebrow) {
    max-width: 800px;
    margin: 0;

    color: rgba(255, 255, 255, 0.9);

    font-size: var(--ubs-font-size-lead);
    line-height: 1.65;
    font-weight: var(--ubs-font-weight-body);

    text-wrap: pretty;
    text-shadow: 0 10px 32px rgba(0, 0, 0, 0.32);
}

/* Logo ticker */

.ubs-logo-ticker {
    position: relative;
    padding: 30px 0 34px;
    overflow: hidden;
    background: var(--ubs-color-white);
    border-bottom: 1px solid var(--ubs-color-border);
}

.ubs-logo-ticker-heading {
    margin-bottom: 22px;
    text-align: center;
}

.ubs-logo-ticker-heading span {
    display: inline-block;
    color: var(--ubs-color-body);
    font-size: var(--ubs-font-size-meta);
    line-height: var(--ubs-line-height-heading-relaxed);
    font-weight: var(--ubs-font-weight-label);
    letter-spacing: 0.09em;
    text-transform: var(--ubs-text-transform-kicker);
}

.ubs-logo-ticker-window {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.ubs-logo-ticker-track {
    display: flex;
    width: max-content;
    animation: ubs-logo-scroll 34s linear infinite;
    will-change: transform;
}

.ubs-logo-ticker-group {
    display: flex;
    flex-shrink: 0;
    margin: 0;
    padding: 0 72px 0 0;
    align-items: center;
    gap: 72px;
    list-style: none;
}

.ubs-logo-item {
    display: flex;
    flex: 0 0 auto;
    width: 170px;
    height: 74px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    box-sizing: border-box;
}

.ubs-logo-item img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 54px;
    object-fit: contain;
    opacity: 0.62;
    filter: saturate(0.72) contrast(0.96);
    transition: opacity var(--ubs-transition-fast),
    filter var(--ubs-transition-fast),
    transform var(--ubs-transition-fast);
}

.ubs-logo-item:hover img {
    opacity: 1;
    filter: saturate(1) contrast(1);
    transform: scale(1.04);
}

.ubs-logo-ticker-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: min(12vw, 170px);
    pointer-events: none;
}

.ubs-logo-ticker-fade-left {
    left: 0;
    background: linear-gradient(
            90deg,
            var(--ubs-color-white),
            rgba(255, 255, 255, 0)
    );
}

.ubs-logo-ticker-fade-right {
    right: 0;
    background: linear-gradient(
            270deg,
            var(--ubs-color-white),
            rgba(255, 255, 255, 0)
    );
}

.ubs-logo-ticker:hover .ubs-logo-ticker-track {
    animation-play-state: paused;
}

@keyframes ubs-logo-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Current homepage hero and logo-ticker responsive rules */

@media only screen and (max-width: 980px) {
    .ubs-local-video-hero {
        min-height: calc(
                100svh - var(--ubs-scroll-stack-top)
        );
    }

    .ubs-local-video-hero .ubs-hero-video {
        object-position: var(
                --ubs-home-hero-focus-tablet,
                var(
                        --ubs-home-hero-focus-desktop,
                        50% 50%
                )
        );
    }

    .ubs-local-video-hero .ubs-video-hero-content {
        width: 92%;
        padding: 104px 0 118px;
    }

    .ubs-local-video-hero h1 {
        max-width: 780px;
        font-size: 46px;
        line-height: 1.04;
        letter-spacing: -0.025em;
    }

    .ubs-local-video-hero .ubs-video-hero-content > p:not(.ubs-eyebrow) {
        max-width: 720px;
        font-size: 17px;
    }

    .ubs-logo-ticker-group {
        gap: 48px;
        padding-right: 48px;
    }

    .ubs-logo-item {
        width: 150px;
        height: 66px;
    }

    .ubs-logo-item img {
        max-height: 48px;
    }
}

@media only screen and (max-width: 767px) {
    .ubs-local-video-hero .ubs-hero-video {
        display: none;
    }

    .ubs-local-video-hero .ubs-video-hero-media {
        background: radial-gradient(
                circle at top right,
                rgba(184, 215, 52, 0.2),
                transparent 34%
        ),
        linear-gradient(
                135deg,
                var(--ubs-color-primary),
                var(--ubs-color-primary-hover)
        );
    }

    .ubs-local-video-hero .ubs-video-hero-content {
        width: 90%;
        padding: 76px 0 104px;
    }

    .ubs-local-video-hero h1 {
        font-size: 38px;
        line-height: 1.05;
        font-weight: var(--ubs-font-weight-heading);
        letter-spacing: -0.02em;
    }

    .ubs-local-video-hero .ubs-video-hero-content > p:not(.ubs-eyebrow) {
        font-size: var(--ubs-font-size-body);
        line-height: var(--ubs-line-height-body);
    }

    .ubs-local-video-hero .ubs-button {
        width: 100%;
    }

    .ubs-logo-ticker-group {
        gap: 32px;
        padding-right: 32px;
    }

    .ubs-logo-item {
        width: 128px;
        height: 58px;
        padding: 6px 8px;
    }

    .ubs-logo-item img {
        max-height: 42px;
    }

    .ubs-logo-ticker-track {
        animation-duration: 26s;
    }

    .ubs-logo-ticker-fade {
        width: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ubs-local-video-hero .ubs-hero-video {
        display: none;
    }

    .ubs-logo-ticker-window {
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .ubs-logo-ticker-track {
        animation: none;
    }

    .ubs-logo-ticker-group[aria-hidden="true"] {
        display: none;
    }
}

/* =========================================================
   Homepage semantic components
   Current scroll-stack, tabs, audience cards, and CTA.
   ========================================================= */

/* The shared scroll-stack component owns the homepage transition. */

.ubs-home-stack-content {
    background: var(--ubs-color-page-bg);
}

.ubs-home-stack-content > .ubs-logo-ticker {
    border-radius: var(--ubs-scroll-stack-radius) var(--ubs-scroll-stack-radius)
    0 0;
}

/* Reuse the shared action-row and button components in the video hero. */

.ubs-local-video-hero .ubs-home-hero-actions {
    margin-top: 36px;
}

.ubs-local-video-hero .ubs-button-accent {
    box-shadow: 0 18px 34px rgba(184, 215, 52, 0.24);
}

.ubs-local-video-hero .ubs-button-outline-light {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.ubs-local-video-hero .ubs-button-outline-light:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.74);
}

/* Semantic logo-ticker heading. */

.ubs-page .ubs-logo-ticker-title {
    margin: 0 0 22px;
    color: var(--ubs-color-body);
    font-size: var(--ubs-font-size-compact);
    line-height: var(--ubs-line-height-heading-relaxed);
    font-weight: var(--ubs-font-weight-kicker);
    letter-spacing: 0.09em;
    text-align: center;
    text-transform: var(--ubs-text-transform-kicker);
}

/* Button-driven tab interface.
   These rules replace the older radio/label-specific tab selectors. */

.ubs-tab-labels {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ubs-space-md);
    margin-bottom: var(--ubs-space-2xl);
}

.ubs-tab-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: var(--ubs-color-white);
    border: 1px solid var(--ubs-color-border);
    border-radius: var(--ubs-radius-pill);
    color: var(--ubs-color-primary);
    font: inherit;
    font-weight: var(--ubs-font-weight-interactive);
    cursor: pointer;
    transition: background-color var(--ubs-transition-fast),
    border-color var(--ubs-transition-fast),
    color var(--ubs-transition-fast), box-shadow var(--ubs-transition-fast);
}

.ubs-tab-button:hover {
    border-color: var(--ubs-color-accent);
}

.ubs-tab-button.is-active,
.ubs-tab-button[aria-selected="true"] {
    background: var(--ubs-color-primary);
    border-color: var(--ubs-color-primary);
    color: var(--ubs-color-white);
}

.ubs-tab-button:focus-visible {
    outline: 3px solid var(--ubs-color-focus-ring);
    outline-offset: 3px;
}

.ubs-tab-panel {
    display: none;
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    gap: 34px;
    align-items: center;
    padding: var(--ubs-space-3xl);
    border-radius: 28px;
}

.ubs-tab-panel.is-active:not([hidden]) {
    display: grid;
}

.ubs-tab-copy h3 {
    margin: 0 0 var(--ubs-space-lg);
    font-size: clamp(30px, 3vw, 44px);
    line-height: 1.05;
    font-weight: var(--ubs-font-weight-heading-strong);
    letter-spacing: -0.04em;
}

.ubs-tab-copy > p:not(.ubs-eyebrow) {
    margin: 0 0 var(--ubs-space-xl);
    font-size: 17px;
    line-height: 1.75;
}

.ubs-tab-media {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.ubs-tab-media img {
    min-height: 300px;
}

.ubs-tab-media figcaption {
    padding: 12px 14px;
    color: var(--ubs-color-body);
    font-size: var(--ubs-font-size-small);
    line-height: 1.45;
}

/* Audience cards now build on the shared card, hover, grid,
   media-card, and text-link components. */

.ubs-home-audience-card {
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

.ubs-home-audience-media {
    flex: 0 0 auto;
    border: 0;
    border-bottom: 3px solid var(--ubs-color-accent);
    border-radius: 0;
}

.ubs-home-audience-media img {
    transform: scale(1);
    transition: transform var(--ubs-transition-button);
}

.ubs-home-audience-card:is(:hover, :focus-within)
.ubs-home-audience-media img {
    transform: scale(1.025);
}

.ubs-home-audience-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(24px, 3vw, 34px);
}

.ubs-home-audience-body h3 {
    width: 100%;
    margin: 0 0 13px;
    font-size: var(--ubs-font-size-heading-card);
    line-height: 1.15;
    text-wrap: balance;
}

.ubs-home-audience-body p {
    margin: 0 0 var(--ubs-space-2xl);
    font-size: var(--ubs-font-size-compact);
    line-height: 1.65;
}

.ubs-home-audience-body .ubs-fancy-links {
    margin-top: auto;
}

/* The shared dark CTA replaces the homepage-only final CTA. */

.ubs-home-final-cta {
    background: var(--ubs-color-page-bg);
}

.ubs-home-cta-actions {
    justify-content: flex-end;
    margin-top: 0;
}

@media only screen and (max-width: 1100px) {
    .ubs-tab-panel {
        grid-template-columns: 1fr;
    }
}

@media only screen and (max-width: 980px) {
    .ubs-home-audiences .ubs-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ubs-home-audience-card:last-child {
        grid-column: 1 / -1;
        width: min(100%, 520px);
        justify-self: center;
    }

    .ubs-home-cta-actions {
        justify-content: flex-start;
    }
}

@media only screen and (max-width: 767px) {
    .ubs-page .ubs-logo-ticker-title {
        width: 88%;
        margin-right: auto;
        margin-left: auto;
        text-align: left;
    }

    .ubs-tab-labels {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .ubs-tab-button {
        width: 100%;
    }

    .ubs-tab-panel {
        padding: var(--ubs-space-xl);
    }

    .ubs-tab-media img {
        min-height: 220px;
    }

    .ubs-home-audiences .ubs-grid-3 {
        grid-template-columns: 1fr;
    }

    .ubs-home-audience-card:last-child {
        grid-column: auto;
        width: 100%;
    }

    .ubs-home-cta-actions {
        display: grid;
        width: 100%;
    }

    .ubs-home-cta-actions .ubs-button {
        width: 100%;
    }
}

/* =========================================================
   UBS Homepage Service Explorer
   Uses the existing [data-ubs-tabs] JavaScript.
   ========================================================= */

.ubs-home-services-explorer {
    /*
     * Desktop layout:
     * - compact vertical service rail
     * - large image stage
     * - horizontal information band beneath image
     */
    --ubs-service-rail-width: 190px;
    --ubs-service-stage-height: clamp(560px, 54vw, 620px);
    --ubs-service-copy-height: 194px;

    --ubs-service-motion: 560ms var(--ubs-ease-out-smooth);
}

/* ---------------------------------------------------------
   Section heading
   --------------------------------------------------------- */

.ubs-service-explorer-heading {
    max-width: 830px;
    margin-bottom: 40px;
}

/* =========================================================
   Explorer Shell
   ========================================================= */

.ubs-service-explorer {
    position: relative;

    display: grid;

    grid-template-columns:
        var(--ubs-service-rail-width)
        minmax(0, 1fr);

    min-height: var(--ubs-service-stage-height);

    overflow: hidden;

    background: var(--ubs-color-card-bg);

    border: 1px solid var(--ubs-color-border);

    border-radius: 24px;

    box-shadow: var(--ubs-shadow-card-hover);
}

/* =========================================================
   Integrated Service Rail
   ========================================================= */

.ubs-service-explorer-rail {
    position: relative;
    z-index: 4;

    display: grid;

    grid-template-rows: repeat(4, minmax(0, 1fr));

    background: radial-gradient(
            circle at 12% 8%,
            rgba(184, 215, 52, 0.16),
            transparent 34%
    ),
    linear-gradient(
            180deg,
            var(--ubs-color-surface-light),
            var(--ubs-color-soft-bg)
    );

    border-right: 1px solid var(--ubs-color-border);
}

/* ---------------------------------------------------------
   Service Tabs
   --------------------------------------------------------- */

.ubs-service-explorer-tab {
    position: relative;

    display: grid;

    grid-template-columns:
        30px
        minmax(0, 1fr);

    gap: 8px;

    align-items: center;

    width: 100%;
    min-width: 0;

    margin: 0;

    padding: 17px 18px;

    appearance: none;

    background: transparent;

    border: 0;

    border-bottom: 1px solid rgba(37, 39, 94, 0.09);

    border-radius: 0;

    color: var(--ubs-color-body-dark);

    font: inherit;

    text-align: left;

    cursor: pointer;

    transition: background-color var(--ubs-transition-fast),
    color var(--ubs-transition-fast);
}

.ubs-service-explorer-tab:last-child {
    border-bottom: 0;
}

/* Active lime indicator */

.ubs-service-explorer-tab::before {
    content: "";

    position: absolute;

    top: 18px;
    bottom: 18px;
    left: 0;

    width: 4px;

    border-radius: 0 var(--ubs-radius-pill) var(--ubs-radius-pill) 0;

    background: var(--ubs-color-accent);

    opacity: 0;

    transform: scaleY(0.35);

    transform-origin: center;

    transition: opacity var(--ubs-transition-fast),
    transform var(--ubs-transition-fast);
}

.ubs-service-explorer-tab:hover {
    background: rgba(255, 255, 255, 0.62);

    color: var(--ubs-color-primary);
}

.ubs-service-explorer-tab.is-active,
.ubs-service-explorer-tab[aria-selected="true"] {
    background: rgba(255, 255, 255, 0.9);

    color: var(--ubs-color-primary);
}

.ubs-service-explorer-tab.is-active::before,
.ubs-service-explorer-tab[aria-selected="true"]::before {
    opacity: 1;

    transform: scaleY(1);
}

.ubs-service-explorer-tab:focus-visible {
    z-index: 2;

    outline: 3px solid var(--ubs-color-focus-ring);

    outline-offset: -4px;
}

/* ---------------------------------------------------------
   Service Number
   --------------------------------------------------------- */

.ubs-service-explorer-number {
    color: rgba(37, 39, 94, 0.46);

    font-size: var(--ubs-font-size-caption);

    line-height: 1;

    font-weight: var(--ubs-font-weight-bold);

    letter-spacing: var(--ubs-letter-spacing-kicker);

    transition: color var(--ubs-transition-fast);
}

.ubs-service-explorer-tab.is-active .ubs-service-explorer-number,
.ubs-service-explorer-tab[aria-selected="true"] .ubs-service-explorer-number {
    color: var(--ubs-color-accent);
}

/* ---------------------------------------------------------
   Service Label
   --------------------------------------------------------- */

.ubs-service-explorer-label {
    min-width: 0;

    font-size: 17px;
    line-height: 1.25;

    font-weight: var(--ubs-font-weight-label);
}

/* =========================================================
   Reveal Stage
   ========================================================= */

.ubs-service-explorer-stage {
    position: relative;

    min-width: 0;

    min-height: var(--ubs-service-stage-height);

    overflow: hidden;

    background: var(--ubs-color-soft-bg);
}

.ubs-service-explorer-panel {
    position: relative;

    display: none;

    min-height: var(--ubs-service-stage-height);

    overflow: hidden;

    background: var(--ubs-color-card-bg);
}

.ubs-service-explorer-panel[hidden] {
    display: none !important;
}

.ubs-service-explorer-panel.is-active:not([hidden]) {
    display: grid;
    grid-template-rows:
        minmax(0, 1fr)
        var(--ubs-service-copy-height);
}

/* =========================================================
   Horizontal Copy Band
   ========================================================= */

.ubs-service-explorer-copy {
    position: relative;

    z-index: 2;

    display: grid;
    grid-row: 2;

    /*
     * True two-column layout:
     *
     * LEFT:
     * service heading
     *
     * RIGHT:
     * description
     * service link
     *
     * The right side gets slightly more room because its
     * paragraph and link need more horizontal breathing room.
     */
    grid-template-columns:
        minmax(0, 0.9fr)
        minmax(0, 1.1fr);

    grid-template-areas:
        "title body"
        "title link";

    grid-template-rows:
        minmax(0, 1fr)
        auto;

    column-gap: 40px;
    row-gap: 8px;

    width: 100%;

    height: 100%;

    padding: 26px 36px 28px;

    align-content: center;

    background: radial-gradient(
            circle at 0% 100%,
            rgba(184, 215, 52, 0.12),
            transparent 34%
    ),
    linear-gradient(90deg, var(--ubs-color-white), var(--ubs-color-card-bg));

    border-top: 4px solid var(--ubs-color-accent);
    box-shadow: 0 -8px 24px rgba(18, 20, 54, 0.15);

    opacity: 0;

    transform: translateY(14px);

    animation: ubs-service-copy-reveal 320ms 260ms ease-out forwards;
}

/* ---------------------------------------------------------
   Service Heading
   --------------------------------------------------------- */

.ubs-service-explorer-copy h3 {
    grid-area: title;

    align-self: center;

    min-width: 0;
    max-width: 100%;

    margin: 0;

    color: var(--ubs-color-heading);

    font-size: clamp(28px, 2.25vw, 35px);

    line-height: 1.08;

    font-weight: var(--ubs-font-weight-heading);

    letter-spacing: -0.02em;

    text-wrap: balance;
}

/* ---------------------------------------------------------
   Service Description
   --------------------------------------------------------- */

.ubs-service-explorer-copy > p {
    grid-area: body;

    align-self: center;

    min-width: 0;
    width: 100%;
    max-width: none;

    margin: 0;

    color: var(--ubs-color-body);

    font-size: 17px;
    line-height: 1.6;

    text-wrap: pretty;
}

/* ---------------------------------------------------------
   Service Link
   --------------------------------------------------------- */

.ubs-service-explorer-copy .ubs-fancy-links {
    grid-area: link;

    align-self: end;

    min-width: 0;

    width: fit-content;
    max-width: 100%;

    margin-top: 6px;

    white-space: normal;
}

/* =========================================================
   Image Reveal
   ========================================================= */

.ubs-service-explorer-cover {
    position: relative;

    z-index: 1;
    grid-row: 1;

    min-width: 0;
    min-height: 0;

    margin: 0;

    overflow: hidden;

    background: var(--ubs-color-soft-bg);

    animation: ubs-service-image-reveal var(--ubs-service-motion) forwards;
}

/*
 * Light image overlay.
 *
 * Because the copy no longer sits over the photograph,
 * the photograph can remain much brighter than the
 * original side-reveal design.
 */

.ubs-service-explorer-cover::after {
    content: "";

    position: absolute;

    inset: 0;

    background: linear-gradient(
            180deg,
            rgba(18, 20, 54, 0.02) 0%,
            rgba(18, 20, 54, 0.04) 58%,
            rgba(18, 20, 54, 0.14) 100%
    );

    pointer-events: none;
}

/* =========================================================
   Responsive image focal points
   ========================================================= */

.ubs-service-explorer-panel {
    --ubs-service-image-focus-desktop: 50% 50%;
    --ubs-service-image-focus-tablet: var(
            --ubs-service-image-focus-desktop
    );
    --ubs-service-image-focus-mobile: var(
            --ubs-service-image-focus-tablet
    );
}

@supports ((mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000))) {
    .ubs-logo-ticker-window {
        -webkit-mask-image: linear-gradient(
                90deg,
                transparent,
                #000 min(9vw, 120px),
                #000 calc(100% - min(9vw, 120px)),
                transparent
        );
        mask-image: linear-gradient(
                90deg,
                transparent,
                #000 min(9vw, 120px),
                #000 calc(100% - min(9vw, 120px)),
                transparent
        );
    }

    .ubs-logo-ticker-fade {
        display: none;
    }
}

/* Keep the technician and water meter within the crop. */
#ubs-panel-maintenance {
    --ubs-service-image-focus-desktop: 50% 100%;
    --ubs-service-image-focus-tablet: 50% 100%;
    --ubs-service-image-focus-mobile: 60% 100%;
}


/* Shared image presentation */
.ubs-service-explorer-cover img {
    position: absolute;
    inset: 0;

    display: block;

    width: 100%;
    height: 100%;
    max-width: none;

    object-fit: cover;
    object-position: var(--ubs-service-image-focus-desktop);
}

/*
 * Keep the existing figcaption in the HTML for semantic
 * context but visually hide it.
 */

.ubs-service-explorer-cover figcaption {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    margin: -1px !important;
    padding: 0 !important;

    overflow: hidden !important;

    clip: rect(0, 0, 0, 0) !important;

    clip-path: inset(50%) !important;

    white-space: nowrap !important;

    border: 0 !important;
}

/* =========================================================
   Motion
   ========================================================= */

@keyframes ubs-service-image-reveal {
    from {
        opacity: 0.82;
        transform: scale(1.018);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ubs-service-copy-reveal {
    to {
        opacity: 1;

        transform: translateY(0);
    }
}

/* =========================================================
   Tablet
   <= 980px
   ========================================================= */

@media only screen and (max-width: 980px) {
    .ubs-home-services-explorer {
        --ubs-service-stage-height: auto;
    }

    /* -----------------------------------------------------
       Explorer becomes vertically stacked
       ----------------------------------------------------- */

    .ubs-service-explorer {
        grid-template-columns: 1fr;

        min-height: 0;
    }

    /* -----------------------------------------------------
       Horizontal service navigation
       ----------------------------------------------------- */

    .ubs-service-explorer-rail {
        display: flex;

        overflow-x: auto;

        border-right: 0;

        border-bottom: 1px solid var(--ubs-color-border);

        scrollbar-width: thin;

        overscroll-behavior-inline: contain;

        scroll-snap-type: x proximity;

        -webkit-overflow-scrolling: touch;
    }

    .ubs-service-explorer-tab {
        flex: 1 0 172px;

        min-height: 68px;

        padding: 15px 17px;

        border-right: 1px solid rgba(37, 39, 94, 0.09);

        border-bottom: 0;

        scroll-snap-align: start;
    }

    .ubs-service-explorer-tab:last-child {
        border-right: 0;
    }

    /* Active indicator becomes horizontal */

    .ubs-service-explorer-tab::before {
        top: auto;

        right: 16px;
        bottom: 0;
        left: 16px;

        width: auto;
        height: 4px;

        border-radius: var(--ubs-radius-pill) var(--ubs-radius-pill) 0 0;

        transform: scaleX(0.35);
    }

    .ubs-service-explorer-tab.is-active::before,
    .ubs-service-explorer-tab[aria-selected="true"]::before {
        transform: scaleX(1);
    }

    /* -----------------------------------------------------
       Stage
       ----------------------------------------------------- */

    .ubs-service-explorer-stage,
    .ubs-service-explorer-panel {
        min-height: 0;
    }

    .ubs-service-explorer-panel.is-active:not([hidden]) {
        display: grid;

        grid-template-rows:
            minmax(330px, 46vw)
            auto;
    }

    /* -----------------------------------------------------
       Image
       ----------------------------------------------------- */

    .ubs-service-explorer-cover {
        min-height: 330px;
    }

    /* -----------------------------------------------------
       Horizontal information band remains on tablet
       ----------------------------------------------------- */

    .ubs-service-explorer-copy {
        grid-template-columns:
            minmax(0, 0.9fr)
            minmax(0, 1.1fr);

        grid-template-areas:
            "title body"
            "title link";

        grid-template-rows:
            minmax(0, 1fr)
            auto;

        column-gap: 32px;
        row-gap: 8px;

        width: 100%;

        height: auto;
        min-height: 0;

        padding: 30px 32px 34px;

        animation: ubs-service-copy-reveal 280ms 100ms ease-out forwards;
    }

    .ubs-service-explorer-copy h3 {
        max-width: none;

        font-size: clamp(28px, 4vw, 36px);
    }

    .ubs-service-explorer-copy > p {
        max-width: none;
    }

    .ubs-service-explorer-cover img {
        object-position: var(--ubs-service-image-focus-tablet);
    }
}

/* =========================================================
   Mobile
   <= 767px
   ========================================================= */

@media only screen and (max-width: 767px) {
    .ubs-service-explorer-heading {
        margin-bottom: 28px;
    }

    .ubs-service-explorer {
        border-radius: 18px;
    }

    /* -----------------------------------------------------
       Compact horizontally scrolling navigation
       ----------------------------------------------------- */

    .ubs-service-explorer-tab {
        flex-basis: 142px;

        min-height: 64px;

        padding: 13px 15px;

        grid-template-columns:
            27px
            minmax(0, 1fr);

        gap: 7px;
    }

    .ubs-service-explorer-label {
        font-size: var(--ubs-font-size-compact);
    }

    /* -----------------------------------------------------
       Mobile image
       ----------------------------------------------------- */

    .ubs-service-explorer-panel.is-active:not([hidden]) {
        grid-template-rows:
            minmax(240px, 64vw)
            auto;
    }

    .ubs-service-explorer-cover {
        min-height: 240px;
    }

    .ubs-service-explorer-cover img {
        object-position: var(--ubs-service-image-focus-mobile);
    }

    /* -----------------------------------------------------
       Copy becomes a normal vertical stack
       ----------------------------------------------------- */

    .ubs-service-explorer-copy {
        display: grid;

        grid-template-columns: 1fr;

        grid-template-areas:
            "title"
            "body"
            "link";

        grid-template-rows: auto;

        gap: 0;

        padding: 28px 24px 32px;
    }

    .ubs-service-explorer-copy h3 {
        margin-bottom: 16px;

        font-size: 30px;
        line-height: 1.08;
    }

    .ubs-service-explorer-copy > p {
        margin-bottom: 22px;

        font-size: var(--ubs-font-size-body);

        line-height: 1.62;
    }

    .ubs-service-explorer-copy .ubs-fancy-links {
        margin-top: 0;
    }
}

/* =========================================================
   Very Small Phones
   <= 480px
   ========================================================= */

@media only screen and (max-width: 480px) {
    .ubs-service-explorer-tab {
        flex-basis: 132px;

        min-height: 62px;

        padding: 12px 13px;

        grid-template-columns:
            24px
            minmax(0, 1fr);

        gap: 6px;
    }

    .ubs-service-explorer-number {
        font-size: 11px;
    }

    .ubs-service-explorer-panel.is-active:not([hidden]) {
        grid-template-rows:
            minmax(225px, 66vw)
            auto;
    }

    .ubs-service-explorer-cover {
        min-height: 225px;
    }

    .ubs-service-explorer-copy {
        padding: 26px 21px 30px;
    }

    .ubs-service-explorer-copy h3 {
        font-size: 28px;
    }
}

/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .ubs-service-explorer-cover,
    .ubs-service-explorer-copy {
        animation: none !important;
    }

    .ubs-service-explorer-copy {
        opacity: 1;

        transform: none;
    }
}

/* =========================================================
   UBS Homepage Interaction Polish
   Card, link, heading, ticker, and CTA micro-interactions.
   ========================================================= */

/* =========================================================
   1. Homepage text-link motion
   ========================================================= */

.ubs-home-page .ubs-fancy-links {
    position: relative;

    display: inline-flex;
    width: fit-content;
    padding-bottom: 4px;

    align-items: center;
    gap: 8px;

    color: var(--ubs-color-primary) !important;

    background-image: linear-gradient(
            var(--ubs-color-accent),
            var(--ubs-color-accent)
    );

    background-position: left bottom;
    background-repeat: no-repeat;
    background-size: 0 2px;

    text-decoration: none !important;

    transition: color var(--ubs-transition-fast),
    background-size 320ms var(--ubs-ease-out-smooth);
}

.ubs-home-page .ubs-fancy-links::after {
    content: "→";

    display: inline-block;

    font-size: 1.05em;
    line-height: 1;

    transform: translateX(0);

    transition: transform 320ms var(--ubs-ease-out-smooth);
}

.ubs-home-page .ubs-fancy-links:is(:hover, :focus-visible) {
    color: var(--ubs-color-primary-hover) !important;
    background-size: 100% 2px;
    text-decoration: none !important;
}

.ubs-home-page .ubs-fancy-links:is(:hover, :focus-visible)::after {
    transform: translateX(4px);
}

.ubs-home-page .ubs-fancy-links:focus-visible {
    border-radius: 4px;
    outline: 3px solid var(--ubs-color-focus-ring);
    outline-offset: 5px;
}

/* =========================================================
   2. One-time section-heading arrival
   ========================================================= */

.ubs-home-page .ubs-motion-heading .ubs-inline-dash::before {
    transform: scaleX(0);
    transform-origin: left center;
}

.ubs-home-page .ubs-motion-heading.is-in-view .ubs-inline-dash::before {
    animation: ubs-heading-accent-grow 480ms var(--ubs-ease-out-smooth) forwards;
}

.ubs-home-page .ubs-motion-heading.is-in-view h2 {
    animation: ubs-heading-settle 520ms 60ms var(--ubs-ease-out-smooth) both;
}

.ubs-home-page .ubs-motion-heading.is-in-view > p:not(.ubs-eyebrow) {
    animation: ubs-heading-settle 520ms 120ms var(--ubs-ease-out-smooth) both;
}

@keyframes ubs-heading-accent-grow {
    to {
        transform: scaleX(1);
    }
}

@keyframes ubs-heading-settle {
    from {
        opacity: 0.72;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   3. Logo ticker inspection state
   ========================================================= */

.ubs-home-page .ubs-logo-item img {
    opacity: 0.86;
    filter: saturate(0.72) contrast(0.96);

    transition: opacity var(--ubs-transition-fast),
    filter var(--ubs-transition-fast),
    transform 320ms var(--ubs-ease-out-smooth);
}

.ubs-home-page .ubs-logo-item:is(:hover, :focus-within) img {
    opacity: 1;
    filter: saturate(1) contrast(1);
    transform: scale(1.035);
}

.ubs-home-page .ubs-logo-ticker:focus-within .ubs-logo-ticker-track {
    animation-play-state: paused;
}

/* =========================================================
   4. Final CTA entrance
   One light sweep and two restrained button nudges
   ========================================================= */

.ubs-home-final-cta .ubs-cta-card-dark::before {
    content: "";

    position: absolute;
    inset: -70% -42%;
    z-index: 0;

    background: linear-gradient(
            110deg,
            transparent 42%,
            rgba(255, 255, 255, 0.08) 47%,
            rgba(184, 215, 52, 0.18) 52%,
            rgba(255, 255, 255, 0.07) 57%,
            transparent 63%
    );

    opacity: 0;
    transform: translateX(-48%) rotate(-5deg);

    pointer-events: none;
}

.ubs-home-final-cta .ubs-cta-card-dark.is-in-view::before {
    animation: ubs-cta-light-sweep 980ms 120ms var(--ubs-ease-out-smooth) both;
}

.ubs-home-final-cta .ubs-cta-card-dark.is-in-view .ubs-button-accent {
    animation: ubs-cta-nudge 680ms 520ms ease-out 2;
}

@keyframes ubs-cta-light-sweep {
    0% {
        opacity: 0;
        transform: translateX(-48%) rotate(-5deg);
    }

    18% {
        opacity: 1;
    }

    82% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(48%) rotate(-5deg);
    }
}

@keyframes ubs-cta-nudge {
    0%,
    100% {
        transform: translateY(0);
    }

    34% {
        transform: translateY(-6px);
    }

    58% {
        transform: translateY(-2px);
    }
}

/* =========================================================
   5. Input and motion safeguards
   ========================================================= */

@media (hover: none), (pointer: coarse) {
    .ubs-home-audiences .ubs-home-audience-card:is(:hover, :focus-within) {
        transform: none;
    }

    .ubs-home-audiences
    .ubs-home-audience-card:is(:hover, :focus-within)
    .ubs-home-audience-media
    img {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ubs-home-page .ubs-motion-heading .ubs-inline-dash::before {
        transform: scaleX(1);
    }

    .ubs-home-page .ubs-motion-heading.is-in-view h2,
    .ubs-home-page .ubs-motion-heading.is-in-view > p:not(.ubs-eyebrow),
    .ubs-home-page .ubs-motion-heading.is-in-view .ubs-inline-dash::before,
    .ubs-home-final-cta .ubs-cta-card-dark.is-in-view::before,
    .ubs-home-final-cta .ubs-cta-card-dark.is-in-view .ubs-button-accent {
        animation: none !important;
    }

    .ubs-home-audiences .ubs-home-audience-card,
    .ubs-home-audiences .ubs-home-audience-media img,
    .ubs-home-page .ubs-fancy-links,
    .ubs-home-page .ubs-fancy-links::after,
    .ubs-home-page .ubs-logo-item img {
        transition: none !important;
    }

    .ubs-home-audiences .ubs-home-audience-card:is(:hover, :focus-within),
    .ubs-home-audiences
    .ubs-home-audience-card:is(:hover, :focus-within)
    .ubs-home-audience-media
    img,
    .ubs-home-page .ubs-logo-item:is(:hover, :focus-within) img {
        transform: none;
    }
}
