/* The landing page's faces, bots and crowds (docs/site.md, src/crowd.ts, src/figure.ts). A piece is placed by
   its middle and its width, as shares of its crowd's box, and wears one wrapper per motion: .dr is the hand's tug,
   .en the arrival and the hop, .fy and .fr the floating. Loops run only for those who did not ask for less motion. */

.face {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
/* What waits for you has a dot on its corner. */
.asks {
  position: relative;
}

/* A bot with its thing: the face's own square, and what it holds over it. */
.fig {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
.fig > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.fig > .held {
  inset: auto;
  width: 44%;
  height: 44%;
}
.held.laptop {
  left: 28%;
  bottom: -16%;
}
.held.ask {
  right: -22%;
  top: -24%;
}
.held.zed {
  right: -26%;
  top: -30%;
}
.thing {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: visible;
}

.crowd-line,
.closing-crowd {
  position: relative;
  container-type: size;
  user-select: none;
}
/* One line of bots across the page. On a narrow window it keeps its size and its ends run off the sides. */
.line-clip {
  display: flex;
  justify-content: center;
  margin: var(--after-head) calc(var(--inset) * -1) 0;
  overflow-x: clip;
}
.crowd-line {
  flex: none;
  width: max(100%, 46rem);
  aspect-ratio: 100 / 15;
}
.closing-crowd {
  width: min(100%, 22rem);
  aspect-ratio: 22 / 11;
}

.it {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--s) * 1cqw);
  z-index: 1;
  transform: translate(-50%, -50%) rotate(var(--lean, 0deg));
  cursor: grab;
}
.it.held-by-hand {
  cursor: grabbing;
  z-index: 2;
}
.it.soft {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--soft);
  z-index: 0;
  cursor: auto;
}
.en {
  transform-origin: 50% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .fy {
    animation: fy var(--d) ease-in-out var(--dl) infinite alternate;
  }
  .fr {
    animation: fr var(--d) ease-in-out var(--dl) infinite alternate;
  }
  .runs {
    animation: run 1.5s linear infinite;
  }
  .held {
    animation: bob 2.2s ease-in-out -0.8s infinite alternate;
  }
  .held.laptop {
    animation: none;
  }
}
@keyframes fy {
  from {
    transform: translateY(var(--y0));
  }
  to {
    transform: translateY(var(--y1));
  }
}
@keyframes fr {
  from {
    transform: rotate(var(--r0));
  }
  to {
    transform: rotate(var(--r1));
  }
}
@keyframes run {
  to {
    stroke-dashoffset: var(--around);
  }
}
@keyframes bob {
  from {
    transform: translateY(-4%);
  }
  to {
    transform: translateY(5%);
  }
}
