/* ==========================================================================
   Website widgets (System package UI_Site, bundle "upb_site"): brand, navbar, logo cloud, quote,
   site footer, frame preview, composition, effects. Built on the upb.css tokens (--upb-*); loaded after
   upb.css only on pages that use these widgets.

   1. Brand, navbar, logo cloud, quote, site footer, frame preview
   2. Composition
   3. Effects (steam, glow, sparkle... pinned to spots of a picture)
   ========================================================================== */

/* ==========================================================================
   1. Brand, navbar, logo cloud, quote, site footer, frame preview
   ========================================================================== */

/* brand */

.upb-brand,
.upb-brand:hover,
.upb-brand:focus {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--upb-heading);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.01em;
    line-height: 1.2;
    text-decoration: none;
}

.upb-brand-logo {
    display: block;
    height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
}

.upb-brand-sm .upb-brand-logo {
    height: 28px;
}

.upb-brand-sm {
    font-size: 16px;
}

.upb-brand-lg .upb-brand-logo {
    height: 44px;
}

.upb-brand-lg {
    font-size: 22px;
}

/* navbar */

.upb-navbar {
    container-type: inline-size;
}

.upb-navbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
}

.upb-navbar-start .upb-brand {
    margin-inline-end: auto;
}

.upb-navbar-center .upb-navbar-inner {
    justify-content: center;
}

.upb-navbar-center .upb-brand {
    flex-basis: 100%;
    justify-content: center;
}

.upb-navbar-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.upb-navbar-link,
.upb-navbar-link:focus {
    padding: 8px 12px;
    border-radius: var(--upb-radius-sm);
    color: var(--upb-text);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.upb-navbar-link:hover,
.upb-navbar-link.is-active {
    color: var(--upb-heading);
    background: var(--upb-surface-soft);
    text-decoration: none;
}

/* .upb-navbar prefix: this file loads before upb.css, so it must beat .upb-buttons / .upb-icon svg */
.upb-navbar .upb-navbar-buttons {
    gap: 8px;
}

.upb-navbar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--upb-border);
    border-radius: var(--upb-radius-sm);
    background: transparent;
    color: var(--upb-heading);
    cursor: pointer;
}

.upb-navbar-toggle .upb-icon svg {
    width: 20px;
    height: 20px;
}

@container (max-width: 760px) {
    .upb-navbar-toggle {
        display: inline-flex;
    }

    .upb-navbar-links {
        display: none;
        order: 10;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        padding-top: 8px;
        border-top: 1px solid var(--upb-border);
    }

    .upb-navbar.is-open .upb-navbar-links {
        display: flex;
    }

    .upb-navbar-center .upb-brand {
        flex-basis: auto;
        margin-inline-end: auto;
    }
}

@container (max-width: 420px) {
    .upb-navbar-buttons .upb-btn:not(:last-child) {
        display: none;
    }
}

/* logo cloud */

.upb-logo-cloud {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.upb-logo-cloud-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--upb-muted);
    text-align: center;
}

.upb-logo-cloud-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 16px 24px;
}

@container (min-width: 480px) {
    .upb-logo-cloud-items {
        grid-template-columns: repeat(min(3, var(--upb-logo-cols, 6)), minmax(0, 1fr));
    }
}

@container (min-width: 720px) {
    .upb-logo-cloud-items {
        grid-template-columns: repeat(var(--upb-logo-cols, 6), minmax(0, 1fr));
    }
}

.upb-logo,
.upb-logo:hover {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    text-decoration: none;
}

.upb-logo img {
    max-height: 40px;
    max-width: 100%;
    width: auto;
    opacity: 0.7;
    filter: grayscale(1);
    transition: opacity 0.2s, filter 0.2s;
}

.upb-logo:hover img {
    opacity: 1;
    filter: none;
}

.upb-on-dark .upb-logo img {
    filter: grayscale(1) brightness(2.2);
}

.upb-logo-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--upb-muted);
}

.upb-logo-cloud-boxed .upb-logo {
    min-height: 88px;
    padding: 16px;
    border: 1px solid var(--upb-border);
    border-radius: var(--upb-radius);
    background: var(--upb-surface);
}

/* quote */

.upb-quote {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    margin: 0;
    color: var(--upb-text);
}

.upb-quote-bordered,
.upb-quote-elevated,
.upb-quote-soft {
    padding: clamp(20px, 3vw, 32px);
    border-radius: var(--upb-radius);
}

.upb-quote-bordered {
    border: 1px solid var(--upb-border);
    background: var(--upb-surface);
}

.upb-quote-elevated {
    border: 1px solid var(--upb-border);
    background: var(--upb-surface);
    box-shadow: var(--upb-shadow);
}

.upb-quote-soft {
    background: var(--upb-surface-soft);
}

/* accent card: soft tint + colored start border (color = page accent or .upb-quote-color-*) */
.upb-quote {
    --upb-quote-color: var(--upb-accent);
}

