:root { --ease: cubic-bezier(.16, 1, .3, 1); --ease-io: cubic-bezier(.76, 0, .24, 1); }

/* Reveals. Hidden states exist only under html.motion */
.motion .rv--txt { opacity: 0; transform: translateY(10px); transition: opacity .6s ease var(--d, 0ms), transform .7s var(--ease) var(--d, 0ms); }
.motion .rv--txt.in { opacity: 1; transform: none; }
.motion .roster tr.rv--txt { transform: none; }
/* Photos fade in over their colour block, only once decoded (see motion.js) */
.motion .rv--img > img { transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.motion .rv--img:not(.in) > img { opacity: 0; }
/* Already on screen after a page change: arrives with the cross-fade, no separate animation */
.motion .rv-now, .motion .rv-now > img, .motion .rv-now .w__i { transition: none !important; }

/* Headlines rise word by word from behind a mask */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .16em; margin-bottom: -.16em; }
.w__i { display: inline-block; }
.motion .rv-split .w__i { transform: translateY(112%); transition: transform .8s var(--ease) calc(var(--i) * 40ms); }
.motion .rv-split.in .w__i { transform: none; }

/* Sliding indicators */
.ink { position: absolute; left: 0; bottom: 0; height: 2px; width: var(--w, 0); background: var(--accent); transform: translateX(var(--x, 0)); transition: transform .6s var(--ease), width .6s var(--ease); pointer-events: none; }
.tabs { position: relative; }
.mainnav .ink { bottom: 6px; }
.mainnav.has-ink > .is-current { box-shadow: none; }
.tabs.has-ink .tab[aria-current="page"] { border-color: transparent; }

/* Banner drift. The clamp keeps the photo covering the banner at every size.
   The photo is enlarged from its right edge (see team.css), so the pagoda there is never cut off. */
.banner img { transform: translateY(clamp(-5%, var(--py, 0px), 5%)) scale(1.12); will-change: transform; }

/* Reading progress on stories */
.progress { position: fixed; inset: 0 0 auto; z-index: 30; height: 2px; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; pointer-events: none; }

/* Page transitions */
.mainnav { view-transition-name: mainnav; }
::view-transition-old(root) { animation: vt-out .22s ease both; }
::view-transition-new(root) { animation: vt-in .32s ease both; }
::view-transition-group(story-photo) { z-index: 5; animation-duration: .6s; animation-timing-function: var(--ease-io); }
::view-transition-old(story-photo), ::view-transition-new(story-photo) { height: 100%; width: 100%; object-fit: cover; overflow: clip; }
/* The clicked photo stays solid while it travels; the final crop only fades in at the end, so faces never double up */
::view-transition-old(story-photo) { animation: none; opacity: 1; }
::view-transition-new(story-photo) { animation: vt-in .22s ease .42s both; }
/* Nothing to hand over to: never leave a lone photo sitting on top of the page */
::view-transition-old(story-photo):only-child { animation: vt-out .15s ease both; }
.storycard__photo { background-color: var(--blank) !important; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ink { transition: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
