/* ===== Кастомный хедер ===== */
.cu-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 28px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.cu-header.cu-scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.cu-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #1a1a1a;
  text-decoration: none;
  transition: color .3s ease;
}
.cu-header__brand .cu-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e99771;
  flex: 0 0 auto;
}

.cu-header__nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.cu-header__link {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  text-decoration: none;
  transition: color .2s ease, opacity .2s ease;
  opacity: .85;
}
.cu-header__link:hover {
  opacity: 1;
  color: #e99771;
}

.cu-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ===== Кнопка переключения темы ===== */
.cu-theme-toggle {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
  transition: background .25s ease, border-color .25s ease, color .25s ease, transform .2s ease;
  padding: 0;
}
.cu-theme-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: rotate(15deg);
}
.cu-theme-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}
.cu-theme-toggle .cu-icon-moon { display: none; }
.cu-theme-toggle .cu-icon-sun  { display: block; }

/* Чтобы контент не уезжал под фиксированный хедер */
body.cu-has-header #allrecords {
  padding-top: 64px;
}

/* Бургер для мобильных */
.cu-burger { display: none; }

@media screen and (max-width: 820px) {
  .cu-header { padding: 0 18px; height: 58px; }
  body.cu-has-header #allrecords { padding-top: 58px; }
  .cu-header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 8px 0;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
  }
  .cu-header__nav.cu-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .cu-header__link {
    padding: 13px 20px;
    opacity: 1;
  }
  .cu-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
  }
  .cu-burger span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease, background .3s ease;
  }
  .cu-burger.cu-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .cu-burger.cu-open span:nth-child(2) { opacity: 0; }
  .cu-burger.cu-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ===================================================== */
/* ===============  ТЁМНАЯ ТЕМА  ======================== */
/* ===================================================== */
html.cu-dark .cu-header {
  background: rgba(20, 20, 22, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
html.cu-dark .cu-header.cu-scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
html.cu-dark .cu-header__brand { color: #f2f2f2; }
html.cu-dark .cu-header__link { color: #ddd; }
html.cu-dark .cu-header__link:hover { color: #e99771; }
html.cu-dark .cu-theme-toggle {
  border-color: rgba(255, 255, 255, 0.18);
  color: #f2f2f2;
}
html.cu-dark .cu-theme-toggle:hover { background: rgba(255, 255, 255, 0.08); }
html.cu-dark .cu-theme-toggle .cu-icon-moon { display: block; }
html.cu-dark .cu-theme-toggle .cu-icon-sun  { display: none; }
html.cu-dark .cu-burger span { background: #f2f2f2; }
html.cu-dark .cu-header__nav {
  background: rgba(20, 20, 22, 0.97);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Тёмные цвета страницы Tilda вынесены в css/dark-theme.css */
