/* Motion layer for the shared shell (nav buttons + page header). Kept
   separate from shell.css so the structural styles and the animation
   treatment can be swapped independently. Everything here is inert at rest
   and only activates on hover/active/load, and backs off entirely under
   prefers-reduced-motion. */

/* --- Nav buttons: a spinning color halo behind the pill on hover/active,
   plus a small icon "pop" and a staggered fade-in the first time the nav
   renders. --- */
.nav-link {
  isolation: isolate;
  animation: nav-link-in 420ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.section-nav .nav-link:nth-child(1) { animation-delay: 0ms; }
.section-nav .nav-link:nth-child(2) { animation-delay: 60ms; }
.section-nav .nav-link:nth-child(3) { animation-delay: 120ms; }
.section-nav .nav-link:nth-child(4) { animation-delay: 180ms; }
.section-nav .nav-link:nth-child(5) { animation-delay: 240ms; }
.section-nav .nav-link:nth-child(n+6) { animation-delay: 300ms; }

@keyframes nav-link-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-link::before {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: -1;
  border-radius: 999px;
  background: conic-gradient(from 0deg, transparent, var(--nav-color), transparent 45%);
  filter: blur(7px);
  opacity: 0;
  transition: opacity 260ms ease;
}
.nav-link:hover::before {
  opacity: 0.45;
  animation: nav-halo-spin 2.8s linear infinite;
}
.nav-link.active::before {
  opacity: 0.6;
  animation: nav-halo-spin 5s linear infinite;
}
@keyframes nav-halo-spin {
  to { transform: rotate(360deg); }
}

.nav-link .nav-icon {
  display: inline-block;
  transition: transform 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-link:hover .nav-icon {
  transform: scale(1.18) rotate(-6deg);
}
.nav-link.active .nav-icon {
  animation: nav-icon-settle 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes nav-icon-settle {
  0% { transform: scale(0.6) rotate(-10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* --- Page header: logo drifts in and holds a slow idle float; heading and
   subtitle rise in just after it. --- */
.page-header .page-logo {
  animation: logo-in 480ms cubic-bezier(0.22, 1, 0.36, 1) backwards,
             logo-float 5s ease-in-out 480ms infinite;
}
@keyframes logo-in {
  from { opacity: 0; transform: scale(0.7) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.page-header h1 {
  animation: header-in 420ms cubic-bezier(0.22, 1, 0.36, 1) 80ms backwards;
}
.page-header p {
  animation: header-in 420ms cubic-bezier(0.22, 1, 0.36, 1) 160ms backwards;
}
@keyframes header-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .nav-link::before,
  .nav-link .nav-icon,
  .nav-link.active .nav-icon,
  .page-header .page-logo,
  .page-header h1,
  .page-header p {
    animation: none !important;
    transition: none !important;
  }
}
