/* =========================================================
   Professional site header & navigation
   Loaded after style.css to override legacy pill nav styles
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: 72px;
  padding: 0;
  display: block;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition:
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.site-header .header-inner {
  width: min(94%, 1240px);
  margin: 0 auto;
}

.site-header .nav-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 72px;
  height: auto;
  padding: 10px 0;
  gap: 20px;
  flex-wrap: nowrap;
  position: relative;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
  text-decoration: none;
}

.site-header .brand-logo {
  height: 48px !important;
  width: auto !important;
  max-height: none !important;
}

.site-header .brand-text,
.site-header .brand-text.gradient-text {
  font-family: "Sora", "Manrope", system-ui, sans-serif;
  font-size: clamp(0.78rem, 1.35vw, 1.05rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #0f172a;
  background: none;
  background-clip: unset;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #0f172a;
  white-space: normal;
  max-width: min(14rem, 42vw);
}

.site-header .brand:hover .brand-text {
  color: #312e81;
}

.site-header .nav {
  display: none;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.site-header .nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.site-header .nav a::before,
.site-header .nav a::after {
  content: none !important;
  display: none !important;
}

.site-header .nav a:hover,
.site-header .nav a:focus-visible {
  transform: none !important;
  color: #312e81;
  background: rgba(124, 58, 237, 0.08);
  box-shadow: none !important;
}

.site-header .nav a:active {
  transform: none !important;
  box-shadow: none !important;
}

.site-header .nav a.active {
  color: #6d28d9;
  background: rgba(124, 58, 237, 0.1);
  border: 0;
  box-shadow: none;
}

.site-header .nav a.nav-cta {
  margin-left: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  background: #4338ca !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(67, 56, 202, 0.22);
}

@media (min-width: 980px) {
  .site-header .nav a.nav-cta {
    margin-left: 14px;
    position: relative;
  }

  .site-header .nav a.nav-cta::before {
    content: "" !important;
    display: block !important;
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 18px;
    background: rgba(15, 23, 42, 0.12);
  }
}

.site-header .nav a.nav-cta:hover,
.site-header .nav a.nav-cta:focus-visible,
.site-header .nav a.nav-cta.active {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: #4f46e5 !important;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
}

.site-header .nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  position: static;
  top: auto;
  right: auto;
  z-index: 1002;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.site-header .nav-toggle:hover {
  border-color: rgba(124, 58, 237, 0.25);
  background: rgba(124, 58, 237, 0.04);
}

.site-header .nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #0f172a;
  border-radius: 999px;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.site-header .nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header .nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.site-header .nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-header .nav-close {
  display: none;
}

@media (min-width: 980px) {
  .site-header .brand-logo {
    height: 52px !important;
  }

  .site-header .nav {
    display: flex;
    position: static;
    opacity: 1;
    transform: none;
    max-height: none;
    pointer-events: auto;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .site-header .nav-toggle {
    display: none;
  }
}

@media (min-width: 980px) and (max-width: 1180px) {
  .site-header .nav a {
    padding: 8px 9px;
    font-size: 12px;
  }

  .site-header .brand-text {
    max-width: 180px;
    white-space: normal;
  }
}

@media (max-width: 979px) {
  .site-header .header-inner {
    width: min(92%, 100%);
  }

  body.nav-open {
    overflow: hidden;
    touch-action: none;
  }

  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 998;
  }

  .site-header .nav {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: min(88vw, 360px);
    height: 100vh;
    max-height: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 72px 18px 24px;
    background: #fff;
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.12);
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
    transition:
      transform 0.28s ease,
      opacity 0.28s ease;
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-header .nav.open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    max-height: none;
  }

  .site-header .nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
  }

  .site-header .nav a {
    width: 100%;
    justify-content: flex-start;
    min-height: 46px;
    padding: 0 12px;
    margin: 0;
    border-radius: 8px;
    font-size: 15px;
    color: #1e293b;
  }

  .site-header .nav a + a {
    margin-top: 2px;
  }

  .site-header .nav a.nav-cta {
    margin-top: 12px;
    margin-left: 0;
    justify-content: center;
    min-height: 48px;
  }

  .site-header .nav.open a {
    animation: headerNavItemIn 0.35s ease both;
  }

  .site-header .nav.open a:nth-child(2) {
    animation-delay: 0.03s;
  }
  .site-header .nav.open a:nth-child(3) {
    animation-delay: 0.06s;
  }
  .site-header .nav.open a:nth-child(4) {
    animation-delay: 0.09s;
  }
  .site-header .nav.open a:nth-child(5) {
    animation-delay: 0.12s;
  }
  .site-header .nav.open a:nth-child(6) {
    animation-delay: 0.15s;
  }
  .site-header .nav.open a:nth-child(7) {
    animation-delay: 0.18s;
  }
  .site-header .nav.open a:nth-child(8) {
    animation-delay: 0.21s;
  }
  .site-header .nav.open a:nth-child(9) {
    animation-delay: 0.24s;
  }
  .site-header .nav.open a:nth-child(10) {
    animation-delay: 0.27s;
  }
  .site-header .nav.open a:nth-child(11) {
    animation-delay: 0.3s;
  }
}

@keyframes headerNavItemIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .nav,
  .site-header .nav.open a {
    animation: none !important;
    transition: none !important;
  }
}
