/* Animated explanations: small scenes made of the product's own UI (wallet card, project card, Telegram group, X
   profile, payout), each telling one thing, driven by explain.js through timed classes (.t1 ... .t9) on the scene.
   Same glass language as the site. Under prefers-reduced-motion every scene shows its final state, still. */

/* ---------- the stepper ---------- */
.stepper { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(20px, 3vw, 40px); align-items: stretch; }
.st-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.st-steps button { position: relative; width: 100%; text-align: left; display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; padding: 18px 20px 20px; border-radius: 18px; border: 1px solid transparent; background: transparent; cursor: pointer; overflow: hidden; color: var(--ink); font: inherit; transition: background 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s; }
.st-steps button:hover { background: rgba(255, 255, 255, 0.5); }
.st-steps button.on { background: var(--card); border-color: rgba(255, 255, 255, 0.95); box-shadow: var(--shadow); }
.st-steps b { grid-row: span 2; font: 400 14px var(--mono); color: var(--muted); padding-top: 3px; }
.st-steps button.on b { color: var(--accent); }
.st-steps span { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.st-steps small { font-size: 14.5px; color: var(--muted); line-height: 1.45; max-height: 0; opacity: 0; transition: max-height 0.5s var(--ease), opacity 0.4s; }
.st-steps button.on small { max-height: 80px; opacity: 1; }
.st-steps i { position: absolute; left: 20px; right: 20px; bottom: 9px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; opacity: 0; }
.st-steps button.on i { opacity: 1; }
.st-steps i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); }
.st-steps button.on i::after { animation: stfill var(--dur, 6s) linear forwards; }
.stepper.paused .st-steps button.on i::after { animation-play-state: paused; }
@keyframes stfill { to { transform: scaleX(1); } }
.st-stage { position: relative; min-height: 440px; overflow: hidden; }
@media (max-width: 900px) { .stepper { grid-template-columns: 1fr; } .st-steps { grid-template-columns: repeat(2, 1fr); } .st-steps small { display: none; } .st-stage { min-height: 400px; } }
@media (max-width: 480px) { .st-steps button { padding: 14px; grid-template-columns: 30px 1fr; } .st-steps span { font-size: 15px; } }

/* ---------- a scene ---------- */
.scene-box { position: relative; min-height: 380px; overflow: hidden; }
.scene-box[data-scene="chat"] { min-height: 560px; }
.sc-chat .c-box { gap: 7px; }
.sc-chat .c-m { font-size: 12.5px; padding: 8px 12px; }
.sc { position: absolute; inset: 0; display: grid; place-items: center; padding: 28px; }
.sc * { transition-timing-function: var(--ease); }
.sc .mini { font: 400 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ui { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 40px -24px rgba(40, 48, 90, 0.35); }
.ui-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; font: 500 13px var(--body); white-space: nowrap; }
.ui-pill.dark { background: var(--ink); color: #fff; }
.ui-pill.soft { background: var(--accent-soft); color: var(--accent); }
.ui-pill.press { animation: press 0.45s var(--ease) both; }
@keyframes press { 40% { transform: scale(0.92); } 100% { transform: scale(1); } }
.tick { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); color: transparent; font-size: 11px; transition: background 0.3s, color 0.3s; flex: none; }
.tick.ok { background: #e8f8ee; color: #1f8a3a; }
.typed { white-space: nowrap; overflow: hidden; display: inline-block; vertical-align: bottom; max-width: 0; transition: max-width 1.1s steps(28, end); }
.typed.go { max-width: 100%; }
.caret::after { content: ""; display: inline-block; width: 1.5px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--ink); animation: blink 0.9s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cursor { position: absolute; width: 22px; height: 22px; z-index: 5; pointer-events: none; opacity: 0; transition: transform 0.9s var(--ease), opacity 0.3s; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.18)); }

