/* Everything on the Gatekeeper page that moves. Nothing here loops: each effect answers
   one action and ends. site.css turns all of it off under prefers-reduced-motion, and the
   rules at the bottom do the same for the footer's pause button. The two canvases follow
   the same rule in script (wantsStill in gatekeeper-sky.js). */

/* Colour answers a pointer in 180ms. */
.gk-chip,.gk-card,.gk-gap,.gk-gaps a,#site-search,.gk-sort,.gk-view,#open-filters,#gk-surprise,#gk-reset,#gk-clear,.gk-pager button,.sheet-close,#sheet-clear,#sheet-apply,.gk-detail-close,.gk-copy-link,.gk-mail,#gk-copy-prompt{transition:background-color .18s,border-color .18s,color .18s,box-shadow .18s,opacity .18s}
.gk-caret,.gk-legend summary::after{transition:transform .25s var(--ease),margin .25s var(--ease)}
.gk-chip:active,.gk-view:active,#gk-surprise:active,#gk-copy-prompt:active,.gk-mail:active{transform:translateY(1px)}

/* A tier row leans toward the pointer, the way the list on the home page does. */
@media (min-width:1041px) and (hover:hover){
  .gk-tile{transition:background-color .18s,box-shadow .18s,padding .25s var(--ease)}
  .gk-tile:hover{padding-left:8px;padding-right:4px}
}

/* The detail panel arrives from the card above it. */
.gk-detail{animation:gk-detail-in .25s var(--ease) both}
@keyframes gk-detail-in{from{opacity:0;transform:translateY(-6px)}}

/* Warp: one sweep of light across the directory, and the card that was picked flashes. */
.dir.gk-streak::after{content:"";position:absolute;z-index:4;inset:0;pointer-events:none;background:linear-gradient(100deg,transparent 30%,rgba(236,235,230,.16) 50%,transparent 70%);animation:gk-streak .55s var(--ease) both}
@keyframes gk-streak{from{transform:translateX(-60%);opacity:0}30%{opacity:1}to{transform:translateX(60%);opacity:0}}
.gk-item.gk-warp .gk-card{animation:gk-warp .7s var(--ease)}
@keyframes gk-warp{from{box-shadow:inset 3px 0 0 var(--tier),0 0 0 3px var(--paper)}to{box-shadow:inset 3px 0 0 var(--tier),0 0 0 3px transparent}}

/* The filter sheet rises from the bottom edge. */
#filter-sheet[open]{animation:gk-sheet .25s var(--ease)}
#filter-sheet[open]::backdrop{animation:gk-fade .25s ease}
@keyframes gk-sheet{from{transform:translateY(24px);opacity:0}}
@keyframes gk-fade{from{opacity:0}}
#gk-empty{animation:gk-fade .25s ease}

/* The pause button freezes animations where they stand. These all start from "not there
   yet", so for them paused has to mean finished. */
html[data-motion="off"] .gk-detail,html[data-motion="off"] .gk-item.gk-warp .gk-card,html[data-motion="off"] #filter-sheet[open],html[data-motion="off"] #filter-sheet[open]::backdrop,html[data-motion="off"] #gk-empty,html[data-motion="off"] .dir.gk-streak::after{animation:none!important}
html[data-motion="off"] .dir.gk-streak::after{display:none}
