/* Motion and feeling: Bi, the three reward tiers, the journey map and the living skill pictures.
   Everything here is decoration on top of working screens, and all of it rests when the device
   asks for reduced motion. */

/* ---------- Bi ---------- */
.bi {
  flex: none;
  overflow: visible;
  filter: drop-shadow(0 3px 3px rgba(25, 30, 59, 0.2));
}
.bi * {
  transform-box: fill-box;
}
/* 2.5D: Bi is a thick block that turns toward the pointer. --bi-x / --bi-y run from -1 to 1. */
.bi {
  rotate: calc(var(--bi-y, 0) * -1) var(--bi-x, 0) 0 calc(var(--bi-m, 0) * 22deg);
  transition: rotate 0.22s ease-out;
  will-change: rotate;
}
.bi .bi-face {
  translate: calc(var(--bi-x, 0) * 2.6px) calc(var(--bi-y, 0) * 2.2px);
  transition: translate 0.22s ease-out;
}
.bi .bi-star {
  translate: calc(var(--bi-x, 0) * 4px) calc(var(--bi-y, 0) * 3px);
  transition: translate 0.22s ease-out;
}
.bi .bi-slice {
  translate: calc(var(--bi-x, 0) * var(--bi-d, 1) * -0.9px)
    calc(var(--bi-y, 0) * var(--bi-d, 1) * -0.35px);
  transition: translate 0.22s ease-out;
}
.bi .bi-ground {
  translate: calc(var(--bi-x, 0) * -5px) 0;
  transition: translate 0.22s ease-out;
}
.bi-companion,
.bi-card-art,
.bi-dock-face,
.jm-line,
.bi-toast {
  perspective: 420px;
}
/* ---------- Bi in 3D ----------
   A real 3D scene: the wrapper is the camera, the stage holds the extruded block. Nothing between
   them may flatten it, so the wrapper carries no filter. */
.bi.bi3 {
  position: relative;
  display: inline-block;
  rotate: none;
  filter: none;
  perspective: 560px;
  will-change: auto;
}
.bi3-sway,
.bi3-stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.bi3-sway {
  animation: bi3Sway 5.2s ease-in-out infinite;
}
.bi3-stage {
  transform: rotateZ(var(--bi-tilt, 0deg)) rotateY(calc(-10deg + var(--bi-x, 0) * 38deg))
    rotateX(calc(5deg + var(--bi-y, 0) * -24deg));
  transition: transform 0.22s ease-out;
}
.bi3-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  /* the block is a fifth as deep as Bi is wide */
  transform: translateZ(calc(var(--z) * var(--bi-s, 64) * 0.2px));
}
.bi3-float {
  transform: translateZ(calc(var(--z) * var(--bi-s, 64) * 0.2px));
}
.bi3 .bi-star,
.bi3 .bi-face {
  translate: none;
}
/* The light stays put while Bi turns: the face brightens as it turns toward the upper left. */
.bi3-shine {
  opacity: calc(0.1 - var(--bi-x, 0) * 0.1 - var(--bi-y, 0) * 0.06);
  transition: opacity 0.22s ease-out;
}
/* A shadow lying on a real floor plane under Bi. */
.bi3-floor {
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 4%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(25, 30, 59, 0.3), rgba(25, 30, 59, 0));
  transform: translateY(42%) rotateX(74deg) translateX(calc(var(--bi-x, 0) * -8%));
  transition: transform 0.22s ease-out;
}
@keyframes bi3Sway {
  0%,
  100% {
    transform: rotateY(-9deg);
  }
  50% {
    transform: rotateY(11deg);
  }
}
