:root {
  --site-header-main-height: 96px;
  --site-header-menu-height: 50px;
  --site-header-height: calc(var(--site-header-main-height) + var(--site-header-menu-height));
}

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 70;
  display: grid;
  grid-template-rows: var(--site-header-main-height) var(--site-header-menu-height);
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  width: 100%;
  min-height: var(--site-header-height);
  padding: 0;
  border-bottom: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, backdrop-filter 180ms ease;
}

[id] {
  scroll-margin-top: calc(var(--site-header-height, 146px) + 18px);
}

.nav--solid,
.nav.is-scrolled {
  border-bottom-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(90deg, rgba(32, 200, 255, 0.055), transparent 30%, rgba(245, 45, 184, 0.05)),
    rgba(3, 8, 23, 0.9);
  backdrop-filter: blur(18px);
}

.nav__masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  min-width: 0;
  padding: 12px max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
}

.nav__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: #fffdf9;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.brand-icon {
  display: block;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255, 86, 201, 0.3),
    0 0 16px rgba(26, 194, 255, 0.42),
    0 0 28px rgba(255, 45, 191, 0.34),
    0 0 48px rgba(132, 91, 255, 0.28),
    0 0 72px rgba(255, 92, 64, 0.18);
}

.brand-word {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  color: #fffdf9;
  font-family: var(--font-wordmark);
  font-weight: 800;
  line-height: 0.82;
  text-transform: uppercase;
}

.brand-word__letter {
  display: inline-block;
  color: transparent;
  background: var(--letter-fill);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 0.28px rgba(255, 255, 255, 0.13);
  filter:
    drop-shadow(0 0 0.12em var(--letter-glow))
    drop-shadow(0 0.07em 0.05em rgba(0, 0, 0, 0.34));
}

.brand-word__letter--r {
  --letter-fill: linear-gradient(180deg, #78ecff 0%, #2dc7ff 34%, #168cff 68%, #1b5ee4 100%);
  --letter-glow: rgba(35, 190, 255, 0.48);
}

.brand-word__letter--i {
  --letter-fill: linear-gradient(180deg, #ded9ff 0%, #aaa0ff 34%, #7658ff 72%, #5638de 100%);
  --letter-glow: rgba(137, 112, 255, 0.46);
}

.brand-word__letter--s {
  --letter-fill: linear-gradient(150deg, #ff98c8 0%, #ff72a5 25%, #db40e6 62%, #7b37e9 100%);
  --letter-glow: rgba(237, 58, 207, 0.46);
}

.brand-word__letter--o {
  --letter-fill: linear-gradient(145deg, #ffe13b 0%, #ffc02d 27%, #ff9430 53%, #ff5d68 82%, #8b3cf1 100%);
  --letter-glow: rgba(255, 173, 31, 0.45);
}

.brand-word--nav {
  gap: 0.3em;
  font-size: clamp(2.1rem, 2.8vw, 3.05rem);
  letter-spacing: 0;
}

.nav__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 3.2vw, 48px);
  min-width: 0;
  width: 100%;
  height: var(--site-header-menu-height);
  padding: 0 max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(90deg, rgba(32, 200, 255, 0.035), transparent 30%, rgba(245, 45, 184, 0.03)),
    rgba(2, 6, 18, 0.28);
  color: #c8cad3;
  font-size: 0.8rem;
  font-weight: 700;
}

.nav__links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.nav__links a:hover { color: #fffdf9; }

.nav__links a[aria-current="page"] {
  color: #fffdf9;
}

.nav__links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #20c8ff, #a383ff 48%, #ff7892);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav__menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(180, 151, 255, 0.42);
  border-radius: 50%;
  color: #fffdf9;
  background: rgba(163, 131, 255, 0.11);
  cursor: pointer;
}

.nav__menu-button:hover { background: rgba(163, 131, 255, 0.2); }

.nav__menu-icon,
.nav__menu-icon::before,
.nav__menu-icon::after {
  display: block;
  width: 17px;
  height: 2px;
  background: currentColor;
  transition: transform 180ms ease, background 180ms ease;
}

.nav__menu-icon { position: relative; }
.nav__menu-icon::before,
.nav__menu-icon::after { content: ""; position: absolute; left: 0; }
.nav__menu-icon::before { top: -5px; }
.nav__menu-icon::after { top: 5px; }

.nav.is-menu-open .nav__menu-icon { background: transparent; }
.nav.is-menu-open .nav__menu-icon::before { transform: translateY(5px) rotate(45deg); }
.nav.is-menu-open .nav__menu-icon::after { transform: translateY(-5px) rotate(-45deg); }

.nav .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-store-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 146px;
  min-height: 46px;
  padding: 6px 14px 7px 12px;
  overflow: hidden;
  border: 1px solid rgba(219, 202, 255, 0.4);
  border-radius: 13px;
  color: #fffdf9;
  background:
    radial-gradient(circle at 16% 18%, rgba(32, 200, 255, 0.24), transparent 34%),
    radial-gradient(circle at 84% 78%, rgba(245, 45, 184, 0.22), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.065) 48%, rgba(163, 131, 255, 0.12)),
    rgba(255, 255, 255, 0.075);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -18px 42px rgba(3, 8, 23, 0.16),
    0 0 24px rgba(32, 200, 255, 0.12),
    0 0 38px rgba(245, 45, 184, 0.12),
    0 16px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.app-store-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 12px;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.36), transparent 34%),
    linear-gradient(300deg, rgba(32, 200, 255, 0.18), transparent 36%);
  opacity: 0.42;
  mix-blend-mode: screen;
}

