/* Nom motion. One soft curve everywhere (--ease, an expo-out), nothing bouncy.
   Time-based: headings rise letter by letter, drinks lift in, stars pop, the footer word gathers.
   Scroll-linked (CSS scroll timelines, run off the main thread where the browser supports them): beans and leaves drift
   at their own depth, pictures float against the page, headings slide a touch on wide screens.
   Everything stops for prefers-reduced-motion. */

/* ---------- touch: no grey flash, a real press instead ---------- */
html { -webkit-tap-highlight-color: transparent; }
a, button, summary, label, [role="tab"], [role="menuitem"] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn:active, .order:active, .round:active, .cat:active, .navbtn:active { transform: scale(.96); transition-duration: .15s; }
.cup:active .cup-fig, .feat:active .feat-fig { transform: scale(.97); transition: transform .2s var(--ease); }
.picks button:active { transform: scale(.98); }

/* ---------- headings: letter by letter ---------- */
.split .sw { display: inline-block; white-space: nowrap; }
.split .sc { display: inline-block; opacity: 0; transform: translateY(.5em) rotate(9deg) scale(.86); transform-origin: 50% 90%;
  transition: opacity .55s ease, transform 1s var(--ease); transition-delay: calc(min(var(--i), 26) * 30ms + var(--d0, 0ms)); }
.split.in .sc { opacity: 1; transform: none; }
.split.done .sc { transition-delay: 0s; transition-duration: .3s, .6s; }
@media (hover: hover) and (pointer: fine) { .split.done .sc:hover { transform: translateY(-.07em) rotate(-5deg); } }

/* ---------- drinks lift in, one after another ---------- */
.cup.lift .cup-fig { opacity: 0; transform: translateY(50px) scale(.9); transition: opacity .8s var(--ease), transform 1.25s var(--ease); transition-delay: calc(min(var(--k, 0), 6) * 80ms); }
.cup.lift .cup-meta { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform 1s var(--ease); transition-delay: calc(min(var(--k, 0), 6) * 80ms + 140ms); }
.cup.lift .flag { opacity: 0; transform: scale(.5); transition: opacity .5s var(--ease), transform .7s var(--ease); transition-delay: calc(min(var(--k, 0), 6) * 80ms + 380ms); }
.cup.lift.in .cup-fig, .cup.lift.in .cup-meta, .cup.lift.in .flag { opacity: 1; transform: none; }

/* ---------- blocks that arrive together ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.rv .hours li { opacity: 0; transform: translateX(-18px); transition: opacity .7s var(--ease), transform 1s var(--ease), color .3s; }
.rv.in .hours li { opacity: 1; transform: none; }
.rv.in .hours li:nth-child(1) { transition-delay: .35s; } .rv.in .hours li:nth-child(2) { transition-delay: .45s; }
.rv .contact a, .rv .now, .rv .vaddr { opacity: 0; transform: translateY(12px); transition: opacity .7s var(--ease) .25s, transform 1s var(--ease) .25s, background-size .5s var(--ease); }
.rv.in .contact a, .rv.in .now, .rv.in .vaddr { opacity: 1; transform: none; }
.rv.in .contact a:nth-child(2) { transition-delay: .32s; } .rv.in .contact a:nth-child(3) { transition-delay: .39s; }
.rev-meta .stars .ic { display: inline-block; opacity: 0; transform: scale(.2) rotate(-40deg); transition: opacity .4s var(--ease), transform .8s var(--ease); }
.rev-meta.in .stars .ic { opacity: 1; transform: none; }
.rev-meta.in .stars .ic:nth-child(2) { transition-delay: .07s; } .rev-meta.in .stars .ic:nth-child(3) { transition-delay: .14s; }
.rev-meta.in .stars .ic:nth-child(4) { transition-delay: .21s; } .rev-meta.in .stars .ic:nth-child(5) { transition-delay: .28s; }
.facts .fact { opacity: 0; transform: translateY(34px); transition: opacity .8s var(--ease), transform 1.2s var(--ease); }
.facts.in .fact { opacity: 1; transform: none; }
.facts.in .fact:nth-child(2) { transition-delay: .12s; } .facts.in .fact:nth-child(3) { transition-delay: .24s; }

/* catering: three drinks rise in turn, then sway on their own */
.line-up img { opacity: 0; transform: translateY(70px) rotate(var(--tilt, 0deg)); transition: opacity .8s var(--ease), transform 1.3s var(--ease); transform-origin: 50% 100%; }
.line-up img:nth-child(1) { --tilt: -8deg; } .line-up img:nth-child(3) { --tilt: 8deg; }
.line-up.in img { opacity: 1; transform: none; }
.line-up.in img:nth-child(2) { transition-delay: .14s; } .line-up.in img:nth-child(3) { transition-delay: .28s; }
@keyframes sway { from { rotate: -1.6deg; translate: 0 0; } to { rotate: 1.6deg; translate: 0 -8px; } }
.live .line-up.in img { animation: sway 4.2s ease-in-out infinite alternate; }
.live .line-up.in img:nth-child(2) { animation-duration: 5s; animation-delay: -1.8s; }
.live .line-up.in img:nth-child(3) { animation-duration: 4.6s; animation-delay: -3s; }

