/* ============================================================
   _nav.css — десктоп-навигация (.nav-*) + fullscreen mobile-nav
   (.mobile-nav-*, .nav-burger) + CTA-кнопка в навигации
   (.nav-link--cta). Responsive 900/640 в конце файла.

   Зависит от _base.css (палитра, --radius-*, --font-serif).
   Используется на всех публичных страницах через partials/_nav.html
   и partials/_mobile_nav.html.
   ============================================================ */

/* ── Десктоп ─────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 68px;
  background: rgba(244,239,230,0.93);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo-group { display: flex; flex-direction: column; gap: 2px; }
.nav-logo {
  font-size: 19px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--dark);
}
.nav-logo span { color: var(--accent-1); font-weight: 700; }
.nav-logo-sub {
  font-size: 11px; font-weight: 500; color: var(--faint);
  letter-spacing: 0.02em;
}
.nav-links {
  display: flex; align-items: center; gap: 4px;
}

/* ── Пункт меню ──────────────────────────────────────────── */
.nav-link {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 18px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Золотая линия снизу — растёт слева вправо при hover */
.nav-link::before {
  content: '';
  position: absolute;
  left: 18px; right: 18px;
  bottom: 5px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--accent-2);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover {
  color: var(--accent-1);
  transform: translateY(-1px);
}
.nav-link:hover::before {
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--accent-1);
  font-weight: 600;
}
.nav-link.active::before {
  transform: scaleX(1);
}

/* ── CTA «Записаться» — pill с градиентом и стрелкой ─────── */
.nav-link--cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--accent-1) 0%, #6e1422 100%);
  color: #fff !important;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 2px 14px rgba(139,26,44,0.28),
              inset 0 1px 0 rgba(255,255,255,0.10);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.3s;
  will-change: transform;
}

/* Стрелка справа от текста */
.nav-link--cta::after {
  content: '→';
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link--cta:hover {
  color: #fff !important;
  background: linear-gradient(135deg, #a31f35 0%, var(--accent-1) 100%);
  box-shadow: 0 6px 24px rgba(139,26,44,0.45),
              0 0 0 1px rgba(194,125,42,0.4) inset,
              inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.nav-link--cta:hover::after {
  transform: translateX(4px);
}
.nav-link--cta:active {
  transform: translateY(0);
  transition: transform 0.1s;
}

/* Псевдоэлемент ::before подчёркивания на CTA не нужен */
.nav-link--cta::before { display: none; }

/* ── Анимация появления при загрузке ─────────────────────── */
@keyframes navFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-links .nav-link {
  opacity: 0;
  animation: navFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.nav-links .nav-link:nth-child(1) { animation-delay: 0.08s; }
.nav-links .nav-link:nth-child(2) { animation-delay: 0.14s; }
.nav-links .nav-link:nth-child(3) { animation-delay: 0.20s; }
.nav-links .nav-link:nth-child(4) { animation-delay: 0.26s; }
.nav-links .nav-link:nth-child(5) { animation-delay: 0.32s; }

.nav .nav-link--cta {
  opacity: 0;
  animation: navFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both;
}

/* ── Логотип — лёгкий hover ──────────────────────────────── */
a.nav-logo-group {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.25s;
}
a.nav-logo-group:hover {
  opacity: 0.78;
}

/* ── Бургер + fullscreen mobile-overlay ──────────────────── */
.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 8px;
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: transform 0.2s, background 0.2s;
}
.nav-burger:hover {
  background: rgba(28,18,10,0.05);
  transform: scale(1.05);
}
.nav-burger:active {
  transform: scale(0.95);
}
.nav-burger span {
  display: block; height: 2px; border-radius: 2px;
  background: var(--dark);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.25s,
              width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.25s;
  transform-origin: center;
}
/* Лесенка: верхняя 100%, средняя 75%, нижняя 50% — даёт «динамику» */
.nav-burger span:nth-child(1) { width: 100%; }
.nav-burger span:nth-child(2) { width: 75%; align-self: flex-end; }
.nav-burger span:nth-child(3) { width: 50%; align-self: flex-end; }

.nav-burger:hover span:nth-child(2) { width: 100%; }
.nav-burger:hover span:nth-child(3) { width: 100%; }

.nav-burger.open span { background: var(--dark); width: 100%; align-self: stretch; }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed; inset: 0;
  width: 100vw; height: 100vh; height: 100dvh; /* dvh для iOS Safari c bottom-bar */
  z-index: 9999;
  background: var(--dark);
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
}
.mobile-nav.open {
  opacity: 1; transform: scale(1);
  pointer-events: all;
}
.mobile-nav-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.22;
  filter: blur(2px);
  pointer-events: none;
}
.mobile-nav-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,18,10,0.55) 0%, rgba(28,18,10,0.9) 60%, rgba(28,18,10,0.98) 100%);
  pointer-events: none;
}
.mobile-nav-close {
  position: absolute; top: 20px; right: 20px;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 2px solid rgba(255,255,255,0.30);
  color: #fff; font-size: 28px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  z-index: 2;
}
.mobile-nav-close:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.5);
  transform: rotate(90deg);
}

