/* Motion.
   One rule for the whole app: motion is everywhere, but it is slow, small and low contrast.
   Nothing flashes, nothing bounces, nothing travels more than a few pixels on its own.
   Entrances are one-shot and ease out; the little that is continuous (a ready card's breath, the ember of a drink
   being made) runs on a long cycle with a tiny amplitude, and only changes size and opacity. */

/* Once the opening has played, the room is still: the lamp, the glass and the clock no longer move on their own, since
   anything that never stops keeps the phone drawing frames (and spending battery) while a guest only waits.
   The one thing that still happens now and then is the brass word mark catching the light: a highlight crossing
   the letters on its own background layer, so the still brass beneath it is never repainted. view.js plays it once
   every sixteen seconds, and only while the word mark is on screen. */
@keyframes sheen{from{background-position:120% 0,120% 0}to{background-position:-40% 0,120% 0}}
/* the sheen pass over an armed button */
@keyframes shine{0%{transform:translateX(-130%)}60%,100%{transform:translateX(130%)}}
/* a warm ember rather than a heartbeat */
@keyframes pulse{0%,100%{transform:scale(1);opacity:.85}50%{transform:scale(1.08);opacity:1}}
/* a ticket arriving: it catches the lamp light in a warm bloom, then goes still */
@keyframes glowSheen{
  0%{opacity:0}
  20%{opacity:1}
  100%{opacity:0}
}
/* a ready drink glowing outwards, slowly */
@keyframes ring{
  0%{opacity:1;transform:scale(1)}
  70%,100%{opacity:0;transform:scale(1.042)}
}
/* a new line of dialogue fading up a couple of pixels */
@keyframes say{0%{opacity:0;transform:translateY(3px)}100%{opacity:1;transform:none}}

/* ---------- opening: the bar lights up, the sign comes on ---------- */
/* Once, as the page loads: the room comes up out of the dark with one soft flicker as the lamp catches, then the
   shelves; the glass appears and fills, the katakana settles in from wide spacing, the word mark
   rises out of a blur, and the 営業中 sign flickers on like an open sign. The door comes in
   three quarters of a second into it, the evening half a second in, as the logo settles: view.js puts what is left
   of that in --in on whatever comes in next. */
