
/* ===== home's chevron run, mirrored (chevslide.py) ===== */
/* .sh2-sheet is already position:relative on every one of the six. It is
   written again here so this placement cannot be undone by a change to
   somebody else's rule, which is the whole failure mode of an absolute
   child trusting a parent it does not own. */
html body .sh2-sheet{position:relative;}
html body .chev-vl{
  position:absolute;top:0;left:26%;z-index:6;
  transform:translateX(var(--cx,-140px));
  will-change:transform;pointer-events:none;}
@media (max-width:900px){html body .chev-vl{display:none;}}


/* ===== the bento block has a pulse (bentolife.py) ===== */
/* 1. THE MESH, on the bottom left tile. The tile is already
      overflow:hidden with a 26px radius, so these are clipped to its
      corners without this pass touching the frame. */
html body .bx-d > .bx-mesh,
html body .bx-c > .bx-mesh{
  position:absolute;inset:0;z-index:0;pointer-events:none;
  overflow:hidden;opacity:1;}
/* NO border-radius HERE, AND THAT IS THE SECOND TIME THIS EXACT TRAP HAS
   CAUGHT THIS FILE. This selector is html body .bx-mesh i, two classes
   and three elements, 0-2-3. Each blob's own rule is html body .bx-mesh1
   .bxm1, two classes and two elements, 0-2-2. Same class count, one fewer
   element name, so the shared rule WINS and every blob kept the 50 per
   cent circle while its eight value radius sat in the stylesheet doing
   nothing. The gradients changed, the shapes did not, and it only showed
   up by reading the computed border-radius back out of the browser.
   The shape now belongs entirely to the blob rules, so there is nothing
   left here for them to lose to. */
html body .bx-d > .bx-mesh i,
html body .bx-c > .bx-mesh i{
  position:absolute;display:block;
  filter:blur(34px);will-change:transform;}

/* AMORPHIC, NOT CIRCULAR. Matt, 13 October: "the mesh gradients seem a
   bit too geometrical, like circular, can they be more amorphic."
   
   He is describing three things at once and all three were true.
   
     the box        border-radius:50% is an ellipse, and an ellipse under
                    a blur is still visibly an ellipse
     the gradient   radial-gradient(circle, ...) puts a perfectly
                    concentric falloff inside it, so the blur softens the
                    edge without ever breaking the symmetry
     the motion     translate and a uniform scale move a circle around
                    and make it bigger. It stays the same shape the whole
                    way, which is what reads as geometric
   
   So all three change. Each blob gets an eight value border-radius, which
   is a different curve on every corner and on both axes; an ELLIPSE
   gradient with its focus off centre, so the bright part is not in the
   middle of the shape; and a transform that rotates and scales the two
   axes by different amounts, which turns an asymmetric shape through
   itself and reads as morphing without costing a layout.
   
   Animating border-radius would morph it literally, and it is the obvious
   way to do this. It is not used here: border-radius is not a compositor
   property, so six blurred elements morphing their own corners would
   repaint the whole block every frame, forever, on a page people leave
   open. A rotating asymmetric shape gets the same read off the GPU.
   
   The keyframes also have three stops rather than two. A two stop
   ease-in-out is a there and back, and a there and back is a rhythm you
   can hear. Three stops that do not retrace never settle into one. */

/* SET ONE, the bottom left tile. Matt, same day: "the mesh can be a
   slightly more obvious also". The alphas were .26, .30 and .17 under a
   38px blur at 90 per cent opacity; they are .36, .42 and .25 under 34px
   at full. */
html body .bx-mesh1 .bxm1{
  width:78%;height:94%;left:-24%;top:-30%;
  border-radius:58% 42% 63% 37% / 49% 57% 43% 51%;
  background:radial-gradient(ellipse at 42% 36%,
    rgba(0,238,204,.36),transparent 68%);
  animation:bxm-a 19s ease-in-out infinite;}
html body .bx-mesh1 .bxm2{
  width:86%;height:98%;right:-28%;top:4%;
  border-radius:38% 62% 45% 55% / 62% 38% 57% 43%;
  background:radial-gradient(ellipse at 58% 52%,
    rgba(84,110,255,.42),transparent 66%);
  animation:bxm-b 23s ease-in-out infinite;}
