/* Meet the Bryants: movement tied to scrolling, run by the browser itself where it can.
   The browser moves these on its own thread, in step with the scroll, so nothing lags the finger.
   site-scroll.js marks the elements and sets the numbers; browsers without scroll-driven animations get the same movement from the script. */
@media (prefers-reduced-motion: reduce) {
  [data-ss="grow"] { transform: scale(1) !important; }
  [data-ss="row"] { transform: translateX(0) !important; }
  [data-ss="word"] { opacity: 1 !important; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes sf-pt { from { translate: calc(var(--sf-d, 0px) * -1) var(--sf-d, 0px); } to { translate: var(--sf-d, 0px) calc(var(--sf-d, 0px) * -1); } }
    @keyframes sf-ps { from { scale: 1.02; } to { scale: 1; } }
    @keyframes sf-grow { from { transform: scale(var(--sf-s0, 0.9)); } to { transform: scale(1); } }
    @keyframes sf-row { from { transform: translateX(2vw); } to { transform: translateX(calc(-86vw - 36px)); } }
    @keyframes sf-cu { from { transform: translateY(40px); } to { transform: translateY(-40px); } }
    @keyframes sf-cd { from { transform: translateY(-25px); } to { transform: translateY(25px); } }
    @keyframes sf-word { from { opacity: 0.2; } to { opacity: 1; } }
    html.sf-sd [data-ssc] { overflow: clip !important; }
    [data-ssf] { view-timeline: --sf-fr block; }
    [data-ssw] { view-timeline: --sf-wr block; }
    [data-ssl] { view-timeline: --sf-ln block; }
    /* large framed photos: diagonal drift, plus a 2% zoom that eases out */
    html.sf-sd img[data-ss="para"] { animation: sf-pt linear both, sf-ps cubic-bezier(0.215, 0.61, 0.355, 1) both; animation-timeline: --sf-fr, --sf-fr; animation-range: cover 0% cover 100%; }
    /* photos that grow to full size: top reaches the bottom of the screen, then 30% from the top (service pages: center to center) */
    html.sf-sd [data-ss="grow"] { animation: sf-grow linear both; animation-timeline: view(); animation-range: cover 0% cover 70vh; }
    html.sf-sd [data-ss="grow"][data-sc] { animation-range: cover 0% cover 50%; }
    /* homepage partnership row */
    html.sf-sd [data-ss="row"] { animation: sf-row linear both; animation-timeline: --sf-wr; animation-range: cover 0% cover 85vh; }
    html.sf-sd [data-ss="cols"] > li:nth-child(odd) { animation: sf-cu linear both; animation-timeline: --sf-wr; animation-range: cover 0% cover 100%; }
    html.sf-sd [data-ss="cols"] > li:nth-child(even) { animation: sf-cd linear both; animation-timeline: --sf-wr; animation-range: cover 0% cover 100%; }
    /* words darken one after another as the line is read: line top 85% down the screen until its bottom is halfway up */
    html.sf-sd [data-ss="word"] { animation: sf-word linear both; animation-timeline: --sf-ln; animation-range: cover calc(15vh + (var(--i) / var(--n)) * (100% - 65vh)) cover calc(15vh + ((var(--i) + 1) / var(--n)) * (100% - 65vh)); }
  }
}