/* footer: n and m slide together, the glass rolls into the middle */
.foot-word.rv { opacity: 1; transform: none; }
.foot-word .fn, .foot-word .fm, .foot-word .fo { transition: transform 1.4s var(--ease), opacity .9s var(--ease); }
.foot-word.rv .fn { transform: translateX(-38%); opacity: 0; }
.foot-word.rv .fm { transform: translateX(30%); opacity: 0; }
.foot-word.rv .fo { transform: translateX(-160%) rotate(-300deg) scale(.6); opacity: 0; }
.foot-word.rv.in .fn, .foot-word.rv.in .fm, .foot-word.rv.in .fo { transform: none; opacity: 1; }
.foot-word.rv.in .fo { transition-delay: .12s; }
.foot-word .fsub { transition: opacity 1s var(--ease) .45s; }
.foot-word.rv .fsub { opacity: 0; }
.foot-word.rv.in .fsub { opacity: 1; }

/* story picker: the dot travels, the word leans in */
.picks button { transition: color .45s var(--ease), transform .6s var(--ease); }
.picks button[aria-selected="true"] { transform: translateX(6px); }

/* magnetic buttons (fine pointers only, set from JS through `translate`) */
.mag { transition: translate .6s var(--ease), transform .45s var(--ease), background-color .3s, color .3s, box-shadow .3s; }

/* ---------- scroll-linked depth ---------- */
@keyframes par { from { translate: 0 var(--py, 36px); } to { translate: 0 calc(var(--py, 36px) * -1); } }
@keyframes deco-par { from { transform: translateY(var(--pd)); } to { transform: translateY(calc(var(--pd) * -1)); } }
@keyframes drift-x { from { translate: 2vw 0; } to { translate: -2vw 0; } }
@supports (animation-timeline: view()) {
 @media (hover: hover) and (pointer: fine) {
  .par { animation: par linear both; animation-timeline: view(); animation-range: cover; }
  .deco { --pd: calc(var(--s) * 1.5); animation: float var(--t, 9s) ease-in-out infinite alternate, deco-par linear both;
    animation-timeline: auto, view(); animation-range: normal, cover; animation-play-state: paused, running; }
  .live .deco { animation-play-state: running, running; }
  @media (max-width: 640px) { .deco { --pd: calc(var(--s) * .5); } }
  @media (min-width: 821px) {
    .sec .h2.split:not([data-count]) { animation: drift-x linear both; animation-timeline: view(); animation-range: cover; }
  }
 }
}

/* ---------- page to page ---------- */
@view-transition { navigation: auto; }
.bar { view-transition-name: bar; }
::view-transition-old(root) { animation: vt-out .38s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .8s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-20px) scale(.99); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(34px); } }

/* ---------- reduced motion: everything simply appears ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .split .sc, .cup.lift .cup-fig, .cup.lift .cup-meta, .cup.lift .flag, .rv .hours li, .rv .contact a, .rv .now, .rv .vaddr,
  .rev-meta .stars .ic, .facts .fact, .line-up img, .foot-word .fn, .foot-word .fm, .foot-word .fo { opacity: 1 !important; transform: none !important; transition: none !important; }
  .par, .deco, .h2, .line-up img { animation: none !important; }
  .picks button[aria-selected="true"] { transform: none; }
}
