/* motion.css: loaded last. Shared touch feedback and small transitions. */

.app-version { text-align: center; font-size: 0.72rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.splash .app-version, .login-screen .app-version { margin-top: 0.75rem; }
.lock .app-version { margin-top: 1.25rem; }
.view-root > .app-version { padding: 0.5rem 0 1.5rem; }

/* Everything you can tap gives a little under your finger. `scale` is used
   so tilted and positioned things keep their own transform. */
:is(.hub-tile, .mem-card, .envelope, .us-switch__btn, .segmented__option, .person-chip, .us-grid :is(.countdown, .record, .ms-us), .chat-search__hit, .attach-menu__item, .moments__item) {
  transition: scale var(--press) var(--ease-out), transform var(--med) var(--ease), background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
:is(.envelope, .us-switch__btn, .segmented__option, .person-chip, .us-grid :is(.countdown, .record, .ms-us), .attach-menu__item):active { scale: 0.97; }

/* Attach menu and emoji picker grow from their own button, and leave the
   same way, a touch quicker than they arrived. */
.popover {
  animation: none;
  opacity: 1; scale: 1; translate: 0 0;
  transition: opacity 180ms var(--ease-out), scale 180ms var(--ease-out), translate 180ms var(--ease-out), display 180ms allow-discrete;
}
.popover.attach-menu { transform-origin: bottom right; }
.popover.emoji-picker { transform-origin: bottom left; animation: none; }
.popover[hidden] { opacity: 0; scale: 0.95; translate: 0 6px; pointer-events: none; transition-duration: 130ms; }
@starting-style { .popover:not([hidden]) { opacity: 0; scale: 0.95; translate: 0 6px; } }

/* Us: switching between story and favourites. */
[data-panel-body] { transition: opacity var(--fast) var(--ease-out); }
@starting-style { [data-panel-body]:not([hidden]) { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .popover, .popover[hidden] { scale: 1; translate: 0 0; }
}

/* The compact title that takes over when a page header scrolls away. */
.titlebar {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0;
  height: calc(env(safe-area-inset-top, 0px) + var(--island-room) + 44px);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 11px;
  font-family: var(--serif); font-size: 1.25rem; line-height: 1.1; color: var(--ink);
  background: var(--glass); border-bottom: 0.5px solid var(--hairline);
  -webkit-backdrop-filter: saturate(1.5) blur(20px); backdrop-filter: saturate(1.5) blur(20px);
  opacity: 0; pointer-events: none; transition: opacity var(--fast) var(--ease-out);
}
.titlebar--visible { opacity: 1; }
@media (min-width: 980px) { .titlebar { display: none; } }
.photo-viewer__stage { overflow: hidden; }
