/*
 * Shared site header.
 * The approved globe landing keeps its protected, page-scoped header bundle.
 * Every other shell loads this file after styles.css.
 */

html:has(> body:is(.public-home-page, .public-auth-page, .legal-page)),
body:is(.public-home-page, .public-auth-page, .legal-page) {
  min-width: 0;
}

body:is(
  .public-home-page,
  .public-auth-page,
  .legal-page
) {
  --site-header-content-rail: 1180px;
  --site-header-gutter: var(--shell-gutter, 16px);
  --site-header-surface:
    radial-gradient(320px circle at 18% 0%, rgba(83, 205, 255, 0.09), transparent 72%),
    radial-gradient(300px circle at 82% 0%, rgba(113, 75, 255, 0.055), transparent 74%),
    rgba(6, 12, 24, 0.88);
}

body:is(
  .public-home-page,
  .public-auth-page,
  .legal-page,
  .orders-page,
  .user-order-wizard,
  .billing-page,
  .profile-page,
  .admin-page
) {
  scrollbar-gutter: auto;
}

body:is(
  .orders-page,
  .user-order-wizard,
  .billing-page,
  .profile-page,
  .admin-page
) {
  --site-header-content-rail: 1120px;
  --site-header-gutter: 16px;
  --site-header-surface:
    radial-gradient(320px circle at 18% 0%, rgba(83, 205, 255, 0.075), transparent 72%),
    radial-gradient(280px circle at 82% 0%, rgba(113, 75, 255, 0.04), transparent 74%),
    rgba(6, 12, 24, 0.93);
}

body:is(
  .public-home-page,
  .public-auth-page,
  .legal-page,
  .orders-page,
  .user-order-wizard,
  .billing-page,
  .profile-page,
  .admin-page
) > .topbar {
  position: relative;
  inset: auto;
  align-self: stretch;
  width: 100%;
  max-width: none;
  min-height: var(--shell-header-height, 72px);
  margin: 0;
  padding-inline:
    max(
      var(--site-header-gutter),
      calc((100% - var(--site-header-content-rail)) / 2)
    );
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  transform: none;
  isolation: isolate;
}

body:is(
  .public-home-page,
  .public-auth-page,
  .legal-page,
  .orders-page,
  .user-order-wizard,
  .billing-page,
  .profile-page,
  .admin-page
) > .topbar::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  width: auto;
  transform: none;
  border: 0;
  border-bottom: 1px solid rgba(125, 164, 255, 0.14);
  border-radius: 0;
  background: var(--site-header-surface);
  box-shadow:
    0 10px 30px rgba(0, 7, 27, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  pointer-events: none;
}

body:is(
  .public-home-page,
  .public-auth-page,
  .legal-page,
  .orders-page,
  .user-order-wizard,
  .billing-page,
  .profile-page,
  .admin-page
) > .topbar::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  left:
    max(
      var(--site-header-gutter),
      calc((100% - var(--site-header-content-rail)) / 2)
    );
  width: min(220px, 42vw);
  height: 1px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(56, 220, 255, 0.1) 18%,
      rgba(94, 234, 212, 0.34) 49%,
      rgba(119, 90, 255, 0.2) 76%,
      transparent
    );
  box-shadow: 0 0 12px rgba(61, 197, 255, 0.1);
  opacity: 0.66;
  pointer-events: none;
}

body.admin-page > .topbar {
  --site-header-gutter: 14px;
}

#site-logo.site-brand {
  width: 223px;
  max-width: none;
  min-width: 0;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding: 0;
}

#site-logo > .brand-reference-lockup {
  width: 223px;
  max-width: none;
  height: 40px;
  aspect-ratio: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  overflow: visible;
  opacity: 1;
  filter: none;
  transform: none;
}

#site-logo .brand-reference-mark {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  overflow: visible;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translateZ(0);
  transition:
    transform 220ms ease,
    filter 220ms ease;
}

#site-logo .brand-reference-mark::before {
  content: none;
}

#site-logo .brand-reference-mark::after {
  content: none;
}

#site-logo .brand-reference-mark-image {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: block;
  max-width: none;
  overflow: visible;
  object-fit: contain;
  filter:
    drop-shadow(0 0 4px rgba(51, 119, 255, 0.3))
    drop-shadow(0 2px 4px rgba(0, 6, 24, 0.38));
  pointer-events: none;
}

#site-logo .brand-reference-name {
  position: relative;
  flex: 0 0 auto;
  width: 159px;
  height: 29px;
  display: block;
  overflow: hidden;
  isolation: auto;
}

#site-logo .brand-reference-name > img {
  position: absolute;
  top: -6.9px;
  left: -6.9px;
  width: 175px;
  height: 36.9px;
  max-width: none;
  display: block;
  object-fit: fill;
  mix-blend-mode: normal;
  filter: brightness(1.3) saturate(1.04) contrast(1);
  -webkit-mask-image: url("/assets/pfexpert-reference-wordmark.png?v=20260729-reference-logo-1");
  mask-image: url("/assets/pfexpert-reference-wordmark.png?v=20260729-reference-logo-1");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  mask-mode: luminance;
  pointer-events: none;
}

#site-logo:hover > .brand-reference-lockup,
#site-logo:focus-visible > .brand-reference-lockup {
  opacity: 1;
  filter: none;
  transform: none;
}

#site-logo:hover .brand-reference-mark,
#site-logo:focus-visible .brand-reference-mark {
  filter: brightness(1.06);
  transform: translateY(-1px) scale(1.025) translateZ(0);
}

@media (max-width: 620px) {
  #site-logo.site-brand,
  #site-logo > .brand-reference-lockup {
    width: 177px;
  }

  #site-logo > .brand-reference-lockup {
    height: 32px;
    gap: 7px;
  }

  #site-logo .brand-reference-mark {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
  }

  #site-logo .brand-reference-mark-image {
    width: 29px;
    height: 29px;
  }

  #site-logo .brand-reference-name {
    width: 126px;
    height: 23px;
  }

  #site-logo .brand-reference-name > img {
    top: -5.5px;
    left: -5.5px;
    width: 138.6px;
    height: 29.2px;
  }
}

@media (max-width: 350px) {
  #site-logo > .brand-reference-lockup {
    gap: 6px;
  }

  #site-logo .brand-reference-mark {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }

  #site-logo .brand-reference-mark-image {
    width: 26px;
    height: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #site-logo .brand-reference-mark {
    transition-duration: 0.01ms;
  }
}
