/* Five greetings share one grid cell, keeping the navigation width stable. */
header.glass-nav nav .nav-greeting {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 6px 10px;
  color: var(--blue-800);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.5;
  cursor: default;
}

header.glass-nav nav .nav-greeting::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 1px;
  height: 16px;
  background: var(--blue-800);
  opacity: 0.85;
  transform: translateY(-50%);
}

.nav-greeting__accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav-greeting__words {
  display: inline-grid;
  overflow: hidden;
  padding-inline: 2px;
  isolation: isolate;
}

.nav-greeting__word {
  grid-area: 1 / 1;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  animation: nav-greeting-cycle 5s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

/* Each word rests for 680ms, then crossfades into the next over 320ms. */
.nav-greeting__word:nth-child(1) { animation-delay: -0.32s; }
.nav-greeting__word:nth-child(2) { animation-delay: 0.68s; }
.nav-greeting__word:nth-child(3) { animation-delay: 1.68s; }
.nav-greeting__word:nth-child(4) { animation-delay: 2.68s; }
.nav-greeting__word:nth-child(5) { animation-delay: 3.68s; }

@keyframes nav-greeting-cycle {
  0% {
    opacity: 0;
    transform: translateY(0.45em);
    filter: blur(3px);
  }
  6.4%, 20% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
  26.4%, 100% {
    opacity: 0;
    transform: translateY(-0.45em);
    filter: blur(3px);
  }
}

@media (max-width: 1080px) {
  header.glass-nav nav .nav-greeting {
    justify-self: start;
    padding: 10px 12px;
    font-size: 0.95rem;
  }

  header.glass-nav nav .nav-greeting::after {
    content: none;
  }

  .nav-greeting__word {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-greeting__word {
    animation: none;
  }

  .nav-greeting__word:first-child {
    opacity: 1;
  }
}

/* Temporarily hidden until the international submenu is ready. Remove this rule to restore. */
header.glass-nav nav .nav-greeting {
  display: none;
}
