body {
  opacity: 0;
  animation: pageFadeIn 280ms ease-out forwards;
  transition: opacity 240ms ease, transform 240ms ease;
}

body.page-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.hero-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-title-row h1 {
  margin-bottom: 0;
}

.contact-spinner {
  --contact-launch-x: 0px;
  --contact-launch-y: 0px;
  display: inline-block;
  flex: 0 0 auto;
  height: 44px;
  position: relative;
  text-decoration: none;
  transform-origin: center;
  transition: transform 180ms ease;
  width: 44px;
}

.contact-spinner::before {
  animation: contactSpin 900ms linear infinite;
  border: 4px solid #007bff;
  border-right-color: transparent;
  border-top-color: #17a2b8;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(0, 123, 255, 0.2);
  content: "";
  inset: 0;
  position: absolute;
}

.contact-spinner::after {
  animation: electronOrbit 1.15s linear infinite;
  background: #007bff;
  border-radius: 50%;
  content: "";
  height: 9px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: rotate(0deg) translateX(15px) translate(-50%, -50%);
  transform-origin: 0 0;
  width: 9px;
}

.contact-spinner:hover {
  transform: scale(1.08);
}

.contact-spinner.is-launching {
  pointer-events: none;
  transition: transform 620ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 620ms ease;
  transform: translate(var(--contact-launch-x), var(--contact-launch-y)) rotate(760deg) scale(0.7);
  z-index: 2000;
}

.contact-spinner.is-launching::before {
  animation-duration: 260ms;
  box-shadow: 0 0 0 8px rgba(0, 123, 255, 0.12), 0 12px 28px rgba(0, 123, 255, 0.32);
}

.navbar-nav .contact-link-target {
  color: #fff !important;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.95);
}

.contact-intro {
  align-items: flex-start;
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.contact-intro h1 {
  margin-bottom: 0;
}

.contact-intro .lead {
  margin-bottom: 1rem;
}

.contact-intro-content {
  flex: 1 1 auto;
  min-width: 0;
}

.contact-avatar {
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  flex: 0 0 auto;
  height: 132px;
  object-fit: cover;
  width: 132px;
}

.required-indicator {
  color: #ff5a5f;
  font-weight: 700;
  margin-left: 0.2rem;
}

.contact-soundbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  overflow: visible;
  position: relative;
}

.contact-music-toggle {
  align-items: center;
  display: inline-flex;
  gap: 0.6rem;
}

.contact-music-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
  display: inline-block;
  height: 1.1rem;
  position: relative;
  width: 1.1rem;
}

.contact-music-icon::after {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 0.38rem;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0.38rem;
}

body.contact-music-playing .contact-music-icon {
  animation: contactSpin 1.6s linear infinite;
}

.linkedin-flyout {
  align-items: center;
  --linkedin-final-rotation: 1600deg;
  --linkedin-travel-x: min(52vw, 34rem);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(10, 102, 194, 0.22);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(10, 102, 194, 0.16);
  color: #0a66c2;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.45rem;
  justify-content: center;
  margin-left: 0.1rem;
  position: relative;
  text-decoration: none;
  transform-origin: center;
  width: 2.45rem;
  will-change: transform;
}

.linkedin-flyout.is-ready {
  animation: linkedinFlyout 3s ease-out 350ms both, linkedinPulse 1.6s ease-in-out 3.6s infinite;
}

.linkedin-flyout:hover,
.linkedin-flyout:focus {
  background: #0a66c2;
  border-color: #0a66c2;
  box-shadow: 0 0 0 0.25rem rgba(10, 102, 194, 0.18), 0 14px 28px rgba(10, 102, 194, 0.28);
  outline: none;
}

.linkedin-flyout img {
  animation: linkedinColorShift 2.2s ease-out 350ms both;
  border-radius: 50%;
  height: 1.55rem;
  position: relative;
  width: 1.55rem;
  z-index: 2;
}

.linkedin-pulse-ring {
  animation: linkedinRingPulse 1.6s ease-in-out 3s infinite;
  border: 2px solid rgba(10, 102, 194, 0.45);
  border-radius: 50%;
  inset: -0.35rem;
  opacity: 0;
  position: absolute;
}

.linkedin-burst {
  background: radial-gradient(circle, rgba(10, 102, 194, 0.95) 0 18%, rgba(23, 162, 184, 0.45) 32%, rgba(10, 102, 194, 0) 68%);
  border-radius: 50%;
  inset: -1.2rem;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: scale(0.25);
}

.linkedin-countdown {
  background: #0a66c2;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(10, 102, 194, 0.22);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 3.6rem;
  opacity: 0;
  padding: 0.25rem 0.55rem;
  pointer-events: none;
  position: absolute;
  text-align: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg) translateX(3.25rem) rotate(0deg) scale(0.85);
  transition: opacity 180ms ease, transform 180ms ease;
}

.linkedin-flyout.is-counting-down .linkedin-countdown {
  animation: linkedinCountdownNumberOrbit 5s cubic-bezier(0.55, 0, 1, 1) forwards;
  opacity: 1;
  transform-origin: center;
}

.linkedin-countdown-number {
  animation: linkedinCountdownSelfSpin 5s cubic-bezier(0.55, 0, 1, 1) forwards;
  display: inline-block;
}

.linkedin-flyout.is-counting-down img {
  animation: linkedinCountdownSpin 5s cubic-bezier(0.55, 0, 1, 1) forwards;
}

.linkedin-flyout.is-exploding {
  pointer-events: none;
}

.linkedin-flyout.is-exploding .linkedin-burst {
  animation: linkedinExplode 850ms ease-out forwards;
}

.linkedin-flyout.is-exploding .linkedin-countdown {
  animation: linkedinNumberExplode 850ms ease-out forwards;
}

