/* Шапка сайта — одна на всех страницах (разметка: tools/site_nav.py, поведение: site-nav.js).
   Подключают главная, демо, Korra Hub и инструкции; цвета и шрифт общие для всех. */
:root { --header-h: 64px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #f1f1eb; border-bottom: 1px solid #deded6;
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.topbar-row {
  display: flex; align-items: center; gap: 16px;
  height: var(--header-h); padding-inline: clamp(20px, 3vw, 48px);
}
.topbar a { text-decoration: none; }
.topbar-brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; }
.topbar-brand img { display: block; width: 92px; height: auto; }

.topbar-nav { display: none; gap: 26px; margin-left: 28px; }
.topbar-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-size: 14.5px; color: #3c3c3c; white-space: nowrap; }
.topbar-link:hover, .topbar-link[aria-current] { color: #1f1f1f; }
.topbar-link[aria-current] {
  text-decoration: underline; text-decoration-color: #9ede01;
  text-decoration-thickness: 2px; text-underline-offset: 8px;
}

.topbar-actions { display: none; align-items: center; gap: 22px; margin-left: auto; }
.topbar-login { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-size: 14.5px; font-weight: 500; color: #1f1f1f; white-space: nowrap; }
/* Та же капсула, что на первом экране главной: 46 px, текст 13 px, стрелка 19 px. */
.topbar-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 28px;
  min-height: 46px; padding: 0 21px; border-radius: 999px;
  background: #1b1e18; color: #f6f7ef; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.topbar-cta span { color: #9ede01; font-size: 19px; line-height: 1; }
.topbar-cta:hover { background: #34451b; }
/* На главной у первого экрана своя кнопка: в шапке она появляется после него (home.js). */
.topbar-actions .topbar-cta { transition: opacity .2s ease, visibility .2s; }
.topbar-home:not(.past-hero) .topbar-actions .topbar-cta { opacity: 0; visibility: hidden; }

/* Телефон и планшет: одна кнопка «Меню», внутри все разделы, вход и связь. */
.topbar-menu { margin-left: auto; }
.topbar-menu-button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 2px;
  font-size: 14px; font-weight: 600; color: #1f1f1f; cursor: pointer; list-style: none;
  -webkit-user-select: none; user-select: none;
}
.topbar-menu-button::-webkit-details-marker { display: none; }
.topbar-menu-icon, .topbar-menu-icon::before { display: block; width: 18px; height: 2px; border-radius: 1px; background: currentColor; transition: transform .2s ease; }
.topbar-menu-icon { position: relative; transform: translateY(-3px); }
.topbar-menu-icon::before { content: ""; position: absolute; top: 6px; }
.topbar-menu[open] .topbar-menu-icon { transform: translateY(0) rotate(45deg); }
.topbar-menu[open] .topbar-menu-icon::before { top: 0; transform: rotate(-90deg); }
.topbar-menu-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  max-height: calc(100svh - var(--header-h)); overflow-y: auto;
  padding: 4px clamp(20px, 3vw, 48px) 22px;
  background: #f1f1eb; border-bottom: 1px solid #deded6; box-shadow: 0 24px 40px rgba(31, 31, 31, 0.1);
}
.topbar-menu-panel nav { display: flex; flex-direction: column; }
.topbar-menu-link {
  display: flex; align-items: center; gap: 10px; min-height: 54px;
  font-size: 19px; letter-spacing: -0.01em; color: #1f1f1f; border-bottom: 1px solid #e0e0d7;
}
.topbar-menu-link[aria-current]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9ede01; }
.topbar-menu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 18px; }

@media (max-width: 419px) { .topbar-brand img { width: 80px; } }
@media (min-width: 1000px) {
  :root { --header-h: 72px; }
  .topbar-brand img { width: 104px; }
  .topbar-nav, .topbar-actions { display: flex; }
  .topbar-menu { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .topbar-actions .topbar-cta, .topbar-menu-icon, .topbar-menu-icon::before { transition: none; }
}
