/* ============================================================
   SPHONIX CORE — GLOBAL DESIGN SYSTEM + HEADER ONLY
   v1.9.1
   ============================================================ */

:root {
  --sx-bg: #020207;
  --sx-bg-soft: #07080d;
  --sx-surface: #0e1016;
  --sx-surface-2: #151822;
  --sx-text: #f7f7fa;
  --sx-text-soft: #a7aab4;
  --sx-text-dim: #737782;
  --sx-blue: #3b82f6;
  --sx-violet: #8b5cf6;
  --sx-pink: #ec4899;
  --sx-peach: #f59e8b;
  --sx-gradient: linear-gradient(100deg,var(--sx-blue),var(--sx-violet),var(--sx-pink),var(--sx-peach));
  --sx-container: 1440px;
  --sx-header-mask-height: 128px;
}

html { scroll-behavior: auto; }
body { overflow-x: hidden; }
html.sx-menu-open,
body.sx-menu-open { overflow: hidden !important; }

.sx-gradient-text {
  color: transparent;
  background: var(--sx-gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   GLOBAL HEADER FOUNDATION
   ============================================================ */

.sx-header,
.sx-header *,
.sx-header *::before,
.sx-header *::after {
  box-sizing: border-box;
}

.sx-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 9999;
  isolation: isolate;
  width: 100%;
  padding: 18px 32px;
  color: var(--sx-text);
  background: transparent;
  pointer-events: none;
  overflow: visible;
  transition:
    transform .5s cubic-bezier(.22,1,.36,1),
    padding .35s ease;
}

/*
 * Hero-safe header mask.
 * Keeps Elementor/WebGL hero objects from visually bleeding through
 * the navigation area while preserving a soft transition into the hero.
 */
.sx-header::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  right: 0;
  height: var(--sx-header-mask-height);
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      #020207 0%,
      rgba(2,2,7,.995) 46%,
      rgba(2,2,7,.94) 68%,
      rgba(2,2,7,.68) 84%,
      rgba(2,2,7,0) 100%
    );
  transition: opacity .3s ease;
}

/* Subtle brand atmosphere only inside the header safe-zone. */
.sx-header::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: -135px;
  left: 50%;
  width: min(760px,62vw);
  height: 230px;
  transform: translateX(-50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(ellipse,rgba(118,90,255,.045),transparent 69%);
  filter: blur(25px);
  transition: opacity .3s ease;
}

.sx-header__inner {
  position: relative;
  z-index: 2;
  width: min(100%,1540px);
  min-height: 66px;
  margin-inline: auto;
  padding: 0 4px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  pointer-events: auto;
}

/* ============================================================
   SCROLLED / FLOATING HEADER
   ============================================================ */

.sx-header.is-scrolled {
  position: fixed;
  padding: 10px 32px;
}

/* The floating glass bar becomes the background after scroll. */
.sx-header.is-scrolled::before,
.sx-header.is-scrolled::after {
  opacity: 0;
}

.sx-header.is-scrolled .sx-header__inner {
  padding: 0 12px 0 20px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: linear-gradient(180deg,rgba(16,18,25,.88),rgba(7,8,13,.82));
  box-shadow:
    0 14px 50px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.04);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.sx-header.is-hidden {
  transform: translateY(-130%);
}

/* ============================================================
   LOGO
   ============================================================ */

.sx-header__brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: inherit;
  text-decoration: none !important;
}

.sx-header__logo {
  display: block;
  width: clamp(126px,9vw,154px);
  max-width: none;
  height: auto;
  object-fit: contain;
  transition:
    transform .4s cubic-bezier(.22,1,.36,1),
    opacity .3s ease;
}

.sx-header__brand:hover .sx-header__logo {
  transform: scale(.98);
}

/* ============================================================
   DESKTOP NAVIGATION
   ============================================================ */

.sx-header__nav {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px,2vw,38px);
}

.sx-nav-item {
  position: relative;
}

.sx-header__link {
  position: relative;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: rgba(247,247,250,.68) !important;
  font-family: "Inter",sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.015em;
  white-space: nowrap;
  text-decoration: none !important;
  transition: color .3s ease;
}

.sx-header__link:hover,
.sx-header__link:focus-visible,
.sx-header__link.is-active {
  color: #fff !important;
}

.sx-header__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 7px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,var(--sx-blue),var(--sx-violet),var(--sx-pink));
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}

.sx-header__link:hover::after,
.sx-header__link:focus-visible::after,
.sx-header__link.is-active::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.sx-header__plus {
  display: inline-block;
  color: rgba(255,255,255,.38);
  font-size: 15px;
  transition:
    color .3s ease,
    transform .4s cubic-bezier(.22,1,.36,1);
}

