@charset "utf-8";

#main_contents {
  margin: 0 3rem;
}

.loading {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #f5f5f5;
  font-size: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

/* 読み込み完了時 */
.loading.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/*** 全文字にアニメーションを適用 ***/
.loading_text span {
  display: inline-block;
  /*横並びにしつつアニメーションを適用*/
  animation: 0.5s loading-anim ease-in infinite alternate;
}

/*** 各文字のスタート時間をずらす ***/
/* 1文字目 */
.loading_text span:nth-child(1) {
  animation-delay: 0;
}

/* 2文字目 */
.loading_text span:nth-child(2) {
  animation-delay: 0.2s;
}

/* 3文字目 */
.loading_text span:nth-child(3) {
  animation-delay: 0.4s;
}

/* 4文字目 */
.loading_text span:nth-child(4) {
  animation-delay: 0.6s;
}

.loading_text span:nth-child(5) {
  animation-delay: 0.8s;
}

.loading_text span:nth-child(6) {
  animation-delay: 1s;
}

.loading_text span:nth-child(7) {
  animation-delay: 1.2s;
}

.loading_text span:nth-child(8) {
  animation-delay: 1.4s;
}

.loading_text span:nth-child(9) {
  animation-delay: 1.6s;
}

.loading_text span:nth-child(10) {
  animation-delay: 1.8s;
}

@keyframes loading-anim {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(10px); /* 18pxだと結構大きく動くので調整 */
  }
}

/* fv */

.fv {
  position: relative;
}

.fv_image {
  width: 72vw;
  max-width: 125vh;
  height: auto;
  display: block;
  margin: 0 auto;
}

.scroll_anime {
  position: absolute;
  bottom: 40px; /* 画面下に配置 */
  right: 1%;
  transform: translateX(-1%);
  z-index: 10; /* fv_imageより上に */
  text-align: center;
}

.scroll_anime p {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.scroll_img {
  width: 12vw;
  min-width: 150px;
  height: auto;
}

/* 周期ポヨン */
@keyframes scrollBounce {
  0% {
    transform: translateX(-1%) translateY(0);
  }
  30% {
    transform: translateX(-1%) translateY(-10px);
  }
  60% {
    transform: translateX(-1%) translateY(0);
  }
  100% {
    transform: translateX(-1%) translateY(0);
  }
}

.scroll_anime {
  animation: scrollBounce 1.6s ease-in-out infinite;
  will-change: transform, opacity;
}

.scroll_anime.is-hide {
  animation: scrollBigJump 0.7s cubic-bezier(0.4, 1.6, 0.6, 1) forwards;
}

@keyframes scrollBigJump {
  0% {
    transform: translateX(-1%) translateY(0);
    opacity: 1;
  }
  40% {
    transform: translateX(-1%) translateY(-80px);
    opacity: 1;
  }
  100% {
    transform: translateX(-1%) translateY(-140px);
    opacity: 0;
  }
}

/* service */

.top_main_item {
  margin-bottom: clamp(20rem, 10vw, 40rem);
  border: 3px solid #363636;
  padding: 20px 30px;
  border-radius: 30px;
  background-color: #f5f5f5;
}

.top_main_line section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top_main_line .text01 {
  text-align: left;
  max-width: 28em;
}

.top_main_title {
  font-family: poppins;
  margin-bottom: 2.5rem;
  font-size: 3rem;
  text-align: center;
}

.top_main_line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.top_sub_title {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.icon {
  margin-bottom: 2rem;
  width: 98px;
}

.text01 {
  margin-bottom: 1rem;
}

/* Works */

.image {
  width: 90%;
  margin-bottom: 1rem;
}

.top_btn {
  width: 16vw;
  margin: 0 auto;
  max-width: 220px;
  padding: 1rem;
}

.works-item {
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.works-item .image {
  display: block;
  overflow: hidden;
  border-radius: 16px;
}

.works-item img {
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
}

@media (hover: hover) {
  .works-item .image:hover img {
    transform: scale(1.08);
  }
}

@keyframes poyopoyo {
  0% {
    transform: scale(1, 1);
  }

  /* 1回目 */
  18% {
    transform: scale(1.1, 0.95);
  }

  30% {
    transform: scale(0.98, 1.03);
  }

  /* 2回目（弱め） */
  45% {
    transform: scale(1.06, 0.98);
  }

  58% {
    transform: scale(0.995, 1.01);
  }

  /* 余韻 */
  100% {
    transform: scale(1, 1);
  }
}

.top_btn img {
  width: 100%;
  animation: poyopoyo 1s ease-in-out infinite;
  transition: transform 0.45s ease;
}

@media (hover: hover) {
  .top_btn a:hover img {
    animation: none;
    transform: scale(1.12);
  }
}

/* JS */
.fv {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.fv_image {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
}

.top_main_item {
  will-change: transform;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .top_main_item {
    transform: none !important;
    transition: none !important;
    will-change: auto;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .fv_image {
    width: 100vw;
    max-width: 125vh;
  }

  .scroll_anime {
    right: 2%;
    transform: translateX(-2%);
  }

  .scroll_anime p {
    margin-bottom: 0.2rem;
    font-size: 1rem;
    letter-spacing: 0.05em;
  }

  .scroll_img {
    width: 10vw;
    min-width: 100px;
    height: auto;
  }

  .top_main_item {
    transform: translateY(20px);
  }

  .top_main_line {
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .top_main_line section {
    max-width: 36em;
    margin: 0 auto;
  }

  .top_btn {
    width: 200px;
  }
}
