body {

  background: #1d1b1b;
}



.AtomAndBalls{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%);
}

.ball {

  position: absolute;
  left: 40%;
  top: 42%;
  z-index: -200;
  width: 12px;
  height: 12px;
  border-radius: 50px;
  box-shadow: 0 0 10px 5px rgb(221, 221, 183);
}

.ball:nth-child(1) {
  background: #FF0000;
  animation: right 1.5s infinite ease-in-out;
}

.ball:nth-child(2) {
  background: #00FF00;
  animation: left 2.4s infinite ease-in-out;
}

.ball:nth-child(3) {
  background: #8000FF;
  opacity: 1;
  z-index: 400;
  animation: center 2.5s infinite ease-in-out;
}

.ball:nth-child(4) {
  background: #00FFFF;
  animation: rightRev 1.5s infinite ease-in-out;
}

.ball:nth-child(5) {
  background: #da4d16;
  animation: leftRev 2.4s infinite ease-in-out;
}

.ball:nth-child(6) {
  background: rgb(236, 12, 188);
  z-index: 5;
  animation: centerRev 2.5s infinite ease-in-out;
}



@keyframes right {
  0% {
    transform: translate(-300px, 300px);
  }

  50% {
    transform: translate(250px, -250px);
  }

  100% {
    transform: translate(-300px, 300px);
  }
}

@keyframes left {
  0% {
    transform: translate(-300px, -300px);
  }

  50% {
    transform: translate(250px, 250px);
  }

  100% {
    transform: translate(-300px, -300px);
  }
}

@keyframes center {
  0% {
    transform: translateX(-300px);
  }

  50% {
    transform: translateX(300px);
  }

  100% {
    transform: translateX(-300px);
  }
}


@keyframes rightRev {
  0% {
    transform: translate(300px, -300px);
  }

  50% {
    transform: translate(-250px, 250px);
  }

  100% {
    transform: translate(300px, -300px);
  }
}

@keyframes leftRev {
  0% {
    transform: translate(300px, 300px);
  }

  50% {
    transform: translate(-250px, -250px);
  }

  100% {
    transform: translate(300px, 300px);
  }
}

@keyframes centerRev {
  0% {
    transform: translateX(300px);
  }

  50% {
    transform: translateX(-250px);

  }

  100% {
    transform: translateX(300px);
  }
}



/* Атом - Ядро */
.Atom {

  z-index: 300;
  --float: 10%;
  --radius: 4rem;
  background: rgb(236, 10, 2);
  border-radius: var(--radius);
  height: var(--radius);
  width: var(--radius);

  animation-name: floatAtom;
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;

  transition: background 3s;
}

.Atom:hover {
  background: rgb(2, 209, 236);

}

/* Атом - Декаратив для 3D */
.Atom::after {

  /* Позиция света  */
  --light-x: 30%;
  --light-y: 25%;
  /* базовый радиус светового пятна */
  --light-radius: 3%;

  background: radial-gradient(circle at var(--light-x) var(--light-y),
      rgba(255, 255, 255, 0.863),
      transparent calc(1 * var(--light-radius))),
    radial-gradient(circle at var(--light-x) var(--light-y),
      rgba(255, 255, 255, 0.8),
      transparent calc(2 * var(--light-radius))),
    radial-gradient(circle at var(--light-x) var(--light-y),
      rgba(255, 255, 255, 0.6),
      transparent calc(3 * var(--light-radius))),
    radial-gradient(circle at var(--light-x) var(--light-y),
      rgba(255, 255, 255, 0.4),
      transparent calc(4 * var(--light-radius))),
    radial-gradient(circle at var(--light-x) var(--light-y),
      rgba(255, 255, 255, 0.2),
      transparent calc(5 * var(--light-radius)));

  /* наследует скругление углов от родительского элемента, чтобы свечение выглядело корректно и не выходило за рамки*/
  border-radius: inherit;
  content: "";
  height: 100%;
  width: 100%;

  /* позиционирование в верхнем левом углу */
  left: 0;
  top: 0;

  /* для точного размещениея поверх атома */
  position: absolute;

}



/* Electrons */
/*************/

