/* SVG ANIMATION PROJECT
------------------------------------*/
/* SVG PROJECT HERO
------------------------------------*/
.svg-page header::before {
  background-image: url("../images/site-assets/bg-svg-mountain-sunrise.jpg");
  background-position: center 50%;
}
/* SKY DISK
------------------------------------*/
.sky-disk {
  display: block;
  position: relative;
  inset-block-start: 50%;
  inline-size: 100%;
  max-inline-size: none;
  block-size: auto;
  transform-origin: center;
  animation: skyRotate 15s linear infinite;
  animation-delay: 2s;
  animation-fill-mode: backwards;
  filter: saturate(0.55);
}
/* SKY DISK ROTATION
------------------------------------*/
@keyframes skyRotate {
  from {
    transform: rotate(0deg) scale(2.2);
  }

  to {
    transform: rotate(360deg) scale(2.2);
  }
}
/* SUN DISK
------------------------------------*/
.sun-disk {
  position: absolute;
  inset-block-start: -80%;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: auto;
  z-index: 1;
  animation: sunVisibility 15s linear infinite;
  animation-delay: 2s;
  animation-fill-mode: backwards;
}
/* SUN VISIBILITY
------------------------------------*/
@keyframes sunVisibility {
  0%,
  53% {
    opacity: 0;
  }

  60% {
    opacity: 0.15;
  }

  67% {
    opacity: 0.4;
  }

  74%,
  80% {
    opacity: 1;
  }

  87% {
    opacity: 0.6;
  }

  92% {
    opacity: 0.2;
  }
  97%,
  100% {
    opacity: 0;
  }
}
/* MOON DISK
------------------------------------*/
.moon-disk {
  position: absolute;
  inset-block-start: -80%;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: auto;
  z-index: 1;
  opacity: 1;
  animation: moonVisibility 15s linear infinite;
  animation-delay: 2s;
  animation-fill-mode: backwards;
}
/* MOON VISIBILITY
------------------------------------*/
@keyframes moonVisibility {
  0%,
  3% {
    opacity: 0;
  }

  10% {
    opacity: 0.15;
  }

  17% {
    opacity: 0.4;
  }

  24%,
  35% {
    opacity: 1;
  }

  42% {
    opacity: 0.6;
  }

  49% {
    opacity: 0.25;
  }

  55%,
  100% {
    opacity: 0;
  }
}
/* NIGHT STARS
------------------------------------*/
.night-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  animation: starsVisibility 15s linear infinite;
  animation-delay: 2s;
  animation-fill-mode: backwards;
}
/* STARS NIGHT VISIBILITY
------------------------------------*/
@keyframes starsVisibility {
  0%,
  10% {
    opacity: 0;
  }

  20%,
  30% {
    opacity: 1;
  }

  48%,
  100% {
    opacity: 0;
  }
}
/* SVG STAGE
------------------------------------*/
.svg-stage {
  display: flex;
  position: relative;
  isolation: isolate;
  justify-content: center;
  align-items: flex-start;
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
/* MOUNTAIN LANDSCAPE
------------------------------------*/
.mountain-landscape {
  position: absolute;
  inset-block-end: 0;
  inline-size: 100%;
  block-size: auto;
  z-index: 1;
}
/* ROAD BACKGROUND
------------------------------------*/
.road-bg {
  position: absolute;
  inset-block-end: 0;
  inline-size: 100%;
  block-size: auto;
  z-index: 2;
  transform: scaleY(0.6);
  transform-origin: bottom;
}
/* CAMPER VAN
------------------------------------*/
.camper-van {
  position: absolute;
  inset-block-end: 8%;
  inset-inline-start: 60%;
  inline-size: 28%;
  z-index: 3;
  animation: camperBounce 2s ease-in-out infinite;
  animation-delay: 2s;
  animation-fill-mode: backwards;
}
/* CAMPER HEADLIGHT
------------------------------------*/
.camper-headlight {
  position: absolute;
  inset-inline-end: 95%;
  inset-block-start: 55%;
  inline-size: 45%;
  block-size: 35%;
  background: linear-gradient(
    to left,
    rgba(255, 245, 180, 0.5),
    rgba(255, 245, 180, 0)
  );
  clip-path: polygon(100% 35%, 100% 65%, 0 100%, 0 0);
  pointer-events: none;

  animation: headlightVisibility 15s linear infinite;
  animation-delay: 2s;
  animation-fill-mode: backwards;
}
/* HEADLIGHT VISIBILITY
------------------------------------*/
@keyframes headlightVisibility {
  0%,
  30% {
    opacity: 1;
  }

  48%,
  100% {
    opacity: 0;
  }
}
/* CAMPER TAILLIGHT
------------------------------------*/
.camper-taillight {
  position: absolute;
  inset-inline-start: 99%;
  inset-block-start: 65%;
  inline-size: 10%;
  block-size: 25%;
  background: linear-gradient(
    to right,
    rgba(255, 65, 65, 0.65),
    rgba(255, 65, 65, 0)
  );
  clip-path: polygon(0 35%, 0 65%, 100% 100%, 100% 0);
  pointer-events: none;

  animation: taillightVisibility 15s linear infinite;
  animation-delay: 2s;
  animation-fill-mode: backwards;
}
/* TAILLIGHTS VISIBILITY
------------------------------------*/
@keyframes taillightVisibility {
  0%,
  8% {
    opacity: 0;
  }

  13%,
  40% {
    opacity: 1;
  }

  48%,
  100% {
    opacity: 0;
  }
}
/* CAMPER BOUNCE
------------------------------------*/
@keyframes camperBounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-0.25rem);
  }
}
.camper-body {
  display: block;
  inline-size: 100%;
  block-size: auto;
}
/* CAMPER WHEELS
------------------------------------*/
.rear-wheel,
.front-wheel {
  position: absolute;
  inset: 0;
}

/* Rear wheel */
.rear-wheel {
  animation: rearWheelBounce 1s ease-in-out infinite;
  animation-delay: 2s;
  animation-fill-mode: backwards;
}

/* Front wheel */
.front-wheel {
  animation: frontWheelBounce 1.3s ease-in-out -0.4s infinite;
  animation-fill-mode: backwards;
}
/* REAR WHEEL SUSPENSION
------------------------------------*/
@keyframes rearWheelBounce {
  0%,
  100% {
    transform: translateY(0);
  }

  25% {
    transform: translateY(0.0625rem);
  }

  50% {
    transform: translateY(0);
  }

  75% {
    transform: translateY(-0.0625rem);
  }
}

/* FRONT WHEEL SUSPENSION
------------------------------------*/
@keyframes frontWheelBounce {
  0%,
  100% {
    transform: translateY(0);
  }

  20% {
    transform: translateY(-0.0625rem);
  }

  45% {
    transform: translateY(0.0625rem);
  }

  70% {
    transform: translateY(-0.03125rem);
  }

  85% {
    transform: translateY(0);
  }
}
