/* =========================================================================
   MOTION LAYER
   Appended last, so it touches nothing above it. None of it applies unless
   #motion-js adds .has-anim to <html>, which it only does when the browser
   has IntersectionObserver and the visitor has not asked for reduced motion.
   Every element's data-anim is stripped the moment it has played, handing it
   straight back to its own hover and state rules.

   NOTE ON STRUCTURE: the start states below carry NO transition, and every
   transition lives on .is-in. That is deliberate. With the transition on the
   start state, tagging an element that is already on screen animates it from
   its normal appearance DOWN into the hidden state and straight back up — so
   it sits at full opacity through its own delay and never appears to move.
   Start states must snap; only the arrival is animated.

   To switch the whole thing off: delete this block and #motion-js.
   ========================================================================= */
html.has-anim [data-anim]{opacity:0;will-change:opacity,transform}

html.has-anim [data-anim="up"]   {transform:translate3d(0,40px,0)}
html.has-anim [data-anim="rise"] {transform:translate3d(0,70px,0)}
html.has-anim [data-anim="left"] {transform:translate3d(-56px,0,0)}
html.has-anim [data-anim="right"]{transform:translate3d(56px,0,0)}
html.has-anim [data-anim="fade"] {transform:none}
/* headings rise out of a mask — the one effect that should be unmissable */
html.has-anim [data-anim="head"] {transform:translate3d(0,52px,0);clip-path:inset(0 -12% 106% -12%)}
/* photographs wipe open from the bottom while the picture inside settles
   back from a zoom — the two together read as one movement */
html.has-anim [data-anim="wipe"]  {opacity:1;clip-path:inset(0 0 100% 0 round 6px)}
html.has-anim [data-anim="settle"]{opacity:1;transform:scale(1.22)}

/* ---- the arrival ---- */
html.has-anim [data-anim].is-in{
  opacity:1;transform:none;
  transition:opacity .95s cubic-bezier(.22,.68,.24,1),
             transform 1.05s cubic-bezier(.17,.73,.21,1),
             clip-path 1.05s cubic-bezier(.17,.73,.21,1);
  transition-delay:var(--d,0ms);
}
html.has-anim [data-anim="head"].is-in  {clip-path:inset(-40% -12% -40% -12%)}
html.has-anim [data-anim="wipe"].is-in  {clip-path:inset(0 0 0 0 round 6px);transition-duration:1.15s}
html.has-anim [data-anim="settle"].is-in{transition-duration:1.7s}

/* ---- shared by the home page and the inner pages ----
   Moved here from motion-signature.css (which only the home page loads) so
   an inner page's banner headline and the specials badge can use them.

   A word or a line rises out of a mask: */
html.has-anim [data-anim="word"]{transform:translate3d(0,.78em,0);clip-path:inset(0 -8% 108% -8%)}
html.has-anim [data-anim="word"].is-in{clip-path:inset(-30% -8% -30% -8%);transition-duration:1.15s}

/* a seal presses in like a wax stamp */
html.has-anim [data-anim="stamp"]{transform:rotate(-26deg) scale(1.8)}
html.has-anim [data-anim="stamp"].is-in{
  transition:opacity .38s ease var(--d,0ms),
             transform .95s cubic-bezier(.18,1.26,.36,1) var(--d,0ms);
}

/* stars land one after another */
html.has-anim [data-anim="pop"]{transform:scale(.25) rotate(-28deg)}
html.has-anim [data-anim="pop"].is-in{
  transition:opacity .26s ease var(--d,0ms),
             transform .6s cubic-bezier(.22,1.62,.4,1) var(--d,0ms);
}

/* The inner pages' banner photograph settles out of a push-in, the home
   hero's move at half the distance and a shorter run - it is a band, not a
   screen, and the same travel reads twice as large on it. .pbn is
   overflow:hidden, so the scale never reaches the page width. */
html.has-anim .pbn-media{transform:scale(1.07)}
html.has-anim.hero-ready .pbn-media{
  transform:none;
  transition:transform 2.4s cubic-bezier(.19,.72,.24,1);
}

/* the handwritten swashes draw themselves in */
html.has-anim [data-draw]{stroke-dasharray:var(--len);stroke-dashoffset:var(--len)}
html.has-anim [data-draw].is-in{
  stroke-dashoffset:0;
  transition:stroke-dashoffset 1.25s cubic-bezier(.33,.06,.22,1) var(--d,0ms);
}

/* the picture behind the hero settles out of a slow push-in */
html.has-anim .hero-media{transform:scale(1.16)}
html.has-anim.hero-ready .hero-media{
  transform:none;
  transition:transform 3s cubic-bezier(.19,.72,.24,1);
}

html.has-anim .discover-media img,
html.has-anim .discover-inner{will-change:transform}

@media (prefers-reduced-motion:reduce){
  html.has-anim [data-anim]{opacity:1!important;transform:none!important;clip-path:none!important;transition:none!important}
  html.has-anim [data-draw]{stroke-dasharray:none!important;stroke-dashoffset:0!important}
  html.has-anim .hero-media{transform:none!important;transition:none!important}
  html.has-anim .pbn-media{transform:none!important;transition:none!important}
  html.has-anim .discover-media img,
  html.has-anim .discover-inner{transform:none!important}
}
