/* FORWARD app — motion layer (loaded after style.css). Pure additive: no layout changes. */
:root{--m-ease:cubic-bezier(.22,1,.36,1);--m-io:cubic-bezier(.65,0,.35,1);--m-accent:#9fe3cf}

/* ---------- Boot: fade the whole app in once ---------- */
/* Content stays visible if motion.js is unavailable; animation is progressive enhancement. */
body.booted .app-shell{animation:bootIn .7s var(--m-ease) both}
body.booted .bottom-nav{animation:bootNav .7s var(--m-ease) .15s both}
@keyframes bootIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes bootNav{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:none}}
body.no-anim .app-shell,body.no-anim .bottom-nav{opacity:1;animation:none}

/* ---------- Screen transitions ---------- */
.screen{animation:none}
.screen.active{animation:screenIn .5s var(--m-ease) both}
.screen.active.dir-back{animation-name:screenInBack}
@keyframes screenIn{from{opacity:0;transform:translateX(18px)}to{opacity:1;transform:none}}
@keyframes screenInBack{from{opacity:0;transform:translateX(-18px)}to{opacity:1;transform:none}}
/* staggered children while a screen is entering */
.screen.entering .page-intro .eyebrow,.screen.entering .page-intro h1,.screen.entering .page-intro p,
.screen.entering .readiness-banner,.screen.entering .card,.screen.entering .metric-card,.screen.entering .path-tile,
.screen.entering .dump-cta,.screen.entering .coach-header-line,.screen.entering .hint-strip,.screen.entering .list-header,
.screen.entering .thought-card,.screen.entering .path-section-grid>*,.screen.entering .wide-review{
  animation:riseIn .7s var(--m-ease) both;animation-delay:calc(var(--i,0)*55ms + 40ms)}