/* wallet scene */
.sc-wallet .w-card { position: relative; width: min(360px, 100%); padding: 22px; }
.sc-wallet .w-top { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 500; }
.sc-wallet .w-bal { margin-top: 10px; font-size: 36px; font-weight: 600; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.sc-wallet .w-usd { font: 13px var(--mono); color: var(--muted); }
.sc-wallet .w-addr { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); font: 13px var(--mono); }
.sc-wallet .w-bar { margin-top: 18px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; }
.sc-wallet .w-bar i { display: block; height: 100%; background: var(--ink); width: 0; transition: width 1s var(--ease); }
.sc-wallet .w-legend { margin-top: 8px; display: flex; justify-content: space-between; font: 12px var(--mono); color: var(--muted); }
.sc-wallet .w-legend b { font-weight: 500; color: var(--ink); }
.sc-wallet .w-coin { position: absolute; width: 120px; left: 50%; top: -150px; margin-left: -60px; opacity: 0; transition: transform 1s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.4s; z-index: 3; }
.sc-wallet.t1 .w-coin { opacity: 1; transform: translateY(170px) scale(0.9); }
.sc-wallet.t2 .w-coin { opacity: 0; transform: translateY(230px) scale(0.4); transition: transform 0.45s ease-in, opacity 0.35s 0.1s; }
.sc-wallet .w-toast { position: absolute; left: 50%; bottom: 26px; transform: translate(-50%, 16px); opacity: 0; transition: 0.5s; }
.sc-wallet.t2 .w-toast { transform: translate(-50%, 0); opacity: 1; }
.sc-wallet.t4 .w-toast { opacity: 0; }
.sc-wallet .w-order { position: absolute; right: 22px; top: 22px; opacity: 0; transform: translateY(-8px); transition: 0.5s; }
.sc-wallet.t3 .w-order { opacity: 1; transform: none; }

