/* =====================================================================
   Nexa Studio: every feature has its own motion signature.
   Only transform / opacity / clip animations (smooth on phones).
   ===================================================================== */
:root { --spring: cubic-bezier(.34, 1.56, .64, 1); --out: cubic-bezier(.16, 1, .3, 1); }

/* Sidebar: agents line up one after another, sliding in from the edge */
.agent-nav .agent-item { animation: navIn .6s var(--out) both; }
.agent-nav .agent-item:nth-child(1) { animation-delay: .02s; } .agent-nav .agent-item:nth-child(2) { animation-delay: .06s; }
.agent-nav .agent-item:nth-child(3) { animation-delay: .10s; } .agent-nav .agent-item:nth-child(4) { animation-delay: .14s; }
.agent-nav .agent-item:nth-child(5) { animation-delay: .18s; } .agent-nav .agent-item:nth-child(6) { animation-delay: .22s; }
.agent-nav .agent-item:nth-child(n+7) { animation-delay: .26s; }
@keyframes navIn { from { opacity: 0; transform: translate3d(-18px, 0, 0); } }

/* Header: the agent's mark swaps in with a little spin whenever you change agent */
.bar-title .av { animation: markSwap .55s var(--spring) both; }
.bar-title h2, .bar-title p { animation: titleIn .45s var(--out) both; }
.bar-title p { animation-delay: .06s; }
@keyframes markSwap { from { opacity: 0; transform: scale(.4) rotate(-40deg); } }
@keyframes titleIn { from { opacity: 0; transform: translate3d(0, 8px, 0); } }

/* Welcome screen: the mark lands, the greeting rises, each suggestion arrives from its own corner */
.empty .big-av { animation: markLand .9s var(--spring) both, float 6s ease-in-out 1s infinite; }
.empty h1 { animation: riseIn .7s var(--out) .12s both; }
.empty > p { animation: riseIn .7s var(--out) .2s both; }
.suggest .sug:nth-child(1) { animation: fromLeft .7s var(--out) .28s both; }
.suggest .sug:nth-child(2) { animation: fromRight .7s var(--out) .34s both; }
.suggest .sug:nth-child(3) { animation: fromBottomLeft .7s var(--out) .40s both; }
.suggest .sug:nth-child(4) { animation: fromBottomRight .7s var(--out) .46s both; }
@keyframes markLand { from { opacity: 0; transform: translate3d(0, -30px, 0) scale(.5) rotate(18deg); } }
@keyframes riseIn { from { opacity: 0; transform: translate3d(0, 16px, 0); } }
@keyframes fromLeft { from { opacity: 0; transform: translate3d(-40px, 0, 0); } }
@keyframes fromRight { from { opacity: 0; transform: translate3d(40px, 0, 0); } }
@keyframes fromBottomLeft { from { opacity: 0; transform: translate3d(-24px, 30px, 0) rotate(-2deg); } }
@keyframes fromBottomRight { from { opacity: 0; transform: translate3d(24px, 30px, 0) rotate(2deg); } }

/* Your message flies in from the composer; the agent's reply grows out of its avatar */
.msg.user:last-child { animation: sendFly .55s var(--out) both; }
@keyframes sendFly { from { opacity: 0; transform: translate3d(30px, 40px, 0) scale(.85); } }
.msg.bot.fresh { animation: none; }
.msg.bot.fresh .av { animation: markSwap .5s var(--spring) both; }
.msg.bot.fresh .body { animation: replyGrow .6s var(--out) .05s both; transform-origin: 0 0; }
@keyframes replyGrow { from { opacity: 0; transform: scale(.94) translate3d(-8px, 6px, 0); } }

/* Working steps tick in one by one, each check pops */
.steps-list li { animation: stepIn .4s var(--out) both; }
.ic.ok { animation: checkPop .45s var(--spring) both; }
@keyframes stepIn { from { opacity: 0; transform: translate3d(-12px, 0, 0); } }
@keyframes checkPop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.ic.spin { animation: spin .7s linear infinite; }

