/* Motion for both designs (shared). Pairs with motion.js.
   Language: content moves on one horizontal axis with a short blur, like turning a page; the navigation,
   top bar and console tabs never move (the console tabs and sub tabs have no motion at all); selection
   indicators glide; rows rise in when a list changes. */

:root{--ease-out:cubic-bezier(.16,1,.3,1);--ease-in:cubic-bezier(.4,0,1,1)}

/* ---------- page to page: cross-document view transitions ---------- */
@view-transition{navigation:auto}
.side,.rail{view-transition-name:dp-nav}
.topbar{view-transition-name:dp-top}
.head .tools{view-transition-name:dp-tools}
.console{view-transition-name:dp-console}
.content,.main{view-transition-name:dp-main}

:root:has(.frame){--vt-bg:var(--panel)}
:root:has(.app){--vt-bg:var(--bg)}
::view-transition-group(dp-main){overflow:clip;background:var(--vt-bg,transparent)}
/* every page keeps the same width whether or not it scrolls, and snapshots are drawn at their natural size,
   so text never stretches or shrinks while one page changes into the next */
html{scrollbar-gutter:stable}
::view-transition-old(dp-main),::view-transition-new(dp-main){mix-blend-mode:normal;height:100%;object-fit:none;object-position:left top}
::view-transition-old(dp-main){animation:dp-page-out .2s var(--ease-in) both}
::view-transition-new(dp-main){animation:dp-page-in .4s var(--ease-out) both}
html:active-view-transition-type(back)::view-transition-old(dp-main){animation-name:dp-page-out-back}
html:active-view-transition-type(back)::view-transition-new(dp-main){animation-name:dp-page-in-back}
::view-transition-old(root),::view-transition-new(root){animation-duration:.2s}
/* the console tabs and sub tabs keep their original behaviour: pages opened from them appear instantly (motion.js
   skips the transition), and when another link changes page the strip itself switches instantly, with no fade or resize */
::view-transition-group(dp-console),::view-transition-new(dp-console){animation:none}
::view-transition-old(dp-console){display:none}
@keyframes dp-page-out{to{opacity:0;transform:translateX(-40px);filter:blur(6px)}}
@keyframes dp-page-in{from{opacity:0;transform:translateX(48px);filter:blur(6px)}}
@keyframes dp-page-out-back{to{opacity:0;transform:translateX(40px);filter:blur(6px)}}
@keyframes dp-page-in-back{from{opacity:0;transform:translateX(-48px);filter:blur(6px)}}

/* ---------- gliding selection indicators (the .ink element is added by motion.js) ---------- */
.ink-host{position:relative}
.ink{position:absolute;left:0;top:0;pointer-events:none;will-change:transform;border-radius:2px}
.ink-host.ink-ready>.ink{transition:transform .32s var(--ease-out),width .32s var(--ease-out),height .32s var(--ease-out)}
.ink-line>.ink{height:2px;background:var(--accent)}
.frame .tabs[role=tablist]{--ink-y:1px} /* the blue underline sits on the tab bar's bottom border */
.ink-pill>.ink{z-index:0}
.ink-pill>button{position:relative;z-index:1}
/* the static indicators step aside while the ink is on */
.ink-on.tabs button[aria-selected=true]::after{opacity:0}
.ink-on.ink-line>button[aria-selected=true],.ink-on.ink-line>button[aria-pressed=true]{border-bottom-color:transparent!important}
.ink-on.ink-pill>button[aria-pressed=true]{background:transparent!important;box-shadow:none!important}
/* pill colours: blue design, then the dark/light design */
.frame .ink-pill>.ink{background:var(--raised);box-shadow:0 1px 2px rgba(0,0,0,.1)}
.app .ink-pill>.ink{background:var(--hover)}
:root[data-theme=light] .app .ink-pill>.ink{background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.12)}

/* ---------- feedback: colour changes ease instead of snapping ---------- */
:where(.btn,.icon-btn,.more,.rail-btn,.side a,.side button,.tabs button,.rec-tabs button,.seg button,.counters button,.menu button,.pop label,.klink,.key,.sw,.check,.link-btn){transition:background-color .15s ease,color .15s ease,border-color .15s ease,box-shadow .15s ease,opacity .15s ease}
:where(tbody tr){transition:background-color .16s ease}
:where(.btn:not([disabled]),.icon-btn,.rail-btn){transition-property:background-color,color,border-color,box-shadow,opacity,transform}
:where(.btn:not([disabled]),.icon-btn):active{transform:scale(.97)}

/* menus and popovers open from their anchor; dialogs settle in */
.pop:not([hidden]),.menu:not([hidden]){animation:dp-pop .18s var(--ease-out);transform-origin:top right}
dialog[open]{animation:dp-dialog .24s var(--ease-out)}
dialog[open]::backdrop{animation:dp-fade .24s ease}
@keyframes dp-pop{from{opacity:0;transform:translateY(-4px) scale(.98)}}
@keyframes dp-dialog{from{opacity:0;transform:translateY(10px) scale(.98)}}
@keyframes dp-fade{from{opacity:0}}
/* the blue design's quick-view side panel */
aside#panel{transition:transform .34s var(--ease-out)}
#scrim{transition:opacity .24s ease}
/* chart bars grow from the baseline (motion.js runs the animation) */
#chart rect{transform-box:view-box}

/* ---------- reduced motion: gentle fades only, nothing travels ---------- */
@media (prefers-reduced-motion:reduce){
  ::view-transition-old(dp-main){animation:dp-fade-out .15s ease both}
  ::view-transition-new(dp-main){animation:dp-fade .15s ease both}
  .ink-host.ink-ready>.ink{transition:none}
  .pop:not([hidden]),.menu:not([hidden]),dialog[open]{animation:dp-fade .12s ease}
  :where(.btn,.icon-btn):active{transform:none}
}
@keyframes dp-fade-out{to{opacity:0}}