/* order scene: the picture and the banner are added first (an upload each), then the words, then the order */
.sc-order { grid-template-columns: 1fr; }
.sc-order .o-card { width: min(380px, 100%); overflow: hidden; position: relative; z-index: 2; opacity: 0; transform: translateY(10px); transition: transform 0.7s, opacity 0.5s; }
.sc-order.t1 .o-card { opacity: 1; transform: none; }
.sc-order.t5 .o-card { transform: translateX(-24%) scale(0.9); }
.sc-order .o-banner { position: relative; height: 92px; margin: 10px 10px 0; border-radius: 12px; border: 1.5px dashed var(--line-2); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; transition: border-color 0.3s; }
.sc-order .o-banner::before { content: ""; position: absolute; inset: 0; background: url(/img/demo-banner.webp) center / cover no-repeat; opacity: 0; transform: scale(1.08); transition: opacity 0.7s, transform 1.2s var(--ease); }
.sc-order .o-banner.filled { border-color: transparent; }
.sc-order .o-banner.filled::before { opacity: 1; transform: none; }
.sc-order .o-body { padding: 0 20px 20px; }
.sc-order .o-top { display: flex; gap: 14px; align-items: flex-end; margin-top: -30px; position: relative; }
.sc-order .o-av { position: relative; flex: none; width: 66px; height: 66px; border-radius: 18px; border: 1.5px dashed var(--line-2); background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 4px #fff; }
.sc-order .o-av::before { content: ""; position: absolute; inset: 0; background: url(/img/demo-logo.webp) center / cover no-repeat; opacity: 0; transform: scale(0.6); transition: opacity 0.5s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.sc-order .o-av.filled { border-style: solid; border-color: var(--line); }
.sc-order .o-av.filled::before { opacity: 1; transform: none; }
.sc-order .o-add { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px var(--body); color: var(--muted); transition: opacity 0.3s; }
.sc-order .o-add em { font: 11px var(--mono); font-style: normal; color: var(--faint); }
.sc-order .loading .o-add, .sc-order .filled .o-add { opacity: 0; }
.sc-order .o-prog { position: absolute; left: 14%; right: 14%; bottom: 12px; height: 4px; border-radius: 4px; background: rgba(17, 19, 28, 0.08); overflow: hidden; opacity: 0; transition: opacity 0.3s; z-index: 2; }
.sc-order .o-av .o-prog { left: 10px; right: 10px; bottom: 10px; }
.sc-order .o-prog i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 4px; }
.sc-order .loading .o-prog { opacity: 1; }
.sc-order .loading .o-prog i { animation: upl 0.7s var(--ease) forwards; }
.sc-order .filled .o-prog { opacity: 0; }
@keyframes upl { to { width: 100%; } }
.sc-order .o-id { padding-bottom: 4px; }
.sc-order .o-name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; min-height: 24px; }
.sc-order .o-tick { font: 12px var(--mono); color: var(--muted); min-height: 16px; }
.sc-order .o-bio { margin-top: 14px; font-size: 14.5px; color: var(--ink-2); line-height: 1.45; min-height: 42px; }
.sc-order .o-handles { margin-top: 8px; font: 12.5px var(--mono); color: var(--muted); opacity: 0; transition: opacity 0.4s; }
.sc-order.t3 .o-handles { opacity: 1; }
.sc-order .o-btns { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.sc-order .o-ticket { position: absolute; z-index: 1; right: 4%; top: 50%; width: min(240px, 44%); padding: 16px; transform: translate(-70%, -50%) scale(0.8); opacity: 0; transition: transform 0.8s, opacity 0.4s; }
.sc-order.t5 .o-ticket { transform: translate(0, -50%) rotate(2deg); opacity: 1; z-index: 3; }
.sc-order .o-ticket b { display: block; margin-top: 8px; font-size: 16px; letter-spacing: -0.01em; }
.sc-order .o-ticket .row2 { margin-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--muted); }
.sc-order .o-live { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.sc-order .o-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
@media (max-width: 560px) { .sc-order.t5 .o-card { transform: translateY(-18%) scale(0.9); } .sc-order .o-ticket { right: 50%; top: auto; bottom: 18px; width: 70%; transform: translate(50%, 30%) scale(0.8); } .sc-order.t5 .o-ticket { transform: translate(50%, 0) rotate(1deg); } }
@media (prefers-reduced-motion: reduce) { .sc-order .o-card { opacity: 1; transform: none; } .sc-order .o-banner::before, .sc-order .o-av::before { opacity: 1; transform: none; } .sc-order .o-add { opacity: 0; } }

/* build scene: the Telegram group, then the X profile assembling under the bot's checks */
.sc-build { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; align-items: center; }
.sc-build .b-tg { padding: 14px; align-self: center; }
.sc-build .b-tg-h { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.sc-build .b-tg-h i { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #5fb3ff, #2f7cf6); display: grid; place-items: center; color: #fff; font-style: normal; }
.sc-build .b-tg-h i svg { width: 15px; height: 15px; }
.sc-build .b-msg { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); font-size: 13px; line-height: 1.45; opacity: 0; transform: translateY(10px); transition: 0.5s; }
.sc-build.t1 .b-msg { opacity: 1; transform: none; }
.sc-build .b-msg b { display: block; font-size: 14px; }
.sc-build .b-claim { margin-top: 10px; width: 100%; justify-content: center; position: relative; }
.sc-build .b-claimed { margin-top: 10px; font: 12px var(--mono); color: #1f8a3a; opacity: 0; transition: 0.4s; }
.sc-build.t3 .b-claimed { opacity: 1; }
.sc-build.t3 .b-claim { background: var(--surface-2); color: var(--muted); }
.sc-build .b-x { overflow: hidden; padding: 0 0 14px; }
.sc-build .b-banner { height: 70px; background: url(/img/demo-banner.webp) center / cover no-repeat; opacity: 0; transition: opacity 0.6s; }
.sc-build.t4 .b-banner { opacity: 1; }
.sc-build .b-row { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 14px; margin-top: -26px; }
.sc-build .b-av { width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; background: url(/img/demo-logo.webp) center / cover no-repeat; transform: scale(0); transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.sc-build.t5 .b-av { transform: scale(1); }
.sc-build .b-name { padding: 8px 14px 0; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; min-height: 28px; }
.sc-build .b-handle { padding: 0 14px; font-size: 13px; color: var(--muted); }
.sc-build .b-bio { padding: 8px 14px 0; font-size: 13px; color: var(--ink-2); min-height: 38px; }
.sc-build .b-post { margin: 10px 14px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 12.5px; color: var(--ink-2); opacity: 0; transform: translateY(8px); transition: 0.5s; }
.sc-build.t8 .b-post { opacity: 1; transform: none; }
.sc-build .b-post .pin { font: 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.sc-build .b-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; font: 12px var(--mono); color: var(--ink-2); }
.sc-build .b-checks span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 560px) { .sc-build { grid-template-columns: 1fr; } .sc-build .b-tg { display: none; } }

/* pay scene: approve, the SOL leaves the wallet, the worker gets paid, the fee is taken */
.sc-pay { grid-template-columns: 1fr; }
.sc-pay .p-lane { position: relative; width: min(560px, 100%); height: 300px; }
.sc-pay .p-del { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: min(300px, 80%); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; transition: transform 0.6s, opacity 0.5s; }
.sc-pay .p-del .l b { display: block; font-size: 14px; }
.sc-pay .p-del .l span { font: 12px var(--mono); color: var(--muted); }
.sc-pay .p-node { position: absolute; bottom: 30px; width: 170px; padding: 14px; text-align: left; }
.sc-pay .p-node.from { left: 0; }
.sc-pay .p-node.to { right: 0; }
.sc-pay .p-node b { display: block; margin-top: 6px; font-size: 22px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.sc-pay .p-node .sub { font: 12px var(--mono); color: var(--muted); }
.sc-pay .p-node.to b { color: var(--ink); }
.sc-pay svg.p-path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sc-pay .p-path path { fill: none; stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 4 6; }
.sc-pay .p-path path.flow { stroke: var(--accent); stroke-dasharray: 520; stroke-dashoffset: 520; stroke-width: 2; transition: stroke-dashoffset 1.2s var(--ease); }
.sc-pay.t3 .p-path path.flow { stroke-dashoffset: 0; }
.sc-pay .p-coin { position: absolute; width: 34px; height: 34px; border-radius: 50%; left: 0; top: 0; background: radial-gradient(circle at 35% 30%, #fff, #c9c2ff 55%, #8e9bff); box-shadow: 0 6px 16px -6px rgba(79, 93, 255, 0.6); offset-path: path("M 100 210 C 220 120, 340 120, 460 210"); offset-distance: 0%; opacity: 0; offset-rotate: 0deg; }
.sc-pay.t3 .p-coin { opacity: 1; animation: travel 1.2s var(--ease) forwards; }
@keyframes travel { from { offset-distance: 0%; } to { offset-distance: 100%; opacity: 0.2; } }
.sc-pay .p-fee { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 8px); opacity: 0; transition: 0.5s; }
.sc-pay.t5 .p-fee { opacity: 1; transform: translate(-50%, 0); }
.sc-pay .p-tx { position: absolute; left: 50%; top: 82px; transform: translateX(-50%); font: 12.5px var(--mono); color: #1f8a3a; display: inline-flex; align-items: center; gap: 8px; opacity: 0; transition: 0.5s; white-space: nowrap; }
.sc-pay.t6 .p-tx { opacity: 1; }
.sc-pay .p-bonus { display: inline-block; margin-top: 8px; opacity: 0; transform: translateY(6px); transition: 0.4s; }
.sc-pay.t5 .p-bonus { opacity: 1; transform: none; }
@media (max-width: 560px) { .sc-pay .p-node { width: 130px; padding: 10px; } .sc-pay .p-node b { font-size: 18px; } }

/* chat scene: the conversation with the bot, then approve */
.sc-chat { grid-template-columns: 1fr; }
.sc-chat .c-box { width: min(420px, 100%); padding: 16px; display: grid; gap: 8px; }
.sc-chat .c-h { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.sc-chat .c-m { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.4; opacity: 0; transform: translateY(8px); transition: 0.45s; }
.sc-chat .c-m.bot { background: var(--surface-2); justify-self: start; }
.sc-chat .c-m.me { background: var(--ink); color: #fff; justify-self: end; }
.sc-chat .c-m small { display: block; margin-top: 3px; font: 10.5px var(--mono); opacity: 0.6; }
.sc-chat .c-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); opacity: 0; transition: 0.45s; }
.sc-chat .c-foot .mini b { color: var(--ink); font-weight: 500; }
.sc-chat .c-paid { font: 12.5px var(--mono); color: #1f8a3a; opacity: 0; transition: 0.4s; }
.sc-chat .c-m.on { opacity: 1; transform: none; }
.sc-chat.t6 .c-foot { opacity: 1; }
.sc-chat.t8 .c-paid { opacity: 1; }

/* join scene (workers): mission cards drop into the group, first come first served */
.sc-join { grid-template-columns: 1fr; }
.sc-join .j-box { width: min(400px, 100%); padding: 16px; display: grid; gap: 10px; }
.sc-join .j-card { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); opacity: 0; transform: translateY(-14px) scale(0.98); transition: 0.55s; }
.sc-join .j-card .ic { width: 34px; height: 34px; border-radius: 10px; background: #fff; display: grid; place-items: center; }
.sc-join .j-card .ic svg { width: 16px; height: 16px; }
.sc-join .j-card b { display: block; font-size: 14px; }
.sc-join .j-card span { font: 11.5px var(--mono); color: var(--muted); }
.sc-join .j-card.on { opacity: 1; transform: none; }
.sc-join .j-card .ui-pill { height: 28px; font-size: 12px; }
.sc-join .j-card .ui-pill.won { background: #ebfbef; color: #1f8a3a; }

/* reduced motion: every scene shows its final state */
@media (prefers-reduced-motion: reduce) {
  .sc *, .st-steps * { transition: none !important; animation: none !important; }
  .typed { max-width: 100%; }
  .sc .cursor, .sc-wallet .w-coin { display: none; }
}
