.page-parts-library .nav-pc {
  display: none;
}

/* PCメニュー */
.nav-pc {
  display: flex;
  list-style: none;
  white-space: nowrap;
  margin-left: auto;
}

.nav-pc li a {
  position: relative;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: bold;
  text-decoration: none;
  color: #333333;
  white-space: nowrap;
  display: inline-block;
  overflow: hidden;
  text-align: center;
  min-width: 120px;
}

.nav-pc li a span {
  display: block;
  transition: transform 0.3s ease;
  will-change: transform;
  color: #FFFFFF;
  padding-top: 6px;
}

.nav-pc li a .en {
  width: 100%;
  text-align: center;
  transform: translateY(0%);
}

.nav-pc li a .ja {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-pc li a:hover .en {
  transform: translateY(-100%);
}

.nav-pc li a:hover .ja {
  transform: translateY(0%);
  opacity: 1;
  visibility: visible;
}

.nav-sp {
  display: none;
}

/* ミートボールアイコン */
.meatball-menu {
  width: 50px;
  height: 50px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  z-index: 100012;
  position: fixed;
  top: 20px;
  right: 35px;
  background-color: #343434;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.meatball-menu .dot {
  display: block;
  height: 8px;
  width: 8px;
  background-color: #FFFFFF;
  border-radius: 50%;
  transition: all 0.4s ease;
  position: absolute;
  transform: translateX(0);
}

.meatball-menu .dot.top {
  transform: translateX(-10px);
}

.meatball-menu .dot.bottom {
  transform: translateX(10px);
}

/* is-active（メニューが開いている状態）時のドットの変化 */
.meatball-menu.is-active {
  background-color: transparent;
}

.meatball-menu.is-active .dot.top {
  background-color: #FFFFFF;
  border-radius: 0;
  width: 30px;
  height: 4px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 1;
}

.meatball-menu.is-active .dot.middle {
  opacity: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(0, 0);
}

.meatball-menu.is-active .dot.bottom {
  background-color: #FFFFFF;
  border-radius: 0;
  width: 30px;
  height: 4px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  opacity: 1;
}

/*
====================================
  モーダルとキーフレームアニメーション
====================================
*/

/* モーダル */
.modal_menu {
  display: none;
  opacity: 0;
  visibility: hidden;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(12px);
  color: #fff;
  z-index: 10010;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* モーダル表示時（開くアニメーション） */
.modal_menu.show {
  display: flex;
  opacity: 1;
  visibility: visible;
  animation: slideUpFadeIn 0.5s ease-out forwards;
}

/* モーダル非表示時（閉じるアニメーション） */
.modal_menu.hide {
  animation: slideDownFadeOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

/* キーフレームアニメーション */
@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpFromBottom {
  from {
    opacity: 0;
    transform: translateY(100%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 閉じる：全面を下へスライドアウト */
@keyframes slideDownFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(100%);
  }
}

/* 項目も一緒に下へ */
@keyframes itemDownFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(30px);
  }
}

.modal_menu.hide li {
  animation: itemDownFadeOut 0.35s ease forwards;
}

/* モーダル表示時（開くアニメーション）のディレイ */
.modal_menu.show li:nth-child(1) {
  animation-delay: 0.1s;
}
.modal_menu.show li:nth-child(2) {
  animation-delay: 0.2s;
}
.modal_menu.show li:nth-child(3) {
  animation-delay: 0.3s;
}
.modal_menu.show li:nth-child(4) {
  animation-delay: 0.4s;
}

/* モーダル非表示時（閉じるアニメーション）の逆順ディレイ */
/* 下から上へ、または4番目から順に消えるように設定 */
.modal_menu.hide li:nth-child(1) {
  /* (4-1) * 0.03s = 0.09s */
  animation-delay: 0.09s;
}
.modal_menu.hide li:nth-child(2) {
  /* (4-2) * 0.03s = 0.06s */
  animation-delay: 0.06s;
}
.modal_menu.hide li:nth-child(3) {
  /* (4-3) * 0.03s = 0.03s */
  animation-delay: 0.03s;
}
.modal_menu.hide li:nth-child(4) {
  /* (4-4) * 0.03s = 0s */
  animation-delay: 0s;
}

/*
====================================
  メニューリストとアイテム
====================================
*/

.modal_menu ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  margin-bottom: 40px;
  text-align: center;
  overflow: hidden;
}

.modal_menu.show li {
  animation: slideUpFromBottom 0.6s ease-out forwards;
  opacity: 0;
}

.modal_menu ul li a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  font-family: 'Noto Serif JP', serif;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.3s ease, transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal_menu ul li a .en {
  font-size: 22px;
  font-weight: 500;
}

.modal_menu ul li a .ja {
  font-size: 18px;
  font-weight: 300;
  margin-top: 4px;
  opacity: 0.8;
}

.modal_menu ul li a:hover,
.modal_menu ul li a.is-active-link {
  color: #ffffff;
  transform: scale(1.1);
  text-shadow:
    0 0 10px #6d6c6c,
    0 0 20px #6d6c6c,
    0 0 25px #6d6c6c;
}

.modal_menu ul li a.animating::after {
  transform: scaleX(1);
}


@media screen and (max-width: 1024px) {
  .nav-pc {
    gap: clamp(0.25rem, 1vw, 0.8rem);
  }

  .nav-pc li a {
    font-size: clamp(0.65rem, 1.6vw, 1.2rem);
    padding-left: 0.7em;
    padding-right: 0.7em;
    font-weight: 900;
  }

  .meatball-menu {
    margin-top: 10px;
  }
}

@media screen and (max-width: 900px) {

  /*(900pxでミートボールメニューに切り替わり)*/
  .p-header__logo {
    padding-top: 20px;
  }

  .nav-pc {
    display: none;
  }

  .second-nav {
    display: none;
  }

  .nav-sp {
    display: block;
  }

  .modal_menu ul li a {
    margin-bottom: 25px;
  }

  .modal_menu ul li a .en {
    font-size: 30px;
  }

  .modal_menu ul li a .ja {
    font-size: 24px;
    margin-top: 4px;
  }
}

@media screen and (max-width: 768px) {
  .meatball-menu {
    margin-top: 10px;
  }
}

@media screen and (max-width: 480px) {
  .meatball-menu {
    width: 40px;
    height: 40px;
    margin-top: 5px;
  }

  .modal_menu ul li a {
    margin-bottom: 25px;
  }

  .modal_menu ul li a .en {
    font-size: 25px;
  }

  .modal_menu ul li a .ja {
    font-size: 20px;
    margin-top: 4px;
  }
}

@media screen and (max-width: 320px) {
  .modal_menu ul li a .en {
    font-size: 20px;
  }

  .modal_menu ul li a .ja {
    font-size: 15px;
    margin-top: 0;
  }
}