/* Fab Mater. Scroll and touch motion (theme 1.4.0, assets/js/motion.js). Individual transform properties
   (translate, rotate, scale) so nothing here fights the transitions of site.css. Reduced motion: none of it. */
html{-webkit-tap-highlight-color:transparent}

/* hero, manifesto, footer: moved by the scroll */
html.fm-motion .hero__title .w,html.fm-motion .hero__mark,html.fm-motion .manifesto__title .w{will-change:translate}
.foot__row{overflow-x:clip}
.foot__l{display:inline-block}
html.fm-motion .foot__l{will-change:translate}

/* a tap on the hero mark: the bars squash and spring back */
.hero__mark svg{transform-origin:50% 100%}
.hero__mark.is-tap svg{animation:fm-squash .7s cubic-bezier(.3,1.6,.4,1)}
@keyframes fm-squash{0%{transform:none}18%{transform:scale(1.08,.84)}46%{transform:scale(.97,1.07)}100%{transform:none}}

/* pictures drift inside their frames */
html.fm-motion .piece__img img,html.fm-motion .context .slice__half img,html.fm-motion .piece-page__media .slice__half img,html.fm-motion .others__img img{scale:1.1;will-change:translate}

/* tap feedback */
.send,.nav__menu,.xbtn,.plain,.crumbs a,.foot__nav a,.foot__base a,.piece__img,.others__img{transition-property:transform,scale,opacity,clip-path;transition-duration:.25s;transition-timing-function:cubic-bezier(.2,.8,.1,1)}
.send:active,.plain:active,.crumbs a:active,.foot__nav a:active,.foot__base a:active{scale:.96}
.nav__menu:active,.xbtn:active{scale:.9}
.piece__btn:active .piece__img,.others a:active .others__img{scale:.97}

/* menu: the ground drops in, the links rise one after another */
html.fm-motion .menu:not([hidden]){animation:fm-menu .55s cubic-bezier(.7,0,.2,1) both}
html.fm-motion .menu:not([hidden]) nav a{animation:fm-menu-a .7s cubic-bezier(.2,.8,.1,1) both;animation-delay:calc(.18s + var(--i,0) * .07s)}
@keyframes fm-menu{from{clip-path:inset(0 0 100% 0)}to{clip-path:inset(0)}}
@keyframes fm-menu-a{from{translate:0 .9em;opacity:0}}

/* ---------- Touch screens ---------- */
@media (hover:none),(pointer:coarse){
  /* statement: the halves follow the scroll (--j: 0 apart, 1 shut); a tap holds them shut */
  html.fm-motion .statement .slice.is-in.fm-scrub .slice__half--a{translate:calc(var(--gx) * -.35 * (1 - var(--j,0))) calc(var(--gy) * -.35 * (1 - var(--j,0)));transform:translate(calc(var(--s) * -.7 * (1 - var(--j,0))),calc(var(--s) * -.7 * (1 - var(--j,0))));transition:none}
  html.fm-motion .statement .slice.is-in.fm-scrub .slice__half--b{translate:calc(var(--gx) * (1 - var(--j,0))) calc(var(--gy) * (1 - var(--j,0)));transform:translate(calc(var(--s) * .7 * (1 - var(--j,0))),calc(var(--s) * .7 * (1 - var(--j,0))));transition:none}
  html.fm-motion .statement .slice.is-in.fm-scrub .slice__line{translate:calc(var(--gx) * .3 * (1 - var(--j,0))) calc(var(--gy) * .3 * (1 - var(--j,0)));opacity:calc(1 - var(--j,0));transition:none}
  html.fm-motion .statement .slice{cursor:pointer}
  html.fm-motion .statement .slice.is-tap{animation:fm-tap .45s cubic-bezier(.3,1.6,.4,1)}
  @keyframes fm-tap{30%{scale:.975}}
  /* the other cut pictures: halves a little apart off centre, the diagonal fading as each is centred */
  html.fm-motion .slice:not(.statement .slice) .slice__half--a{translate:calc(-5px * (1 - var(--j,1))) calc(-5px * (1 - var(--j,1)))}
  html.fm-motion .slice:not(.statement .slice) .slice__half--b{translate:calc(5px * (1 - var(--j,1))) calc(5px * (1 - var(--j,1)))}
  html.fm-motion .slice:not(.statement .slice) .slice__line{opacity:calc(1 - var(--j,0))}
  html.fm-motion .sheet .slice .slice__half,html.fm-motion .sheet .slice .slice__line{translate:none;opacity:1}
  /* pieces: the diagonal is wiped from the piece in front */
  .piece__img.is-centre::after{clip-path:inset(100% 0 0 100%);opacity:0;transition:clip-path .6s var(--ease),opacity .6s}
}

/* ---------- Phones: the collection is a rail swiped sideways ---------- */
.pieces__rail{display:none}
@media (max-width:759px){
  .pieces.pieces--rail{position:relative;display:flex;gap:14px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;
    margin:0 calc(var(--gut) * -1);padding:0 var(--gut);scroll-padding:0 var(--gut);scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .pieces.pieces--rail::-webkit-scrollbar{display:none}
  .pieces--rail .piece{flex:0 0 84%;scroll-snap-align:start}
  .pieces--rail .piece--wide .piece__img{aspect-ratio:3/2}
  .pieces--rail .piece__btn{transform-origin:50% 40%;will-change:scale,opacity}
  .pieces__rail{display:flex;align-items:center;gap:16px;margin-top:22px;font-stretch:125%;font-weight:700;font-size:12px;letter-spacing:.2em}
  .pieces__count b{color:var(--red);font-weight:800}
  .pieces__rail i{flex:1;height:2px;background:rgba(255,255,255,.25);overflow:hidden}
  .pieces__rail i b{display:block;height:100%;background:var(--white);transform-origin:0 50%;scale:.5 1}
}
@media (prefers-reduced-motion:reduce){.pieces.pieces--rail{scroll-behavior:auto}}
@media (max-width:759px){
  html.js:not(.rm) .pieces--rail:has(.piece.is-in) .piece{transform:none;opacity:1}
  html.js:not(.rm) .pieces--rail .piece:nth-child(2){transition-delay:.12s}
}
