/* 3D and motion for every site. Loaded last. Nothing here hides content when motion is off or unsupported. */
.stage3d { position: relative; } .stage3d > canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s; pointer-events: none; } .stage3d > canvas.is-on { opacity: 1; }
.stage3d > .flat { transition: opacity .4s; } .stage3d.has-3d > .flat { opacity: 0; }
.mt-hero-art.stage3d > canvas { inset: -4% 0 auto -10%; width: 110%; height: 108%; }
@media (max-width: 860px) { .mt-hero-art.stage3d > canvas { left: 0; width: 100%; } }
.mt-hero-art.stage3d .hero-face { z-index: 1; }
.page-intro.has-scene { position: relative; max-width: none; min-height: 190px; padding-right: 290px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; } .page-intro.has-scene > .stage3d { position: absolute; right: 0; top: 0; width: 270px; height: 190px; } .page-intro.has-scene > p:not(.kicker) { max-width: 640px; }
@media (max-width: 620px) { .page-intro.has-scene { padding-right: 0; min-height: 0; } .page-intro.has-scene > .stage3d { width: 150px; height: 108px; top: -6px; } .page-intro.has-scene > h1 { min-height: 92px; display: flex; align-items: center; margin: 0; } .page-intro.has-scene > .kicker { display: none; } }
/* Mallu Earn and its download page */
.stage3d.palm { height: 236px; margin: 0 auto 2px; max-width: 420px; display: grid; place-items: center; } .hello .stage3d.palm { margin-top: -3vh; } .get .stage3d.palm { margin-top: -6px; }
.wallet { position: relative; overflow: hidden; isolation: isolate; } .wallet > .stage3d { position: absolute; right: -4px; top: -2px; width: 152px; height: 152px; z-index: -1; }
/* Mallu Earn: 3D on every screen */
.head3d { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 74px; margin: -6px 0 6px; } .head3d h1 { margin: 0; } .head3d .stage3d { flex: none; width: 96px; height: 96px; margin: -10px 0; } .card .head3d { margin-top: -8px; }
.tiles .ic.stage3d { overflow: visible; } .tiles .ic.stage3d > canvas { inset: -13px; width: calc(100% + 26px); height: calc(100% + 26px); }
.tabs .stage3d { display: grid; place-items: center; width: 25px; height: 25px; } .tabs .stage3d > canvas { inset: -17px -10px -3px; width: 45px; height: 45px; filter: drop-shadow(0 5px 5px rgba(50, 30, 130, .28)); }
.count > .stage3d { display: block; width: 92px; height: 92px; border-radius: 50%; margin-bottom: 8px; background: radial-gradient(closest-side, #f3f2ff 82%, transparent 83% 100%), conic-gradient(var(--main) var(--p, 0%), #d9d6ff 0); } .count.is-done > .stage3d { background: radial-gradient(closest-side, #f3f2ff 82%, transparent 83% 100%), conic-gradient(#0c9f6e 100%, #0c9f6e 0); }
.stat3d { float: right; width: 64px; height: 64px; margin: -6px -4px -10px 6px; } .admin-body .stat .stat3d { display: block; }
/* Studio login */
body.plain-page .stack-form + .fine-print { margin-top: 1rem; } .login3d { position: fixed; inset: 0; z-index: 0; } body.plain-page:has(.login3d) main { position: relative; z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
    body:not(.site):not(.admin-body):not(.plain-page)::before, body:not(.site):not(.admin-body):not(.plain-page)::after { content: ""; position: fixed; z-index: -1; width: 70vmax; height: 70vmax; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(129, 108, 255, .2), transparent); left: -30vmax; top: -20vmax; animation: drift 16s ease-in-out infinite alternate; }
    body:not(.site):not(.admin-body):not(.plain-page)::after { background: radial-gradient(closest-side, rgba(255, 197, 61, .17), transparent); left: auto; right: -36vmax; top: 34vh; animation-duration: 21s; animation-delay: -6s; }
    @keyframes drift { to { transform: translate3d(14vmax, 9vmax, 0) scale(1.15); } }
    .wallet::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .2) 50%, transparent 62%); transform: translateX(-100%); animation: sheen 5.5s ease-in-out 1.4s infinite; } @keyframes sheen { 0% { transform: translateX(-100%); } 34%, 100% { transform: translateX(100%); } }
    .tiles > a:active, .list .task:active { transform: perspective(700px) rotateX(7deg) scale(.97); } .tiles > a, .list .task { transition: transform .16s; }
    .tabs [aria-current] .stage3d > canvas { animation: hop .55s cubic-bezier(.2, 1.5, .4, 1) both; } @keyframes hop { from { transform: translateY(22px) scale(.3); } }
    .note.good { animation: flipnote .6s cubic-bezier(.2, 1.3, .4, 1) both; transform-origin: 50% 0; } @keyframes flipnote { from { transform: perspective(600px) rotateX(-70deg); opacity: 0; } }
    .count.is-done > .stage3d { animation: donehop .8s cubic-bezier(.2, 1.6, .4, 1) both; } @keyframes donehop { 40% { transform: translateY(-16px) scale(1.14); } }
    .pay .amount { position: relative; overflow: hidden; } .pay .amount::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .75) 50%, transparent 65%); transform: translateX(-110%); animation: sheen 4.5s ease-in-out infinite 2s; }
    /* Page to page */
    @view-transition { navigation: auto; }
    ::view-transition-group(root) { animation-duration: .34s; }
    ::view-transition-old(root) { animation: out3d .2s ease-in both; transform-origin: 50% 40%; }
    ::view-transition-new(root) { animation: in3d .34s cubic-bezier(.2, .8, .25, 1) both; transform-origin: 50% 40%; }
    @keyframes out3d { to { opacity: 0; transform: perspective(1200px) translateZ(-90px) rotateX(3deg); } }
    @keyframes in3d { from { opacity: 0; transform: perspective(1200px) translateZ(-110px) rotateX(-4deg); } }

    /* Cards turn towards the pointer */
    .tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0); transition: transform .28s ease-out, box-shadow .28s; will-change: auto; }
    .tilt.is-tilting { transition-duration: .07s, .2s; will-change: transform; box-shadow: calc(var(--ry, 0deg) / 1deg * -1px) calc(14px + var(--rx, 0deg) / 1deg * 1px) 34px rgba(60, 30, 140, .28); }
    .tilt.is-tilting > :is(svg, .dot, .ic, .icon-tile, .app-letter, .app-card-top, strong, h3, b) { transform: translateZ(26px); } .tilt { transform-style: preserve-3d; }
    .tile.tilt { transform-style: flat; }

    /* Cards rise as they come into view */
    @supports (animation-timeline: view()) {
        body.site :is(.tile, .post-card, .app-card, .video-card, .feature-card, .how-grid li, .envelope, .game), body:not(.site) main :is(.tiles > a, .list > li, .card, .stat) { animation: rise3d linear both; animation-timeline: view(); animation-range: entry 0% entry min(90%, 150px); }
        body.site .tilt, body:not(.site) main .tilt { animation-composition: add; }
        @keyframes rise3d { from { opacity: .25; translate: 0 34px; rotate: x 16deg; } }
    }

    /* Buttons have depth and go down when pressed */
    body.site .btn.btn-primary, body.site .btn.btn-gold, body.site .nav-youtube, .admin-body .btn.btn-primary, body.plain-page .btn.btn-primary, .btn.gold, main > section .btn:not(.plain):not(.btn-ghost):not(.danger):not(.btn-small) { transition: transform .12s, box-shadow .12s, filter .2s; }
    body.site .btn.btn-primary, body.site .btn.btn-gold, body.site .nav-youtube, .admin-body .btn.btn-primary, body.plain-page .btn.btn-primary { box-shadow: 0 4px 0 #45258f, 0 10px 20px rgba(80, 40, 160, .28); }
    body.site .btn.btn-primary:active, body.site .btn.btn-gold:active, body.site .nav-youtube:active, .admin-body .btn.btn-primary:active, body.plain-page .btn.btn-primary:active { transform: translateY(4px); box-shadow: 0 0 0 #45258f, 0 3px 8px rgba(80, 40, 160, .3); }

    .envelope { animation-duration: auto; } .envelope .seal { animation: seal 5s ease-in-out infinite; }
    @keyframes seal { 0%, 60%, 100% { transform: perspective(300px) rotateY(0); } 80% { transform: perspective(300px) rotateY(360deg); } }
    .site-header .brand-logo, .name img { transition: transform .5s; } .site-header .brand:hover .brand-logo, .name:hover img { transform: perspective(300px) rotateY(360deg); }
    .bell:has(i) svg { animation: ring 3.4s ease-in-out infinite; transform-origin: 50% 10%; }
    @keyframes ring { 0%, 78%, 100% { rotate: 0deg; } 82% { rotate: 16deg; } 87% { rotate: -13deg; } 92% { rotate: 8deg; } 96% { rotate: -4deg; } }
    .tabs [aria-current] svg { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; } @keyframes pop { from { transform: perspective(200px) translateZ(-60px) rotateY(-70deg); } }
    .wallet strong { animation: flipin .7s cubic-bezier(.2, 1.2, .4, 1) both .1s; transform-origin: 50% 100%; } @keyframes flipin { from { transform: perspective(500px) rotateX(70deg); } }
    .burst { position: fixed; left: 50%; top: 30%; width: 0; height: 0; z-index: 50; pointer-events: none; perspective: 700px; }
    .burst i { position: absolute; width: 30px; height: 30px; margin: -15px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #ffe59a, #ffc53d 55%, #d98e04); border: 2px solid #f2a615; color: #6b4300; font: 800 15px/1 "Plus Jakarta Sans", sans-serif; animation: fly 1.5s cubic-bezier(.15, .7, .4, 1) both; }
    @keyframes fly { to { transform: translate3d(var(--x), var(--y), var(--z)) rotateY(var(--r)) rotateX(220deg); opacity: 0; } }
}
/* Mallu Earn buttons keep their depth even when motion is off */
.hello .btn, .card .btn, .wallet .btn { box-shadow: 0 4px 0 #332a9e; } .hello .btn.gold, .card .btn.gold, .wallet .btn.gold { box-shadow: 0 4px 0 #c98a0a; } .hello .btn.plain, .card .btn.plain { box-shadow: 0 4px 0 #cfcff0; } .card .btn.danger { box-shadow: 0 4px 0 #7d1812; }
.hello .btn:active, .card .btn:active, .wallet .btn:active { transform: translateY(4px); box-shadow: none; } .hello .btn + .btn, .card .btn + .btn { margin-top: 16px; }
@media print { .stage3d > canvas { display: none; } }