.sx-nav-item--has-menu:hover .sx-header__plus,
.sx-nav-item--has-menu:focus-within .sx-header__plus {
  color: #fff;
  transform: rotate(45deg);
}

/* ============================================================
   HEADER CTA
   ============================================================ */

.sx-header__actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sx-header__cta {
  position: relative;
  isolation: isolate;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  color: #fff !important;
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font-family: "Inter",sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  transition:
    transform .4s cubic-bezier(.22,1,.36,1),
    border-color .3s ease,
    box-shadow .3s ease;
}

.sx-header__cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: linear-gradient(105deg,var(--sx-blue),var(--sx-violet),var(--sx-pink));
  transition: opacity .35s ease;
}

.sx-header__cta:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 12px 35px rgba(139,92,246,.20);
}

.sx-header__cta:hover::before {
  opacity: 1;
}

.sx-header__cta-icon {
  display: inline-flex;
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}

.sx-header__cta:hover .sx-header__cta-icon {
  transform: translate(3px,-3px);
}

/* ============================================================
   CAPABILITIES MEGA MENU
   ============================================================ */

.sx-mega-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 50%;
  width: min(920px,84vw);
  padding-top: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%,16px) scale(.985);
  transform-origin: top center;
  transition:
    opacity .28s ease,
    visibility .28s ease,
    transform .4s cubic-bezier(.22,1,.36,1);
}

.sx-mega-menu::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 0;
  right: 0;
  height: 35px;
}

.sx-nav-item--has-menu:hover .sx-mega-menu,
.sx-nav-item--has-menu:focus-within .sx-mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%,0) scale(1);
}

.sx-mega-menu__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(230px,.78fr) minmax(480px,1.55fr);
  gap: 38px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 22px;
  background: linear-gradient(135deg,rgba(18,20,29,.97),rgba(7,8,13,.97));
  box-shadow:
    0 32px 100px rgba(0,0,0,.52),
    inset 0 1px 0 rgba(255,255,255,.045);
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
}

.sx-mega-menu__inner::before {
  content: "";
  position: absolute;
  top: -190px;
  left: -160px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(139,92,246,.14);
  filter: blur(75px);
  pointer-events: none;
}

.sx-mega-menu__intro {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sx-menu-eyebrow {
  display: block;
  margin-bottom: 18px;
  color: var(--sx-violet);
  font: 700 9px/1 "Inter",sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.sx-mega-menu__intro h3 {
  max-width: 280px;
  margin: 0 0 14px;
  color: #f7f7fa;
  font-family: "Manrope","Inter",sans-serif;
  font-size: clamp(25px,2vw,34px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.045em;
}

.sx-mega-menu__intro p {
  max-width: 275px;
  margin: 0;
  color: #8d919c;
  font: 400 12px/1.65 "Inter",sans-serif;
}

.sx-mega-menu__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 28px;
  color: #f7f7fa !important;
  font: 600 11px/1 "Inter",sans-serif;
  text-decoration: none !important;
}

.sx-mega-menu__all span {
  transition: transform .3s ease;
}

.sx-mega-menu__all:hover span {
  transform: translate(3px,-3px);
}

.sx-mega-menu__services {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 15px;
  background: rgba(255,255,255,.065);
}

.sx-mega-menu__services > a {
  position: relative;
  min-height: 110px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 13px;
  padding: 20px;
  color: #f7f7fa !important;
  background: rgba(8,9,14,.96);
  text-decoration: none !important;
  transition: background-color .3s ease;
}

.sx-mega-menu__services > a:hover {
  background: rgba(255,255,255,.04);
}

.sx-service-number {
  color: rgba(255,255,255,.27);
  font: 400 8px/1 "Inter",sans-serif;
  letter-spacing: .12em;
  padding-top: 3px;
}

.sx-service-content {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sx-service-content strong {
  color: #f7f7fa;
  font: 600 12px/1.25 "Inter",sans-serif;
}

.sx-service-content small {
  color: #777b86;
  font: 400 10px/1.5 "Inter",sans-serif;
}

.sx-service-arrow {
  color: rgba(255,255,255,.28);
  font-size: 13px;
  transition:
    color .3s ease,
    transform .35s ease;
}

.sx-mega-menu__services > a:hover .sx-service-arrow {
  color: var(--sx-violet);
  transform: translate(3px,-3px);
}

/* ============================================================
   MOBILE HEADER + MENU
   ============================================================ */

.sx-menu-toggle {
  width: 46px;
  height: 46px;
  display: none;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.sx-menu-toggle__line {
  display: block;
  width: 16px;
  height: 1px;
  background: #fff;
}

.sx-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  color: #f7f7fa;
  background: #05060a;
  transition: opacity .3s ease,visibility .3s ease;
}

.sx-mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sx-mobile-menu__background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 10%,rgba(59,130,246,.13),transparent 38%),
    radial-gradient(circle at 90% 90%,rgba(236,72,153,.09),transparent 40%),
    #05060a;
}

.sx-mobile-menu__inner {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.sx-mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sx-mobile-menu__brand {
  display: inline-flex;
}

.sx-mobile-menu__brand img {
  display: block;
  width: 125px;
  height: auto;
}

.sx-mobile-menu__close {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  cursor: pointer;
}

.sx-mobile-menu__close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 1px;
  background: #fff;
}

.sx-mobile-menu__close span:first-child {
  transform: translate(-50%,-50%) rotate(45deg);
}

.sx-mobile-menu__close span:last-child {
  transform: translate(-50%,-50%) rotate(-45deg);
}

.sx-mobile-menu__nav {
  width: 100%;
  margin: auto 0;
  display: flex;
  flex-direction: column;
}

.sx-mobile-menu__nav > a {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 17px 0;
  color: #f7f7fa !important;
  border-bottom: 1px solid rgba(255,255,255,.085);
  text-decoration: none !important;
}

.sx-mobile-menu__nav > a:first-child {
  border-top: 1px solid rgba(255,255,255,.085);
}

.sx-mobile-menu__number {
  color: rgba(255,255,255,.28);
  font: 400 9px/1 "Inter",sans-serif;
  letter-spacing: .12em;
}

.sx-mobile-menu__title {
  color: #f7f7fa;
  font-family: "Manrope","Inter",sans-serif;
  font-size: clamp(28px,8vw,43px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.045em;
}

.sx-mobile-menu__arrow {
  color: rgba(255,255,255,.38);
  font-size: 17px;
  transition:
    color .3s ease,
    transform .3s ease;
}

.sx-mobile-menu__nav > a:hover .sx-mobile-menu__arrow {
  color: var(--sx-violet);
  transform: translate(3px,-3px);
}

.sx-mobile-menu__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
}

.sx-mobile-menu__footer-copy span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255,255,255,.32);
  font: 600 8px/1 "Inter",sans-serif;
  letter-spacing: .15em;
}

