/* ---------------------------------------------------------
   Dice
   --------------------------------------------------------- */

.hero__dice {
  position: relative;

  display: grid;
  place-items: center;

  width: min(440px, 42vw);
  aspect-ratio: 1;

  justify-self: center;

  perspective: 1200px;

  animation: dice-float 6s ease-in-out infinite;
}

.dice {
  position: relative;

  width: 150px;
  height: 150px;

  transform-style: preserve-3d;

  transform:
    rotateX(-24deg) rotateY(38deg) rotateZ(-8deg);

  animation:
    dice-rotate 16s linear infinite;
}

.dice__face {
  position: absolute;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  place-items: center;

  width: 150px;
  height: 150px;

  padding: 22px;

  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 25px;

  background:
    linear-gradient(145deg,
      rgba(103, 24, 217, 0.92),
      rgba(33, 118, 205, 0.88));

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -20px 35px rgba(0, 0, 0, 0.12),
    0 25px 70px rgba(103, 24, 217, 0.24);
}

.dice__face span {
  width: 19px;
  height: 19px;

  border-radius: 50%;

  background: var(--highlight);

  box-shadow:
    0 0 15px rgba(221, 244, 253, 0.4);
}

/* Dice faces */

.dice__face--front {
  transform: translateZ(75px);
}

.dice__face--back {
  transform: rotateY(180deg) translateZ(75px);
}

.dice__face--right {
  transform: rotateY(90deg) translateZ(75px);
}

.dice__face--left {
  transform: rotateY(-90deg) translateZ(75px);
}

.dice__face--top {
  transform: rotateX(90deg) translateZ(75px);
}

.dice__face--bottom {
  transform: rotateX(-90deg) translateZ(75px);
}

/* Face positioning */

.dice__face--front span:nth-child(1) {
  grid-area: 2 / 2;
}

.dice__face--back span:nth-child(1) {
  grid-area: 1 / 1;
}

.dice__face--back span:nth-child(2) {
  grid-area: 3 / 3;
}

.dice__face--right span:nth-child(1) {
  grid-area: 1 / 1;
}

.dice__face--right span:nth-child(2) {
  grid-area: 2 / 2;
}

.dice__face--right span:nth-child(3) {
  grid-area: 3 / 3;
}

.dice__face--left span:nth-child(1) {
  grid-area: 1 / 1;
}

.dice__face--left span:nth-child(2) {
  grid-area: 1 / 3;
}

.dice__face--left span:nth-child(3) {
  grid-area: 3 / 1;
}

.dice__face--left span:nth-child(4) {
  grid-area: 3 / 3;
}

.dice__face--top span:nth-child(1) {
  grid-area: 1 / 1;
}

.dice__face--top span:nth-child(2) {
  grid-area: 1 / 3;
}

.dice__face--top span:nth-child(3) {
  grid-area: 2 / 2;
}

.dice__face--top span:nth-child(4) {
  grid-area: 3 / 1;
}

.dice__face--top span:nth-child(5) {
  grid-area: 3 / 3;
}

.dice__face--bottom span:nth-child(1) {
  grid-area: 1 / 1;
}

.dice__face--bottom span:nth-child(2) {
  grid-area: 1 / 3;
}

.dice__face--bottom span:nth-child(3) {
  grid-area: 2 / 1;
}

.dice__face--bottom span:nth-child(4) {
  grid-area: 2 / 3;
}

.dice__face--bottom span:nth-child(5) {
  grid-area: 3 / 1;
}

.dice__face--bottom span:nth-child(6) {
  grid-area: 3 / 3;
}

.dice__shadow {
  position: absolute;

  bottom: 18%;

  width: 180px;
  height: 38px;

  border-radius: 50%;

  background: rgba(0, 0, 0, 0.45);

  filter: blur(20px);

  transform: scaleX(1.25);

  animation: dice-shadow 6s ease-in-out infinite;
}

/* ---------------------------------------------------------
   Dice orbit
   --------------------------------------------------------- */

.dice-orbit {
  position: absolute;

  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;

  pointer-events: none;
}

.dice-orbit--outer {
  width: 100%;
  height: 42%;

  transform: rotate(-28deg);

  box-shadow:
    0 0 50px rgba(103, 24, 217, 0.06);

  animation: orbit-outer 12s linear infinite;
}

.dice-orbit--inner {
  width: 76%;
  height: 32%;

  transform: rotate(48deg);

  border-color: rgba(23, 211, 239, 0.09);

  animation: orbit-inner 9s linear infinite reverse;
}