/* Header layout */
.hch-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(245, 247, 243, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.hch-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  gap: var(--space-4);
}

/* Brand */
.hch-header__brand {
  display: flex;
  align-items: center;
}

.hch-header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: inherit;
}

.hch-header__logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f855a, #2196f3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-md);
}

.hch-header__leaf {
  position: absolute;
  width: 14px;
  height: 24px;
  border-radius: 14px 14px 2px 14px;
  background-color: #e6f4ec;
}

.hch-header__leaf--left {
  transform: rotate(-35deg);
  left: 8px;
}

.hch-header__leaf--right {
  transform: rotate(40deg);
  right: 8px;
}

.hch-header__text {
  display: flex;
  flex-direction: column;
}

.hch-header__title {
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: var(--line-height-tight);
}

.hch-header__tagline {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Navigation */
.hch-header__nav {
  display: flex;
}

.hch-header__nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hch-header__nav-link {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-gray-700);
  padding-block: 0.25rem;
  position: relative;
}

.hch-header__nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.3rem;
  height: 2px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition-normal);
}

.hch-header__nav-link:hover::after,
.hch-header__nav-link:focus-visible::after {
  transform: scaleX(1);
}

/* CTA */
.hch-header__nav-item--primary {
  margin-left: var(--space-2);
}

.hch-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  box-shadow: var(--shadow-md);
}

.hch-header__cta:hover {
  filter: brightness(0.95);
}

/* Mobile toggle */
.hch-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-gray-200);
  background-color: var(--color-bg-alt);
  box-shadow: var(--shadow-sm);
}

.hch-header__toggle-bar {
  width: 20px;
  height: 2px;
  border-radius: var(--radius-full);
  background-color: var(--color-gray-800);
  transition: transform var(--transition-normal), opacity var(--transition-fast);
}

/* Toggle animation */
.hch-header__toggle[aria-expanded="true"] .hch-header__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hch-header__toggle[aria-expanded="true"] .hch-header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.hch-header__toggle[aria-expanded="true"] .hch-header__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile styles */
@media (max-width: 768px) {
  .hch-header__inner {
    padding-block: var(--space-2);
  }

  .hch-header__toggle {
    display: inline-flex;
  }

  .hch-header__nav {
    position: fixed;
    inset-inline: 0;
    top: 64px;
    background-color: rgba(245, 247, 243, 0.98);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition-slow), opacity var(--transition-normal), visibility var(--transition-normal);
  }

  .hch-header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-4);
    gap: var(--space-3);
  }

  .hch-header__nav-link,
  .hch-header__cta {
    width: 100%;
    justify-content: flex-start;
  }

  .hch-header__nav--open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hch-header__nav {
    transition: none;
  }

  .hch-header__toggle-bar {
    transition: none;
  }
}
