/* ============================================================
   freymi — Header & Navigation
   ============================================================ */

/* ── Fixed strip ── */
#header-strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(1.25rem, 5vw, 5rem);
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

#header-strip.scrolled {
  background-color: rgba(15, 15, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ── Logo ── */
.header-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
  color: var(--text-white);
  mix-blend-mode: difference;
  z-index: 10;
  flex-shrink: 0;
}

.header-logo span {
  color: var(--accent);
}

/* ── Desktop nav ── */
#desktop-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.25s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav-link:hover {
  color: var(--text-white);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* ── Header right group ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ── CTA button в шапке (механика lazarev: пилл схлопывается в кружок) ── */
.header-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 9px 9px 20px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dark);
  white-space: nowrap;
  z-index: 0;
  text-decoration: none;
}

/* Лаймовый пилл-фон */
.header-cta::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  background-color: var(--accent);
  border-radius: 100px;
  transition: width 0.4s var(--ease-out);
  z-index: -1;
}

/* Hover: пилл схлопывается до кружка вокруг иконки */
.header-cta:hover::after {
  width: 38px;
}

/* Текст меняет цвет на акцентный */
.cta-text {
  transition: color 0.3s ease;
}

.header-cta:hover .cta-text {
  color: var(--accent);
}

/* Контейнер иконки */
.cta-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.cta-icon svg {
  width: 18px;
  height: 18px;
  position: absolute;
  color: var(--text-dark);
  transition: opacity 0.2s ease;
}

/* Смена иконок при hover */
.icon-pencil { opacity: 1; }
.icon-arrow  { opacity: 0; }

.header-cta:hover .icon-pencil { opacity: 0; }
.header-cta:hover .icon-arrow  { opacity: 1; }

/* ── Hamburger ── */
#menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-dark);
  cursor: pointer;
  z-index: 600;
  background: rgba(255,255,255,0.04);
  transition: border-color 0.3s ease;
}

#menu-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

#menu-btn span {
  display: block;
  width: 16px;
  height: 1.5px;
  background-color: var(--text-white);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.25s ease;
  transform-origin: center;
}

#menu-btn.open span:first-child {
  transform: translateY(3.25px) rotate(45deg);
}

#menu-btn.open span:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* ── Mobile nav overlay ── */
/* Источник: digital-agency/style.css clip-path approach */
#nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 490;
  background-color: var(--bg-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.25rem, 5vw, 5rem);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s var(--ease);
  pointer-events: none;
}

#nav-overlay.open {
  clip-path: inset(0 0 0% 0);
  pointer-events: auto;
}

#nav-overlay ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 80px;
}

#nav-overlay ul li {
  overflow: hidden;
}

#nav-overlay ul li a {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 8vw, 5rem);
  letter-spacing: -0.04em;
  color: var(--text-white);
  line-height: 1.1;
  transition: color 0.3s ease;
}

#nav-overlay ul li a:hover {
  color: var(--accent);
}

/* Контакты в оверлее */
.overlay-contacts {
  margin-top: auto;
  padding-top: 40px;
  border-top: 1px solid var(--border-dark);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overlay-contacts a {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted-dark);
  transition: color 0.25s ease;
}

.overlay-contacts a:hover {
  color: var(--text-white);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  #desktop-nav {
    display: none;
  }

  #menu-btn {
    display: flex;
  }
}

@media (max-width: 480px) {
  #header-strip {
    padding: 16px clamp(1rem, 4vw, 2rem);
  }

  .header-cta {
    display: none;
  }
}