/* Electrons - Container */
.Atom-orbits {
  --color-line: #f3eaea;
  --color-glow: rgb(0, 255, 213);


  /* количество электронов */
  --electron-nb: 4;

  /* радиус орбиты электрона */
  --radius: 500%;

  border-radius: var(--radius);
  filter: drop-shadow(0 0 0.3rem var(--color-glow));
  height: var(--radius);
  left: calc(50% - var(--radius) / 2);
  position: absolute;
  top: calc(50% - var(--radius) / 2);
  width: var(--radius);


  /* линия орбиты */

  transition: filter 4s;
  /* плавная смена цвета */
}

.Atom-orbits:hover {
  --color-line: #f31212;
  filter: drop-shadow(0 0 0.3rem var(red));

}


/* Electrons - Base */
.Atom-orbits__electron {

  --clip-radius: 10%;
  --radius: 100%;

  /* сжатие для орбиты */
  --ratio: 3;
  border-radius: var(--radius);
  height: calc(var(--radius) / var(--ratio));
  left: calc(50% - var(--radius) / 2);
  position: absolute;
  top: calc(50% - var(--radius) / (var(--ratio) * 2));
  transform: rotateZ(calc(var(--index) * 180deg / var(--electron-nb)));
  width: var(--radius);
  z-index: 100;
}

/* Electrons - Light */
.Atom-orbits__electron::before,
.Atom-orbits__electron::after {
  border-radius: inherit;
  box-shadow: inset 0 var(--offset-direction) 0 0.02rem var(--color-line);
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
}

.Atom-orbits__electron::before {
  --offset-direction: 0.1rem;
}

.Atom-orbits__electron::after {
  --offset-direction: -0.1rem;
}



/****************/
/* Interactions */
/****************/
.Atom-orbits__electron:nth-child(1) {
  --index: 0;
}

.Atom-orbits__electron:nth-child(2) {
  --index: 1;
}

.Atom-orbits__electron:nth-child(3) {
  --index: 2;
}

.Atom-orbits__electron:nth-child(4) {
  --index: 3;
}

/* Electrons */
.Atom-orbits__electron {
  animation-name: orbitElectron;
  animation-delay: calc((var(--index) + 1) * 0.5s / var(--electron-nb));
  animation-duration: 0.4s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
}

/**************/
/* Animations */
/**************/

/* Atom - Makes the atom float */
@keyframes floatAtom {
  0% {
    transform: translateY(calc(-1 * var(--float)));
  }

  25% {
    transform: translateY(calc(-2 * var(--float)));
  }

  50% {
    transform: translateY(calc(-1 * var(--float)));
  }

  75% {
    transform: translateY(calc(0 * var(--float)));
  }

  100% {
    transform: translateY(calc(-1 * var(--float)));
  }
}

/* Electrons - Makes the electron's light orbit around the center */
@keyframes orbitElectron {
  0% {
    clip-path: ellipse(calc(2 * var(--clip-radius)) var(--clip-radius) at 50% 0);
  }

  25% {
    clip-path: ellipse(calc(2 * var(--clip-radius)) var(--clip-radius) at 0 50%);
  }

  50% {
    clip-path: ellipse(calc(2 * var(--clip-radius)) var(--clip-radius) at 50% 100%);
  }

  75% {
    clip-path: ellipse(calc(2 * var(--clip-radius)) var(--clip-radius) at 100% 50%);
  }

  100% {
    clip-path: ellipse(calc(2 * var(--clip-radius)) var(--clip-radius) at 50% 0);
  }
}




.button-inher {
  margin-top: 5%;
  display: flex;
  justify-content: space-evenly;
}

.button {
  color: white;
  background: #0D1127;
  padding: 1rem 3rem 1rem 3rem;
  border-radius: 5rem;
  border: 5px solid #5978F3;
  font-size: 1.2rem;
  line-height: 1em;
  letter-spacing: 0.075em;
}

.button-1:hover {
  color: rgb(0, 255, 55);
  border: 5px solid #59d83f;
}

.button-2:hover {
  color: rgb(255, 0, 0);
  border: 5px solid #d83f3f;
}
