/* ============================================
   МЕНЮ — круги как набор цифр на айфоне
   ============================================ */

.menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(5rem, 12vh, 8rem) var(--gut) clamp(2rem, 6vh, 4rem);
  /* Размытие включается сразу при открытии, прозрачность
     анимирует только затемнение. */
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.28s;
}

.menu.is-open {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s linear 0s;
}

/* Размытие отдельным слоем: включается сразу,
   без анимации прозрачности */
.menu__blur {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(20px) saturate(115%);
  -webkit-backdrop-filter: blur(20px) saturate(115%);
  opacity: 0;
  pointer-events: none;
}

.menu.is-open .menu__blur {
  opacity: 1;
}

/* Затемнение фона — частицы остаются видны, но приглушены */
.menu__veil {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.22s cubic-bezier(0.33, 0, 0.2, 1);
  background: radial-gradient(
    ellipse 80% 70% at 50% 45%,
    rgba(7, 6, 5, 0.72) 0%,
    rgba(7, 6, 5, 0.9) 100%
  );
}

.menu.is-open .menu__veil {
  opacity: 1;
}

/* ---------- Сетка кругов ---------- */

.menu__grid {
  position: relative;
  display: grid;
  /* Шесть пунктов — сетка 3×2 */
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2.25rem);
  width: 100%;
  max-width: 620px;
}

@media (max-width: 560px) {
  .menu__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 1rem;
    max-width: 320px;
  }
}

.menu__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  opacity: 0;
  transform: translateY(24px) scale(0.9);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
}

/* Круги проявляются по очереди */
.menu.is-open .menu__cell {
  opacity: 1;
  transform: none;
  /* Ждём, пока фон уйдёт в муть */
  transition-delay: calc(0.12s + var(--i) * 0.05s);
}

/* ---------- Сам круг ---------- */

.menu__circle {
  position: relative;
  width: clamp(76px, 15vw, 112px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition:
    transform var(--med) var(--ease-out),
    box-shadow var(--med) var(--ease);
}

.menu__cell:hover .menu__circle,
.menu__link:focus-visible .menu__circle {
  transform: scale(1.06);
  box-shadow: var(--edge-hot), 0 20px 44px -12px rgba(0, 0, 0, 0.7);
}

.menu__cell:active .menu__circle {
  transform: scale(0.97);
}

.menu__icon {
  position: relative;
  z-index: 1;
  width: 38%;
  height: 38%;
  color: var(--gold-soft, #e6d6c2);
  transition: color var(--med) var(--ease);
}

.menu__cell:hover .menu__icon {
  color: var(--gold-hot);
}

/* ---------- Подпись ---------- */

.menu__label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  text-align: center;
  transition: color var(--med) var(--ease);
}

.menu__cell:hover .menu__label {
  color: var(--sand);
}

.menu__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
}

/* ---------- Низ меню ---------- */

.menu__foot {
  position: relative;
  margin-top: clamp(2rem, 6vh, 4rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2.5rem;
  opacity: 0;
  transition: opacity var(--slow) var(--ease) 0.4s;
}

.menu.is-open .menu__foot {
  opacity: 1;
}

.menu__foot-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-mute);
  transition: color var(--fast) var(--ease);
}

a.menu__foot-item:hover {
  color: var(--gold-soft);
}

@media (prefers-reduced-motion: reduce) {
  .menu__cell {
    opacity: 1;
    transform: none;
  }
}
