/* Motion styles. Entrances and glides are run by app/motion.js (script, so a refresh cannot cut them);
   this file holds the shared curves, the phone screen slide, and the small state transitions.
   --slow (set by motion.js from localStorage 'wx.slow') stretches everything for frame-by-frame checks. */
:root{interpolate-size:allow-keywords;--slow:1;
  --spring:linear(0,.063 2.3%,.223 5%,.462 8.6%,.715 12.8%,.873 16.5%,.968 20.6%,1.019 25.2%,1.033 29.9%,1.027 35.2%,1.01 44.5%,1.001 54%,.998 66%,1);
  --ease-out:cubic-bezier(.16,1,.3,1);--ease-in:cubic-bezier(.55,0,.8,.2);--ease:var(--ease-out);
  --t-fast:calc(.16s * var(--slow));--t:calc(.28s * var(--slow));--t-spring:calc(.56s * var(--slow))}
/* phone: into a chat or contact the new screen springs in from the right, the old one recedes; back reverses */
.cx-chat-page,.wx-directory{view-transition-name:page}
::view-transition-group(*){animation-duration:var(--t-spring);animation-timing-function:var(--spring)}
::view-transition-old(root),::view-transition-new(root){animation-duration:calc(.32s * var(--slow));animation-timing-function:var(--ease-out)}
[data-motion=forward]::view-transition-old(page){animation:vt-recede calc(.4s * var(--slow)) var(--ease-out) both}
[data-motion=forward]::view-transition-new(page){animation:vt-from-right var(--t-spring) var(--spring) both}
[data-motion=back]::view-transition-old(page){animation:vt-away calc(.32s * var(--slow)) var(--ease-in) both}
[data-motion=back]::view-transition-new(page){animation:vt-return calc(.44s * var(--slow)) var(--ease-out) both}
@keyframes vt-recede{to{transform:translateX(-28%);filter:brightness(.8)}}
@keyframes vt-from-right{from{transform:translateX(100%)}}
@keyframes vt-away{to{transform:translateX(100%)}}
@keyframes vt-return{from{transform:translateX(-28%);filter:brightness(.8)}}
/* the selected tab is one indicator that glides to the next tab (CSS anchor positioning; a refresh cannot reset it) */
@supports (anchor-name:--a){
  .segments,.set-list{position:relative;anchor-scope:--pick}
  .segments .selected,.set-list .wx-current{anchor-name:--pick;background:transparent!important;box-shadow:none!important}
  .segments button,.set-list button{position:relative;z-index:1}
  .segments::before,.set-list::before{content:'';position:absolute;z-index:0;left:anchor(--pick left);right:anchor(--pick right);top:anchor(--pick top);bottom:anchor(--pick bottom);border-radius:7px;
    background:var(--seg-on);box-shadow:var(--seg-shadow);transition:left var(--t-spring) var(--spring),right var(--t-spring) var(--spring),top var(--t-spring) var(--spring),bottom var(--t-spring) var(--spring)}
  .set-list::before{background:var(--accent-soft);box-shadow:none}
}
/* folds open and close with the same ease */
details::details-content{height:0;overflow:clip;transition:height calc(.42s * var(--slow)) var(--ease-out),content-visibility calc(.42s * var(--slow)) allow-discrete}
details[open]::details-content{height:auto}
/* touch feedback: press in fast, spring back */
.cx-btn,.wx-rail-link,.rail-icon,.todo-item,.pin-bar,.segments button{transition:transform var(--t-spring) var(--spring),background-color var(--t-fast) var(--ease-out),color var(--t-fast) var(--ease-out),box-shadow var(--t-fast) var(--ease-out),border-color var(--t-fast) var(--ease-out)}
.cx-btn:active,.wx-rail-link:active,.rail-icon:active,.todo-item:active,.pin-bar:active,.segments button:active{transform:scale(.965);transition-duration:.08s}
.cx-switch i{transition:transform var(--t-spring) var(--spring)!important}.cx-switch{transition:background-color var(--t) var(--ease-out)}
.pin-bar b::after{transition:transform var(--t-spring) var(--spring)}
.wx-conversation-card,.wx-person,.set-list button,.alert-row,.srow,.cx-link{transition:background-color var(--t-fast) var(--ease-out),color var(--t-fast) var(--ease-out),box-shadow var(--t) var(--ease-out)}
.cx-modal>*{animation:modal-in var(--t-spring) var(--spring) both}@keyframes modal-in{from{opacity:0;transform:translateY(10px) scale(.98)}}
@media(prefers-reduced-motion:reduce){*,::view-transition-group(*),::view-transition-old(*),::view-transition-new(*),.segments::before,.set-list::before{animation:none!important;transition:none!important}}