html body .bx-mesh1 .bxm3{
  width:68%;height:80%;left:18%;bottom:-30%;
  border-radius:52% 48% 34% 66% / 41% 63% 37% 59%;
  background:radial-gradient(ellipse at 36% 60%,
    rgba(0,238,204,.25),transparent 70%);
  animation:bxm-c 29s ease-in-out infinite;}

/* SET TWO, the top right tile, and it is a DIFFERENT SET rather than the
   same one moved. Matt: "make sure both are random so they don't copy
   each other as they shift."

   It is not random, and uncorrelated is the better thing to be. Random
   per page load would mean the two could come up aligned by chance, and
   nobody could ever reproduce the one that looked wrong. These cannot
   align, and the reason is arithmetic rather than luck:

     the bottom left   19s   23s   29s
     the top right     17s   31s   37s

   Six different primes, so no blob shares a period with any other blob
   and the whole six only return to their starting phase after the product
   of all six, which is 19*23*29*17*31*37 seconds. That is about 246,000
   years. On top of that the top right set starts part way through its own
   cycles with negative delays, so the two tiles do not even begin
   together on a fresh load, and its blobs sit in different corners, have
   different curves and travel on different paths. */
html body .bx-mesh2 .bxm1{
  width:88%;height:86%;right:-26%;top:-24%;
  border-radius:64% 36% 41% 59% / 36% 64% 46% 54%;
  background:radial-gradient(ellipse at 62% 44%,
    rgba(84,110,255,.40),transparent 66%);
  animation:bxm-d 17s ease-in-out infinite;animation-delay:-6s;}
html body .bx-mesh2 .bxm2{
  width:72%;height:96%;left:-24%;top:10%;
  border-radius:43% 57% 68% 32% / 55% 36% 64% 45%;
  background:radial-gradient(ellipse at 40% 58%,
    rgba(0,238,204,.34),transparent 68%);
  animation:bxm-e 31s ease-in-out infinite;animation-delay:-13s;}
html body .bx-mesh2 .bxm3{
  width:80%;height:76%;right:10%;bottom:-28%;
  border-radius:35% 65% 55% 45% / 60% 44% 56% 40%;
  background:radial-gradient(ellipse at 54% 34%,
    rgba(0,238,204,.23),transparent 70%);
  animation:bxm-f 37s ease-in-out infinite;animation-delay:-21s;}

/* Three stops, none of them retracing, and a rotation in every one. */
@keyframes bxm-a{
  0%,100%{transform:translate3d(0,0,0) rotate(0deg) scale(1,1);}
  34%{transform:translate3d(20%,10%,0) rotate(38deg) scale(1.16,.9);}
  67%{transform:translate3d(28%,20%,0) rotate(-24deg) scale(.92,1.2);}}
@keyframes bxm-b{
  0%,100%{transform:translate3d(0,0,0) rotate(0deg) scale(1.06,1);}
  36%{transform:translate3d(-14%,-18%,0) rotate(-31deg) scale(.88,1.14);}
  71%{transform:translate3d(-24%,-6%,0) rotate(19deg) scale(1.18,.94);}}
@keyframes bxm-c{
  0%,100%{transform:translate3d(0,0,0) rotate(0deg) scale(1,1);}
  31%{transform:translate3d(-18%,-14%,0) rotate(27deg) scale(1.22,1.04);}
  64%{transform:translate3d(-8%,-24%,0) rotate(-35deg) scale(.96,1.18);}}
@keyframes bxm-d{
  0%,100%{transform:translate3d(0,0,0) rotate(0deg) scale(1.1,1);}
  38%{transform:translate3d(-22%,16%,0) rotate(-26deg) scale(.92,1.16);}
  73%{transform:translate3d(-10%,26%,0) rotate(33deg) scale(1.14,.9);}}
@keyframes bxm-e{
  0%,100%{transform:translate3d(0,0,0) rotate(0deg) scale(.96,1.04);}
  33%{transform:translate3d(18%,-12%,0) rotate(29deg) scale(1.2,.92);}
  69%{transform:translate3d(26%,-22%,0) rotate(-18deg) scale(.9,1.16);}}
