/* The "Apply Online" header button.
   A rotating conic sweep behind an opaque core, plus a soft outward glow. The
   sweep sits on a pseudo-element so the label never inherits the animation, and
   the whole effect is disabled under prefers-reduced-motion — a persistently
   spinning element in fixed chrome is exactly what that setting exists for. */

nav.links a.nav-apply {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 14px 22px;
  border-bottom: 0;
  border-radius: var(--r-s, 10px);
  color: #fff;
  font-weight: 800;
  letter-spacing: .02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  animation: nav-apply-glow 2.8s ease-in-out infinite;
}

/* The travelling light. Oversized and centred so the cone sweeps the corners. */
nav.links a.nav-apply::before {
  content: '';
  position: absolute;
  z-index: -2;
  left: 50%;
  top: 50%;
  width: 240%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: conic-gradient(
    from 0deg,
    transparent 0 62%,
    rgba(255, 255, 255, .55) 76%,
    #fff 82%,
    rgba(255, 255, 255, .55) 88%,
    transparent 100%
  );
  animation: nav-apply-spin 3.2s linear infinite;
}

/* Opaque core, inset by the ring thickness so only a hairline of light shows. */
nav.links a.nav-apply::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 2px;
  border-radius: calc(var(--r-s, 10px) - 1px);
  background: var(--crimson, #c41e3a);
}

nav.links a.nav-apply:hover,
nav.links a.nav-apply:focus-visible {
  color: #fff;
  background: transparent;
}

nav.links a.nav-apply:hover::after { background: #d92546; }

nav.links a.nav-apply:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

nav.links a.nav-contact-link { border-bottom: 0; }

@keyframes nav-apply-spin {
  to { rotate: 1turn; }
}

@keyframes nav-apply-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 30, 58, .5), 0 2px 10px rgba(0, 0, 0, .22); }
  50%      { box-shadow: 0 0 18px 3px rgba(196, 30, 58, .48), 0 2px 10px rgba(0, 0, 0, .22); }
}

/* Desktop: this is the loudest thing in the header, so it earns more room.
   align-self stops the nav's stretch alignment turning it into a full-height
   slab, which also hides the radius; the right margin gives the glow somewhere
   to fall instead of being clipped by the header edge. */
@media (min-width: 1100px) {
  nav.links a.nav-apply {
    align-self: center;
    margin: 0 4px 0 14px;
    padding: 0 28px;
    height: 50px;
    border-radius: 10px;
    font-size: 1.05rem;
  }
  nav.links a.nav-apply::after { border-radius: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  nav.links a.nav-apply { animation: none; box-shadow: 0 2px 10px rgba(0, 0, 0, .22); }
  nav.links a.nav-apply::before { animation: none; background: #fff; }
}

/* ── Hero and in-page apply buttons ────────────────────────────────────── */

.btn.btn-apply {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  color: #fff;
  animation: nav-apply-glow 2.8s ease-in-out infinite;
}

.btn.btn-apply::before {
  content: '';
  position: absolute;
  z-index: -2;
  left: 50%;
  top: 50%;
  width: 240%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: conic-gradient(
    from 0deg,
    transparent 0 62%,
    rgba(255, 255, 255, .5) 76%,
    #fff 82%,
    rgba(255, 255, 255, .5) 88%,
    transparent 100%
  );
  animation: nav-apply-spin 3.2s linear infinite;
}

.btn.btn-apply::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 2px;
  border-radius: inherit;
  background: var(--crimson, #c41e3a);
}

.btn.btn-apply:hover::after { background: #d92546; }

@media (prefers-reduced-motion: reduce) {
  .btn.btn-apply { animation: none; }
  .btn.btn-apply::before { animation: none; background: #fff; }
}