/* Reply actions appear left to right; follow-up chips bubble up */
.msg.bot:last-child .actions .act { animation: actIn .45s var(--out) both; }
.msg.bot:last-child .actions .act:nth-child(1) { animation-delay: .05s; } .msg.bot:last-child .actions .act:nth-child(2) { animation-delay: .1s; }
.msg.bot:last-child .actions .act:nth-child(3) { animation-delay: .15s; } .msg.bot:last-child .actions .act:nth-child(4) { animation-delay: .2s; }
.msg.bot:last-child .actions .act:nth-child(5) { animation-delay: .25s; }
@keyframes actIn { from { opacity: 0; transform: translate3d(0, 6px, 0); } }
.follow button { animation: bubbleUp .55s var(--spring) both; }
.follow button:nth-child(2) { animation-delay: .08s; } .follow button:nth-child(3) { animation-delay: .16s; }
@keyframes bubbleUp { from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.8); } }

/* Charts: bars rise like an equaliser */
.chart .bar-v { animation: barRise .9s var(--spring) both; }
@keyframes barRise { from { transform: scaleY(0); } 60% { transform: scaleY(1.08); } }

/* Composer: send makes a ripple; the paperclip swings when a file is dropped */
.send { isolation: isolate; }
.send .ripple { position: absolute; inset: 0; border-radius: inherit; background: rgba(255,255,255,.55); animation: ripple .6s ease-out forwards; pointer-events: none; z-index: -1; }
@keyframes ripple { from { transform: scale(.3); opacity: .8; } to { transform: scale(2.4); opacity: 0; } }
.dropzone:not([hidden]) { animation: dropPulse 1.4s ease-in-out infinite; }
@keyframes dropPulse { 50% { box-shadow: inset 0 0 0 6px rgba(62, 230, 168, .15); } }
.paused-bar:not([hidden]) { animation: warnShake .6s var(--out) both; }
@keyframes warnShake { 0% { opacity: 0; transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } 100% { opacity: 1; transform: none; } }

/* Workspace: saved items slide in from the right, tasks drop in, finishing a task draws a line through it */
.saved { animation: slideFromRight .5s var(--out) both; }
.task { animation: taskDrop .45s var(--out) both; }
@keyframes slideFromRight { from { opacity: 0; transform: translate3d(24px, 0, 0); } }
@keyframes taskDrop { from { opacity: 0; transform: translate3d(0, -10px, 0); } }
.task span { text-decoration: none !important; background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-position: 0 56%; background-size: 0 1.5px; transition: background-size .45s var(--out), color .3s; }
.task.done span { background-size: 100% 1.5px; }
.progress i { transition: width .7s var(--spring); }

/* Dialogs: each one enters in its own way */
.palette.show { animation: paletteDrop .32s var(--out) both; }
@keyframes paletteDrop { from { opacity: 0; transform: translate(-50%, -18px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.builder:not([hidden]) .builder-sheet { animation: sheetUp .55s var(--out) both; }
@keyframes sheetUp { from { opacity: 0; transform: translate3d(0, 60px, 0); } }
#shareModal:not([hidden]) .lite-box { animation: shareBounce .6s var(--spring) both; }
@keyframes shareBounce { from { opacity: 0; transform: scale(.7); } }
#importModal:not([hidden]) .lite-box { animation: importSlide .55s var(--out) both; }
@keyframes importSlide { from { opacity: 0; transform: translate3d(60px, 0, 0) rotate(2deg); } }
#accountModal:not([hidden]) .lite-box { animation: accountDrop .55s var(--out) both; }
@keyframes accountDrop { from { opacity: 0; transform: translate3d(0, -50px, 0); } }
#voiceModal:not([hidden]) .lite-box { animation: voiceRise .55s var(--spring) both; transform-origin: 0 100%; }
@keyframes voiceRise { from { opacity: 0; transform: scale(.6) rotate(-6deg); } }
#cardModal:not([hidden]) .lite-box { animation: cardFlip .7s var(--out) both; transform-origin: 50% 0; }
@keyframes cardFlip { from { opacity: 0; transform: perspective(900px) rotateX(-35deg) translate3d(0, -20px, 0); } }
.tour-card { animation: tourPop .5s var(--spring) both; }
@keyframes tourPop { from { opacity: 0; transform: scale(.85); } }

/* Read-aloud strip unfolds */
.speak-strip { animation: unfold .45s var(--out) both; transform-origin: 0 0; }
@keyframes unfold { from { opacity: 0; transform: scaleY(.6); } }

/* Toasts spring up */
.toast.show { transition: opacity .3s, transform .5s var(--spring); }

/* Builder pickers bounce when chosen */
.b-icons button.sel, .b-colors button.sel, .b-skill.sel, .b-chips button.sel { animation: pickBounce .45s var(--spring); }
@keyframes pickBounce { 40% { transform: scale(1.12); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
