/* JPL MOTION: the "at home" feel. Layers that rise forward, soften behind, and settle.
   Shared, additive, opt-in. A page links this file and its twin jpl-motion.js, then asks for an effect
   with an attribute or a class. Nothing here changes a font, a colour or a layout.

     data-reveal            fades and rises into place the first time it scrolls into view
     data-reveal-step       on a parent: its data-reveal children arrive one after another
     data-depth="recede"    softens, shrinks and fades as the page scrolls past it (sets --p, 0 to 1)
     .jm-pop                lifts toward you on hover, presses back on touch
     .jm-glass              a frosted bar (solid when the browser cannot blur, or the user asked for less)

   Compositor properties only (transform, opacity), so it stays smooth on a phone. Everything is off for
   anyone who asks their device for reduced motion, and the content is visible with no script at all. */
:root{
  --jm-out:cubic-bezier(.22,1,.36,1);        /* fast start, long soft landing */
  --jm-pop:cubic-bezier(.25,1,.4,1);         /* quick, then settles with no bounce */
  --jm-lift:0 22px 44px rgba(0,0,0,.50),0 3px 8px rgba(0,0,0,.32);
}

/* ---- arrive ---- */
html.js-motion [data-reveal]{
  opacity:0;transform:translate3d(0,20px,0) scale(.985);
  transition:opacity .75s var(--jm-out),transform .75s var(--jm-out);
  transition-delay:calc(var(--i,0) * 70ms);
  will-change:opacity,transform;
}
html.js-motion [data-reveal].jm-in{opacity:1;transform:none;will-change:auto}

/* ---- recede: a layer steps back as you scroll past ---- */
[data-depth="recede"]{
  transform:translate3d(0,calc(var(--p,0) * -34px),0) scale(calc(1 - var(--p,0) * .05));
  opacity:calc(1 - var(--p,0) * .92);
  transform-origin:left center;
  will-change:transform,opacity;
}
html[dir="rtl"] [data-depth="recede"]{transform-origin:right center}

/* ---- pop: forward on hover, pressed on touch ---- */
.jm-pop{transition:transform .38s var(--jm-pop),box-shadow .38s var(--jm-out),border-color .2s,opacity .3s}
@media (hover:hover){
  .jm-pop:hover,.jm-pop:focus-visible{transform:translate3d(0,-5px,0) scale(1.014);box-shadow:var(--jm-lift)}
}
.jm-pop:active{transform:scale(.972);box-shadow:none;transition-duration:.12s}

/* ---- a group where one thing steps forward and the rest fall back ---- */
@media (hover:hover){
  .jm-focus:hover > .jm-focus-i{opacity:.5}
  .jm-focus:hover > .jm-focus-i:hover,.jm-focus:hover > .jm-focus-i:focus-visible{opacity:1}
}
.jm-focus-i{transition:opacity .3s var(--jm-out),transform .38s var(--jm-pop),color .16s ease}

/* ---- glass ---- */
.jm-glass{
  background:rgba(9,15,27,.88);
  -webkit-backdrop-filter:blur(18px) saturate(150%);backdrop-filter:blur(18px) saturate(150%);
  box-shadow:inset 0 -1px 0 rgba(255,255,255,.10);
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.jm-glass{background:#05080d}}
@media (prefers-reduced-transparency:reduce){.jm-glass{background:#05080d;-webkit-backdrop-filter:none;backdrop-filter:none}}

/* ---- reduced motion: everything simply there ---- */
@media (prefers-reduced-motion:reduce){
  html.js-motion [data-reveal]{opacity:1;transform:none;transition:none}
  [data-depth="recede"]{transform:none;opacity:1}
  .jm-pop,.jm-pop:hover,.jm-pop:active,.jm-focus-i{transform:none;transition:none;box-shadow:none}
  .jm-focus:hover > .jm-focus-i{opacity:1}
}
