/* Shared header / main nav — homepage + learn/solutions/all */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.header.scrolled {
  border-bottom-color: rgba(124, 58, 237, 0.08);
  box-shadow: 0 1px 12px rgba(15, 23, 42, 0.06);
}

.header-inner {
  max-width: var(--max-w, 1200px);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 21px;
  color: var(--purple, #7c3aed);
  letter-spacing: -0.3px;
  text-decoration: none;
}

.logo img {
  display: block;
  max-width: 100%;
  height: 70px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  font-size: 15px;
  color: var(--gray-500, #64748b);
  font-weight: 600;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav a:hover,
.nav a.active {
  color: var(--purple, #7c3aed);
}

.nav a.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--purple, #7c3aed);
  border-radius: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-phone,
a.header-phone {
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--purple, #7c3aed);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  transition: color 0.2s, opacity 0.2s;
}

.header-phone:hover,
a.header-phone:hover {
  color: var(--purple-dark, #6d28d9);
  opacity: 0.92;
  font-weight: 800;
}

.header-phone-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: inherit;
}

.header-phone-number {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: inherit;
  line-height: inherit;
}

.nav-toggle {
  display: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  border: none;
  background: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--gray-700, #334155);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1024px) {
  .nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    gap: 0;
    padding: 8px 28px 16px;
    border-bottom: 1px solid var(--gray-200, #e2e8f0);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100, #f1f5f9);
    font-size: 15px;
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .nav a.active::after {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .header-phone {
    display: none;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 16px;
    height: 60px;
  }

  .logo {
    font-size: 18px;
    gap: 8px;
  }

  .logo img {
    height: 52px;
  }

  .nav {
    top: 60px;
    padding: 8px 16px 16px;
  }
}

/* Lock phone typography so homepage / solutions cannot desync */
.header .header-phone,
.header a.header-phone,
.header .header-phone .header-phone-number {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
  font-size: 15px !important;
  font-weight: 800 !important;
}
