/* Menu under the hamburger — shared by every page. The per-page inline rules for .mobile-menu-panel stay as the
   fallback; this file wins by selector weight (nav.mobile-menu-panel), so load order doesn't matter. */

.mobile-menu-overlay {
  background-color: rgba(14, 10, 12, 0.66);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

nav.mobile-menu-panel {
  top: 84px;                                   /* right under the 76px compact header */
  left: 50%;                                   /* centred on every screen */
  width: min(calc(100vw - 64px), 340px);
  max-width: none;
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  padding: 10px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 45%), rgb(67, 57, 61);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 60px -22px rgba(0, 0, 0, 0.85);
  transform: translate(-50%, -14px) scale(0.97);
  transform-origin: top center;
  transition: opacity 0.25s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.25s;
}
nav.mobile-menu-panel.open {
  transform: translate(-50%, 0);
}

nav.mobile-menu-panel ul {
  gap: 4px;
}

/* items glide in one after another (every second <li> is a hidden divider, hence 1/3/5/7/9) */
nav.mobile-menu-panel li {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.28s ease, transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
}
nav.mobile-menu-panel.open li {
  opacity: 1;
  transform: none;
}
nav.mobile-menu-panel.open li:nth-child(1) { transition-delay: 0.05s; }
nav.mobile-menu-panel.open li:nth-child(3) { transition-delay: 0.10s; }
nav.mobile-menu-panel.open li:nth-child(5) { transition-delay: 0.15s; }
nav.mobile-menu-panel.open li:nth-child(7) { transition-delay: 0.20s; }
nav.mobile-menu-panel.open li:nth-child(9) { transition-delay: 0.25s; }

nav.mobile-menu-panel ul a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 10px;
  border-radius: 18px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: normal;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease;
}
nav.mobile-menu-panel ul a::after {               /* chevron */
  content: "";
  flex: none;
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.35;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
nav.mobile-menu-panel ul a:hover,
nav.mobile-menu-panel ul a:focus-visible {
  background-color: rgba(255, 255, 255, 0.07);
}
nav.mobile-menu-panel ul a:hover::after {
  opacity: 0.8;
  transform: translateX(2px) rotate(45deg);
}
nav.mobile-menu-panel ul a:focus-visible {
  outline: 2px solid rgb(255, 204, 34);
  outline-offset: -2px;
}
nav.mobile-menu-panel ul a:active {
  background-color: rgba(255, 255, 255, 0.11);
}

nav.mobile-menu-panel .nav-icon {
  flex: none;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background-color: rgba(255, 204, 34, 0.13);
  color: rgb(255, 204, 34);
}
nav.mobile-menu-panel .nav-icon svg {
  width: 26px;
  height: 26px;
}

/* the page you are on */
nav.mobile-menu-panel ul a.active {
  color: #fff;
  background-color: rgba(255, 204, 34, 0.1);
}
nav.mobile-menu-panel ul a.active .nav-icon {
  background-color: rgb(255, 204, 34);
  color: rgb(56, 46, 50);
}
nav.mobile-menu-panel ul a.active::after {
  color: rgb(255, 204, 34);
  opacity: 1;
}

nav.mobile-menu-panel .social-links {
  margin-top: 8px;
  padding: 14px 6px 6px;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  nav.mobile-menu-panel,
  nav.mobile-menu-panel li,
  nav.mobile-menu-panel ul a,
  nav.mobile-menu-panel ul a::after { transition: none; }
}

/* Переносы: без «висячих» одиночных слов на последней строке. Старые браузеры просто игнорируют. */
h1, h2, h3, .section-heading { text-wrap: balance; }
p, li, .lead, .section-sub, .intro-text { text-wrap: pretty; }

/* ===== Футер v3: колонки бренд / контакты / документы / соцсети, внизу реквизиты ===== */
footer.site-footer {
  --f-yellow: rgb(255, 204, 34);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr) auto;
  grid-template-areas:
    "brand contacts links social"
    "line line line line"
    "legal legal legal copy";
  column-gap: clamp(28px, 4vw, 64px);
  row-gap: 0;
  align-items: start;
  padding: 64px max(153.6px, calc((100% - 1550px) / 2 + 153.6px)) 36px;
  background: #2c2428;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}
footer.site-footer .foot-brand {
  grid-area: brand;
  font-family: 'Torus', 'Manrope', sans-serif;
  font-weight: 600;
  font-size: clamp(1.6rem, 1.1rem + 1.2vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
footer.site-footer .foot-brand span { display: block; color: var(--f-yellow); white-space: nowrap; }
footer.site-footer::after { content: ""; grid-area: line; height: 1px; margin-top: 48px; background: rgba(255, 255, 255, 0.12); }
footer.site-footer .foot-contacts::before,
footer.site-footer .foot-links::before,
footer.site-footer .social-links::before {
  display: block;
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.56);
}
footer.site-footer .foot-contacts::before { content: "Контакты"; }
footer.site-footer .foot-links::before { content: "Документы"; }
footer.site-footer .social-links::before { content: "Мы в соцсетях"; flex-basis: 100%; margin-bottom: 2px; }
footer.site-footer .foot-contacts { grid-area: contacts; display: flex; flex-direction: column; gap: 10px; width: auto; order: 0; font-size: 1rem; }
footer.site-footer .foot-contacts a { width: fit-content; white-space: nowrap; color: #fff; font-weight: 600; text-decoration: none; }
footer.site-footer .foot-contacts a:first-child { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
footer.site-footer .foot-links { grid-area: links; display: flex; flex-direction: column; gap: 10px; width: auto; margin: 0; order: 0; }
footer.site-footer .foot-links a { width: fit-content; font-size: 0.95rem; line-height: 1.45; color: rgba(255, 255, 255, 0.8); text-decoration: none; }
footer.site-footer .foot-contacts a:hover,
footer.site-footer .foot-links a:hover { color: var(--f-yellow); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.25em; }
footer.site-footer .social-links { grid-area: social; display: flex; flex-wrap: wrap; gap: 12px; width: auto; margin: 0; order: 0; }
footer.site-footer .foot-legal,
footer.site-footer small { margin-top: 22px; }
footer.site-footer .foot-legal { grid-area: legal; width: auto; order: 0; font-size: 0.85rem; line-height: 1.6; color: rgba(255, 255, 255, 0.64); }
footer.site-footer small { grid-area: copy; justify-self: stretch; text-align: right; font-size: 0.85rem; line-height: 1.6; color: rgba(255, 255, 255, 0.64); }
@media (max-width: 1100px) {
  footer.site-footer {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "brand brand" "contacts links" "social social" "line line" "legal legal" "copy copy";
    row-gap: 32px;
    padding: 56px 6vw 32px;
  }
  footer.site-footer::after { margin-top: 0; }
  footer.site-footer .foot-legal { margin-top: -8px; }
  footer.site-footer small { margin-top: -16px; text-align: left; }
}
@media (max-width: 560px) {
  footer.site-footer { grid-template-columns: 1fr; grid-template-areas: "brand" "contacts" "links" "social" "line" "legal" "copy"; row-gap: 28px; padding-bottom: 88px; }
}
