:root { --header-offset: 108px; }

/* A persistent navigation dock keeps every section one click away. */
.nav.shell {
  position: fixed;
  z-index: 30;
  top: 14px;
  left: 50%;
  width: min(1180px, calc(100% - 40px));
  height: auto;
  min-height: 70px;
  padding: 10px 16px;
  gap: 16px;
  border: 1px solid rgba(123, 174, 255, .22);
  border-radius: 16px;
  background: rgba(6, 8, 28, .91);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .24), inset 0 1px rgba(255, 255, 255, .04);
}

.nav .brand { flex-shrink: 0; min-height: 44px; font-size: 15px; white-space: nowrap; }
.nav .brand-mascot,
footer .brand-mascot {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255, 47, 179, .22));
}
footer .brand { min-height: 44px; white-space: nowrap; border-radius: 8px; }
.nav nav { display: flex; align-items: center; gap: 5px; min-width: 0; }
.nav nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(123, 174, 255, .13);
  border-radius: 10px;
  color: #b9c2d9;
  background: rgba(57, 198, 255, .025);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .08em;
  text-align: center;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.nav nav #navRadar {
  color: #d2f7ff;
  border-color: rgba(57, 198, 255, .35);
  background: linear-gradient(115deg, rgba(57, 198, 255, .14), rgba(91, 92, 255, .12));
}
.nav nav #navRadar::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #74e4ff;
  box-shadow: 0 0 10px rgba(57, 198, 255, .6);
}
.nav nav a[aria-current="location"] {
  color: #fff;
  border-color: rgba(255, 77, 187, .55);
  background: linear-gradient(115deg, rgba(255, 47, 179, .2), rgba(124, 80, 255, .16));
  box-shadow: inset 0 -2px #ff6bc7;
}
.nav nav #navRadar[aria-current="location"] { color: #fff; border-color: #6cdfff; box-shadow: inset 0 -2px #6cdfff, 0 0 18px rgba(57, 198, 255, .08); }

.nav .nav-tools { flex-shrink: 0; gap: 10px; }
.nav .language-switch {
  padding: 3px;
  border-color: rgba(123, 174, 255, .22);
  border-radius: 12px;
  background: rgba(2, 5, 18, .7);
}
.nav .language-switch button {
  min-width: 38px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #9ea9c5;
  font-size: 10px;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.nav .language-switch button[aria-pressed="true"] {
  color: #fff;
  border-color: rgba(255, 114, 204, .42);
  background: linear-gradient(125deg, rgba(214, 48, 157, .85), rgba(107, 69, 225, .9));
  box-shadow: inset 0 1px rgba(255, 255, 255, .14);
}
.nav .status { padding: 10px 11px; font-size: 9px; letter-spacing: .08em; }

.nav a:focus-visible,
.nav button:focus-visible,
footer .brand:focus-visible {
  outline: 2px solid #91e7ff;
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}
.nav nav a:active,
.nav .language-switch button:active { transform: translateY(1px); }

section[id],
#signalMethod { scroll-margin-top: var(--header-offset); }

/* Keep fixed navigation attached to the viewport during language changes. */
@keyframes i18nFade { from { opacity: .55; } to { opacity: 1; } }

@media (hover: hover) {
  .nav nav a:hover { color: #fff; background-color: rgba(57, 198, 255, .1); border-color: rgba(123, 174, 255, .4); }
  .nav nav #navRadar:hover { border-color: #72dcff; box-shadow: 0 0 20px rgba(57, 198, 255, .13); }
  .nav .language-switch button:hover { color: #fff; border-color: rgba(123, 174, 255, .4); }
}

@media (max-width: 1100px) {
  .nav .status { display: none; }
  .nav nav a { padding-inline: 11px; }
}

@media (max-width: 900px) {
  :root { --header-offset: 162px; }
  .nav.shell {
    top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    gap: 8px 12px;
    padding: 10px 12px;
  }
  .nav .brand { grid-column: 1; grid-row: 1; }
  .nav .nav-tools { grid-column: 2; grid-row: 1; margin-left: 0; justify-self: end; }
  .nav nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 5px;
    padding: 0;
    border: 0;
  }
  .nav nav a { min-width: 0; padding-inline: 7px; font-size: 10px; }
  .hero { height: auto; min-height: 850px; padding: calc(var(--header-offset) + 24px) 0 100px; }
  .hero-copy { padding-top: 0; }
}

@media (max-width: 540px) {
  :root { --header-offset: 202px; }
  .nav.shell { width: calc(100% - 24px); padding: 10px; border-radius: 14px; gap: 8px; }
  .nav .brand { font-size: 13px; letter-spacing: .08em; gap: 7px; }
  .nav .brand-mascot { width: 32px; height: 36px; }
  .nav .language-switch button { min-width: 40px; min-height: 40px; padding-inline: 5px; }
  .nav nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .nav nav a { min-height: 44px; font-size: 10px; }
}

@media (max-width: 360px) {
  .nav .brand { font-size: 11px; letter-spacing: .04em; gap: 6px; }
  .nav .brand-mascot { width: 26px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav nav a,
  .nav .language-switch button { transition: none; }
}

@media (forced-colors: active) {
  .nav.shell,
  .nav nav a,
  .nav .language-switch,
  .nav .language-switch button { border: 1px solid ButtonText; }
  .nav nav a[aria-current="location"],
  .nav .language-switch button[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -4px; }
}
