.blu-site-header {
  --blu-header-x: -50%;
  position: fixed;
  z-index: 1000;
  top: clamp(20px, 3.4vh, 38px);
  left: 50%;
  width: min(920px, calc(100% - 48px));
  min-height: 66px;
  transform: translateX(-50%);
}

.blu-cafe-home .blu-site-header:not(.is-scroll-ready) {
  opacity: 0;
  transform: translate(-50%, -26px);
  animation: blu-header-arrives 0.36s 1.92s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.blu-site-header.is-scroll-ready {
  opacity: 1;
  animation: none;
}

.blu-site-header.is-scroll-visible {
  visibility: visible;
  opacity: 1;
  transform: translate3d(var(--blu-header-x), 0, 0);
  clip-path: inset(0);
  pointer-events: auto;
}

.blu-site-header.is-scroll-hidden {
  visibility: hidden;
  opacity: 0;
  transform: translate3d(var(--blu-header-x), -110px, 0);
  clip-path: inset(0);
  pointer-events: none;
}

.blu-site-header.is-glitch-out {
  animation: blu-header-glitch-out 210ms linear both;
  will-change: transform, opacity, clip-path;
  pointer-events: none;
}

.blu-site-header.is-glitch-in {
  visibility: visible;
  animation: blu-header-glitch-in 240ms linear both;
  will-change: transform, opacity, clip-path;
}

.blu-site-header::before,
.blu-site-header::after {
  position: absolute;
  z-index: 4;
  right: 0;
  left: 0;
  height: 2px;
  content: "";
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 4%, #51a5d9 22%, #f7fcff 50%, #f20103 78%, transparent 96%);
}

.blu-site-header::before {
  top: 24%;
}

.blu-site-header::after {
  bottom: 21%;
}

.blu-site-header:is(.is-glitch-in, .is-glitch-out)::before {
  animation: blu-header-glitch-line-a 190ms steps(2, end) both;
}

.blu-site-header:is(.is-glitch-in, .is-glitch-out)::after {
  animation: blu-header-glitch-line-b 220ms steps(2, end) both;
}

.blu-cafe-home .blu-site-header:not(.is-scroll-ready)::before {
  animation: blu-header-glitch-line-a 180ms 1.97s steps(2, end) both;
}

.blu-cafe-home .blu-site-header:not(.is-scroll-ready)::after {
  animation: blu-header-glitch-line-b 200ms 2s steps(2, end) both;
}

.blu-primary-navigation {
  position: relative;
  border: 1px solid rgba(100, 205, 255, 0.36);
  border-radius: 2px;
  background: linear-gradient(110deg, rgba(7, 35, 69, 0.82), rgba(8, 12, 28, 0.78) 52%, rgba(64, 6, 20, 0.76));
  box-shadow:
    -18px 12px 44px rgba(81, 165, 217, 0.12),
    18px 12px 44px rgba(242, 1, 3, 0.1),
    inset 0 1px rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.blu-primary-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 4vw, 58px);
  min-height: 66px;
  margin: 0;
  padding: 0 34px;
  list-style: none;
}

.blu-primary-menu > li {
  position: relative;
  margin: 0;
  padding: 0;
}

.blu-primary-menu > li:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: clamp(-31px, -2vw, -15px);
  content: "·";
  transform: translateY(-56%);
  color: rgba(214, 239, 255, 0.58);
}

.blu-primary-menu > li > a,
.blu-primary-menu > li > .blu-menu-label {
  position: relative;
  display: block;
  padding: 11px 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(242, 249, 255, 0.94);
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.17em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.blu-primary-menu > li > a {
  transition:
    translate 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.24s ease,
    background-color 0.24s ease,
    box-shadow 0.24s ease,
    color 0.24s ease;
}

.blu-primary-menu > li > .blu-menu-label {
  cursor: default;
  opacity: 0.9;
  user-select: none;
}

.blu-primary-menu > li > a:is(:hover, :focus-visible) {
  translate: 0 -4px;
  border-color: rgba(255, 255, 255, 0.96);
  outline: none;
  color: #fff;
  background: linear-gradient(110deg, rgba(81, 165, 217, 0.14), rgba(242, 1, 3, 0.11));
  box-shadow: 0 8px 22px rgba(12, 110, 195, 0.18), 0 0 16px rgba(255, 255, 255, 0.08);
}

.blu-mobile-brand,
.blu-menu-toggle {
  display: none;
}

@keyframes blu-header-arrives {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -26px, 0);
    clip-path: inset(0);
  }
  30% {
    opacity: 0.7;
    transform: translate3d(calc(-50% + 3px), -9px, 0);
    clip-path: inset(54% 0 12% 0);
  }
  46% {
    opacity: 0.44;
    transform: translate3d(calc(-50% - 2px), -5px, 0);
    clip-path: inset(10% 0 66% 0);
  }
  64% {
    opacity: 0.94;
    transform: translate3d(calc(-50% + 2px), -1px, 0);
    clip-path: inset(0);
  }
  82% {
    opacity: 1;
    transform: translate3d(calc(-50% - 1px), 0, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
    clip-path: inset(0);
  }
}

