/**
 * Scroll Animations
 * スクロールに応じて表示されるアニメーション
 */

/* 左から右へフェードイン */
.left-to-right {
  opacity: 0;
  transform: translateX(-200px);
  transition: all 1s;
}
.left-to-right.scrollin {
  opacity: 1;
  transform: translate(0);
}

/* 下から上へフェードイン（3段階） */
.down-to-top1 {
  opacity: 0;
  transform: translateY(80px);
  transition: all 1s;
}
.down-to-top2 {
  opacity: 0;
  transform: translateY(100px);
  transition: all 1s;
}
.down-to-top3 {
  opacity: 0;
  transform: translateY(110px);
  transition: all 1s;
}
.down-to-top1.scrollin,
.down-to-top2.scrollin,
.down-to-top3.scrollin {
  opacity: 1;
  transform: translateY(0);
}

/* モバイルではアニメーション量を抑える */
@media (max-width: 767.98px) {
  .down-to-top1,
  .down-to-top2,
  .down-to-top3 {
    opacity: 0;
    transform: translateY(1px);
    transition: all 1s;
  }
  .down-to-top1.scrollin,
  .down-to-top2.scrollin,
  .down-to-top3.scrollin {
    opacity: 1;
    transform: translateY(0);
  }
}

/**
 * Customer Logo Scroll Animation
 */
@keyframes customer-logo-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

/**
 * CTA Button Slide Animations
 */
@keyframes slidein {
  0% {
    right: -100px;
  }
  100% {
    right: 0;
  }
}
@keyframes slideout {
  0% {
    right: 0;
  }
  100% {
    right: -100px;
  }
}
@media (max-width: 767.98px) {
  @keyframes slidein {
    0% {
      bottom: -100px;
    }
    100% {
      bottom: 0;
    }
  }
  @keyframes slideout {
    0% {
      bottom: 0;
    }
    100% {
      bottom: -100px;
    }
  }
}
#go-to-top {
  width: 50px;
  height: 50px;
  position: fixed;
  right: 20px;
  bottom: 20px;
  border: solid 2px #17a635;
  background: #fff;
  border-radius: 50%;
  z-index: 9999;
  opacity: 0;
  transition: all 0.5s;
}
@media (max-width: 767.98px) {
  #go-to-top {
    display: none;
  }
}
#go-to-top.hide {
  opacity: 0;
}
#go-to-top.show {
  opacity: 1;
}
#go-to-top a {
  position: relative;
  display: block;
  width: 50px;
  height: 50px;
  text-decoration: none;
}
#go-to-top a::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  right: 0;
  width: 8px;
  height: 8px;
  margin: auto;
  vertical-align: middle;
  border-top: 2px solid #17a635;
  border-right: 2px solid #17a635;
  transform: rotate(-45deg);
}

/**
 * Reduced Motion
 * OS 側でモーション低減が有効な場合は、動かさずに最終状態だけを見せる。
 * フェードインの初期状態は opacity: 0 なので、打ち消さないと要素ごと見えなくなる。
 */
@media (prefers-reduced-motion: reduce) {
  .left-to-right,
  .down-to-top1,
  .down-to-top2,
  .down-to-top3 {
    opacity: 1;
    transition: none;
    transform: none;
  }

  .button__document-request.show,
  .button__document-request.hide {
    animation: none;
  }

  #go-to-top {
    transition: none;
  }
}