.app-store-button:hover {
  transform: translateY(-1px);
  border-color: rgba(219, 202, 255, 0.68);
  background:
    radial-gradient(circle at 16% 18%, rgba(32, 200, 255, 0.32), transparent 36%),
    radial-gradient(circle at 84% 78%, rgba(245, 45, 184, 0.3), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.085) 48%, rgba(163, 131, 255, 0.17)),
    rgba(255, 255, 255, 0.095);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -18px 42px rgba(3, 8, 23, 0.14),
    0 0 30px rgba(32, 200, 255, 0.18),
    0 0 48px rgba(245, 45, 184, 0.16),
    0 18px 38px rgba(0, 0, 0, 0.26);
}

.app-store-button svg {
  position: relative;
  z-index: 1;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  fill: currentColor;
  filter: drop-shadow(0 0 10px rgba(32, 200, 255, 0.2));
}

.app-store-button span {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1px;
  line-height: 1;
}

.app-store-button small {
  color: rgba(219, 202, 255, 0.86);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0;
}

.app-store-button b {
  color: #fffdf9;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0;
}

@media (max-width: 960px) {
  :root {
    --site-header-main-height: 88px;
    --site-header-menu-height: 0px;
    --site-header-height: var(--site-header-main-height);
  }
  [id] { scroll-margin-top: 112px; }
  .nav {
    display: block;
    min-height: 88px;
  }
  .nav__masthead { height: 88px; padding-block: 8px; column-gap: 14px; }
  .nav__brand { min-width: 0; margin-right: 0; }
  .brand-word--nav { gap: 0.18em; font-size: 1.35rem; }
  .nav__menu-button { display: inline-flex; }
  .nav__links {
    position: absolute;
    inset: 88px 0 auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 88px);
    padding: 10px max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))) 18px;
    overflow-y: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    background:
      linear-gradient(150deg, rgba(32, 200, 255, 0.07), transparent 38%, rgba(245, 45, 184, 0.06)),
      #030817;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
  }
  .nav.is-menu-open .nav__links { display: flex; }
  .nav__links a { display: block; height: auto; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .nav__links a::after { display: none; }
  .nav__links a[aria-current="page"] { box-shadow: inset 3px 0 #b497ff; padding-left: 14px; }
  .app-store-button--header { min-width: 132px; min-height: 42px; padding: 5px 12px 6px 10px; }
  .app-store-button--header svg { width: 21px; height: 21px; }
  .app-store-button--header small { font-size: 0.54rem; }
  .app-store-button--header b { font-size: 0.93rem; }
}

@media (max-width: 640px) {
  .nav__masthead { column-gap: 9px; padding-inline: 14px; }

  .nav__brand {
    max-width: 100%;
  }

  .brand-word--nav {
    gap: 0.14em;
    font-size: 1.12rem;
  }

  .nav__menu-button {
    position: static;
  }

  .app-store-button--header {
    position: static;
    width: 46px;
    min-width: 46px;
    min-height: 42px;
    padding: 0;
    gap: 0;
  }
  .app-store-button--header svg { width: 20px; height: 20px; }
  .app-store-button--header span { display: none; }
}

@media (max-width: 390px) {
  [id] { scroll-margin-top: 112px; }
  .nav__masthead { column-gap: 8px; }
  .nav__brand { font-size: 1.15rem; }
  .brand-icon { width: 56px; height: 56px; border-radius: 15px; }
  .brand-word--nav { gap: 0.1em; font-size: 1.04rem; }
  .app-store-button--header { width: 44px; min-width: 44px; min-height: 42px; padding: 0; gap: 0; }
  .app-store-button--header svg { width: 19px; height: 19px; }
  .app-store-button--header span { display: none; }
}