.linkedin-flyout.is-exploding img {
  animation: linkedinIconExplode 850ms ease-out forwards;
}

.linkedin-transition-burst {
  background: #ffd447;
  border-radius: 50%;
  height: 12vmax;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 12vmax;
  z-index: 3000;
}

.linkedin-transition-burst.is-active {
  animation: linkedinPageFill 1.2s cubic-bezier(0.55, 0, 0.25, 1) forwards;
}

.page-link-burst {
  background: #ffd447;
  border-radius: 50%;
  height: 12vmax;
  left: var(--link-burst-x, 50%);
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: var(--link-burst-y, 50%);
  transform: translate(-50%, -50%) scale(0);
  width: 12vmax;
  z-index: 3000;
}

.page-link-burst.is-active {
  animation: linkedinPageFill 650ms cubic-bezier(0.55, 0, 0.25, 1) forwards;
}

@keyframes contactSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes electronOrbit {
  0% {
    transform: translate(-50%, -50%) translate(12px, -8px) scale(1);
  }

  14% {
    transform: translate(-50%, -50%) translate(-6px, -14px) scale(0.9);
  }

  29% {
    transform: translate(-50%, -50%) translate(-15px, 3px) scale(1.08);
  }

  43% {
    transform: translate(-50%, -50%) translate(5px, 13px) scale(0.95);
  }

  58% {
    transform: translate(-50%, -50%) translate(15px, 2px) scale(1.05);
  }

  73% {
    transform: translate(-50%, -50%) translate(-3px, 9px) scale(0.9);
  }

  88% {
    transform: translate(-50%, -50%) translate(8px, -13px) scale(1.12);
  }

  100% {
    transform: translate(-50%, -50%) translate(12px, -8px) scale(1);
  }
}

@keyframes linkedinFlyout {
  from {
    opacity: 0;
    transform: translate(-8rem, -0.5rem) rotate(calc(var(--linkedin-final-rotation) * -0.16)) scale(0.38);
  }

  to {
    opacity: 1;
    transform: translate(var(--linkedin-travel-x), 0) rotate(var(--linkedin-final-rotation)) scale(1.2);
  }
}

@keyframes linkedinColorShift {
  from {
    filter: grayscale(1) brightness(0.45);
  }

  to {
    filter: saturate(1.7) drop-shadow(0 0 8px rgba(10, 102, 194, 0.35));
  }
}

@keyframes linkedinPulse {
  0%,
  100% {
    transform: translate(var(--linkedin-travel-x), 0) rotate(var(--linkedin-final-rotation)) scale(1.2);
  }

  50% {
    transform: translate(var(--linkedin-travel-x), 0) rotate(var(--linkedin-final-rotation)) scale(1.32);
  }
}

@keyframes linkedinRingPulse {
  0%,
  100% {
    opacity: 0.08;
    transform: scale(0.9);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.22);
  }
}

@keyframes linkedinCountdownSpin {
  from {
    filter: saturate(1.7) drop-shadow(0 0 8px rgba(10, 102, 194, 0.35));
    transform: rotate(0deg) scale(1);
  }

  to {
    filter: saturate(2) drop-shadow(0 0 14px rgba(10, 102, 194, 0.55));
    transform: rotate(3820deg) scale(1.28);
  }
}

@keyframes linkedinCountdownNumberOrbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg) translateX(3.25rem) rotate(0deg) scale(1);
  }

  to {
    transform: translate(-50%, -50%) rotate(2860deg) translateX(3.25rem) rotate(-700deg) scale(1.2);
  }
}

@keyframes linkedinCountdownSelfSpin {
  from {
    transform: rotate(0deg) scale(1);
  }

  to {
    transform: rotate(2160deg) scale(1.12);
  }
}

@keyframes linkedinExplode {
  0% {
    opacity: 0.95;
    transform: scale(0.2);
  }

  55% {
    opacity: 0.75;
    transform: scale(1.4);
  }

  100% {
    opacity: 0;
    transform: scale(2.6);
  }
}

@keyframes linkedinIconExplode {
  0% {
    opacity: 1;
    transform: rotate(3820deg) scale(1.28);
  }

  45% {
    opacity: 0.85;
    transform: rotate(4120deg) scale(1.65);
  }

  100% {
    opacity: 0;
    transform: rotate(4520deg) scale(0.15);
  }
}

@keyframes linkedinNumberExplode {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(2860deg) translateX(3.25rem) rotate(-700deg) scale(1.2);
  }

  45% {
    opacity: 0.95;
    transform: translate(-50%, -50%) rotate(3180deg) translateX(3.25rem) rotate(-360deg) scale(1.8);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(3600deg) translateX(3.25rem) rotate(0deg) scale(0.1);
  }
}

@media (max-width: 575.98px) {
  .contact-soundbar {
    flex-direction: row-reverse;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.75rem;
  }

  .linkedin-flyout {
    --linkedin-final-rotation: -1080deg;
    --linkedin-travel-x: 0;
    margin-left: 0;
  }
}

@keyframes linkedinPageFill {
  0% {
    opacity: 0.96;
    transform: translate(-50%, -50%) scale(0);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(24);
  }
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
    opacity: 1;
    transition: none;
  }

  .contact-spinner,
  .contact-spinner.is-launching {
    transition: none;
  }

  .contact-spinner::before {
    animation: none;
  }

  .contact-spinner::after {
    animation: none;
  }

  .contact-avatar {
    height: 96px;
    width: 96px;
  }

  .linkedin-flyout,
  .linkedin-flyout img,
  .linkedin-burst,
  .linkedin-countdown,
  .linkedin-countdown-number,
  .page-link-burst,
  .linkedin-transition-burst,
  .linkedin-pulse-ring {
    animation: none;
  }
}