@keyframes roomOn{0%{opacity:0}35%{opacity:.6}42%{opacity:.35}62%{opacity:.9}100%{opacity:1}}
@keyframes fadeIn{from{opacity:0}}
@keyframes markIn{from{opacity:0;transform:translateY(8px) scale(.9)}}
@keyframes pourIn{from{clip-path:inset(100% 0 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes trackIn{from{opacity:0;letter-spacing:.9em}}
@keyframes wordIn{from{opacity:0;transform:translateY(12px);filter:blur(6px)}}
@keyframes signOn{0%{opacity:0}20%{opacity:.8}26%{opacity:.2}40%{opacity:1}48%{opacity:.5}60%,100%{opacity:1}}
/* the lamp's warm-up, flicker and all; the glass fills on the same clock, full as the lamp settles.
   --pre is a moment of dark before any of it, when the load ends at the door (the page's head script sets html.door). */
:root{--lamp:1.8s;--pre:0s}
html.door{--pre:.45s}
.room{animation:roomOn var(--lamp) var(--ease-soft) var(--pre) both}
.room .shelves{animation:fadeIn 1.6s var(--ease-soft) calc(var(--pre) + .5s) both}
.logo-mark{animation:markIn .8s var(--ease-out) calc(var(--pre) + .25s) both}
/* The liquid fills the glass from its foot up, and then stays still. The level rises (the liquid is uncovered
   from below, clipped to its own box) rather than the liquid being stretched, which would squash it into a wide
   wedge sticking out past the narrow bottom of the glass. A slow, even pour: it starts gently and settles at the
   top, rather than most of it rushing in at once. It begins .3s in and ends with the lamp's last flicker. */
.logo-mark .pour{animation:pourIn calc(var(--lamp) - .3s) var(--ease-soft) calc(var(--pre) + .3s) both}
.logo-jp{animation:trackIn 1.1s var(--ease-out) calc(var(--pre) + .35s) both}
h1{animation:wordIn 1s var(--ease-out) calc(var(--pre) + .45s) both}
/* the pass keeps the entrance first in the list, so ending the pass does not play the entrance again */
h1.shine{animation:wordIn 1s var(--ease-out) calc(var(--pre) + .45s) both,sheen 4.5s var(--ease-soft)}
.sticker{animation:signOn 1s linear calc(var(--pre) + .95s) both}
.bigclock{animation:riseInSoft .8s var(--ease-out) calc(var(--pre) + .7s) both}
.tagline,.title-row > .lang-btn{animation:fadeIn 1s var(--ease-soft) calc(var(--pre) + .8s) both}

/* ---------- entrances: the door, and the evening coming into view ---------- */
@keyframes riseIn{from{opacity:0;transform:translateY(18px) scale(.985)}to{opacity:1;transform:none}}
@keyframes riseInSoft{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes doorGlow{
  0%{box-shadow:var(--shadow-1),0 0 0 0 rgba(224,160,68,0)}
  35%{box-shadow:var(--shadow-1),0 0 64px -8px rgba(224,160,68,.42)}
  100%{box-shadow:var(--shadow-1),0 0 0 0 rgba(224,160,68,0)}
}
@keyframes doorSheen{from{transform:translateX(-110%)}to{transform:translateX(110%)}}

/* The door rises out of the dark and catches the lamp once: a warm glow, one sheen across it. What is written on it
   follows line by line, and does again whenever the door's content changes, since new nodes play their entrance.
   Every delay here and below starts at --in: the rest of the opening, when the door arrives while the bar is still
   lighting up, and nothing after it (view.js sets it on the door and on the page). */
.gate{position:relative;overflow:hidden;animation:riseIn 1.1s var(--ease-out) var(--in,0s) both,doorGlow 2s var(--ease-out) calc(var(--in,0s) + .4s)}
.gate::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(105deg,transparent 35%,rgba(255,236,200,.10) 50%,transparent 65%);
  transform:translateX(-110%);animation:doorSheen 1.6s var(--ease-soft) calc(var(--in,0s) + .55s)}
/* an even fade, not a front-loaded one: with most of the change in its first moments, the bright button seemed to pop */
.gate>*,.gate-form>*{animation:riseInSoft 1s var(--ease-soft) both}
.gate>:nth-child(1){animation-delay:calc(var(--in,0s) + .15s)}
.gate>:nth-child(2){animation-delay:calc(var(--in,0s) + .26s)}
.gate>:nth-child(3){animation-delay:calc(var(--in,0s) + .37s)}
.gate>:nth-child(4){animation-delay:calc(var(--in,0s) + .45s)}
.gate-form>:nth-child(1){animation-delay:calc(var(--in,0s) + .5s)}
.gate-form>:nth-child(2){animation-delay:calc(var(--in,0s) + .59s)}
.gate-form>:nth-child(3){animation-delay:calc(var(--in,0s) + .66s)}
.gate-form>:nth-child(4){animation-delay:calc(var(--in,0s) + .72s)}

/* Through the door: the evening rises into view piece by piece (view.js reveal sets body.revealing for the entrance
   only, so a pane shown later by a tab does not rise in again). */
body.revealing .phone{animation:riseIn 1.1s var(--ease-out) var(--in,0s) both}
body.revealing .phone>*{animation:riseInSoft .95s var(--ease-soft) both}
body.revealing .phone>:nth-child(1){animation-delay:calc(var(--in,0s) + .18s)}
body.revealing .phone>:nth-child(2){animation-delay:calc(var(--in,0s) + .32s)}
body.revealing .phone>:nth-child(3){animation-delay:calc(var(--in,0s) + .47s)}
body.revealing .page-foot{animation:riseInSoft .9s var(--ease-soft) calc(var(--in,0s) + .7s) both}
body.revealing .bigclock{animation:riseInSoft .9s var(--ease-soft) calc(var(--in,0s) + .1s) both}
body.revealing .top-tools{animation:riseInSoft .9s var(--ease-soft) calc(var(--in,0s) + .12s) both}
body.revealing .btabs{animation:riseInSoft .9s var(--ease-soft) calc(var(--in,0s) + .08s) both}
body.revealing .bar-layout .tabpane,body.revealing .bar-layout>.guidecol>#pickup{animation:riseIn 1.1s var(--ease-out) var(--in,0s) both}
body.revealing #tabRecipe{animation-delay:calc(var(--in,0s) + .12s)}
body.revealing #pickup,body.revealing #tabOrders{animation-delay:calc(var(--in,0s) + .26s)}
body.revealing #tabDrinks{animation-delay:calc(var(--in,0s) + .4s)}
/* the bar's screen (/orders/): its columns rise in as the bartender's do, one after another; and again whenever the
   board changes shape as the bar closes or opens (screen.js, body.sc-rising) */
body.revealing .sc-col,body.sc-rising .sc-col{animation:riseIn 1.1s var(--ease-out) var(--in,0s) both}
body.revealing .sc-col:nth-child(2),body.sc-rising .sc-col:nth-child(2){animation-delay:calc(var(--in,0s) + .12s)}
body.revealing .sc-col:nth-child(3),body.sc-rising .sc-col:nth-child(3){animation-delay:calc(var(--in,0s) + .26s)}
/* The other language (i18n.js setLang) comes in on the same entrances, with the logo and the room left as they are.
   The header's tagline and language button have only the opening's late fade, so they get a prompt one here. */
body.relang .tagline,body.relang .title-row > .lang-btn{animation:fadeIn .8s var(--ease-soft) .15s both}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
  .fly{display:none!important}
}

/* a card out of sight takes a change in one step (motion.js snapAbove) */
.still,.still *{transition:none!important}
