/* Общая шапка сайта (капсульный вид с главной страницы) для Wiki и Map */
html {
  scrollbar-gutter: stable;
}
.top,
.top * {
  box-sizing: border-box;
}
.top a {
  color: inherit;
  text-decoration: none;
}
.top button {
  font-family: inherit;
}
.top .wrap {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  gap: 12px;
  pointer-events: none;
}

.top.solid {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: 10px 0;
  pointer-events: none;
  color: var(--ink);
  font-family: Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}

.top.solid .brand,
.top.solid .nav-links,
.top.solid .nav-actions {
  pointer-events: auto;
  display: flex;
  align-items: center;
  border: 1px solid rgba(43, 28, 49, 0.08);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    0 12px 30px -6px rgba(55, 24, 62, 0.12),
    0 2px 6px rgba(55, 24, 62, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: var(--ink);
  transition:
    background 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.3s;
}

.top.solid .brand {
  font-family: Rubik, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.02;
  height: 46px;
  padding: 0 16px 0 10px;
  gap: 12px;
  font-size: 18px;
  flex: none;
}
.top.solid .logo {
  width: 27px;
  height: 27px;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
  transition: transform 0.3s;
}
.top.solid .brand:hover .logo {
  transform: scale(1.08) rotate(-4deg);
}

.top.solid .nav-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  list-style: none;
  width: auto;
  max-width: 100%;
  flex: 0 1 auto;
  min-width: 0;
  height: 46px;
  padding: 4px;
  margin: 0;
  margin-inline: auto;
  gap: 4px;
}
.top.solid .nav-links li {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
}
.top.solid .nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  gap: 7px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid transparent;
  white-space: nowrap;
  opacity: 0.92;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.15s,
    opacity 0.2s;
}
.top.solid .nav-ic {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.top.solid .nav-links a:hover {
  opacity: 1;
  color: var(--coral);
  background: rgba(185, 27, 159, 0.08);
}
.top.solid .nav-links a:active {
  transform: scale(0.97);
}
.top.solid .nav-links a.active {
  opacity: 1;
  background: rgba(185, 27, 159, 0.12);
  border-color: rgba(185, 27, 159, 0.35);
  color: var(--coral);
}
.top.solid .nav-links a.active .nav-ic {
  stroke: var(--coral);
}
.top.solid .nav-links a.active:hover {
  background: rgba(185, 27, 159, 0.18);
}

.top.solid .nav-actions {
  height: 46px;
  padding: 4px 6px 4px 8px;
  gap: 8px;
  flex: none;
}
.top.solid .nav-divider {
  width: 1px;
  height: 16px;
  background: rgba(43, 28, 49, 0.12);
  margin: 0 2px;
}

.top.solid .sw {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  border: 1.5px solid transparent;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: inherit;
  opacity: 0.95;
  padding: 0;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.15s;
}
.top.solid .sw:hover {
  background: rgba(185, 27, 159, 0.08);
  color: var(--coral);
  transform: scale(1.05);
}
.top.solid .sw svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.top.solid .sw .moon {
  display: none;
}
html[data-sky="night"] .top.solid .sw .moon {
  display: block;
}
html[data-sky="night"] .top.solid .sw .sun {
  display: none;
}

.top.solid .nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 34px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: var(--brand-button, var(--coral));
  color: #fff;
  box-shadow: none;
  white-space: nowrap;
  transition:
    background 0.2s,
    transform 0.18s;
}
.top.solid .nav-btn:hover {
  background: var(--brand-button-hover, #a1168c);
  transform: translateY(-2px);
  box-shadow: none;
}
.top.solid .nav-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

.top.solid .burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  color: inherit;
  padding: 0;
  transition: background 0.2s;
}
.top.solid .burger:hover {
  background: rgba(255, 255, 255, 0.14);
}
.top.solid .burger::before,
.top.solid .burger::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: currentColor;
  top: 14px;
  box-shadow: 0 6px 0 currentColor;
  border-radius: 2px;
  transition:
    transform 0.22s,
    top 0.22s;
}
.top.solid .burger::after {
  box-shadow: none;
  top: 26px;
}
.menu-open .top.solid .burger::before {
  top: 19px;
  transform: rotate(45deg);
  box-shadow: none;
}
.menu-open .top.solid .burger::after {
  top: 19px;
  transform: rotate(-45deg);
}