@keyframes blu-header-arrives-mobile {
  0% {
    opacity: 0;
    transform: translate3d(0, -26px, 0);
    clip-path: inset(0);
  }
  30% {
    opacity: 0.7;
    transform: translate3d(3px, -9px, 0);
    clip-path: inset(54% 0 12% 0);
  }
  46% {
    opacity: 0.44;
    transform: translate3d(-2px, -5px, 0);
    clip-path: inset(10% 0 66% 0);
  }
  64% {
    opacity: 0.94;
    transform: translate3d(2px, -1px, 0);
    clip-path: inset(0);
  }
  82% {
    opacity: 1;
    transform: translate3d(-1px, 0, 0);
  }
  100% {
    opacity: 1;
    transform: none;
    clip-path: inset(0);
  }
}

@keyframes blu-header-glitch-out {
  0% {
    opacity: 1;
    transform: translate3d(var(--blu-header-x), 0, 0);
    clip-path: inset(0);
  }
  16% {
    opacity: 0.92;
    transform: translate3d(calc(var(--blu-header-x) + 4px), -2px, 0);
    clip-path: inset(0 0 61% 0);
  }
  31% {
    opacity: 1;
    transform: translate3d(calc(var(--blu-header-x) - 5px), -5px, 0);
    clip-path: inset(39% 0 22% 0);
  }
  49% {
    opacity: 0.76;
    transform: translate3d(calc(var(--blu-header-x) + 3px), -14px, 0);
    clip-path: inset(70% 0 7% 0);
  }
  67% {
    opacity: 0.48;
    transform: translate3d(calc(var(--blu-header-x) - 2px), -39px, 0);
    clip-path: inset(16% 0 46% 0);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--blu-header-x), -110px, 0);
    clip-path: inset(0);
  }
}

@keyframes blu-header-glitch-in {
  0% {
    opacity: 0;
    transform: translate3d(var(--blu-header-x), -110px, 0);
    clip-path: inset(0);
  }
  24% {
    opacity: 0.42;
    transform: translate3d(calc(var(--blu-header-x) + 5px), -31px, 0);
    clip-path: inset(11% 0 58% 0);
  }
  43% {
    opacity: 1;
    transform: translate3d(calc(var(--blu-header-x) - 4px), -8px, 0);
    clip-path: inset(64% 0 7% 0);
  }
  61% {
    transform: translate3d(calc(var(--blu-header-x) + 3px), 1px, 0);
    clip-path: inset(35% 0 27% 0);
  }
  79% {
    transform: translate3d(calc(var(--blu-header-x) - 1px), -1px, 0);
    clip-path: inset(0);
  }
  100% {
    opacity: 1;
    transform: translate3d(var(--blu-header-x), 0, 0);
    clip-path: inset(0);
  }
}

@keyframes blu-header-glitch-line-a {
  0%, 100% { opacity: 0; transform: translateX(0) scaleX(0.72); }
  28% { opacity: 0.9; transform: translateX(8px) scaleX(0.96); }
  58% { opacity: 0.34; transform: translateX(-11px) scaleX(0.54); }
}

@keyframes blu-header-glitch-line-b {
  0%, 100% { opacity: 0; transform: translateX(0) scaleX(0.58); }
  39% { opacity: 0.72; transform: translateX(-7px) scaleX(0.88); }
  69% { opacity: 0.25; transform: translateX(12px) scaleX(0.42); }
}

body.admin-bar .blu-site-header {
  top: calc(32px + clamp(20px, 3.4vh, 38px));
}

