/* Narrix.studio global menu — 2026-08-08 / layout v4 */
:root {
  --narrix-menu-bg: rgba(2, 2, 3, 0.965);
  --narrix-menu-line: rgba(255, 255, 255, 0.10);
  --narrix-menu-muted: rgba(255, 255, 255, 0.42);
  --narrix-menu-blue: var(--brand, #3b8ceb);
  --narrix-menu-edge: max(22px, calc((100vw - 1180px) / 2));
}

html.narrix-menu-lock,
body.narrix-menu-open {
  overflow: hidden;
}

.narrix-menu-toggle {
  position: relative;
  z-index: 330;
  display: inline-flex;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.narrix-menu-toggle::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: inherit;
  background: rgba(255,255,255,.025);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: .82;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.narrix-menu-toggle:hover::before,
.narrix-menu-toggle:focus-visible::before,
.narrix-menu-toggle[aria-expanded='true']::before {
  border-color: rgba(59,140,235,.42);
  background: rgba(59,140,235,.07);
  box-shadow: 0 0 26px rgba(59,140,235,.10);
}

.narrix-menu-toggle:focus-visible {
  outline: 2px solid rgba(59,140,235,.72);
  outline-offset: 3px;
}

.narrix-menu-toggle__icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 22px;
  height: 16px;
}

.narrix-menu-toggle__line {
  position: absolute;
  left: 0;
  width: 22px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
  transition: top 220ms ease, transform 220ms ease, opacity 160ms ease, color 180ms ease;
}
.narrix-menu-toggle__line:nth-child(1) { top: 1px; }
.narrix-menu-toggle__line:nth-child(2) { top: 7px; }
.narrix-menu-toggle__line:nth-child(3) { top: 13px; }

.narrix-menu-toggle:hover .narrix-menu-toggle__line,
.narrix-menu-toggle:focus-visible .narrix-menu-toggle__line { color: #9acbff; }

.narrix-menu-toggle[aria-expanded='true'] .narrix-menu-toggle__line:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}
.narrix-menu-toggle[aria-expanded='true'] .narrix-menu-toggle__line:nth-child(2) {
  opacity: 0;
}
.narrix-menu-toggle[aria-expanded='true'] .narrix-menu-toggle__line:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

/* Homepage: no topbar logo; language + menu form one cluster on the right. */
.page-home > .lang-switch {
  position: fixed;
  top: 29px;
  right: calc(var(--narrix-menu-edge) + 62px);
  left: auto;
  z-index: 330;
}

.narrix-menu-toggle--standalone {
  position: fixed;
  top: 20px;
  right: var(--narrix-menu-edge);
}

/* Subpages: brand left; language + menu on the right. */
.hub-topbar.has-global-menu,
.patron-topbar.has-global-menu {
  justify-content: flex-start;
  gap: 10px;
}

.hub-topbar.has-global-menu .hub-brand,
.patron-topbar.has-global-menu .patron-brand {
  order: 1;
  margin-right: 0;
}

.hub-topbar.has-global-menu .hub-language,
.patron-topbar.has-global-menu .hub-language {
  order: 2;
  margin-left: auto;
  margin-right: 0;
}

.patron-topbar.has-global-menu .patron-download {
  order: 2;
  margin-left: auto;
  margin-right: 0;
}

.hub-topbar.has-global-menu .narrix-menu-toggle,
.patron-topbar.has-global-menu .narrix-menu-toggle {
  order: 3;
}

body.narrix-menu-open .hub-topbar,
body.narrix-menu-open .patron-topbar,
body.narrix-menu-open > .lang-switch {
  z-index: 330;
}

.narrix-menu-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  align-items: center;
  overflow: auto;
  padding: max(126px, 13vh) max(28px, calc((100vw - 1180px) / 2)) 72px;
  background: var(--narrix-menu-bg);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  -webkit-backdrop-filter: blur(18px) saturate(.92);
  backdrop-filter: blur(18px) saturate(.92);
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}

.narrix-menu-panel::before {
  content: '';
  position: fixed;
  width: min(720px, 74vw);
  aspect-ratio: 1;
  top: -34vw;
  right: -24vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,140,235,.14) 0%, rgba(59,140,235,.035) 38%, transparent 70%);
  pointer-events: none;
}

.narrix-menu-panel::after {
  content: '';
  position: fixed;
  inset: 20px;
  border: 1px solid rgba(255,255,255,.055);
  pointer-events: none;
}

body.narrix-menu-open .narrix-menu-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.narrix-menu-panel__inner {
  position: relative;
  z-index: 1;
  width: min(100%, 1180px);
  margin: 0 auto;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 260ms ease, opacity 220ms ease;
}