.mobile-nav-inner {
  position: relative;
  z-index: 1;
  display: flex; flex-direction: column;
  min-height: 100%;
  padding: 72px 28px 32px;
}
.mobile-nav-brand {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 32px;
  padding: 4px 0 4px 0;
  transition: padding-left 0.25s, color 0.25s;
}
.mobile-nav-brand::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--accent-2), var(--accent-1));
  border-radius: 3px;
  transform: translateY(-50%);
  transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Когда мы на главной — лого подсвечен в мобайл-меню, маркер «вы здесь» */
.mobile-nav-brand.active {
  padding-left: 18px;
}
.mobile-nav-brand.active::before {
  height: 80%;
}
.mobile-nav-brand.active .mobile-nav-sub {
  color: rgba(194,125,42,0.75);
}

.mobile-nav-logo {
  font-family: 'Inter', sans-serif;
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.03em; color: #fff;
}
.mobile-nav-logo span { color: var(--accent-2); font-weight: 700; }
.mobile-nav-sub {
  font-size: 12px; letter-spacing: 0.04em;
  color: rgba(244,239,230,0.45);
  margin-top: 6px; text-transform: uppercase;
  transition: color 0.25s;
}

.mobile-nav-links {
  display: flex; flex-direction: column;
  gap: 2px;
  margin-bottom: 32px;
}
.mobile-nav-link {
  position: relative;
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-serif);
  font-size: 28px; font-weight: 700;
  color: rgba(244,239,230,0.92);
  padding: 14px 0 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  letter-spacing: -0.01em; line-height: 1.1;
  transition: color 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              padding-left 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.15s;
}

/* Левый бордюр-индикатор — растёт сверху вниз при hover/active */
.mobile-nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--accent-2), var(--accent-1));
  border-radius: 3px;
  transform: translateY(-50%);
  transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-nav-link:hover {
  color: var(--accent-2);
  padding-left: 12px;
}
.mobile-nav-link:hover::before {
  height: 60%;
}

/* Tap-feedback */
.mobile-nav-link:active {
  transform: scale(0.98);
  color: var(--accent-2);
}

/* Активный пункт — заметно выделен */
.mobile-nav-link.active {
  color: var(--accent-2);
  padding-left: 18px;
  border-bottom-color: rgba(194,125,42,0.35);
  background: linear-gradient(90deg, rgba(194,125,42,0.06) 0%, transparent 60%);
}
.mobile-nav-link.active::before {
  height: 70%;
}
.mobile-nav-link.active .mnl-num {
  color: var(--accent-2);
  font-weight: 700;
  transform: scale(1.15);
}