@media (max-width: 760px) {
  .blu-site-header {
    --blu-header-x: 0px;
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 28px);
    min-height: 58px;
    padding: 0 16px;
    border: 1px solid rgba(104, 206, 255, 0.32);
    background: linear-gradient(110deg, rgba(6, 31, 61, 0.88), rgba(30, 5, 20, 0.86));
    box-shadow: -12px 15px 36px rgba(81, 165, 217, 0.12), 12px 15px 36px rgba(242, 1, 3, 0.1);
    transform: none;
    animation-name: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .blu-cafe-home .blu-site-header:not(.is-scroll-ready) {
    transform: translateY(-26px);
    animation-name: blu-header-arrives-mobile;
  }

  .blu-site-header.is-scroll-visible {
    transform: none;
  }

  .blu-site-header.is-glitch-out {
    animation: blu-header-glitch-out 210ms linear both;
  }

  .blu-site-header.is-glitch-in {
    animation: blu-header-glitch-in 240ms linear both;
  }

  body.blu-menu-is-open .blu-site-header {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    animation: none !important;
    pointer-events: auto !important;
    will-change: auto;
  }

  .blu-mobile-brand {
    display: inline-block;
    color: var(--blu-paper);
    font-size: 21px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
  }

  .blu-menu-toggle {
    position: relative;
    z-index: 2;
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-content: center;
    gap: 7px;
    border: 0;
    background: transparent;
    color: var(--blu-paper);
    cursor: pointer;
  }

  .blu-menu-toggle span {
    display: block;
    width: 23px;
    height: 1px;
    background: currentColor;
    transition: transform 0.32s ease;
  }

  .blu-menu-toggle:focus-visible {
    border-radius: 2px;
    outline: 2px solid rgba(255, 255, 255, 0.96);
    outline-offset: 3px;
  }

  .blu-menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(4px) rotate(45deg);
  }

  .blu-menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-4px) rotate(-45deg);
  }

  .blu-primary-navigation {
    position: fixed;
    inset: 0;
    display: grid;
    visibility: hidden;
    place-items: center;
    border: 0;
    border-radius: 0;
    opacity: 0;
    transform: translateY(-16px);
    background:
      radial-gradient(circle at 28% 42%, rgba(81, 165, 217, 0.24), transparent 40%),
      radial-gradient(circle at 76% 54%, rgba(242, 1, 3, 0.2), transparent 42%),
      rgba(3, 6, 12, 0.98);
    transition: opacity 0.34s ease, transform 0.34s ease, visibility 0.34s;
  }

  .blu-primary-navigation.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .blu-primary-menu {
    flex-direction: column;
    gap: 12px;
    min-height: auto;
    padding: 86px 28px 40px;
  }

  .blu-primary-menu > li:not(:last-child)::after {
    display: none;
  }

  .blu-primary-menu > li > a,
  .blu-primary-menu > li > .blu-menu-label {
    padding: 13px 18px;
    font-size: clamp(16px, 4.6vw, 20px);
    text-align: center;
  }

}

@media (max-width: 782px) {
  body.admin-bar .blu-site-header {
    top: 60px;
  }
}

.elementor-editor-active .blu-site-header,
.elementor-editor-active.blu-cafe-home .blu-site-header {
  opacity: 1;
  transform: translate(-50%, 0);
  animation: none;
  filter: none;
}

.elementor-editor-active .blu-primary-menu > li > a,
.elementor-editor-active .blu-primary-menu > li > .blu-menu-label {
  opacity: 1;
  transform: none;
  animation: none;
}

@media (max-width: 760px) {
  .elementor-editor-active .blu-site-header,
  .elementor-editor-active.blu-cafe-home .blu-site-header {
    left: 14px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blu-site-header,
  .blu-cafe-home .blu-site-header,
  .blu-cafe-home .blu-site-header:not(.is-scroll-ready),
  .blu-cafe-home .blu-primary-menu > li > a,
  .blu-cafe-home .blu-primary-menu > li > .blu-menu-label {
    animation: none;
    filter: none;
  }

  .blu-site-header:not(.is-scroll-hidden),
  .blu-cafe-home .blu-site-header:not(.is-scroll-hidden) {
    visibility: visible;
    opacity: 1;
    transform: translate3d(var(--blu-header-x), 0, 0);
  }

  .blu-site-header.is-scroll-hidden {
    visibility: hidden;
    opacity: 0;
    transform: translate3d(var(--blu-header-x), -110px, 0);
    pointer-events: none;
  }

  .blu-site-header.is-glitch-in,
  .blu-site-header.is-glitch-out {
    animation: none;
  }

  .blu-site-header::before,
  .blu-site-header::after {
    display: none;
  }

  .blu-menu-toggle span,
  .blu-primary-navigation {
    transition: none;
  }

  .blu-cafe-home .blu-primary-menu > li > a,
  .blu-cafe-home .blu-primary-menu > li > .blu-menu-label {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 760px) {
  .blu-site-header,
  .blu-cafe-home .blu-site-header {
    left: 14px;
  }

  .blu-site-header:not(.is-scroll-hidden),
  .blu-cafe-home .blu-site-header:not(.is-scroll-hidden) {
    transform: none;
  }
}