@keyframes bxm-f{
  0%,100%{transform:translate3d(0,0,0) rotate(0deg) scale(1.14,.98);}
  35%{transform:translate3d(14%,-18%,0) rotate(-33deg) scale(.9,1.2);}
  72%{transform:translate3d(22%,-28%,0) rotate(22deg) scale(1.1,.94);}}
/* and the tile's own words stay in front of it */
html body .bx-d > :not(.bx-mesh),
html body .bx-c > :not(.bx-mesh){position:relative;z-index:1;}

/* 2. THE PARALLAX LAYER. Taller than the tile and offset, so there is
      room to move without showing an edge. It INHERITS the tile's own
      background-image rather than being told a path: the photograph on
      these two is chosen elsewhere, and a second copy of the filename
      here would be a second thing to keep in step. */
html body .bx-img > .bx-par{
  position:absolute;left:0;right:0;top:var(--par-top,-14%);
  height:var(--par-h,128%);
  z-index:0;pointer-events:none;
  background-image:inherit;
  background-size:cover;
  background-position:inherit;
  transform:translate3d(0,var(--py,0px),0);
  will-change:transform;}

/* 3. THE SIX GLIDE IN, IN READING ORDER. Matt, 13 October: "could the
      boxes sliding in from the bottom be more obvious, it's a bit too
      subtle to catch the eye / feel exciting and gliding."

      Measured first. The site's reveal is a 26px rise and a fade over
      0.8s on the browser's own `ease`, and with a 70ms step across six
      tiles the whole cascade is done in 1.15s. Four numbers, and all
      four are working against him:

        26px    less than a tenth of a 302px tile, so the tile is
                basically already where it lands before you notice it
        ease    symmetrical. It accelerates as much as it decelerates,
                which is the curve that reads as "a thing moved" rather
                than "a thing arrived"
        0.8s    short enough that the travel is over before the eye
                finds it
        70ms    a cascade you cannot count

      So: 56px of travel, 1.15s, and a steep decelerating curve that does
      most of its distance early and settles slowly, which is the whole
      of what "gliding" means. The step goes to 110ms, which spreads the
      six over 1.7s and makes the order legible. And a 0.965 scale comes
      off with the rise, so they arrive forward as well as up.

      SCOPED TO THE BENTO ONLY. The .rv reveal is on hundreds of elements
      across the site and this is a decision about one block. Written as
      html body .bento > .bx.rv, three classes and two elements, which
      outranks the .rv rule it has to beat. Verified by reading the
      computed values back rather than by counting selectors, because
      counting selectors has been wrong twice in this file today. */
html body .bento > .bx.rv{
  transform:translate3d(0,56px,0) scale(.965);
  transition-duration:1.15s,1.15s;
  transition-timing-function:
    cubic-bezier(.17,.84,.3,1),cubic-bezier(.17,.84,.3,1);
  will-change:transform,opacity;}
html body .bento > .bx.rv.on{transform:none;}
html body .bento > .bx:nth-child(1){transition-delay:0s;}
html body .bento > .bx:nth-child(2){transition-delay:.11s;}
html body .bento > .bx:nth-child(3){transition-delay:.22s;}
html body .bento > .bx:nth-child(4){transition-delay:.33s;}
html body .bento > .bx:nth-child(5){transition-delay:.44s;}
html body .bento > .bx:nth-child(6){transition-delay:.55s;}

@media (prefers-reduced-motion:reduce){
  /* NAMED ONE BY ONE, NOT AS `i`, AND THAT IS NOT STYLE. The rules that
     start these animations are html body .bx-d > .bx-mesh .bxm1, which is
     0-3-2. A reduce rule written against the element, .bx-mesh i, is
     0-2-3, and three classes beat two however many element names follow.
     Tested with reduced motion on: the mesh carried on drifting. */
  html body .bx-mesh1 .bxm1,html body .bx-mesh1 .bxm2,
  html body .bx-mesh1 .bxm3,html body .bx-mesh2 .bxm1,
  html body .bx-mesh2 .bxm2,html body .bx-mesh2 .bxm3{animation:none;}
  html body .bx-img > .bx-par{transform:none;}
  html body .bento > .bx{transition-delay:0s;}
  html body .bento > .bx.rv{transform:none;}
}