body.narrix-menu-open .narrix-menu-panel__inner {
  transform: translateY(0);
  opacity: 1;
}

.narrix-menu-panel__eyebrow {
  margin: 0 0 clamp(28px, 4vw, 48px);
  color: var(--narrix-menu-muted);
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: .70rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.narrix-menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--narrix-menu-line);
}

.narrix-menu-item {
  border-top: 1px solid var(--narrix-menu-line);
}

.narrix-menu-link {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 36px;
  gap: 18px;
  align-items: center;
  min-height: clamp(80px, 10.2vh, 116px);
  padding: 14px 0;
  color: rgba(255,255,255,.90);
  text-decoration: none;
  transition: color 180ms ease;
}

.narrix-menu-link__no {
  color: rgba(255,255,255,.28);
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  transition: color 180ms ease, transform 180ms ease;
}

.narrix-menu-link__label {
  font-family: var(--font-display, 'Sora', sans-serif);
  font-size: clamp(1.52rem, 3.15vw, 3.05rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.035em;
  text-wrap: balance;
  transition: transform 200ms ease, color 180ms ease, text-shadow 180ms ease;
}

.narrix-menu-link__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  color: rgba(255,255,255,.34);
  transition: color 180ms ease, transform 200ms ease;
}

.narrix-menu-link__arrow svg {
  width: 26px;
  height: 26px;
}

.narrix-menu-link:hover,
.narrix-menu-link:focus-visible {
  color: #fff;
  outline: none;
}

.narrix-menu-link:hover .narrix-menu-link__no,
.narrix-menu-link:focus-visible .narrix-menu-link__no {
  color: var(--narrix-menu-blue);
  transform: translateX(4px);
}

.narrix-menu-link:hover .narrix-menu-link__label,
.narrix-menu-link:focus-visible .narrix-menu-link__label {
  color: #f8fbff;
  transform: translateX(8px);
  text-shadow: 0 0 28px rgba(59,140,235,.13);
}

.narrix-menu-link:hover .narrix-menu-link__arrow,
.narrix-menu-link:focus-visible .narrix-menu-link__arrow {
  color: #9acbff;
  transform: translateX(5px);
}

.narrix-menu-panel__note {
  margin: 28px 0 0 76px;
  color: rgba(255,255,255,.28);
  font-size: .72rem;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .page-home > .lang-switch {
    top: 20px;
    right: 72px;
    left: auto;
  }

  .narrix-menu-toggle--standalone {
    top: 14px;
    right: 14px;
  }

  .hub-topbar.has-global-menu,
  .patron-topbar.has-global-menu {
    gap: 8px;
  }

  .hub-topbar.has-global-menu .narrix-menu-toggle,
  .patron-topbar.has-global-menu .narrix-menu-toggle {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .hub-topbar.has-global-menu .hub-language,
  .patron-topbar.has-global-menu .hub-language {
    margin-left: auto;
  }

  .narrix-menu-panel {
    align-items: start;
    padding: 112px 20px 42px;
  }

  .narrix-menu-panel::after {
    inset: 12px;
  }

  .narrix-menu-panel__eyebrow {
    margin-bottom: 24px;
    font-size: .66rem;
  }

  .narrix-menu-link {
    grid-template-columns: 34px minmax(0,1fr) 24px;
    gap: 10px;
    min-height: 78px;
    padding: 16px 0;
  }

  .narrix-menu-link__no {
    font-size: .62rem;
  }

  .narrix-menu-link__label {
    font-size: clamp(1.24rem, 6.4vw, 1.78rem);
    line-height: 1.08;
  }

  .narrix-menu-link__arrow svg {
    width: 21px;
    height: 21px;
  }

  .narrix-menu-panel__note {
    margin: 22px 0 0 44px;
    font-size: .68rem;
  }
}

@media (max-width: 430px) {
  .hub-topbar.has-global-menu .hub-brand,
  .hub-topbar.has-global-menu .hub-brand img,
  .patron-topbar.has-global-menu .patron-brand,
  .patron-topbar.has-global-menu .patron-brand img {
    width: 94px;
  }

  .hub-topbar.has-global-menu .hub-language,
  .patron-topbar.has-global-menu .hub-language {
    padding-inline: 10px;
    gap: 8px;
  }

  .narrix-menu-panel {
    padding-top: 98px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .narrix-menu-panel,
  .narrix-menu-panel__inner,
  .narrix-menu-toggle__line,
  .narrix-menu-link__label,
  .narrix-menu-link__no,
  .narrix-menu-link__arrow {
    transition: none !important;
  }
}