.upb-quote-color-accent { --upb-quote-color: var(--upb-accent); }
.upb-quote-color-blue { --upb-quote-color: #3b82f6; }
.upb-quote-color-teal { --upb-quote-color: #14b8a6; }
.upb-quote-color-violet { --upb-quote-color: #8b5cf6; }
.upb-quote-color-amber { --upb-quote-color: #f59e0b; }
.upb-quote-color-rose { --upb-quote-color: #f43f5e; }
.upb-quote-color-slate { --upb-quote-color: #64748b; }

.upb-quote-accent {
    padding: clamp(20px, 3vw, 28px) clamp(20px, 3vw, 28px) clamp(20px, 3vw, 28px) clamp(18px, 2.6vw, 26px);
    border-inline-start: 4px solid var(--upb-quote-color);
    border-radius: var(--upb-radius-sm);
    background: color-mix(in srgb, var(--upb-quote-color) 8%, transparent);
}

.upb-on-dark .upb-quote-accent {
    background: color-mix(in srgb, var(--upb-quote-color) 16%, transparent);
}

.upb-quote.upb-text-center {
    align-items: center;
}

.upb-quote-stars {
    display: flex;
    gap: 3px;
    color: #f59e0b;
    font-size: 13px;
}

.upb-quote-text {
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: 16px;
    line-height: 1.7;
    color: var(--upb-heading);
}

.upb-quote-lg .upb-quote-text {
    max-width: 760px;
    font-size: clamp(19px, 2.4vw, 24px);
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: -0.01em;
}

.upb-quote-person {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: start;
}

.upb-quote-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}

.upb-quote-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--upb-quote-color);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
}

.upb-quote-lg .upb-quote-avatar {
    width: 52px;
    height: 52px;
}

.upb-quote-lg .upb-quote-initials {
    font-size: 17px;
}

.upb-quote-who {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.upb-quote-name {
    color: var(--upb-heading);
    font-weight: 600;
}

.upb-quote-role {
    color: var(--upb-muted);
    font-size: 13px;
}

/* site footer */

.upb-site-footer {
    container-type: inline-size;
}

.upb-site-footer-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
}

.upb-site-footer-about {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 440px;
}

.upb-site-footer-text {
    color: var(--upb-muted);
}

.upb-site-footer-text > :last-child {
    margin-bottom: 0;
}

.upb-site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
}

.upb-site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.upb-site-footer-link,
.upb-site-footer-link:focus {
    color: var(--upb-text);
    font-weight: 500;
    text-decoration: none;
}

.upb-site-footer-link:hover {
    color: var(--upb-heading);
    text-decoration: none;
}

.upb-site-footer-social {
    display: flex;
    gap: 6px;
}

.upb-site-footer-social-link,
.upb-site-footer-social-link:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--upb-text);
    font-size: 16px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.upb-site-footer-social-link:hover {
    background: var(--upb-surface-soft);
    color: var(--upb-heading);
}

.upb-site-footer-bottom {
    margin-top: 16px;
    color: var(--upb-muted);
    font-size: 13px;
}

.upb-site-footer-centered .upb-site-footer-main,
.upb-site-footer-centered .upb-site-footer-about,
.upb-site-footer-centered .upb-site-footer-nav {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.upb-site-footer-centered .upb-site-footer-main {
    justify-content: center;
}

.upb-site-footer-centered .upb-site-footer-links {
    justify-content: center;
}

.upb-site-footer-centered .upb-site-footer-bottom {
    margin-top: 24px;
    text-align: center;
}

.upb-site-footer-split .upb-site-footer-main {
    align-items: flex-start;
}

.upb-site-footer-split .upb-site-footer-nav {
    flex-direction: column;
    align-items: flex-end;
}

.upb-site-footer-split .upb-site-footer-bottom {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--upb-border);
}

@container (max-width: 719px) {
    .upb-site-footer-split .upb-site-footer-nav {
        align-items: flex-start;
    }
}

/* frame preview */

.upb-frame {
    position: relative;
    height: var(--upb-frame-h, 240px);
    overflow: hidden;
    background: var(--upb-surface-soft);
}

.upb-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--upb-frame-w, 1280px);
    height: 100%;
    border: 0;
    transform-origin: 0 0;
    pointer-events: none;
}

@media print {
    .upb-navbar-toggle {
        display: none !important;
    }
}


/* ==========================================================================
   2. Composition: framed picture + background shape + floating labels/shapes
       Sizes use cqi of the stage (the picture width), so everything scales together.
       Wrappers place (left/top + translate), inner .upb-comp-anim elements move (transform).
   ========================================================================== */

.upb-composition {
    --upb-comp-speed: 1;
    --upb-comp-delay: 0s;
    display: flex;
    justify-content: center;
    padding-block: 6%;
    overflow-x: clip;
}

.upb-composition-speed-slow { --upb-comp-speed: 1.7; }
.upb-composition-speed-fast { --upb-comp-speed: 0.55; }

.upb-comp-stage {
    position: relative;
    width: 62%;
    max-width: 460px;
    container-type: inline-size;
}