.sx-mobile-menu__footer-copy p {
  margin: 0;
  color: #f7f7fa;
  font: 400 12px/1.5 "Inter",sans-serif;
}

.sx-mobile-menu__cta {
  min-height: 46px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 19px;
  border-radius: 999px;
  color: #fff !important;
  background: linear-gradient(105deg,var(--sx-blue),var(--sx-violet),var(--sx-pink));
  font: 600 11px/1 "Inter",sans-serif;
  text-decoration: none !important;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.sx-header a:focus-visible,
.sx-header button:focus-visible {
  outline: 2px solid var(--sx-violet);
  outline-offset: 4px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width:1100px) {
  :root { --sx-header-mask-height: 110px; }

  .sx-header {
    padding: 15px 22px;
  }

  .sx-header__inner {
    display: flex;
    justify-content: space-between;
  }

  .sx-header__nav,
  .sx-header__cta {
    display: none;
  }

  .sx-menu-toggle {
    display: flex;
  }

  .sx-mobile-menu {
    display: block;
  }

  .sx-header.is-scrolled .sx-header__inner {
    padding-left: 16px;
    padding-right: 10px;
  }
}

@media (max-width:767px) {
  :root { --sx-header-mask-height: 88px; }

  .sx-header {
    padding: 12px 15px;
  }

  .sx-header::before {
    background:
      linear-gradient(
        180deg,
        #020207 0%,
        rgba(2,2,7,.985) 63%,
        rgba(2,2,7,0) 100%
      );
  }

  .sx-header::after {
    display: none;
  }

  .sx-header__inner {
    min-height: 56px;
    padding: 0;
  }

  .sx-header__logo {
    width: 118px;
  }

  .sx-menu-toggle {
    width: 42px;
    height: 42px;
  }

  .sx-header.is-scrolled {
    padding: 8px 10px;
  }

  .sx-header.is-scrolled .sx-header__inner {
    min-height: 54px;
    padding-left: 13px;
    padding-right: 7px;
    border-radius: 15px;
  }

  .sx-mobile-menu__inner {
    padding: 18px;
  }

  .sx-mobile-menu__brand img {
    width: 115px;
  }

  .sx-mobile-menu__close {
    width: 42px;
    height: 42px;
  }

  .sx-mobile-menu__footer {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
  }

  .sx-mobile-menu__cta {
    width: 100%;
  }
}

@media (prefers-reduced-motion:reduce) {
  .sx-header *,
  .sx-header *::before,
  .sx-header *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
