* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #f1f3f5;
  color: #1a1a1a;
  padding-top: 90px;
}

/* Фиксация шапки сверху по центру */
.header-container {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 1000;
  padding: 0 16px;
}

/* Сама плавающая капсула */
.capsule-nav {
  width: 100%;
  max-width: 620px;
  background-color: #ffffff;
  border-radius: 36px;
  padding: 10px 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.logo {
  display: flex;
  align-items: center;
  color: #000000;
  text-decoration: none;
}

/* Кнопка с тремя линиями */
.burger-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  padding: 4px;
}

.burger-btn .bar {
  display: block;
  width: 100%;
  height: 2.5px;
  background-color: #111111;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Выпадающее меню со ссылками */
.nav-menu {
  list-style: none;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.nav-menu li {
  border-top: 1px solid #f0f0f0;
}

.nav-menu li:first-child {
  margin-top: 8px;
}

.nav-menu a {
  display: block;
  padding: 14px 4px;
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 1.05rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-menu a:active,
.nav-menu a:hover {
  color: #0066cc;
  transform: translateX(4px);
}

/* --- Состояние при открытии (.is-open) --- */

/* 1. Превращение полосок в крестик */
.capsule-nav.is-open .burger-btn .bar:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.capsule-nav.is-open .burger-btn .bar:nth-child(2) {
  opacity: 0;
}

.capsule-nav.is-open .burger-btn .bar:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* 2. Раскрытие списка */
.capsule-nav.is-open .nav-menu {
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
  padding-bottom: 4px;
}

/* 3. Уменьшение скругления углов при раскрытом списке */
.capsule-nav.is-open {
  border-radius: 24px;
}

/* Демонстрационные секции */
.demo-section {
  min-height: 75vh;
  margin: 16px auto;
  max-width: 900px;
  padding: 40px 24px;
  background: #ffffff;
  border-radius: 24px;
  scroll-margin-top: 90px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.demo-section h2 {
  font-size: 1.8rem;
  margin-bottom: 12px;
}