/* Keep the link readable before the first sweep and with reduced motion. */
.top-nav .academy-nav {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px #c5a56d;
}

.top-nav .academy-nav:focus-visible {
  outline: 2px solid #926322;
  outline-offset: 2px;
}

@media (max-width: 750px) {
  .top-nav > :is([data-home], .academy-nav) {
    font-size: clamp(.9rem, 4.1vw, 1.125rem);
    padding-inline: clamp(.45rem, 2.35vw, .75rem);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .top-nav .academy-nav::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 27%, #f6cf7b24 42%, #fff0be69 50%, #f6cf7b20 59%, transparent 73%);
    background-size: 270% 100%;
    background-position: 100% 0;
    content: "";
    pointer-events: none;
  }

  .top-nav .academy-nav.atlas-nav-shine::before {
    animation: atlas-nav-sweep 15s ease-in-out var(--atlas-motion-delay, 0ms) infinite both;
  }

  .top-nav .academy-nav:hover {
    box-shadow: inset 0 0 0 1px #f0d59b;
  }

  .atlas-title-in {
    animation:
      atlas-title-arrival 760ms ease-out var(--atlas-motion-delay, 0ms) 1 both,
      atlas-title-glow 15s ease-out var(--atlas-motion-delay, 0ms) infinite both;
  }

  .atlas-title-in:is(h1, .academy-home h2, .community-home-link h2) {
    animation-name: atlas-title-arrival, atlas-title-gleam;
    animation-duration: 1250ms, 15s;
  }

  .atlas-title-in:not(.atlas-motion-visible) {
    animation-play-state: running, paused;
  }

  .top-nav .atlas-nav-shine:not(.atlas-motion-visible)::before {
    animation-play-state: paused;
  }

  /* The opening keyframes play the effect. The rest of each 15s cycle is still. */
  @keyframes atlas-nav-sweep {
    from { background-position: 100% 0; }
    11%, to { background-position: 0 0; }
  }

  @keyframes atlas-title-arrival {
    from { transform: translateY(4px); }
    to { transform: translateY(0); }
  }

  @keyframes atlas-title-glow {
    from, 5.1%, to { text-shadow: none; }
    2.6% { text-shadow: 0 0 .42em #c5923b55; }
  }

  @keyframes atlas-title-gleam {
    from, 8.3%, to { text-shadow: none; }
    3.75% { text-shadow: 0 0 .22em #ffdfa0a6, 0 0 .58em #c18a3855; }
  }
}

@media print {
  .atlas-title-in {
    animation: none !important;
    text-shadow: none;
  }
}
