/* =====================================================================
   Explainer player (.wx-player) — shared by Our Advantage (why-us.php) and About Us (about.php).
   Each page keeps its own scene artwork animations in its page stylesheet.
   ===================================================================== */
.hm .wx-section { background: var(--soft, #f8fafc); }

.wx-player {
    position: relative;
    margin-top: clamp(28px, 4vw, 44px);
    padding: 16px 16px 14px;
    border-radius: 30px;
    color: #fff;
    background:
        radial-gradient(60% 80% at 100% 0%, rgba(94, 234, 212, .22), transparent 60%),
        radial-gradient(50% 70% at 0% 100%, rgba(251, 191, 36, .12), transparent 60%),
        linear-gradient(150deg, #0f766e 0%, #0b4f4a 55%, #083b37 100%);
    box-shadow: 0 40px 80px -36px rgba(8, 59, 55, .7);
}

/* Story-style progress */
.wx-progress { display: flex; gap: 6px; padding: 2px 6px 14px; }
.wx-progress span { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.wx-progress i { display: block; height: 100%; background: linear-gradient(90deg, #5eead4, #fbbf24); transform-origin: left center; transform: scaleX(0); }
.wx-progress .is-done i { transform: scaleX(1); }
.wx-progress .is-active i { animation: wx-fill var(--wx-ms, 6500ms) linear forwards; }
@keyframes wx-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Stage */
.wx-stage {
    position: relative;
    aspect-ratio: 16 / 8.4;
    min-height: 430px;
    border-radius: 22px;
    overflow: hidden;
    background:
        radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px,
        rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .1);
}
.wx-brand, .wx-count { position: absolute; top: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font: 700 .74rem/1 var(--font-ui, 'Inter', sans-serif); letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .65); }
.wx-brand { left: 20px; } .wx-count { right: 20px; } .wx-count b { color: #fff; }
.wx-brand svg { width: 15px; height: 15px; color: #5eead4; }

.wx-scene {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    align-items: center;
    gap: clamp(20px, 3vw, 40px);
    padding: 54px clamp(22px, 3.5vw, 44px) 30px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease, visibility 0s linear .5s;
}
.wx-scene.is-active { opacity: 1; visibility: visible; transition: opacity .5s ease; }

/* Caption */
.wx-kicker { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: #ccfbf1; font: 800 .72rem/1 var(--font-ui, 'Inter', sans-serif); letter-spacing: .06em; text-transform: uppercase; }
.wx-kicker svg { width: 14px; height: 14px; color: #5eead4; }
.hm .wx-title { margin-top: 14px; font-family: var(--font-h); font-size: clamp(1.45rem, 2.4vw, 2.05rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: #fff; }
.wx-text { margin-top: 12px; font-size: .98rem; line-height: 1.6; color: rgba(236, 253, 245, .8); }
.wx-points { list-style: none; margin-top: 16px; display: grid; gap: 9px; }
.wx-points li { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .92rem; color: #fff; }
.wx-points svg { width: 20px; height: 20px; padding: 4px; flex-shrink: 0; border-radius: 50%; background: #14b8a6; color: #fff; stroke-width: 3; }
.wx-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding: 10px 18px; border-radius: 999px; background: #fff; color: #0f766e !important; font: 700 .9rem var(--font-ui, 'Inter', sans-serif); transition: transform .2s ease, box-shadow .2s ease; }
.wx-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .5); }
.wx-cta svg { width: 16px; height: 16px; }

.is-active .wx-kicker { animation: wx-up .6s cubic-bezier(.2, .8, .2, 1) backwards .05s; }
.is-active .wx-title { animation: wx-up .7s cubic-bezier(.2, .8, .2, 1) backwards .15s; }
.is-active .wx-text { animation: wx-up .7s cubic-bezier(.2, .8, .2, 1) backwards .3s; }
.is-active .wx-points li { animation: wx-up .5s cubic-bezier(.2, .8, .2, 1) backwards; }
.is-active .wx-points li:nth-child(1) { animation-delay: .55s; }
.is-active .wx-points li:nth-child(2) { animation-delay: .7s; }
.is-active .wx-points li:nth-child(3) { animation-delay: .85s; }
.is-active .wx-cta { animation: wx-up .6s cubic-bezier(.2, .8, .2, 1) backwards 1.05s; }
@keyframes wx-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Art */
.wx-art { display: grid; place-items: center; min-width: 0; height: 100%; }
.wx-art svg { width: 100%; max-height: 100%; overflow: visible; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .25)); }
.wx-art .wx-t { font: 600 13px var(--font-ui, 'Inter', sans-serif); }
.wx-art .wx-t-b { font: 700 13px var(--font-ui, 'Inter', sans-serif); }
.wx-art .wx-t-h { font: 800 16px var(--font-h, 'Outfit', sans-serif); }
.wx-art .wx-t-s { font: 700 11px var(--font-ui, 'Inter', sans-serif); }
.wx-art [class*="wx-"] { transform-box: fill-box; transform-origin: center; }

/* shared entrances */
@keyframes wx-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes wx-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes wx-in-l { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes wx-in-r { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes wx-grow-x { from { transform: scaleX(0); } }
@keyframes wx-blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.wx-bounce { animation-timing-function: cubic-bezier(.34, 1.56, .64, 1) !important; }


/* Shared keyframes used by page scene styles */
@keyframes wx-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes wx-spin { to { transform: rotate(360deg); } }
@keyframes wx-draw { from { stroke-dashoffset: var(--wx-len, 520); } to { stroke-dashoffset: 0; } }
@keyframes wx-stamp { from { opacity: 0; transform: scale(2.2) rotate(-30deg); } to { opacity: 1; transform: none; } }
@keyframes wx-press { 0% { transform: scale(1); } 40% { transform: scale(.88); filter: brightness(1.3); } 100% { transform: scale(1); } }

/* Paused: freeze everything (also used while off-screen / tab hidden) */
.wx-player.is-paused *, .wx-player.is-paused *::before, .wx-player.is-paused *::after { animation-play-state: paused !important; }

/* Controls */
.wx-controls { display: flex; align-items: center; gap: 12px; padding: 14px 4px 2px; }
.wx-play { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; transition: background-color .2s ease; }
.wx-play:hover { background: rgba(255, 255, 255, .2); }
.wx-play svg { width: 18px; height: 18px; }
.wx-play .wx-ic-play { display: none; }
.is-user-paused .wx-play .wx-ic-play { display: block; }
.is-user-paused .wx-play .wx-ic-pause { display: none; }
.wx-chapters { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.wx-chapters::-webkit-scrollbar { display: none; }
.wx-chapter { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .78); font: 700 .82rem var(--font-ui, 'Inter', sans-serif); white-space: nowrap; cursor: pointer; transition: background-color .25s ease, color .25s ease, border-color .25s ease; }
.wx-chapter svg { width: 15px; height: 15px; }
.wx-chapter:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.wx-chapter.is-active { background: #fff; color: #0f766e; border-color: #fff; }
.wx-play:focus-visible, .wx-chapter:focus-visible, .wx-cta:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }

/* Tablet / phone: stack art above caption, height follows content */
@media (max-width: 900px) {
    .wx-player { padding: 12px 10px 10px; border-radius: 24px; }
    .wx-stage { aspect-ratio: auto; min-height: 0; }
    .wx-scene { position: relative; display: none; grid-template-columns: 1fr; gap: 14px; padding: 46px 18px 22px; }
    .wx-scene.is-active { display: grid; }
    .wx-art { order: -1; max-width: 440px; width: 100%; margin: 0 auto; }
    .wx-chapter span { display: none; }
    .wx-chapter { flex: 0 0 auto; padding: 11px; }
    .wx-chapter.is-active span { display: inline; }
    .wx-chapter.is-active { padding: 10px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .wx-player *, .wx-player *::before, .wx-player *::after { animation: none !important; }
    .wx-scene { transition: none; }
}
