/* No.21 全画面メニューの開き方 */

.fm-stage {
  padding: clamp(26px, 5vw, 60px) clamp(16px, 4vw, 48px) clamp(40px, 6vw, 78px);
  background:
    radial-gradient(circle at 50% 0%, rgba(83, 169, 175, 0.13), transparent 46%),
    var(--surface-1);
}
.fm-wrap { width: min(560px, 100%); margin-inline: auto; text-align: center; }

.fm-lead { margin: 0 0 20px; color: var(--text-2); font-size: 14.9px; }
.fm-hint {
  max-width: 460px;
  margin: 20px auto 0;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.75;
}

.fm-modes {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.fm-mode {
  padding: 9px 16px;
  color: var(--text-2);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease;
}
.fm-mode:hover { color: var(--brand-deep); }
.fm-mode.is-active { color: var(--surface); background: var(--brand-deep); }

.fm-phone {
  position: relative;
  width: min(300px, 100%);
  margin-inline: auto;
  padding: 12px;
  background: #2c3335;
  border-radius: 40px;
  box-shadow: 0 28px 60px rgba(40, 107, 112, 0.26), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}
.fm-notch {
  position: absolute;
  top: 20px;
  left: 50%;
  z-index: 4;
  width: 96px;
  height: 22px;
  margin-left: -48px;
  background: #2c3335;
  border-radius: 999px;
}
.fm-screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 18;
  background: var(--surface);
  border-radius: 30px;
  text-align: left;
}

.fm-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 46px 18px 0;
}
.fm-logo {
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: color 0.35s ease 0.1s;
}
.fm-screen.is-open .fm-logo { color: var(--surface); }

.fm-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.fm-toggle-box {
  position: relative;
  display: block;
  width: 24px;
  height: 14px;
}
.fm-toggle-box span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.42s cubic-bezier(0.3, 1.1, 0.4, 1), opacity 0.2s ease, background-color 0.35s ease;
}
.fm-toggle-box span:nth-child(1) { top: 0; }
.fm-toggle-box span:nth-child(2) { top: 6px; }
.fm-toggle-box span:nth-child(3) { top: 12px; }

.fm-screen.is-open .fm-toggle-box span { background: var(--surface); }
.fm-screen.is-open .fm-toggle-box span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.fm-screen.is-open .fm-toggle-box span:nth-child(2) { opacity: 0; transform: scaleX(0.3); }
.fm-screen.is-open .fm-toggle-box span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.fm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 背景に見えているページ本体（ダミー） */
.fm-content { padding: 20px 18px; transition: transform 0.6s ease, opacity 0.5s ease; }
.fm-screen.is-open .fm-content { transform: scale(0.96); opacity: 0.6; }
.fm-hero {
  height: 128px;
  margin-bottom: 18px;
  background: linear-gradient(140deg, var(--surface-2), rgba(140, 172, 136, 0.28));
  border-radius: 3px 16px 16px 16px;
}
.fm-line {
  height: 9px;
  margin-bottom: 9px;
  background: rgba(63, 70, 72, 0.11);
  border-radius: 999px;
}
.fm-line-lg { width: 74%; height: 15px; margin-bottom: 14px; background: rgba(63, 70, 72, 0.18); }
.fm-line-sm { width: 52%; }
.fm-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.fm-card { height: 66px; background: rgba(83, 169, 175, 0.13); border-radius: 10px; }

/* メニュー本体。開き方は data-mode で切り替える */
.fm-panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* 上はヘッダー（ロゴとボタン）に重ならない高さを空ける */
  padding: 104px 26px 30px;
  background: linear-gradient(150deg, var(--brand-deep), #1d5257);
  visibility: hidden;
  transition: visibility 0s linear 0.62s;
}
.fm-screen.is-open .fm-panel { visibility: visible; transition: visibility 0s; }

/* 円が広がる: ボタンの位置を中心に丸く開く */
.fm-screen[data-mode="circle"] .fm-panel {
  clip-path: circle(0% at calc(100% - 38px) 66px);
  transition: clip-path 0.62s cubic-bezier(0.6, 0, 0.2, 1), visibility 0s linear 0.62s;
}
.fm-screen[data-mode="circle"].is-open .fm-panel {
  clip-path: circle(150% at calc(100% - 38px) 66px);
  transition: clip-path 0.62s cubic-bezier(0.3, 0.6, 0.2, 1), visibility 0s;
}

/* 上から降りる */
.fm-screen[data-mode="drop"] .fm-panel {
  transform: translateY(-100%);
  transition: transform 0.55s cubic-bezier(0.6, 0, 0.25, 1), visibility 0s linear 0.55s;
}
.fm-screen[data-mode="drop"].is-open .fm-panel {
  transform: none;
  transition: transform 0.6s cubic-bezier(0.2, 0.85, 0.25, 1), visibility 0s;
}

/* 右から入る */
.fm-screen[data-mode="slide"] .fm-panel {
  transform: translateX(100%);
  transition: transform 0.52s cubic-bezier(0.6, 0, 0.25, 1), visibility 0s linear 0.52s;
}
.fm-screen[data-mode="slide"].is-open .fm-panel {
  transform: none;
  transition: transform 0.58s cubic-bezier(0.2, 0.85, 0.25, 1), visibility 0s;
}

/* ふわっと現れる */
.fm-screen[data-mode="fade"] .fm-panel {
  opacity: 0;
  transform: scale(1.07);
  transition: opacity 0.4s ease, transform 0.5s ease, visibility 0s linear 0.5s;
}
.fm-screen[data-mode="fade"].is-open .fm-panel {
  opacity: 1;
  transform: none;
  transition: opacity 0.42s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.25, 1), visibility 0s;
}

.fm-menu { margin: 0; padding: 0; list-style: none; }
.fm-menu li {
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 253, 248, 0.16);
}
.fm-menu a {
  display: block;
  padding: 15px 2px;
  color: var(--surface);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(120%);
  transition: transform 0.55s cubic-bezier(0.22, 0.9, 0.2, 1);
}
.fm-menu a em {
  display: block;
  margin-top: 2px;
  color: rgba(255, 253, 248, 0.6);
  font-family: var(--font-ui);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.16em;
}
.fm-foot {
  margin-top: 24px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fm-foot p {
  margin: 0;
  color: rgba(255, 253, 248, 0.72);
  font-size: 12px;
}

.fm-screen.is-open .fm-menu a,
.fm-screen.is-open .fm-foot {
  transform: none;
  opacity: 1;
  transition-delay: calc(0.2s + var(--i) * 0.07s);
}
.fm-menu li { --i: 0; }

@media (max-width: 600px) {
  .fm-phone { width: min(300px, 100%); }
}