.mnl-num {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(194,125,42,0.55);
  min-width: 24px;
  transition: color 0.25s, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-nav-link:hover .mnl-num {
  color: var(--accent-2);
  transform: scale(1.1);
}
.mobile-nav-actions {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: auto; padding-top: 24px;
}
.mobile-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--accent-1) 0%, #6e1422 100%);
  color: #fff;
  border-radius: 99px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  box-shadow: 0 4px 24px rgba(139,26,44,0.42),
              inset 0 1px 0 rgba(255,255,255,0.10);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s,
              background 0.25s;
}
.mobile-nav-cta::after {
  content: '→';
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-nav-cta:hover,
.mobile-nav-cta:active {
  background: linear-gradient(135deg, #a31f35 0%, var(--accent-1) 100%);
  box-shadow: 0 8px 32px rgba(139,26,44,0.55),
              0 0 0 1px rgba(194,125,42,0.4) inset,
              inset 0 1px 0 rgba(255,255,255,0.15);
  transform: translateY(-2px);
}
.mobile-nav-cta:hover::after,
.mobile-nav-cta:active::after { transform: translateX(4px); }
.mobile-nav-tg {
  display: block;
  padding: 16px 22px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06); color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 15px; font-weight: 500; text-align: center;
  transition: background 0.2s, transform 0.1s;
}
.mobile-nav-tg:hover { background: rgba(255,255,255,0.1); }
.mobile-nav-tg:active { transform: scale(0.98); }

.mobile-nav-foot {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px; color: rgba(244,239,230,0.35);
  text-align: center;
}

/* При открытом overlay фиксируем прокрутку body */
body.mobile-nav-open { overflow: hidden; }

/* ── Staggered fade-in пунктов мобайл-меню ───────────────── */
@keyframes mobileNavItemIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.mobile-nav.open .mobile-nav-link {
  animation: mobileNavItemIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.mobile-nav.open .mobile-nav-link:nth-child(1) { animation-delay: 0.18s; }
.mobile-nav.open .mobile-nav-link:nth-child(2) { animation-delay: 0.26s; }
.mobile-nav.open .mobile-nav-link:nth-child(3) { animation-delay: 0.34s; }
.mobile-nav.open .mobile-nav-link:nth-child(4) { animation-delay: 0.42s; }
.mobile-nav.open .mobile-nav-link:nth-child(5) { animation-delay: 0.50s; }
.mobile-nav.open .mobile-nav-link:nth-child(6) { animation-delay: 0.58s; }
.mobile-nav.open .mobile-nav-actions {
  animation: mobileNavItemIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.68s both;
}
.mobile-nav.open .mobile-nav-foot {
  animation: mobileNavItemIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.72s both;
}

/* ── Telegram FAB — плашка в правом нижнем углу ──────────── */
/* ⚠️ Дубль `.tg-float` из student_page.css (кабинет). Унификация
   обоих в общий компонент — техдолг, отложен после спринта. */
.tg-float {
  position: fixed; bottom: 28px; right: 28px; z-index: 30;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px;
  padding: 12px 20px 12px 15px;
  background: linear-gradient(135deg, var(--accent-1) 0%, #6e1422 100%);
  color: #fff;
  border-radius: 99px;
  font-size: 13.5px; font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 24px rgba(139,26,44,0.35),
              inset 0 1px 0 rgba(255,255,255,0.10);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s,
              background 0.25s;
}
.tg-float:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, #a31f35 0%, var(--accent-1) 100%);
  box-shadow: 0 10px 32px rgba(139,26,44,0.5),
              0 0 0 1px rgba(194,125,42,0.4) inset,
              inset 0 1px 0 rgba(255,255,255,0.15);
}
.tg-float:active { transform: scale(0.97); }
.tg-float svg { flex-shrink: 0; }

/* Появление с задержкой после загрузки — не мозолит глаз сразу */
@keyframes tgFloatIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.tg-float {
  animation: tgFloatIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.8s both;
}

/* Скрытие FAB когда виден hero (на мобайле — там уже есть кнопка Telegram в hero) */
.tg-float--hidden {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateY(30px) scale(0.9) !important;
  transition: opacity 0.3s, transform 0.3s !important;
}

@media (max-width: 640px) {
  .tg-float {
    right: 14px;
    bottom: 14px;
    padding: 11px 14px;
    min-height: 44px;
  }
  .tg-float span { display: none; }
}

/* ── Responsive ──────────────────────────────────────────── */
/* Десктоп-nav: лого + 5 пунктов + CTA "Записаться" — не помещается
   на ширине меньше ~1100px и пункты наезжают друг на друга. Поэтому
   бургер появляется уже на средних экранах. */
@media (max-width: 1100px) {
  .nav { padding: 0 24px; }
  .nav-links { display: none; }
  .nav-logo-sub { display: none; }
  .nav-contacts { display: none; }
  /* Десктоп-CTA убрана из шапки на средних — она остаётся внутри
     fullscreen-overlay как mobile-nav-cta, в шапке ей тесно с лого+бургером */
  .nav-cta-desktop { display: none; }
  .nav-burger { display: flex; }
  .mobile-nav { display: flex; }
}
@media (max-width: 900px) {
  .nav { padding: 0 20px; }
}

@media (max-width: 640px) {
  .nav { height: 60px; }
  .nav-logo { font-size: 15px; }
  .mobile-nav-inner { padding: 64px 22px 28px; }
  .mobile-nav-link { font-size: 24px; }
  .mobile-nav-close { top: 14px; right: 14px; width: 40px; height: 40px; }
}