.upb-composition-sm .upb-comp-stage {
    width: 50%;
    max-width: 360px;
}

.upb-composition-lg .upb-comp-stage {
    width: 72%;
    max-width: 560px;
}

/* picture */
.upb-comp-frame {
    position: relative;
    z-index: 2;
    overflow: hidden;
    border-radius: 8cqi;
    background: var(--upb-surface-strong);
    aspect-ratio: 3 / 4;
}

.upb-comp-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upb-comp-frame-empty {
    background: linear-gradient(160deg, var(--upb-accent-soft-strong), var(--upb-surface-strong));
}

.upb-comp-frame-shadow { box-shadow: var(--upb-shadow-lg); }
.upb-comp-frame-soft { border-radius: 4cqi; }
.upb-comp-frame-square { border-radius: 0; }
.upb-comp-frame-arch { border-radius: 50cqi 50cqi 6cqi 6cqi; }
.upb-comp-frame-circle { border-radius: 50%; }
.upb-comp-frame-pill { border-radius: 50cqi; }
.upb-comp-frame-blob { border-radius: 42% 58% 55% 45% / 38% 42% 58% 62%; }

/* white photo border + tilt (the effects layer inside the frame tilts with the picture) */
.upb-comp-frame-border {
    border: max(4px, 2.6cqi) solid #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.upb-comp-frame-border.upb-comp-frame-shadow { box-shadow: var(--upb-shadow-lg); }
.upb-comp-tilt-left { rotate: -4deg; }
.upb-comp-tilt-right { rotate: 3deg; }

.upb-comp-ratio-3x4 { aspect-ratio: 3 / 4; }
.upb-comp-ratio-4x5 { aspect-ratio: 4 / 5; }
.upb-comp-ratio-2x3 { aspect-ratio: 2 / 3; }
.upb-comp-ratio-1x1 { aspect-ratio: 1 / 1; }
.upb-comp-ratio-4x3 { aspect-ratio: 4 / 3; }
.upb-comp-ratio-16x9 { aspect-ratio: 16 / 9; }

/* background shape behind the picture */
.upb-comp-backdrop {
    position: absolute;
    z-index: 0;
    top: 50%;
    left: 50%;
    width: 150cqi;
    aspect-ratio: 1 / 1;
    translate: -50% -50%;
    pointer-events: none;
}

.upb-comp-backdrop-sm { width: 118cqi; }
.upb-comp-backdrop-lg { width: 185cqi; }
.upb-comp-backdrop-at-start { left: 22%; }
.upb-comp-backdrop-at-end { left: 78%; }
.upb-comp-backdrop-at-top { top: 30%; }
.upb-comp-backdrop-at-bottom { top: 70%; }

/* offset card: same box as the picture, shifted to the bottom end */
.upb-comp-backdrop-at-offset {
    inset: 0;
    width: auto;
    aspect-ratio: auto;
    translate: 7cqi 7cqi;
}

.upb-comp-backdrop-at-offset > .upb-comp-shape-rounded { border-radius: 8cqi; }

.upb-comp-backdrop > .upb-comp-shape {
    width: 100%;
    height: 100%;
}

/* shapes (backdrop + decorations) */
.upb-comp-shape {
    --upb-comp-color: var(--upb-accent);
    --upb-comp-fill: var(--upb-comp-color);
    background: var(--upb-comp-fill);
}

.upb-comp-color-gray { --upb-comp-color: color-mix(in srgb, var(--upb-accent) 7%, #e9ecf3); }
.upb-comp-color-soft { --upb-comp-color: color-mix(in srgb, var(--upb-accent) 16%, #ffffff); }
.upb-comp-color-accent { --upb-comp-color: var(--upb-accent); }
.upb-comp-color-dark { --upb-comp-color: #0f172a; }
.upb-comp-color-white { --upb-comp-color: #ffffff; }
.upb-comp-color-blue { --upb-comp-color: #3b82f6; }
.upb-comp-color-teal { --upb-comp-color: #14b8a6; }
.upb-comp-color-violet { --upb-comp-color: #8b5cf6; }
.upb-comp-color-amber { --upb-comp-color: #f59e0b; }
.upb-comp-color-rose { --upb-comp-color: #f43f5e; }
.upb-comp-color-slate { --upb-comp-color: #64748b; }

.upb-comp-color-gradient {
    --upb-comp-color: var(--upb-accent);
    --upb-comp-fill: linear-gradient(135deg, var(--upb-accent), var(--upb-accent-2));
}

/* big backdrops in a strong color are toned down; the picture must stay the focus */
.upb-comp-backdrop :is(.upb-comp-color-blue, .upb-comp-color-teal, .upb-comp-color-violet, .upb-comp-color-amber, .upb-comp-color-rose, .upb-comp-color-slate) {
    --upb-comp-fill: color-mix(in srgb, var(--upb-comp-color) 16%, #ffffff);
}

.upb-comp-shape-circle { border-radius: 50%; }
.upb-comp-shape-square { border-radius: 22%; }
.upb-comp-shape-rounded { border-radius: 24%; }
.upb-comp-shape-arch { border-radius: 50% 50% 12% 12%; }
.upb-comp-shape-blob { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }

.upb-comp-shape-ring {
    border: max(2px, 1.2cqi) solid var(--upb-comp-color);
    border-radius: 50%;
    background: none;
}

.upb-comp-backdrop .upb-comp-shape-ring {
    border-width: max(2px, 0.6cqi);
    border-style: dashed;
}

.upb-comp-shape-dots {
    background: radial-gradient(circle, var(--upb-comp-color) 22%, transparent 26%) 0 0 / 14.28% 14.28%;
}

.upb-comp-backdrop .upb-comp-shape-dots {
    background-size: 5% 5%;
    border-radius: 50%;
    -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 71%);
    mask-image: radial-gradient(circle, #000 55%, transparent 71%);
}

.upb-comp-shape-plus {
    background: linear-gradient(var(--upb-comp-color), var(--upb-comp-color)) center / 100% 26% no-repeat,
        linear-gradient(var(--upb-comp-color), var(--upb-comp-color)) center / 26% 100% no-repeat;
    border-radius: 0;
}

/* floating pieces: x/y = point on the picture where the piece is centered */
.upb-comp-deco,
.upb-comp-label {
    position: absolute;
    translate: -50% -50%;
}

.upb-comp-deco {
    z-index: 1;
    width: 12cqi;
    aspect-ratio: 1 / 1;
    pointer-events: none;
}

.upb-comp-deco > .upb-comp-shape {
    width: 100%;
    height: 100%;
}

.upb-comp-deco-xs { width: 6cqi; }
.upb-comp-deco-md { width: 20cqi; }
.upb-comp-deco-lg { width: 32cqi; }

.upb-comp-label { z-index: 3; }

.upb-comp-x-start { left: 18%; }
.upb-comp-x-center { left: 50%; }
.upb-comp-x-end { left: 82%; }

/* outside: the outer edge sticks out a fixed amount (fits the composition's side room on every screen),
   so a longer label grows over the picture instead of being cut off */
.upb-comp-label.upb-comp-x-out_start { left: -18cqi; translate: 0 -50%; }
.upb-comp-label.upb-comp-x-out_end { left: auto; right: -18cqi; translate: 0 -50%; }
.upb-composition-lg .upb-comp-label.upb-comp-x-out_start { left: -12cqi; }
.upb-composition-lg .upb-comp-label.upb-comp-x-out_end { right: -12cqi; }

/* left / right labels: outer edge just inside the picture, growing toward the middle */
.upb-comp-label.upb-comp-x-start { left: 6cqi; translate: 0 -50%; }
.upb-comp-label.upb-comp-x-end { left: auto; right: 6cqi; translate: 0 -50%; }

/* small decorative shapes: centered just outside the picture edge */
.upb-comp-deco.upb-comp-x-out_start { left: -4%; translate: -50% -50%; }
.upb-comp-deco.upb-comp-x-out_end { left: 104%; translate: -50% -50%; }
.upb-comp-y-top { top: 9%; }
.upb-comp-y-upper { top: 30%; }
.upb-comp-y-middle { top: 50%; }
.upb-comp-y-lower { top: 70%; }
.upb-comp-y-bottom { top: 91%; }

/* text labels */
.upb-comp-label-card {
    --upb-comp-label-fg: #0f172a;
    --upb-comp-label-muted: #475569;
    padding: 0.85em 1.5em;
    border-radius: 1.05em;
    background: #ffffff;
    box-shadow: 0 1.2em 2.4em -1em rgba(15, 23, 42, 0.22), 0 0.15em 0.5em rgba(15, 23, 42, 0.06);
    color: var(--upb-comp-label-fg);
    font-size: max(12px, 4.4cqi);
    line-height: 1.25;
    /* one line; wraps only when wider than the picture + the part that may stick out (very long text) */
    box-sizing: border-box;
    width: max-content;
    max-width: 112cqi;
}

.upb-comp-label-sm .upb-comp-label-card { font-size: max(11px, 3.3cqi); }
.upb-comp-label-lg .upb-comp-label-card { font-size: max(13px, 5.6cqi); }

.upb-comp-label-glass {
    background: rgba(255, 255, 255, 0.74);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 1.2em 2.4em -1em rgba(15, 23, 42, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.upb-comp-label-soft {
    background: color-mix(in srgb, var(--upb-accent) 10%, #ffffff);
}

.upb-comp-label-accent,
.upb-comp-label-gradient,
.upb-comp-label-dark {
    --upb-comp-label-fg: #ffffff;
    --upb-comp-label-muted: rgba(255, 255, 255, 0.78);
}

.upb-comp-label-accent { background: var(--upb-accent); }
.upb-comp-label-gradient { background: linear-gradient(135deg, var(--upb-accent), var(--upb-accent-2)); }
.upb-comp-label-dark { background: rgba(15, 23, 42, 0.88); }

.upb-comp-label-body {
    display: flex;
    align-items: center;
    gap: 0.6em;
}

.upb-comp-label-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    border-radius: 50%;
    background: color-mix(in srgb, var(--upb-accent) 14%, transparent);
    color: var(--upb-accent);
    font-size: 0.8em;
}

.upb-comp-label-icon svg {
    width: 1.1em;
    height: 1.1em;
}

:is(.upb-comp-label-accent, .upb-comp-label-gradient, .upb-comp-label-dark) .upb-comp-label-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.upb-comp-label-text {
    display: flex;
    flex-direction: column;
}

.upb-comp-label-title {
    font-weight: 500;
    letter-spacing: -0.01em;
}

.upb-comp-label-note {
    color: var(--upb-comp-label-muted);
    font-size: 0.72em;
}

/* continuous motion */
.upb-comp-anim {
    animation-delay: var(--upb-comp-delay);
    animation-iteration-count: infinite;
    will-change: transform;
}

.upb-comp-anim-float { animation: upb-comp-float calc(6s * var(--upb-comp-speed)) ease-in-out var(--upb-comp-delay) infinite; }
.upb-comp-anim-sway { animation: upb-comp-sway calc(7s * var(--upb-comp-speed)) ease-in-out var(--upb-comp-delay) infinite; }
.upb-comp-anim-orbit { animation: upb-comp-orbit calc(9s * var(--upb-comp-speed)) linear var(--upb-comp-delay) infinite; }
.upb-comp-anim-rotate { animation: upb-comp-rotate calc(40s * var(--upb-comp-speed)) linear var(--upb-comp-delay) infinite; }
.upb-comp-anim-pulse { animation: upb-comp-pulse calc(5s * var(--upb-comp-speed)) ease-in-out var(--upb-comp-delay) infinite; }
.upb-comp-anim-morph { animation: upb-comp-morph calc(12s * var(--upb-comp-speed)) ease-in-out var(--upb-comp-delay) infinite; }
.upb-comp-deco .upb-comp-anim-rotate { animation-duration: calc(16s * var(--upb-comp-speed)); }

@keyframes upb-comp-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

@keyframes upb-comp-sway {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(14px); }
}

/* small circle path, text stays upright */
@keyframes upb-comp-orbit {
    from { transform: rotate(0deg) translateX(10px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(10px) rotate(-360deg); }
}

@keyframes upb-comp-rotate {
    to { transform: rotate(360deg); }
}

@keyframes upb-comp-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes upb-comp-morph {
    0%, 100% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; transform: rotate(0deg); }
    33% { border-radius: 58% 42% 38% 62% / 52% 61% 39% 48%; transform: rotate(60deg); }
    66% { border-radius: 36% 64% 54% 46% / 61% 37% 63% 39%; transform: rotate(-30deg); }
}

@media (prefers-reduced-motion: reduce) {
    .upb-comp-anim {
        animation: none !important;
    }
}


/* cutout: no frame, a picture with a transparent background standing on the bottom (head may rise above the backdrop) */
.upb-comp-frame-cutout {
    overflow: visible;
    border-radius: 0;
    background: none;
}

.upb-comp-frame-cutout img {
    object-fit: contain;
    object-position: 50% 25%;
}

.upb-comp-frame-cutout.upb-comp-frame-shadow {
    box-shadow: none;
    filter: drop-shadow(0 1.6cqi 3cqi rgba(15, 23, 42, 0.16));
}

.upb-comp-frame-cutout.upb-comp-frame-empty { border-radius: 50cqi 50cqi 0 0; }
.upb-comp-backdrop-xs { width: 96cqi; }

/* faded pattern behind everything (grid lines / dot grid) */
.upb-comp-pattern {
    position: absolute;
    z-index: 0;
    top: 50%;
    left: 50%;
    width: 230cqi;
    aspect-ratio: 1 / 1;
    translate: -50% -50%;
    pointer-events: none;
    --upb-comp-line: color-mix(in srgb, var(--upb-ink) 9%, transparent);
    -webkit-mask-image: radial-gradient(closest-side, #000 45%, transparent);
    mask-image: radial-gradient(closest-side, #000 45%, transparent);
}

.upb-comp-pattern-grid {
    background: linear-gradient(var(--upb-comp-line) 1px, transparent 1px) 0 0 / 12cqi 12cqi,
        linear-gradient(90deg, var(--upb-comp-line) 1px, transparent 1px) 0 0 / 12cqi 12cqi;
}

.upb-comp-pattern-dots {
    background: radial-gradient(circle, color-mix(in srgb, var(--upb-accent) 30%, transparent) 0.7cqi, transparent 0.8cqi) 0 0 / 7cqi 7cqi;
}

/* rings: thin concentric orbits */
.upb-comp-shape-rings {
    border-radius: 50%;
    background: radial-gradient(circle closest-side,
            transparent calc(54% - 1px), var(--upb-comp-line-color) calc(54% - 1px), var(--upb-comp-line-color) 54%, transparent 54%,
            transparent calc(78% - 1px), var(--upb-comp-line-color) calc(78% - 1px), var(--upb-comp-line-color) 78%, transparent 78%,
            transparent calc(100% - 1px), var(--upb-comp-line-color) calc(100% - 1px), var(--upb-comp-line-color) 100%, transparent 100%),
        radial-gradient(circle closest-side, color-mix(in srgb, var(--upb-comp-color) 14%, transparent) 54%, transparent 54%);
    --upb-comp-line-color: color-mix(in srgb, var(--upb-comp-color) 50%, transparent);
}

.upb-comp-backdrop .upb-comp-shape-rings { background-color: transparent; }

/* hand-drawn doodles (mask = shape, background = color) */
.upb-comp-shape-sparkle,
.upb-comp-shape-heart,
.upb-comp-shape-squiggle,
.upb-comp-shape-wave {
    border-radius: 0;
    -webkit-mask: var(--upb-comp-mask) center / contain no-repeat;
    mask: var(--upb-comp-mask) center / contain no-repeat;
}

.upb-comp-shape-sparkle { --upb-comp-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 0C54 34 66 46 100 50C66 54 54 66 50 100C46 66 34 54 0 50C34 46 46 34 50 0Z'/%3E%3C/svg%3E"); }
.upb-comp-shape-heart { --upb-comp-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M48 84C22 66 8 48 13 31C18 15 40 13 49 31C57 12 81 14 86 31C91 48 76 65 52 83C40 92 22 96 8 94' fill='none' stroke='%23000' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.upb-comp-shape-squiggle { --upb-comp-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M10 66C18 38 34 30 40 48S56 74 64 52S80 22 90 36' fill='none' stroke='%23000' stroke-width='8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.upb-comp-shape-wave { --upb-comp-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M6 50Q17 34 28 50T50 50T72 50T94 50' fill='none' stroke='%23000' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* extra large decoration = a second backdrop shape (sits behind the picture) */
.upb-comp-deco-xl { width: 70cqi; }
.upb-comp-deco-xl :is(.upb-comp-color-blue, .upb-comp-color-teal, .upb-comp-color-violet, .upb-comp-color-amber, .upb-comp-color-rose, .upb-comp-color-slate) {
    --upb-comp-fill: color-mix(in srgb, var(--upb-comp-color) 22%, #ffffff);
}

/* stat card: icon on top, big title, note under it */
.upb-comp-label-stat {
    padding: 1em 1.4em;
    border-radius: 1.2em;
    text-align: center;
}

.upb-comp-label-stat .upb-comp-label-body {
    flex-direction: column;
    gap: 0.35em;
}

.upb-comp-label-stat .upb-comp-label-icon {
    background: none;
    color: #f59e0b;
    font-size: 1.15em;
}

.upb-comp-label-stat .upb-comp-label-title {
    font-size: 1.4em;
    font-weight: 700;
    line-height: 1.1;
}

/* bubble: round, icon only (text stays for screen readers) */
.upb-comp-label-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.4em;
    height: 4.4em;
    padding: 0;
    border-radius: 50%;
}

.upb-comp-label-bubble .upb-comp-label-icon {
    width: 2.4em;
    height: 2.4em;
    background: none;
    font-size: 1.1em;
}

.upb-comp-label-bubble .upb-comp-label-icon svg {
    width: 1.6em;
    height: 1.6em;
}

.upb-comp-label-bubble .upb-comp-label-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.upb-comp-label-bubble.upb-comp-label-card { width: 4.4em; }
.upb-comp-label.upb-comp-x-out_start:has(.upb-comp-label-bubble) { left: -10cqi; }
.upb-comp-label.upb-comp-x-out_end:has(.upb-comp-label-bubble) { right: -10cqi; }

/* collage: the picture + 2 tiles on colored cards in a staggered grid */
.upb-composition-collage .upb-comp-stage {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 5cqi;
    align-items: start;
}

.upb-composition-collage .upb-comp-frame {
    grid-column: 1;
    grid-row: 1;
    aspect-ratio: 1 / 1;
    border-radius: 7cqi;
}

.upb-comp-tile {
    position: relative;
    z-index: 2;
    overflow: hidden;
    border-radius: 7cqi;
}

.upb-comp-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 25%;
}

.upb-comp-tile:is(.upb-comp-color-blue, .upb-comp-color-teal, .upb-comp-color-violet, .upb-comp-color-amber, .upb-comp-color-rose, .upb-comp-color-slate) {
    --upb-comp-fill: color-mix(in srgb, var(--upb-comp-color) 38%, #ffffff);
}

.upb-comp-tile-1 {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 16cqi;
    aspect-ratio: 4 / 5;
}

.upb-comp-tile-2 {
    grid-column: 1;
    grid-row: 2;
    aspect-ratio: 5 / 4;
}

.upb-composition-collage .upb-comp-frame-circle,
.upb-composition-collage .upb-comp-frame-cutout { aspect-ratio: 1 / 1; }

.upb-hero-media .upb-composition {
    padding-block: 2%;
}

/* ==========================================================================
   3. Effects: continuous effects pinned to spots of a picture (composition frame or .upb-fx-host)
       The layer covers the picture; each .upb-fx sits on its point (left/top %) and is sized in cqi of
       the layer, so effects follow the object at every screen width. Particles (<i>) carry
       --upb-fx-n/x/y/dx; rising/falling ones move the whole <i> track, the others animate ::before.
   ========================================================================== */

.upb-fx-host {
    position: relative;
}

.upb-fx-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    container-type: inline-size;
}

.upb-fx-host > .upb-fx-layer {
    border-radius: var(--upb-radius);
}

.upb-fx-host:has(.upb-image-plain) > .upb-fx-layer { border-radius: 0; }
.upb-fx-host:has(.upb-image-circle) > .upb-fx-layer { border-radius: 50%; }

.upb-fx {
    --upb-fx-w: 16cqi;
    --upb-fx-c: #d3d8df;
    --upb-fx-dur: 3.4s;
    --upb-fx-time: calc(var(--upb-fx-dur) * var(--upb-comp-speed, 1));
    position: absolute;
    width: var(--upb-fx-w);
    aspect-ratio: 1 / 1;
    translate: -50% -50%;
    rotate: var(--upb-fx-angle, 0deg);
    opacity: 0.85;
}

.upb-fx-xs { --upb-fx-w: 6cqi; }
.upb-fx-sm { --upb-fx-w: 10cqi; }
.upb-fx-lg { --upb-fx-w: 24cqi; }
.upb-fx-xl { --upb-fx-w: 36cqi; }

.upb-fx-soft { opacity: 0.5; }
.upb-fx-strong { opacity: 1; }

.upb-fx.upb-fx-tinted {
    --upb-fx-c: var(--upb-comp-color);
    --upb-fx-edge: transparent;
}

.upb-fx i {
    position: absolute;
    inset: 0;
    display: block;
    animation-duration: var(--upb-fx-time);
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    /* negative delay: every particle is already on its way when the page opens */
    animation-delay: calc(var(--upb-fx-time) * (var(--upb-fx-n) / var(--upb-fx-count) + var(--upb-fx-shift, 0)) * -1);
}

.upb-fx i::before {
    content: "";
    position: absolute;
    animation-duration: inherit;
    animation-iteration-count: inherit;
    animation-delay: inherit;
    animation-timing-function: ease-in-out;
}

/* rising from the point: steam, smoke, bubbles (anchored at the bottom center, angle tilts the column) */
.upb-fx-steam,
.upb-fx-smoke,
.upb-fx-bubbles {
    aspect-ratio: 1 / 2.2;
    translate: -50% -100%;
    transform-origin: 50% 100%;
}

.upb-fx-steam {
    --upb-fx-c: #ffffff;
    --upb-fx-edge: rgba(51, 65, 85, 0.55);
}

.upb-fx-steam i,
.upb-fx-smoke i {
    transform-origin: 50% 100%;
    animation-name: upb-fx-rise;
}

/* thin wisps: narrow ellipses, a little skewed, soft edges */
.upb-fx-steam i::before,
.upb-fx-smoke i::before {
    left: calc(50% + (var(--upb-fx-x) - 50%) * 0.5);
    bottom: 0;
    width: 30%;
    aspect-ratio: 1 / 3;
    translate: -50% 0;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--upb-fx-c), color-mix(in srgb, var(--upb-fx-c) 40%, transparent) 55%, transparent);
    /* white core + faint shadow: reads on light and dark pictures */
    filter: blur(max(1px, 0.35cqi)) drop-shadow(0 0 max(1px, 0.5cqi) var(--upb-fx-edge));
    transform: skewX(9deg);
}

.upb-fx-steam i:nth-child(even)::before,
.upb-fx-smoke i:nth-child(even)::before {
    transform: skewX(-9deg);
}

.upb-fx-smoke {
    --upb-fx-c: #8f97a3;
    --upb-fx-edge: transparent;
    --upb-fx-dur: 5.6s;
}

.upb-fx-smoke i::before {
    width: 52%;
    aspect-ratio: 1 / 2;
    filter: blur(max(2px, 1cqi));
}

@keyframes upb-fx-rise {
    0% { transform: translate(0, 4%) scale(0.5); opacity: 0; }
    12% { opacity: 1; }
    50% { transform: translate(var(--upb-fx-dx), -24%) scale(0.85); opacity: 0.8; }
    100% { transform: translate(calc(var(--upb-fx-dx) * -1), -52%) scale(1.2); opacity: 0; }
}

.upb-fx-bubbles {
    --upb-fx-c: #7cc4f2;
    --upb-fx-dur: 4.2s;
}

.upb-fx-bubbles i {
    animation-name: upb-fx-bubble;
    animation-timing-function: ease-in;
}

.upb-fx-bubbles i::before {
    left: var(--upb-fx-x);
    bottom: 0;
    width: calc(8% + var(--upb-fx-n) * 1.6%);
    aspect-ratio: 1;
    translate: -50% 0;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.95) 0 14%, transparent 18%), color-mix(in srgb, var(--upb-fx-c) 30%, transparent);
    box-shadow: inset 0 0 0 max(1px, 0.25cqi) var(--upb-fx-c);
}

@keyframes upb-fx-bubble {
    0% { transform: translate(0, 0); opacity: 0; }
    12% { opacity: 1; }
    40% { transform: translate(var(--upb-fx-dx), -30%); }
    70% { transform: translate(calc(var(--upb-fx-dx) * -0.6), -60%); opacity: 1; }
    100% { transform: translate(var(--upb-fx-dx), -88%); opacity: 0; }
}

/* glow: soft light pulsing on the point (lamp, screen, candle) */
.upb-fx-glow {
    --upb-fx-c: #ffcf6b;
    --upb-fx-dur: 3s;
}

.upb-fx-glow i::before {
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--upb-fx-c), color-mix(in srgb, var(--upb-fx-c) 35%, transparent) 45%, transparent);
    animation-name: upb-fx-glow;
}

@keyframes upb-fx-glow {
    0%, 100% { transform: scale(0.82); opacity: 0.55; }
    50% { transform: scale(1.08); opacity: 1; }
}

/* beam: light cone shining down from the point (angle turns it) */
.upb-fx-beam {
    --upb-fx-c: #ffe39a;
    --upb-fx-dur: 5s;
    aspect-ratio: 1 / 1.4;
    translate: -50% 0;
    transform-origin: 50% 0;
}

.upb-fx-beam i::before {
    inset: 0;
    clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
    background: linear-gradient(to bottom, var(--upb-fx-c), color-mix(in srgb, var(--upb-fx-c) 30%, transparent) 55%, transparent 92%);
    filter: blur(max(1px, 0.6cqi));
    animation-name: upb-fx-flicker;
}

@keyframes upb-fx-flicker {
    0%, 100% { opacity: 0.8; }
    40% { opacity: 1; }
    55% { opacity: 0.88; }
    70% { opacity: 1; }
}

/* sparkle: twinkling stars around the point */
.upb-fx-sparkle {
    --upb-fx-c: #f5b72e;
    --upb-fx-dur: 2.6s;
}

.upb-fx-sparkle i::before {
    left: var(--upb-fx-x);
    top: var(--upb-fx-y);
    width: calc(16% + var(--upb-fx-n) * 4%);
    aspect-ratio: 1;
    translate: -50% -50%;
    background: var(--upb-fx-c);
    clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
    animation-name: upb-fx-twinkle;
}

@keyframes upb-fx-twinkle {
    0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
    45% { transform: scale(1) rotate(45deg); opacity: 1; }
    70% { transform: scale(0.2) rotate(90deg); opacity: 0.4; }
}

/* ripple: rings spreading from the point */
.upb-fx-ripple {
    --upb-fx-c: var(--upb-accent);
    --upb-fx-dur: 3s;
}

.upb-fx-ripple i::before {
    inset: 0;
    border: max(1.5px, 0.5cqi) solid var(--upb-fx-c);
    border-radius: 50%;
    animation-name: upb-fx-ripple;
    animation-timing-function: ease-out;
}

@keyframes upb-fx-ripple {
    0% { transform: scale(0.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

/* dust: tiny specks drifting in the light */
.upb-fx-dust {
    --upb-fx-c: #f1cf8e;
    --upb-fx-dur: 7s;
}

.upb-fx-dust i::before {
    left: var(--upb-fx-x);
    top: var(--upb-fx-y);
    width: 4.5%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--upb-fx-c);
    box-shadow: 0 0 max(2px, 0.6cqi) var(--upb-fx-c);
    animation-name: upb-fx-drift;
}

@keyframes upb-fx-drift {
    0%, 100% { transform: translate(0, 0); opacity: 0; }
    25% { opacity: 1; }
    50% { transform: translate(calc(var(--upb-fx-dx) * 4), -160%); opacity: 0.7; }
    75% { transform: translate(calc(var(--upb-fx-dx) * -3), -320%); opacity: 1; }
}

/* snow: flakes falling through the area */
.upb-fx-snow {
    --upb-fx-c: #ffffff;
    --upb-fx-dur: 6s;
}

.upb-fx-snow i {
    animation-name: upb-fx-fall;
}

.upb-fx-snow i::before {
    left: var(--upb-fx-x);
    top: 0;
    width: calc(2.6% + var(--upb-fx-n) * 0.3%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--upb-fx-c);
    /* thin edge keeps white flakes visible on light pictures */
    box-shadow: 0 0 0 0.5px rgba(15, 23, 42, 0.12), 0 0 max(2px, 0.4cqi) var(--upb-fx-c);
}

@keyframes upb-fx-fall {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 1; }
    50% { transform: translate(var(--upb-fx-dx), 48%); }
    90% { opacity: 1; }
    100% { transform: translate(calc(var(--upb-fx-dx) * -1), 95%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .upb-fx i,
    .upb-fx i::before {
        animation: none !important;
    }
}
