/* Bloxify motion layer. Everything here is gated behind .MotionReady (set by app.js)
   and switched off for prefers-reduced-motion. */

/* ── hero entrance ── */
@keyframes Rise {
    from { opacity: 0; translate: 0 1.25rem; filter: blur(6px); }
}

@keyframes DropIn {
    from { opacity: 0; translate: 0 -3rem; rotate: var(--From, 0deg); }
}

@keyframes Fade {
    from { opacity: 0; }
}

.MotionReady .NavBar { animation: Fade 0.8s var(--EaseOut) 0.1s backwards; }
.MotionReady .HeroCopy > * { animation: Rise 0.9s var(--EaseOut) backwards; }
.MotionReady .HeroCopy > :nth-child(1) { animation-delay: 0.15s; }
.MotionReady .HeroCopy > :nth-child(2) { animation-delay: 0.22s; }
.MotionReady .HeroCopy > :nth-child(3) { animation-delay: 0.32s; }
.MotionReady .HeroCopy > :nth-child(4) { animation-delay: 0.4s; }
.MotionReady .HeroCopy > :nth-child(5) { animation-delay: 0.5s; }

@keyframes SkySettle { from { opacity: 0; scale: 1.1; } }

/* the mascot hops onto the corner in whole-pixel steps, like a game sprite */
@keyframes Hop {
    0% { opacity: 0; transform: translateY(-120px); }
    1% { opacity: 1; }
    50% { transform: translateY(12px); }
    70% { transform: translateY(-24px); }
    85% { transform: translateY(0); }
}

@keyframes Peek { from { opacity: 0; transform: translateX(52px); } }

.MotionReady .PixelSky { animation: SkySettle 1.6s var(--EaseOut) backwards; }
.MotionReady .MascotBite { animation: Hop 0.7s steps(8, end) 1s backwards; }
.MotionReady .MascotPeek { animation: Peek 0.8s var(--EaseSpring) 1.3s backwards; }


/* hero buttons: each has its own hover */
/* Browse Products: the label steps aside and a magnifying glass slides in after it */
.BrowseButton { overflow: hidden; }
.BrowseLabel { transition: translate 0.35s var(--EaseOut); }
.Button.BrowseButton > .BrowseArrow { position: absolute; right: 1.1rem; display: grid; opacity: 0; translate: -0.75rem 0; transition: opacity 0.25s var(--EaseOut), translate 0.35s var(--EaseOut); }
.BrowseArrow .Lens { width: 1rem; height: 1rem; }
.BrowseButton:hover .BrowseLabel { translate: -0.6rem 0; }
.Button.BrowseButton:hover > .BrowseArrow { opacity: 1; translate: 0 0; }

/* View Giveaways: the gift gives a little shake, like it's about to open */
.GiftButton svg { transition: scale 0.3s var(--EaseOut); }
.GiftButton:hover svg { scale: 1.12; animation: GiftShake 0.6s ease-in-out; }
@keyframes GiftShake { 20% { rotate: -14deg; } 40% { rotate: 11deg; } 60% { rotate: -7deg; } 80% { rotate: 3deg; } }
.GiftButton:hover .GiftTimer { background: rgb(255 201 74 / 0.28); }
.GiftTimer { transition: background-color 0.3s var(--EaseOut); }

/* Check Status: a beam of light passes across the glass, and the status light pings */
.StatusButton { overflow: hidden; }
.StatusButton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.35) 50%, transparent 70%); translate: -120% 0; pointer-events: none; }
.StatusButton:hover::after { translate: 120% 0; transition: translate 0.8s var(--EaseOut); }
.Button.StatusButton:hover > .StatusDot { translate: none; animation-duration: 0.9s; }

