
/* FLOATING PARTICLES — ARRABBANI BLOG */

#app {
  position: relative;
  z-index: 1;
}

.floating-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-particles span {
  position: absolute;
  bottom: -20px;
  width: 5px;
  height: 5px;
  border-radius: 50%;

  background: #b7efbe;
  box-shadow: 0 0 12px rgba(183,239,190,.5);

  opacity: 0;
  animation: particleFloat 22s linear infinite;
}

.floating-particles span:nth-child(1)  {left:5%;animation-delay:-12s}
.floating-particles span:nth-child(2)  {left:14%;animation-delay:-5s;animation-duration:27s}
.floating-particles span:nth-child(3)  {left:24%;animation-delay:-18s;width:3px;height:3px}
.floating-particles span:nth-child(4)  {left:34%;animation-delay:-8s;animation-duration:18s}
.floating-particles span:nth-child(5)  {left:43%;animation-delay:-15s}
.floating-particles span:nth-child(6)  {left:51%;animation-delay:-3s;width:7px;height:7px}
.floating-particles span:nth-child(7)  {left:60%;animation-delay:-20s}
.floating-particles span:nth-child(8)  {left:68%;animation-delay:-11s;animation-duration:29s}
.floating-particles span:nth-child(9)  {left:75%;animation-delay:-7s}
.floating-particles span:nth-child(10) {left:82%;animation-delay:-17s;width:3px;height:3px}
.floating-particles span:nth-child(11) {left:90%;animation-delay:-4s}
.floating-particles span:nth-child(12) {left:96%;animation-delay:-14s;animation-duration:26s}
.floating-particles span:nth-child(13) {left:29%;animation-delay:-23s}

@keyframes particleFloat {
  0% {
    transform: translate3d(0,0,0) scale(.6);
    opacity: 0;
  }
  15% {
    opacity: .6;
  }
  80% {
    opacity: .4;
  }
  100% {
    transform: translate3d(65px,-110vh,0) scale(1.2);
    opacity: 0;
  }
}

@media (max-width: 670px) {
  .floating-particles span:nth-child(2n) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-particles {
    display: none;
  }
}


/* MAGNETIC ARTICLE CARDS */

@media (hover: hover) and (pointer: fine)
       and (prefers-reduced-motion: no-preference) {

  .posts-grid .post:not(.skeleton) {
    transform: perspective(950px) translate3d(0,0,0);
    backface-visibility: hidden;
    transition:
      transform .32s cubic-bezier(.2,.7,.2,1),
      border-color .25s ease,
      box-shadow .25s ease;
  }

  .posts-grid .post:not(.skeleton):hover,
  .posts-grid .post.is-magnetic {
    transform:
      perspective(950px)
      translate3d(
        var(--mag-x, 0px),
        calc(-6px + var(--mag-y, 0px)),
        0
      )
      rotateX(var(--mag-rx, 0deg))
      rotateY(var(--mag-ry, 0deg));

    border-color: rgba(183,239,190,.58);
    box-shadow:
      0 18px 42px rgba(0,0,0,.32),
      0 0 0 1px rgba(183,239,190,.08),
      0 0 28px rgba(125,207,149,.08);
  }

  .posts-grid .post.is-magnetic {
    transition:
      transform .12s ease-out,
      border-color .25s ease,
      box-shadow .25s ease;
  }

  .posts-grid .post:not(.skeleton)::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 2;
    pointer-events: none;
    opacity: 0;

    background: radial-gradient(
      340px circle at
      var(--mag-spot-x, 50%)
      var(--mag-spot-y, 50%),
      rgba(183,239,190,.12),
      transparent 67%
    );

    transition: opacity .2s ease;
  }

  .posts-grid .post.is-magnetic::after {
    opacity: 1;
  }
}

.posts-grid .post:focus-within {
  border-color: #b7efbe;
}
