/* Quiet, continuous feedback within the existing glass navigation. */
.nav-links { position: relative; isolation: isolate; }
.nav-links a { position: relative; padding-block: 8px; transition: color 220ms ease; }
.nav-links a[aria-current="location"] { color: #eef4ff; }
.nav-selection {
  position: absolute; left: -12px; top: 0; height: 100%; z-index: -1;
  border-radius: 10px; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, #a8c8ff0a, #a8c8ff16);
  transition: transform 460ms cubic-bezier(.22,1,.36,1), width 460ms cubic-bezier(.22,1,.36,1), opacity 220ms ease;
}
.nav-selection::after {
  content: ""; position: absolute; height: 1px; bottom: 0; left: 12px; right: 12px;
  background: linear-gradient(90deg, transparent, #abc8ff 25%, #abc8ff 75%, transparent);
  box-shadow: 0 2px 9px #9fbfff38;
}
body[data-home-mode="life"] .nav-links a[aria-current="location"] { color: #214e9b; }
body[data-home-mode="life"] .nav-selection { background: linear-gradient(180deg, #4775da04, #4775da10); }
body[data-home-mode="life"] .nav-selection::after { background: linear-gradient(90deg, transparent, #4775da 25%, #4775da 75%, transparent); box-shadow: none; }
/* Reserve both languages' space so translating never moves the action group. */
.nav-actions { flex: 0 0 auto; }
.nav .nav-contact {
  display: grid; grid-template-columns: minmax(0,1fr) 14px;
  align-items: center; gap: 10px;
  flex: 0 0 140px; width: 140px; height: 40px;
  padding: 0 17px; line-height: 20px;
}
.nav .nav-contact span { margin-left: 0; }
.nav-contact-label { display: block; text-align: center; }
.nav-contact-arrow { display: grid; place-items: center; }
.language-switch { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); flex: 0 0 84px; width: 84px; }
@media (max-width:700px) {
  .nav .nav-contact { grid-template-columns: minmax(0,1fr) 12px; gap: 8px; flex-basis: 110px; width: 110px; padding: 0 10px; }
}
@media (max-width:360px) {
  .nav-actions { gap: 8px; }
  .language-switch { flex-basis: 80px; width: 80px; }
  .language-switch button { padding-inline: 8px; }
  .nav .nav-contact { flex-basis: 106px; width: 106px; padding-inline: 8px; }
}
.language-switch::before {
  content: ""; position: absolute; left: 3px; top: 3px; bottom: 3px;
  width: calc((100% - 8px) / 2); border-radius: 22px; z-index: -1;
  background: #f5f5f7;
  transition: transform 360ms cubic-bezier(.22,1,.36,1), background 300ms ease;
}
.language-switch[data-selected="zh"]::before { transform: translateX(calc(100% + 2px)); }
.language-switch button[aria-pressed="true"],
body[data-home-mode="life"] .language-switch button[aria-pressed="true"] { background: transparent; }
body[data-home-mode="life"] .language-switch::before { background: #4775da; }
html.language-transitioning { overflow-anchor: none; scroll-behavior: auto; }
html.language-transitioning body { overflow-anchor: none; }
@media (prefers-reduced-motion: reduce) {
  .nav-selection, .language-switch::before, .nav-links a { transition: none; }
}
