/* fmenu.css — Liquid morph floating menu (veil 브랜드 이식)
   원본: liquid-morph-floating-menu.tsx (React + framer-motion)
   → 바닐라 CSS/JS 이식. ease = cubic-bezier(0.22,1,0.36,1) 원본 그대로 */

:root {
  --fm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fm-gold: var(--brand-gold, #CDA00A);
  --fm-gold-deep: var(--brand-gold-deep, #A88208);
  --fm-ink: var(--brand-gold-ink, #1A1400);
  --fm-panel: #1428CC;            /* 펼침 원 = 코발트 딥 */
  --fm-panel-text: #f7f1ed;       /* 열림 메뉴 텍스트 */
}

/* 하단 중앙 고정 — 모바일 전용 노출 (데스크톱은 상단 메가메뉴 사용) */
.fmenu {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: none;
  opacity: 0;
  animation: fm-rise .4s var(--fm-ease) forwards;
}
@keyframes fm-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (max-width: 768px) { .fmenu { display: block; } }

/* 모핑 박스 */
.fmenu-box {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 150px;
  height: 48px;
  border-radius: 72px;
  cursor: pointer;
  transform: scale(1);
  transition: width .8s var(--fm-ease), height .15s var(--fm-ease),
              border-radius .8s var(--fm-ease), transform .25s var(--fm-ease);
  font-family: inherit;
  letter-spacing: -0.02em;
}
.fmenu:not(.open) .fmenu-box:active,
.fmenu:not(.open) .fmenu-box:hover { transform: scale(1.05); }

.fmenu.open .fmenu-box {
  width: 280px;
  height: 260px;
  border-radius: 32px;
  cursor: default;
  transform: scale(1);
  transition: width .8s var(--fm-ease), height .8s var(--fm-ease),
              border-radius .8s var(--fm-ease);
}

/* 금색 배경 레이어 */
.fmenu-bg {
  position: absolute;
  inset: 0;
  background: var(--fm-gold);
  border: 1px solid var(--fm-gold-deep);
  border-radius: inherit;
  transition: border-color .3s var(--fm-ease);
}
.fmenu.open .fmenu-bg { border-color: var(--fm-gold); }

/* 하단에서 확장되는 다크(코발트) 원 */
.fmenu-circle {
  position: absolute;
  left: 50%;
  bottom: -200%;
  width: 200%;
  height: 200%;
  border-radius: 50%;
  background: var(--fm-panel);
  transform: translateX(-50%);
  transition: bottom .8s var(--fm-ease);
}
.fmenu.open .fmenu-circle { bottom: -20%; transition-delay: .1s; }

/* 메뉴 항목 컨테이너 */
.fmenu-items {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  justify-content: center;
  flex: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.fmenu.open .fmenu-items { flex: 1; opacity: 1; pointer-events: auto; }

/* 개별 항목 (글자 롤오버) */
.fmenu-item {
  display: block;
  color: var(--fm-panel-text);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow: hidden;
  height: 1em;
  opacity: 0;
  transition: opacity .4s var(--fm-ease);
  background: none;
  border: 0;
  cursor: pointer;
}
.fmenu.open .fmenu-item {
  opacity: 1;
  transition-delay: calc(.4s + .08s * var(--i, 0));
}
.fmenu-item-row { display: flex; justify-content: center; }

.fm-char { display: inline-block; overflow: hidden; height: 1em; }
.fm-stack {
  display: flex;
  flex-direction: column;
  transition: transform 0ms;
  transform: translateY(0%);
}
.fmenu-item:hover .fm-stack,
.fmenu-item:focus-visible .fm-stack {
  transform: translateY(-50%);
  transition-property: transform;
  transition-duration: 800ms;
  transition-timing-function: var(--fm-ease);
  transition-delay: var(--fm-cd, 0ms);
}
.fm-face { display: block; height: 1em; line-height: 1em; }

/* 하단 바: Menu + 햄버거 */
.fmenu-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 48px;
  flex-shrink: 0;
  padding: 0 20px;
  cursor: pointer;
  transition: padding .8s var(--fm-ease);
}
.fmenu.open .fmenu-bar { padding: 0 24px 24px; }

.fmenu-label {
  font-size: 14px;
  line-height: 1;
  color: var(--fm-ink);
  transition: color .3s var(--fm-ease);
}
.fmenu.open .fmenu-label { color: var(--fm-panel-text); }

.fmenu-burger {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fmenu-burger span {
  position: absolute;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 9999px;
  background: var(--fm-ink);
  transition: transform .4s var(--fm-ease), background-color .4s var(--fm-ease);
}
.fmenu-burger span:nth-child(1) { transform: translateY(-3px); }
.fmenu-burger span:nth-child(2) { transform: translateY(3px); }
.fmenu.open .fmenu-burger span { background: var(--fm-panel-text); }
.fmenu.open .fmenu-burger span:nth-child(1) { transform: rotate(45deg); }
.fmenu.open .fmenu-burger span:nth-child(2) { transform: rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .fmenu, .fmenu-box, .fmenu-circle, .fmenu-items, .fmenu-item,
  .fm-stack, .fmenu-bar, .fmenu-label, .fmenu-burger span {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
