/* ==========================================================================
   gnav.css — メニュー（各ページへ移動）
   --------------------------------------------------------------------------
   スマホ：右上の MENU ボタンで全画面に開く（menu.js が <html> に is-menu-open）
   PC   ：画面上部の中央に、すりガラスの横長メニューとして常に表示
   ========================================================================== */

/* ---- MENU ボタン（スマホ） ------------------------------------------ */

.menu-toggle {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.3rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--color-ink);
  color: #fff;
}

.menu-toggle__bars {
  position: relative;
  display: block;
  width: 1.25rem;
  height: 0.5rem;
}

.menu-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition:
    top 0.3s var(--motion-ease),
    rotate 0.3s var(--motion-ease);
}

.menu-toggle__bars span:first-child { top: 0; }
.menu-toggle__bars span:last-child  { top: calc(100% - 2px); }

.menu-toggle__label {
  font-size: 0.5rem;
  font-weight: var(--weight-heavy);
  letter-spacing: 0.12em;
  line-height: 1;
}

/* 開いている時は × に */
.is-menu-open .menu-toggle {
  background: #fff;
  color: var(--color-ink);
}

.is-menu-open .menu-toggle__bars span:first-child,
.is-menu-open .menu-toggle__bars span:last-child {
  top: calc(50% - 1px);
}

.is-menu-open .menu-toggle__bars span:first-child { rotate: 25deg; }
.is-menu-open .menu-toggle__bars span:last-child  { rotate: -25deg; }

/* ---- メニュー本体（スマホ：全画面） ---------------------------------- */

.gnav {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-7);
  padding: calc(var(--header-height) + 1rem) var(--gutter) 2rem;
  overflow-y: auto;
  background: var(--texture-grain-light), var(--gradient-brand-deep);
  color: #fff;
  /* 右上のボタンから円が広がるように開く */
  clip-path: circle(0 at calc(100% - var(--gutter) - 1.5rem) calc(var(--header-height) / 2));
  visibility: hidden;
  transition:
    clip-path 0.6s cubic-bezier(0.76, 0, 0.24, 1),
    visibility 0s linear 0.6s;
}

.is-menu-open .gnav {
  clip-path: circle(150% at calc(100% - var(--gutter) - 1.5rem) calc(var(--header-height) / 2));
  visibility: visible;
  transition:
    clip-path 0.7s cubic-bezier(0.76, 0, 0.24, 1),
    visibility 0s;
}

.is-menu-open body {
  overflow: hidden;
}

.gnav__list {
  display: grid;
  gap: 0.25rem;
}

.gnav__link {
  display: flex;
  flex-direction: column;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.25);
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  font-size: clamp(1.375rem, 1.2rem + 1vw, 1.75rem);
  line-height: 1.3;
  letter-spacing: 0.06em;
}

.gnav__en {
  font-size: 0.6875rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.24em;
  opacity: 0.8;
}

.gnav__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
}

/* LPへの小さなリンク（スマホのメニューの中だけ） */
.gnav__sub {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.gnav__sub svg {
  width: 1em;
  height: 1em;
}

/* 今いるページ */
.gnav__link[aria-current="page"] {
  color: var(--color-sun);
}

.gnav__cta .btn-line {
  box-shadow: 0 6px 0 var(--color-line-dark);
}

/* 開いた時に、上から順に項目が出てくる */
.gnav__list li,
.gnav__cta {
  opacity: 0;
  translate: 0 16px;
  transition:
    opacity 0.4s ease,
    translate 0.5s var(--motion-ease);
}

.is-menu-open .gnav__list li,
.is-menu-open .gnav__cta {
  opacity: 1;
  translate: 0 0;
  transition-delay: calc(var(--n, 0) * 60ms + 0.25s);
}

.gnav__list li:nth-child(1) { --n: 0; }
.gnav__list li:nth-child(2) { --n: 1; }
.gnav__list li:nth-child(3) { --n: 2; }
.gnav__list li:nth-child(4) { --n: 3; }
.gnav__list li:nth-child(5) { --n: 4; }
.gnav__list li:nth-child(6) { --n: 5; }
.gnav__cta { --n: 7; }

/* メニューが開いている間のヘッダー：ロゴを白く、LINEボタンは隠す */
.is-menu-open .site-header {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.is-menu-open .site-header__logo {
  filter: brightness(0) invert(1);
}

.is-menu-open .site-header__cta {
  visibility: hidden;
}

/* ---- PC：画面上部の中央に横並び -------------------------------------- */

@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }

  .gnav {
    inset: 0.65rem auto auto 50%;
    z-index: calc(var(--z-header) + 1);
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0.35rem 0.5rem;
    overflow: visible;
    translate: -50% 0;
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 0.72);
    border: 1px solid rgb(255 255 255 / 0.9);
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    box-shadow: 0 10px 30px -14px rgb(60 36 130 / 0.35);
    color: var(--color-ink);
    clip-path: none;
    visibility: visible;
    transition: none;
    animation: gnav-in 0.7s var(--motion-ease) both;
  }

  @keyframes gnav-in {
    from {
      opacity: 0;
      translate: -50% -150%;
    }
  }

  .gnav__list {
    display: flex;
    gap: 0;
  }

  .gnav__list li {
    opacity: 1;
    translate: 0 0;
    transition: none;
  }

  .gnav__link {
    position: relative;
    padding: 0.45rem 0.95rem;
    border: 0;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
    transition:
      background-color 0.2s ease,
      color 0.2s ease;
  }

  .gnav__link:hover,
  .gnav__link[aria-current="page"] {
    background: var(--color-ink);
    color: #fff;
  }

  .gnav__en {
    display: none;
  }

  .gnav__cta {
    display: none;
  }
}

/* 幅が狭めのPCでは文字を少し小さく */
@media (min-width: 1024px) and (max-width: 1279px) {
  .gnav__link {
    padding-inline: 0.8rem;
    font-size: 0.8125rem;
  }
}
