/* Mobile motion layer.
   Desktop keeps its pinned choreography; these rules only apply below 990px.

   Everything is driven by --skn-mm-p (0 = not yet arrived, 1 = settled), which
   JavaScript writes from scroll position so the motion tracks the finger
   instead of firing a one-shot transition. The default is the settled state, so
   copy is visible even if the script never runs.

   Two attributes are used per selector to outrank the `transform: none
   !important` mobile resets in the section stylesheets, which load later. */

@media screen and (max-width: 989px) {
  [data-skn-mm][data-skn-mm-v] {
    --skn-mm-p: 1;
    --skn-mm-x: 0px;
    --skn-mm-y: 34px;
    --skn-mm-blur: 0px;
    opacity: calc(0.06 + 0.94 * var(--skn-mm-p)) !important;
    transform: translate3d(
      calc((1 - var(--skn-mm-p)) * var(--skn-mm-x)),
      calc((1 - var(--skn-mm-p)) * var(--skn-mm-y)),
      0
    ) !important;
    filter: blur(calc((1 - var(--skn-mm-p)) * var(--skn-mm-blur))) !important;
  }

  [data-skn-mm='media'][data-skn-mm-v] {
    --skn-mm-y: 28px;
    --skn-mm-blur: 8px;
  }

  /* Rows that travel in from the side would otherwise widen the scrollable
     area and let the page slide horizontally: the document ends up ~16px wider
     than the viewport, and the fixed hero background then stretches to the
     scroll width and shows past the sections above it. Clip rather than hide,
     so no scroll container is created for sticky elements elsewhere. Each
     section stylesheet loads after this file, so the pinned wrappers need a
     second class to beat the same-specificity rules there. */
  .skn-manifesto,
  .skn-ritual,
  .skn-ingredient-theatre .skn-ingredient-theatre__pin,
  .skn-plain-facts .skn-plain-facts__pin {
    overflow-x: clip;
  }

  /* Images drift inside their clipped frame for the whole time the frame is
     on screen, which is what reads as movement on a phone. */
  [data-skn-mm-img][data-skn-mm-v] {
    --skn-mm-shift: 0px;
    transform: translate3d(0, var(--skn-mm-shift), 0) scale(var(--skn-mm-zoom, 1.12)) !important;
    opacity: 1 !important;
    filter: none !important;
    will-change: transform;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-skn-mm][data-skn-mm-v],
  [data-skn-mm-img][data-skn-mm-v] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