/* Ночная тема капсул */
html[data-sky="night"] .top.solid .brand,
html[data-sky="night"] .top.solid .nav-links,
html[data-sky="night"] .top.solid .nav-actions {
  background: rgba(12, 12, 12, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 14px 34px -8px rgba(0, 0, 0, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f8f1f8;
}
html[data-sky="night"] .top.solid .nav-links a {
  color: rgba(248, 241, 248, 0.8);
}
html[data-sky="night"] .top.solid .nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
html[data-sky="night"] .top.solid .nav-links a.active {
  background: rgba(240, 113, 219, 0.18);
  border-color: rgba(240, 113, 219, 0.45);
  color: var(--coral);
}
html[data-sky="night"] .top.solid .nav-links a.active .nav-ic {
  stroke: var(--coral);
}
html[data-sky="night"] .top.solid .sw:hover {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
}
html[data-sky="night"] .top.solid .nav-divider {
  background: rgba(255, 255, 255, 0.14);
}

@media (min-width: 1021px) and (max-width: 1200px) {
  .top .wrap {
    gap: 8px;
  }
  .top.solid .nav-links {
    width: auto;
    flex: 0 1 auto;
    padding: 3px;
    gap: 3px;
  }
  .top.solid .nav-links a {
    padding: 0 8px;
    gap: 5px;
    font-size: 12px;
  }
}

@media (max-width: 1020px) {
  .top.solid {
    padding: 10px 0;
  }
  .top.solid .wrap {
    height: 48px;
  }
  .top.solid .brand,
  .top.solid .nav-actions {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(43, 28, 49, 0.08);
    box-shadow: 0 10px 24px -6px rgba(55, 24, 62, 0.12);
    color: var(--ink);
    height: 46px;
  }
  html[data-sky="night"] .top.solid .brand,
  html[data-sky="night"] .top.solid .nav-actions {
    background: rgba(12, 12, 12, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, 0.4);
    color: #f8f1f8;
  }
  .top.solid .logo {
    width: 28px;
    height: 28px;
  }
  .top.solid .brand {
    font-size: 19px;
    padding: 0 14px 0 10px;
  }
  .top.solid .nav-links {
    position: absolute;
    top: 64px;
    left: 16px;
    right: 16px;
    z-index: 60;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(43, 28, 49, 0.1);
    box-shadow: 0 20px 40px rgba(55, 24, 62, 0.18);
    color: var(--ink);
    padding: 8px;
    border-radius: 20px;
    display: none;
    width: auto;
    height: auto;
    pointer-events: auto;
    margin: 0;
    gap: 4px;
    grid-template-columns: 1fr;
  }
  html[data-sky="night"] .top.solid .nav-links {
    background: rgba(12, 12, 12, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    color: #f8f1f8;
  }
  .menu-open .top.solid .nav-links {
    display: grid;
  }
  .top.solid .nav-links li {
    display: flex;
    width: 100%;
  }
  .top.solid .nav-links a {
    width: 100%;
    height: 44px;
    justify-content: flex-start;
    padding: 0 14px;
    font-size: 14px;
    gap: 8px;
    border-radius: 12px;
  }
  .top.solid .nav-ic {
    width: 17px;
    height: 17px;
  }
  .top.solid .burger {
    display: block;
  }
  .top.solid .nav-btn {
    display: none;
  }
  .top.solid .nav-divider {
    display: block;
    background: rgba(43, 28, 49, 0.12);
  }
  html[data-sky="night"] .top.solid .nav-divider {
    background: rgba(255, 255, 255, 0.15);
  }
}

@media (max-width: 359px) {
  .top .wrap {
    width: calc(100% - 36px);
  }
}

/* Плавное переключение темы (View Transitions API) */
html.sky-snap *,
html.sky-snap *::before,
html.sky-snap *::after {
  transition: none !important;
}
html.sky-xfade::view-transition-old(root),
html.sky-xfade::view-transition-new(root) {
  animation-duration: 0.65s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
html.sky-circle::view-transition-old(root),
html.sky-circle::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
html.sky-circle::view-transition-old(root) {
  z-index: 1;
}
html.sky-circle::view-transition-new(root) {
  z-index: 9999;
}
@media (prefers-reduced-motion: reduce) {
  *,
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Общий подвал сайта для Wiki, 404 и др. (как на главной странице) */
footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 30px 0;
  color: var(--muted);
  font-size: 14.5px;
  background: var(--bg);
}
footer .wrap {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}
footer .brand {
  color: var(--ink);
  font-family: Rubik, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
footer .brand:hover .logo {
  transform: scale(1.08) rotate(-4deg);
}
footer .logo {
  width: 26px;
  height: 26px;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
  transition: transform 0.3s;
}
footer .foot-info {
  font-size: 12px;
  max-width: 440px;
  line-height: 1.65;
  color: var(--muted);
}
footer .foot-info a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
footer .foot-info a:hover {
  color: var(--coral);
}
footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}
footer ul a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
footer ul a:hover {
  color: var(--coral);
}
@media (max-width: 640px) {
  footer .wrap {
    gap: 22px;
  }
  footer .wrap > .foot-info {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    line-height: 1.7;
  }
  footer ul {
    font-size: 12px;
    gap: 15px;
  }
}