/* coming soon: the blur fades in and the card rises */
.Soon[open] { animation: SoonIn 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.Soon[open]::backdrop { animation: BlurIn 0.4s ease-out; }
@keyframes SoonIn { from { opacity: 0; translate: 0 1.5rem; scale: 0.96; } }
@keyframes BlurIn { from { opacity: 0; } }

/* the status light breathes */
.MotionReady .StatusDot { animation: StatusPulse 2s ease-out infinite; }
@keyframes StatusPulse { 0% { box-shadow: 0 0 0 0 rgb(70 224 138 / 0.6); } 70%, 100% { box-shadow: 0 0 0 0.45rem rgb(70 224 138 / 0); } }

/* ── staircase edge slides ── */
.MotionReady .Dark::before { animation: Steps 36s linear infinite; }
.MotionReady .DarkEnd::after { animation: Steps 36s linear infinite reverse; }
@keyframes Steps { to { transform: translateX(288px); } }

/* ── scroll reveals ── */
.MotionReady [data-reveal]:not(.In) { opacity: 0; translate: 0 1.5rem; filter: blur(6px); }
.MotionReady [data-reveal] {
    transition:
        opacity 0.9s var(--EaseOut) var(--Delay, 0ms),
        translate 0.9s var(--EaseOut) var(--Delay, 0ms),
        filter 0.9s var(--EaseOut) var(--Delay, 0ms),
        border-color var(--DurationBase) var(--EaseOut),
        background-color var(--DurationBase) var(--EaseOut);
}

/* intro accent underline draws in */
.IntroTitle span { background: linear-gradient(currentColor, currentColor) left 92% / 0% 0.08em no-repeat; transition: background-size 1.2s var(--EaseOut) 0.4s; }
.IntroTitle.In span, html:not(.MotionReady) .IntroTitle span { background-size: 100% 0.08em; }

/* the key-cuddler breathes slowly */
.MotionReady .Cuddler.In { animation: Breathe 4.5s ease-in-out infinite; transform-origin: 50% 100%; }

/* how-it-works: the three stages play one after another, as one story (pick → pay → play), on a shared 9s loop */
.Steps:not(.Live) *, .Steps:not(.Live) *::after { animation-play-state: paused !important; }
.MotionReady .Steps:not(.In) .StepMascot { opacity: 0; translate: 0 2rem; }
.MotionReady .StepMascot { transition: opacity 0.5s var(--EaseOut), translate 0.8s var(--EaseSpring); }
.Step:nth-child(2) .StepMascot { transition-delay: 0.15s; }
.Step:nth-child(3) .StepMascot { transition-delay: 0.3s; }

/* each mascot hops when its step is the one playing */
.MotionReady .Steps.In .StepMascot { animation: MascotHop 9s var(--EaseOut) infinite; }
.Step:nth-child(2) .StepMascot { animation-delay: 3s !important; }
.Step:nth-child(3) .StepMascot { animation-delay: 6s !important; }
@keyframes MascotHop { 0%, 30%, 100% { transform: none; } 4% { transform: translateY(-0.75rem) rotate(-4deg); } 8% { transform: none; } 11% { transform: translateY(-0.3rem); } 14% { transform: none; } }

/* the track: after the click the order leaves Pick, lands in Pay as it starts, then rides on to Play */
.MotionReady .Steps.In ~ .StepPacket, .MotionReady .StepsWrap:has(.Steps.In) .StepPacket { animation: Packet 9s cubic-bezier(0.6, 0, 0.3, 1) infinite; }
.MotionReady .StepsWrap:has(.Steps.In) .StepWire .Fill { animation: WireFill 9s cubic-bezier(0.6, 0, 0.3, 1) infinite; }
.StepsWrap:has(.Steps:not(.Live)) .StepPacket, .StepsWrap:has(.Steps:not(.Live)) .StepWire .Fill { animation-play-state: paused; }
@keyframes Packet {
    0% { translate: var(--X1) var(--Y1); opacity: 0; scale: 0.4; }
    18%, 22% { translate: var(--X1) var(--Y1); opacity: 1; scale: 1; }
    33% { translate: var(--X2) var(--Y2); }
    35% { scale: 1.25; } 38% { scale: 1; }
    55% { translate: var(--X2) var(--Y2); }
    66% { translate: var(--X3) var(--Y3); }
    68% { scale: 1.25; } 71% { scale: 1; }
    90% { translate: var(--X3) var(--Y3); opacity: 1; scale: 1; }
    96%, 100% { translate: var(--X3) var(--Y3); opacity: 0; scale: 0.4; }
}
@keyframes WireFill { 0%, 22% { stroke-dashoffset: 1; opacity: 1; } 33%, 55% { stroke-dashoffset: 0.5; } 66%, 90% { stroke-dashoffset: 0; opacity: 1; } 98% { opacity: 0; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 1; } }

/* each stop lights up while its step is the one playing */
.MotionReady .Steps.In .StepNum { animation: NodeOn 9s infinite; }
.Step:nth-child(2) .StepNum { animation-delay: 3s !important; }
.Step:nth-child(3) .StepNum { animation-delay: 6s !important; }
@keyframes NodeOn { 0%, 33% { background: var(--AccentBlue); color: #fff; box-shadow: inset 0 0 0 2px var(--AccentBlue), 0 2px 0 #06368a; } 36%, 100% { background: var(--InkWhite); color: var(--AccentDeep); box-shadow: inset 0 0 0 2px #cfe0f5, 0 2px 0 #cfe0f5; } }

/* 1 · cursor glides to Matcha, clicks, the row lights up */
.MotionReady .Steps.In .Cursor { animation: CursorPick 9s cubic-bezier(0.6, 0, 0.3, 1) infinite; }
@keyframes CursorPick {
    0% { left: 30%; top: 9rem; opacity: 0; }
    5% { opacity: 1; }
    16% { left: 72%; top: 5.9rem; transform: none; }
    19% { transform: scale(0.8); }
    22%, 30% { left: 72%; top: 5.9rem; transform: none; opacity: 1; }
    36%, 100% { left: 72%; top: 5.9rem; opacity: 0; }
}
.MotionReady .Steps.In .PickList .Chosen { animation: Chosen 9s infinite; }
@keyframes Chosen { 0%, 18% { background: transparent; box-shadow: inset 0 0 0 1.5px transparent; } 20%, 92% { background: #eaf4ff; box-shadow: inset 0 0 0 1.5px var(--AccentBlue); } 100% { background: transparent; } }

/* 2 · the chip lights, the button presses and turns green */
.MotionReady .Steps.In .PayChips span:nth-child(3) { animation: ChipOn 9s infinite 3s; }
@keyframes ChipOn { 0%, 6% { background: #f3f6fa; color: #52627a; } 8%, 90% { background: var(--AccentBlue); color: #fff; } 100% { background: #f3f6fa; color: #52627a; } }
.MotionReady .Steps.In .PayButton { animation: PayPress 9s infinite 3s; }
@keyframes PayPress { 0%, 14% { transform: none; background: var(--AccentBlue); } 17% { transform: scale(0.94); } 20%, 90% { transform: none; background: #1f9c57; } 100% { background: var(--AccentBlue); } }
.MotionReady .Steps.In .PayIdle { animation: Out 9s infinite 3s; }
.MotionReady .Steps.In .PayDone { animation: In 9s infinite 3s; }
@keyframes Out { 0%, 18% { opacity: 1; } 20%, 90% { opacity: 0; } 100% { opacity: 1; } }
@keyframes In { 0%, 18% { opacity: 0; } 20%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* 3 · the key email drops in, then the launch bar fills */
.MotionReady .Steps.In .InboxMail { animation: MailDrop 9s var(--EaseOut) infinite 6s backwards; }
@keyframes MailDrop { 0% { opacity: 0; transform: translateY(-1rem); } 6%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.MotionReady .Steps.In .LaunchBar i { animation: LaunchFill 9s infinite 6s backwards; }
@keyframes LaunchFill { 0%, 8% { transform: scaleX(0); } 22%, 92% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
.MotionReady .Steps.In .Loading { animation: Out2 9s infinite 6s; }
.MotionReady .Steps.In .Ready { animation: In2 9s infinite 6s; }
@keyframes Out2 { 0%, 21% { opacity: 1; } 23%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes In2 { 0%, 21% { opacity: 0; } 23%, 92% { opacity: 1; } 100% { opacity: 0; } }



/* ── FAQ smooth open ── */
.FaqList details::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size var(--DurationSlow) var(--EaseOut), content-visibility var(--DurationSlow) allow-discrete;
}

.FaqList details[open]::details-content { block-size: auto; }
:root { interpolate-size: allow-keywords; }


.Button:active { scale: 0.96; }

@media (prefers-reduced-motion: reduce) {
    .MotionReady *, .MotionReady *::before, .MotionReady *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
    }
    .MotionReady [data-reveal]:not(.In) { opacity: 1; translate: none; filter: none; }
    .MotionReady .Steps:not(.In) .StepMascot { opacity: 1; translate: none; }
}


/* proof bento loops: transform + opacity only, and paused unless the bento is on screen */
.Bento:not(.Live) *, .Bento:not(.Live) *::after { animation-play-state: paused !important; }

.MotionReady .Feed ul { animation: FeedScroll 7.5s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
@keyframes FeedScroll {
    0%, 22% { transform: translateY(0); }
    30%, 55% { transform: translateY(-2.75rem); }
    63%, 88% { transform: translateY(-5.5rem); }
    96%, 100% { transform: translateY(-8.25rem); } /* rows repeat, so this lands on the start */
}

.MotionReady .SendBar i { animation: SendFill 6s var(--EaseOut) infinite; }
@keyframes SendFill { 0% { transform: scaleX(0); } 38%, 100% { transform: scaleX(1); } }
.MotionReady .Mail { animation: MailIn 6s var(--EaseOut) infinite; }
@keyframes MailIn {
    0%, 40% { opacity: 0; transform: translateY(0.75rem) scale(0.96); }
    48%, 90% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: none; }
}
.MotionReady .SendLabel { animation: LabelSwap 6s infinite; }
@keyframes LabelSwap { 0%, 38% { opacity: 1; } 44%, 92% { opacity: 0.35; } 100% { opacity: 1; } }

.MotionReady .Them { animation: ChatThem 7s var(--EaseOut) infinite; }
.MotionReady .Typing { animation: ChatTyping 7s infinite; }
.MotionReady .Us { animation: ChatUs 7s var(--EaseOut) infinite; }
.MotionReady .Typing i { animation: Dot 0.9s ease-in-out infinite; }
.Typing i:nth-child(2) { animation-delay: 0.15s; }
.Typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ChatThem { 0%, 4% { opacity: 0; transform: translateY(0.5rem); } 10%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes ChatTyping { 0%, 18% { opacity: 0; } 22%, 46% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes ChatUs { 0%, 48% { opacity: 0; transform: translateY(0.5rem); } 54%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes Dot { 50% { transform: translateY(-3px); opacity: 0.5; } }

.MotionReady .EmbedButton { animation: Press 6s var(--EaseOut) infinite; }
.MotionReady .Join { animation: JoinOut 6s infinite; }
.MotionReady .Joined { animation: JoinedIn 6s infinite; }
@keyframes Press { 0%, 40% { transform: none; background: #5865f2; } 44% { transform: scale(0.94); } 50%, 90% { transform: none; background: #248046; } 100% { background: #5865f2; } }
@keyframes JoinOut { 0%, 44% { opacity: 1; } 48%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes JoinedIn { 0%, 44% { opacity: 0; } 48%, 92% { opacity: 1; } 100% { opacity: 0; } }

/* trust cards: one-off draws on reveal, then loops that run only while on screen */
.TrustCards:not(.Live) *, .TrustCards:not(.Live) *::after { animation-play-state: paused !important; }

.MotionReady .TrustCard:not(.In) .Stars i { scale: 0; }
.MotionReady .TrustCard.In .Stars i { animation: StarPop 0.5s var(--EaseOut) calc(350ms + var(--S, 0) * 90ms) both; }
.Stars i:nth-child(2) { --S: 1; } .Stars i:nth-child(3) { --S: 2; } .Stars i:nth-child(4) { --S: 3; } .Stars i:nth-child(5) { --S: 4; }
@keyframes StarPop { from { scale: 0; rotate: -40deg; } 60% { scale: 1.25; } }

/* licenses: the columns stack up block by block, then new sales keep dropping onto the latest one */
.MotionReady .TrustCard:not(.In) .Stack i { opacity: 0; }
.MotionReady .TrustCard.In .Stack i:not(.New) { animation: BlockDrop 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) calc(300ms + var(--C) * 55ms + var(--R) * 70ms) both; }
.MotionReady .TrustCard.In .Stack i.New { animation: Sale 2.8s cubic-bezier(0.3, 1.3, 0.5, 1) 1.6s infinite both; }
.MotionReady .TrustCard.In .StackTick { animation: Tick 2.8s var(--EaseOut) 1.6s infinite both; }
@keyframes BlockDrop { from { opacity: 0; translate: 0 -1.5rem; } }
@keyframes Sale {
    0% { opacity: 0; translate: 0 -3rem; }
    18% { opacity: 1; translate: 0 0; scale: 1.15 0.85; }
    26% { scale: 1; }
    70% { opacity: 1; translate: 0 0; background: #46e08a; }
    90%, 100% { opacity: 0; translate: 0 0; background: var(--AccentBright); }
}
@keyframes Tick { 0%, 14% { opacity: 0; translate: 0 0.5rem; } 24%, 70% { opacity: 1; translate: 0 0; } 88%, 100% { opacity: 0; translate: 0 -0.5rem; } }

/* stores: a pulse leaves the active store and lands in the Bloxify block */
.Wires .Flow.Run { animation: Flow 1s cubic-bezier(0.5, 0, 0.3, 1) both; }
@keyframes Flow { 0% { opacity: 1; stroke-dasharray: 0 1; stroke-dashoffset: 0; } 40% { stroke-dasharray: 0.35 1; } 90% { opacity: 1; } 100% { opacity: 0; stroke-dasharray: 0.2 1; stroke-dashoffset: -1; } }
.HubBlock.Ping { animation: HubPing 0.7s var(--EaseOut); }
@keyframes HubPing { 0% { scale: 1; } 30% { scale: 1.12; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 0.3rem 0 #06368a, 0 0 0 0.25rem rgb(77 184 255 / 0.45); } 100% { scale: 1; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 0.3rem 0 #06368a, 0 0 0 1rem rgb(77 184 255 / 0); } }

@keyframes LabelIn { from { opacity: 0; translate: 0 0.4rem; } }

.MotionReady .PayBelt .Payments { animation: Belt 26s linear infinite; }
.MotionReady .PayBelt .Payments + .Payments { animation-direction: reverse; animation-duration: 32s; }
@keyframes Belt { to { transform: translateX(-50%); } }

/* the lounger breathes slowly while it reads */
.MotionReady .Lounger { animation: Breathe 4.5s ease-in-out infinite; transform-origin: 40% 100%; }
@keyframes Breathe { 50% { transform: translateY(-0.25rem) rotate(-0.6deg); } }

/* review belts slide opposite ways; hovering one holds it still so it can be read */
.MotionReady .ReviewRow { animation: Belt 60s linear infinite; }
.MotionReady .ReviewRow + .ReviewRow { animation-direction: reverse; animation-duration: 70s; }
.ReviewRow:hover, .ReviewBelts:not(.Live) .ReviewRow { animation-play-state: paused; }

/* favourites: the podium rises, the winner last */
.MotionReady .Podium:not(.In) .Fave { opacity: 0; translate: 0 3rem; }
.MotionReady .Podium .Fave { transition: opacity 0.6s var(--EaseOut), translate 0.9s var(--EaseSpring); }
.Podium .Fave:nth-child(2) { transition-delay: 0.1s; }
.Podium .Fave:nth-child(3) { transition-delay: 0.2s; }
.Podium .Fave:nth-child(1) { transition-delay: 0.4s; }
.MotionReady .Podium.In .Top .FaveRank svg { animation: Crown 2.8s ease-in-out 1.2s infinite; }
@keyframes Crown { 0%, 70%, 100% { rotate: 0deg; } 78% { rotate: -14deg; } 86% { rotate: 10deg; } 92% { rotate: -4deg; } }

/* the puzzled mascot tilts its head back and forth, thinking */
.MotionReady .Puzzled.In { animation: Ponder 4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes Ponder { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }

/* the smitten mascot sways a little on its ledge */
.MotionReady .Hanger { animation: Sway 3.6s ease-in-out infinite; transform-origin: 50% 58%; }
@keyframes Sway { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; } }

/* review stats: stars light up, the crowd pops in and keeps cheering, the blocks fill */
.MotionReady .ReviewStats:not(.In) .StatArt > * { opacity: 0; }
.MotionReady .ReviewStats.In .BigStars i { animation: StarPop 0.5s var(--EaseOut) calc(400ms + var(--S, 0) * 100ms) both; }
.BigStars i:nth-child(2) { --S: 1; } .BigStars i:nth-child(3) { --S: 2; } .BigStars i:nth-child(4) { --S: 3; } .BigStars i:nth-child(5) { --S: 4; }
.Crowd > :nth-child(2) { --S: 1; } .Crowd > :nth-child(3) { --S: 2; } .Crowd > :nth-child(4) { --S: 3; } .Crowd > :nth-child(5) { --S: 4; } .Crowd > :nth-child(6) { --S: 5; }
.MotionReady .ReviewStats.In .Crowd > * { animation: CrowdIn 0.5s var(--EaseSpring) calc(500ms + var(--S, 0) * 90ms) both, Cheer 3.2s ease-in-out calc(1.6s + var(--S, 0) * 120ms) infinite; }
@keyframes CrowdIn { from { opacity: 0; translate: 0 0.75rem; scale: 0.6; } }
@keyframes Cheer { 0%, 20%, 100% { transform: none; } 8% { transform: translateY(-0.3rem); } }
.MotionReady .ReviewStats.In .Waffle i { animation: Cell 0.35s var(--EaseOut) calc(600ms + var(--N) * 14ms) both; }
@keyframes Cell { from { opacity: 0; scale: 0.3; } }
.MotionReady .ReviewStats.In .Waffle i.Off { animation: Cell 0.35s var(--EaseOut) 1.4s both, Blink 2.4s steps(1) 2s infinite; }
@keyframes Blink { 50% { background: #3a5274; } }
.ReviewStats:not(.Live) * { animation-play-state: paused !important; }

/* stills for reduced motion: every UI in its finished state */
@media (prefers-reduced-motion: reduce) {
    .Bento * , .Bento *::after { animation: none !important; }
    .Typing { display: none; }
    .TrustCards * { animation: none !important; }
    .Steps *, .StepPacket, .StepWire .Fill { animation: none !important; }
    .ReviewRow { animation: none !important; }
    .ReviewBelts { overflow-x: auto; }
    .Cursor { display: none; }
    .PickList .Chosen { background: #eaf4ff; box-shadow: inset 0 0 0 1.5px var(--AccentBlue); }
}
