/* Market pages motion core (owner approved 2026-11-04). Same file on the Saudi and UAE branches.
   Every hidden or moved state sits under html.mm, which only market-motion.js adds (never with reduced motion), so the page is complete without it.
   Colours come from each market's tokens: --mm-ink, --mm-accent, --mm-soft, --mm-line, --mm-focus. */

/* Headlines that build word by word */
html.mm .mw {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding-block: .12em;
    margin-block: -.12em;
}
html.mm .mw-i {
    display: inline-block;
    transform: translate3d(0, 108%, 0);
    opacity: 0;
    transition: transform .9s cubic-bezier(.2, .8, .2, 1) calc(var(--i) * 70ms + var(--mm-delay, 0ms)),
                opacity .5s linear calc(var(--i) * 70ms + var(--mm-delay, 0ms));
}
html.mm .mm-in .mw-i { transform: none; opacity: 1; }

/* Count-ups: the ghost reserves the final width, the live copy counts over it */
.mm-stack { display: inline-grid; }
.mm-stack > * { grid-area: 1 / 1; }
.mm-ghost { visibility: hidden; }
/* Overlay count: the real number stays in the text; the counting value is drawn over it. The text
   fill (not the colour) is hidden, so the element keeps its real colour for contrast checks. */
html.mm .mm-counting { position: relative; -webkit-text-fill-color: transparent; }
html.mm .mm-counting::after {
    content: attr(data-mm-n);
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 0;
    -webkit-text-fill-color: currentColor;
    white-space: nowrap;
}

/* Buttons that pull toward the cursor: the label moves a little more than the button */
html.mm .mm-mag { will-change: transform; transition: none; }
/* `translate` composes with a child's own transform (e.g. an arrow flipped for RTL). */
html.mm .mm-mag > * { translate: var(--mmx, 0) var(--mmy, 0); }

/* The moving reference strip */
.mm-strip {
    direction: ltr;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.mm-strip__track { display: flex; gap: var(--mm-strip-gap, 14px); width: max-content; will-change: transform; }
.mm-strip .mm-strip__list {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: var(--mm-strip-gap, 14px);
    width: max-content;
    margin: 0;
    padding: 0;
}
.mm-strip .mm-strip__list > * { flex: none; }
.mm-sleep .mm-strip__track, .mm-strip.mm-sleep .mm-strip__track { will-change: auto; }

/* Staged reveals */
html.mm .mm-rv {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition: opacity .6s ease calc(var(--k, 0) * 90ms), transform .8s cubic-bezier(.2, .8, .2, 1) calc(var(--k, 0) * 90ms);
}
html.mm .mm-rv.mm-rv-in { opacity: 1; transform: none; }

/* The form's first question, on the page */
.mm-q {
    --p: .06;
    display: grid;
    gap: 14px;
    padding: clamp(18px, 3vw, 28px);
    border-radius: 22px;
    background: var(--mm-card, #fff);
    color: var(--mm-ink);
    box-shadow: 0 1px 0 var(--mm-line), 0 24px 60px rgb(0 0 0 / .10);
    text-align: start;
}
.mm-q__top { display: flex; align-items: center; gap: 12px; }
.mm-q__num { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--mm-accent); }
[dir="rtl"] .mm-q__num svg { transform: scaleX(-1); }
.mm-q__bar { flex: 1; height: 6px; border-radius: 99px; background: var(--mm-line); overflow: hidden; }
.mm-q__bar b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--mm-accent);
    transform: scaleX(var(--p));
    transform-origin: 0 50%;
    transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
[dir="rtl"] .mm-q__bar b { transform-origin: 100% 50%; }
.mm-q__title { margin: 4px 0 0; font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); font-weight: 700; line-height: 1.35; color: var(--mm-ink); text-wrap: balance; }
.mm-q__desc { margin: -6px 0 0; font-size: .95rem; color: var(--mm-muted, inherit); }
.mm-q__opts { display: grid; gap: 10px; }
.mm-q__opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--mm-card, #fff);
    box-shadow: inset 0 0 0 1.5px var(--mm-line-strong, var(--mm-line));
    cursor: pointer;
    transition: box-shadow .2s, background-color .2s, transform .25s cubic-bezier(.2, .8, .2, 1);
}
.mm-q__opt:hover { background: var(--mm-soft); }
.mm-q__opt:active { transform: scale(.985); }
.mm-q__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.mm-q__key {
    flex: none;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    direction: ltr;
    color: var(--mm-ink);
    box-shadow: inset 0 0 0 1.5px var(--mm-line-strong, var(--mm-line));
    transition: background-color .2s, color .2s, box-shadow .2s;
}
.mm-q__txt { flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.mm-q__chk { flex: none; width: 22px; height: 22px; color: var(--mm-accent); opacity: 0; transform: scale(.4); transition: opacity .2s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.mm-q__opt.is-on { background: var(--mm-soft); box-shadow: inset 0 0 0 2px var(--mm-accent); }
.mm-q__opt.is-on .mm-q__key { background: var(--mm-accent); color: var(--mm-on-accent, #fff); box-shadow: none; }
.mm-q__opt.is-on .mm-q__chk { opacity: 1; transform: none; }
.mm-q__opt:has(input:focus-visible) { outline: 3px solid var(--mm-focus); outline-offset: 3px; }
.mm-q__exit { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--mm-soft); font-weight: 600; line-height: 1.7; }
.mm-q__go { display: flex; }
.mm-q__go > a { flex: 1; justify-content: center; }
html.mm .mm-pop { animation: mm-pop .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes mm-pop { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .mm-q__bar b, .mm-q__opt, .mm-q__chk { transition: none; }
}
