.site-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 16px 20px 0;
  pointer-events: none;
}

.site-header {
  position: relative;
  pointer-events: auto;
  display: flex;
  justify-content: center;
  width: calc(100% - 8px);
  min-width: 0;
  max-width: 1120px;
  margin: 0 auto;
  border-radius: 30px;
  padding: 12px 20px;
  background-color: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  isolation: isolate;
  transition:
    padding 0.35s ease,
    border-radius 0.35s ease,
    box-shadow 0.35s ease,
    backdrop-filter 0.35s ease,
    background-color 0.35s ease;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: -5px;
  background: black;
  filter: blur(25px);
  border-radius: 20px;
  z-index: -1;
  opacity: 0.12;
  pointer-events: none;
}

.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.5),
    rgba(91, 33, 182, 0.4),
    rgba(114, 8, 156, 0.5)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.site-header--scrolled {
  padding: 8px 16px;
  border-radius: 24px;
  background-color: rgba(20, 18, 18, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.site-header--scrolled::before {
  opacity: 0.18;
}

.site-header-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.site-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: #e0e0e0;
  transition: opacity 0.25s ease;
}

.site-header-logo:hover {
  opacity: 0.9;
}

.site-header-logo-img {
  height: 36px;
  width: auto;
  transition: height 0.35s ease;
}

.site-header--scrolled .site-header-logo-img {
  height: 30px;
}

.site-header-logo-text {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #38bdf8, #6d28d9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-header-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 8px;
}

.menu-item {
  color: #c8c8c8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 9999px;
  /* Only animate transform — color/background transitions flash when active class toggles */
  transition: transform 0.25s ease;
}

.menu-item:hover {
  color: #e0e0e0;
  background-color: rgba(66, 116, 255, 0.12);
  transform: translateY(-1px);
}

.menu-item.menu-item--active,
.menu-item.menu-item--active:hover {
  background-color: rgba(56, 189, 248, 0.12);
  background-image: linear-gradient(90deg, #38bdf8, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transform: none;
  transition: none;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.site-header-social {
  color: #c8c8c8;
  gap: 12px;
}

.site-header-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 9999px;
  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    transform 0.25s ease;
}

.site-header-social-link:hover {
  color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.12);
  transform: translateY(-1px);
}

.site-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(90deg, #38bdf8, #6d28d9);
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.25);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    filter 0.25s ease;
}

.site-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(109, 40, 217, 0.35);
  filter: brightness(1.08);
}

.site-header-cta:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.site-header-cta--mobile {
  margin-top: 8px;
  width: 100%;
  text-align: center;
}

.site-header-social--mobile {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(60, 60, 60, 0.35);
  justify-content: center;
}

.mobile-menu {
  display: none;
  margin-left: auto;
  position: relative;
}

.mobile-menu-checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.burger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  color: #e0e0e0;
  font-size: 2em;
  line-height: 1;
  padding: 5px 10px;
  position: relative;
  z-index: 3;
  touch-action: manipulation;
  width: 1.4em;
  height: 1.4em;
  cursor: pointer;
  border-radius: 12px;
  transition: background-color 0.25s ease;
}

.burger-icon:hover {
  background-color: rgba(66, 116, 255, 0.12);
}

.burger-icon-menu,
.burger-icon-close {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.burger-icon-menu {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.burger-icon-close {
  opacity: 0;
  transform: scale(0.8) rotate(-90deg);
}

.mobile-menu-checkbox:checked + .burger-icon .burger-icon-menu {
  opacity: 0;
  transform: scale(0.8) rotate(90deg);
}

.mobile-menu-checkbox:checked + .burger-icon .burger-icon-close {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.mobile-dropdown {
  display: grid;
  grid-template-rows: 0fr;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  pointer-events: none;
  transition:
    grid-template-rows 0.35s ease,
    opacity 0.35s ease,
    margin-top 0.35s ease,
    padding-top 0.35s ease,
    border-color 0.35s ease;
}

.mobile-menu-checkbox:checked ~ .mobile-dropdown {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 8px;
  padding-top: 12px;
  border-top-color: rgba(60, 60, 60, 0.3);
  pointer-events: auto;
}

.mobile-dropdown-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  min-height: 0;
}

.mobile-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    background-color 0.3s ease;
}

.mobile-menu-checkbox:checked ~ .mobile-dropdown .mobile-dropdown-item,
.mobile-menu-checkbox:checked ~ .mobile-dropdown .site-header-cta--mobile,
.mobile-menu-checkbox:checked ~ .mobile-dropdown .site-header-social--mobile {
  opacity: 1;
  transform: translateY(0);
}

.mobile-dropdown-item:hover {
  background-color: rgba(60, 60, 60, 0.4);
  transform: translateY(0);
}

@media (max-width: 900px) {
  .site-header-logo-text {
    display: none;
  }
}

@media (max-width: 800px) {
  .site-header-wrapper {
    padding: 12px 12px 0;
  }

  .site-header {
    width: 100%;
    padding: 10px 14px;
  }

  .site-header--scrolled {
    padding: 8px 12px;
  }

  .desktop-menu,
  .desktop-actions {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .site-header-content {
    flex-wrap: wrap;
  }

  .site-header:has(.mobile-menu-checkbox:checked) .site-header-content {
    align-items: stretch;
  }

  .site-header:has(.mobile-menu-checkbox:checked) .mobile-menu {
    width: 100%;
    order: 10;
  }

  .mobile-dropdown {
    position: static;
  }

  .mobile-menu-checkbox:checked ~ .mobile-dropdown .mobile-dropdown-item:nth-child(1) {
    transition-delay: 0.05s;
  }

  .mobile-menu-checkbox:checked ~ .mobile-dropdown .mobile-dropdown-item:nth-child(2) {
    transition-delay: 0.1s;
  }

  .mobile-menu-checkbox:checked ~ .mobile-dropdown .mobile-dropdown-item:nth-child(3) {
    transition-delay: 0.15s;
  }

  .mobile-menu-checkbox:checked ~ .mobile-dropdown .mobile-dropdown-item:nth-child(4) {
    transition-delay: 0.2s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header-logo-img,
  .burger-icon-menu,
  .burger-icon-close,
  .mobile-dropdown,
  .mobile-dropdown-item,
  .menu-item,
  .site-header-cta,
  .site-header-social-link {
    transition: none;
  }

  .mobile-menu-checkbox:checked + .burger-icon .burger-icon-menu,
  .burger-icon-close {
    transform: none;
  }

  .mobile-dropdown-item,
  .site-header-cta--mobile,
  .site-header-social--mobile {
    opacity: 1;
    transform: none;
  }
}