@keyframes riseIn{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
.screen.entering .page-intro .eyebrow-line{animation:lineDraw .8s var(--m-ease) .1s both;transform-origin:left}
@keyframes lineDraw{from{transform:scaleX(0)}to{transform:scaleX(1)}}

/* ---------- Cards & buttons ---------- */
.card{transition:transform .45s var(--m-ease),border-color .3s,box-shadow .45s var(--m-ease)}
.card:not(.dump-cta):hover{border-color:#3b444d}
.dump-cta{transition:transform .45s var(--m-ease),border-color .3s,background .3s}
.dump-cta:hover{transform:translateY(-3px);border-color:#5b6a75}
.dump-cta .dump-cta-title [aria-hidden]{display:inline-block;transition:transform .35s var(--m-ease)}
.dump-cta:hover .dump-cta-title [aria-hidden]{transform:translate(3px,-3px)}
.btn{transition:transform .35s var(--m-ease),filter .2s,background .2s,box-shadow .35s var(--m-ease),border-color .2s!important}
.btn:not(:disabled):hover{transform:translateY(-1px)}
.btn:not(:disabled):active{transform:translateY(1px) scale(.98);transition-duration:.08s}
.btn.primary:not(:disabled):active{box-shadow:0 1px 0 #66717a}
.btn [aria-hidden]{display:inline-block;transition:transform .35s var(--m-ease)}
.btn:hover [aria-hidden]{transform:translate(2px,-2px)}
.text-action{transition:color .2s,transform .3s var(--m-ease)}
.text-action:hover{transform:translateX(2px)}
.round-icon{transition:transform .5s var(--m-ease),background .2s,border-color .2s}
.round-icon:hover{transform:rotate(30deg)}
.brand-mark{transition:transform .5s var(--m-ease)}
.brand:hover .brand-mark{transform:rotate(-8deg) scale(1.06)}
.x-btn,.danger-link{transition:color .2s,transform .25s var(--m-ease),background .2s}
.x-btn:hover{transform:scale(1.15)}
.status{transition:background .3s,color .3s,border-color .3s}

/* ---------- Bottom nav ---------- */
.nav-item{transition:color .25s,background .35s var(--m-ease),border-color .35s,transform .35s var(--m-ease)}
.nav-item svg{transition:transform .45s var(--m-ease)}
.nav-item:hover svg{transform:translateY(-2px)}
.nav-item.active svg{animation:navPop .5s var(--m-ease)}
@keyframes navPop{0%{transform:scale(.8)}60%{transform:scale(1.18)}100%{transform:scale(1)}}
.nav-item:active{transform:scale(.94)}

/* ---------- Lists: tasks / thoughts ---------- */
.task{transition:background .25s}
.task.added,.thought-card.added,.coach-alt.added,.chat-message.added,.transaction-row.added{animation:itemIn .55s var(--m-ease) both}
@keyframes itemIn{from{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:none}}
.task.leaving,.thought-card.leaving{animation:itemOut .28s var(--m-io) both;pointer-events:none}
@keyframes itemOut{to{opacity:0;transform:translateX(24px) scale(.97);height:0;padding-top:0;padding-bottom:0;margin:0;border-width:0}}
.checkbox-btn{transition:background .3s,border-color .3s,transform .3s var(--m-ease)}
.checkbox-btn:hover{transform:scale(1.1)}
.checkbox-btn.done.just-done{animation:checkPop .5s var(--m-ease)}
@keyframes checkPop{0%{transform:scale(.6)}55%{transform:scale(1.25)}100%{transform:scale(1)}}
.task-name{position:relative;transition:color .3s}
.task-name::after{content:"";position:absolute;left:0;top:55%;height:1.5px;width:100%;background:currentColor;transform:scaleX(0);transform-origin:left;transition:transform .4s var(--m-ease)}
.task-name.done::after{transform:scaleX(1)}
.thought-card{transition:transform .45s var(--m-ease),border-color .3s}
.thought-card:hover{border-color:#3b444d;transform:translateY(-2px)}
.thought-actions button{transition:color .2s,transform .25s var(--m-ease)}
.thought-actions button:hover{transform:translateY(-1px)}
.segmented button{transition:background .3s var(--m-ease),color .2s}
.scale button{transition:background .25s,color .2s,border-color .25s,transform .3s var(--m-ease)}
.scale button:hover{transform:translateY(-2px)}
.scale button:active{transform:scale(.92)}
.scale button.selected{animation:scalePick .35s var(--m-ease)}
@keyframes scalePick{50%{transform:scale(1.12)}}
.prompt-chip{transition:background .25s,transform .3s var(--m-ease),border-color .25s}
.prompt-chip:hover{transform:translateY(-2px);border-color:#6a7882}

/* ---------- Path tiles & content ---------- */
.path-tile{transition:transform .45s var(--m-ease),border-color .3s,background .3s,box-shadow .45s var(--m-ease)!important}
.path-tile:hover{transform:translateY(-4px)!important}
.path-tile .tile-icon{display:inline-block;transition:transform .45s var(--m-ease)}
.path-tile:hover .tile-icon,.path-tile.selected .tile-icon{transform:translate(2px,-2px) rotate(-6deg)}
.path-tile.selected{box-shadow:inset 0 1px #ffffff22,0 12px 30px -16px #000c}
.path-content.swap{animation:contentSwap .5s var(--m-ease) both}
@keyframes contentSwap{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.path-content.swap .card{animation:riseIn .6s var(--m-ease) both;animation-delay:calc(var(--i,0)*60ms)}

/* ---------- Coach ---------- */
.coach-recommendation.refresh{animation:recoSwap .55s var(--m-ease) both}
@keyframes recoSwap{0%{opacity:.4;transform:translateY(8px)}100%{opacity:1;transform:none}}
.coach-glance-mark{display:inline-block;animation:twinkle 3.5s ease-in-out infinite}
@keyframes twinkle{0%,100%{opacity:.6;transform:scale(1) rotate(0)}50%{opacity:1;transform:scale(1.15) rotate(15deg)}}
.coach-chat-log{scroll-behavior:smooth}
.chat-message.added.you{animation-name:bubbleYou}
@keyframes bubbleYou{from{opacity:0;transform:translateX(14px) scale(.96)}to{opacity:1;transform:none}}

/* ---------- Focus timer ---------- */
.clock{transition:color .3s,transform .4s var(--m-ease)}
.focus-card.running .clock{color:#fff;animation:clockBreathe 2s ease-in-out infinite}
@keyframes clockBreathe{50%{transform:scale(1.015);text-shadow:0 0 24px #9fe3cf33}}
.focus-card.running{border-color:#4a6a60}
.focus-card.running .status{background:#2f503d;color:#d7f3e4}
.focus-card.timeup .clock{animation:clockDone .6s var(--m-ease) 3}
@keyframes clockDone{50%{transform:scale(1.06);color:var(--m-accent)}}
.clock.tick{animation:tick .25s var(--m-ease)}
@keyframes tick{50%{transform:translateY(-1px)}}

/* ---------- Progress ---------- */
.bar-pillar{transform-origin:bottom;transition:background .3s}
.screen.entering .bar-pillar{animation:growBar .9s var(--m-ease) both;animation-delay:calc(var(--i,0)*60ms + 200ms)}
@keyframes growBar{from{transform:scaleY(0)}to{transform:scaleY(1)}}
.bar-group:hover .bar-pillar{filter:brightness(1.15)}
.bar-group b{transition:transform .3s var(--m-ease)}
.bar-group:hover b{transform:translateY(-3px)}
.progress-track>div{transition:width 1.1s var(--m-ease) .25s}
.screen.entering .progress-track>div{animation:fillIn 1.1s var(--m-ease) .25s both;transform-origin:left}
@keyframes fillIn{from{transform:scaleX(0)}to{transform:scaleX(1)}}
.metric-card{transition:transform .45s var(--m-ease),border-color .3s}
.metric-card:hover{transform:translateY(-3px);border-color:#3b444d}
.metric-card strong{display:inline-block;font-variant-numeric:tabular-nums}

/* ---------- Readiness banner & indicators ---------- */
.readiness-banner{transition:border-color .3s}
.readiness-indicators>*{animation:riseIn .5s var(--m-ease) both;animation-delay:calc(var(--i,0)*50ms)}

/* ---------- Modal ---------- */
.modal-shell{transition:opacity .25s var(--m-io);opacity:0}
.modal-shell.visible{animation:shellIn .3s var(--m-ease) both}
@keyframes shellIn{from{opacity:0}to{opacity:1}}
.modal-shell.visible .modal{animation:modalIn .45s var(--m-ease) both}
@keyframes modalIn{from{opacity:0;transform:translateY(22px) scale(.97)}to{opacity:1;transform:none}}
.modal-shell.closing{opacity:0}
.modal-shell.closing .modal{animation:modalOut .22s var(--m-io) both}
@keyframes modalOut{to{opacity:0;transform:translateY(12px) scale(.98)}}
.modal .fields>label,.modal h2,.modal p,.modal .modal-actions,.modal .button-row{animation:riseIn .5s var(--m-ease) both;animation-delay:calc(var(--i,0)*40ms + 80ms)}

/* ---------- Toast ---------- */
.toast{transition:opacity .3s var(--m-ease),transform .45s var(--m-ease)}
.toast{transform:translateX(-50%) translateY(-24px) scale(.96)}
.toast.show{transform:translateX(-50%) translateY(0) scale(1)}

/* ---------- Inputs ---------- */
input,textarea,select{transition:border-color .25s,box-shadow .25s,background .25s}
input:focus-visible,textarea:focus-visible,select:focus-visible{outline:none!important;border-color:#8fb8ad!important;box-shadow:0 0 0 3px #9fe3cf2a}
@keyframes blinkBar{50%{opacity:.4}}

/* ---------- Leaving the app / arriving from landing ---------- */
body.leaving{transition:opacity .3s var(--m-io);opacity:0}

@media (prefers-reduced-motion:reduce){
  .app-shell,.bottom-nav{opacity:1;animation:none!important}
  .screen.active,.screen.entering *,.modal-shell.visible,.modal-shell.visible .modal,.path-content.swap,.path-content.swap .card,.coach-recommendation.refresh,.coach-glance-mark,.focus-card.running .clock,.task.added,.thought-card.added,.chat-message.added,.coach-alt.added{animation:none!important}
}
