/* Subtle portfolio motion — professional, not distracting */

@keyframes gradient-drift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes ambient-float-a {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(18px, -14px);
  }
}

@keyframes ambient-float-b {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-16px, 12px);
  }
}

@keyframes ambient-float-c {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(12px, 16px);
  }
}

@keyframes glow-breathe-scale {
  0%,
  100% {
    opacity: 0.88;
    transform: scale(1);
  }
  50% {
    opacity: 0.96;
    transform: scale(1.04);
  }
}

@keyframes glow-breathe-opacity {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

@keyframes glow-breathe-centered {
  0%,
  100% {
    opacity: 0.88;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.96;
    transform: translateX(-50%) scale(1.03);
  }
}

@keyframes orbit-spin {
  from {
    transform: rotate(31.36deg);
  }
  to {
    transform: rotate(391.36deg);
  }
}

@keyframes float-icon-a {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(12px, -16px) rotate(2deg);
  }
  50% {
    transform: translate(-10px, -8px) rotate(-1.5deg);
  }
  75% {
    transform: translate(-14px, 12px) rotate(1deg);
  }
}

@keyframes float-icon-b {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  30% {
    transform: translate(-14px, 10px) rotate(-2deg);
  }
  55% {
    transform: translate(10px, -12px) rotate(1.5deg);
  }
  80% {
    transform: translate(8px, 14px) rotate(-1deg);
  }
}

@keyframes float-icon-c {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(14px, 8px) rotate(1.5deg);
  }
  45% {
    transform: translate(-12px, -14px) rotate(-2deg);
  }
  70% {
    transform: translate(-8px, 10px) rotate(1deg);
  }
}

@keyframes profile-ring-spin {
  from {
    transform: rotate(-129.85deg);
  }
  to {
    transform: rotate(230.15deg);
  }
}

/* Slow background gradient shift (home + projects) */
body:has(.projects-page) {
  background-size: 160% 160%;
  animation: gradient-drift 22s ease-in-out infinite;
}

body.home-scroll-bg {
  background: transparent;
}

.scroll-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(110deg, var(--bg-0) 0%, var(--bg-2) 50%, var(--bg-0) 100%);
  background-size: 160% 160%;
  animation: gradient-drift 22s ease-in-out infinite;
  will-change: background;
}

body.home-scroll-bg .top-nav {
  z-index: 20;
}

body.home-scroll-bg main.page,
body.home-scroll-bg .footer {
  position: relative;
  z-index: 1;
}

body.home-scroll-bg .page::before,
body.home-scroll-bg .page::after {
  opacity: calc(1 - var(--scroll-progress, 0) * 0.28);
  transition: opacity 0.2s linear;
}

body.home-scroll-bg .hero-blob {
  opacity: calc(1 - var(--scroll-progress, 0) * 0.32);
  transition: opacity 0.2s linear;
}

body.home-scroll-bg .top-nav {
  background: rgba(
    calc(15 - var(--scroll-progress, 0) * 4),
    calc(15 - var(--scroll-progress, 0) * 4),
    calc(35 - var(--scroll-progress, 0) * 8),
    0.82
  );
  transition: background 0.2s linear;
}

/* Ambient blobs */
.hero-blob-a,
.page::before,
.ambient-a {
  animation: ambient-float-a 14s ease-in-out infinite;
}

.hero-blob-b,
.ambient-b {
  animation: ambient-float-b 16s ease-in-out infinite;
}

.hero-blob-c,
.page::after,
.ambient-c {
  animation: ambient-float-c 18s ease-in-out infinite;
}

.page::before,
.page::after {
  will-change: transform;
}

/* Hero orb */
.orb-glow,
.profile-glow {
  animation: glow-breathe-scale 7s ease-in-out infinite;
}

.impact-glow {
  animation: glow-breathe-centered 9s ease-in-out infinite;
}

.connect-glow,
.about-glow,
.purpose-glow {
  animation: glow-breathe-opacity 9s ease-in-out infinite;
}

.orb-ring-dashed,
.profile-ring-dashed {
  animation: orbit-spin 120s linear infinite;
}

.floating-icon {
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease,
    border-color 0.35s ease;
  will-change: transform;
}

.icon-ribbon {
  animation: float-icon-a 4.2s ease-in-out infinite;
}

.icon-users {
  animation: float-icon-b 4.8s ease-in-out infinite 0.5s;
}

.icon-spark {
  animation: float-icon-c 4.5s ease-in-out infinite 1s;
}

.floating-icon:hover {
  animation-play-state: paused;
  transform: translateY(-5px) scale(1.05);
  z-index: 2;
}

.icon-ribbon:hover {
  box-shadow:
    0 22px 28px rgba(97, 95, 255, 0.28),
    0 8px 12px rgba(97, 95, 255, 0.22);
}

.icon-users:hover {
  box-shadow:
    0 22px 28px rgba(173, 70, 255, 0.28),
    0 8px 12px rgba(246, 51, 154, 0.18);
}

.icon-spark:hover {
  box-shadow:
    0 22px 28px rgba(246, 51, 154, 0.28),
    0 8px 12px rgba(97, 95, 255, 0.18);
}

/* Interactive cards & buttons */
.card,
.metric-card,
.clarity-card,
.impact-card,
.purpose-inner,
.resume-intro,
.resume-skill-card,
.resume-edu-card,
.resume-cert {
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.4s ease;
}

.card:hover,
.metric-card:hover,
.clarity-card:hover,
.impact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 134, 255, 0.35);
  box-shadow: 0 16px 40px rgba(97, 95, 255, 0.12);
}

.purpose-inner:hover,
.about-card:hover {
  border-color: rgba(124, 134, 255, 0.38);
}

.btn,
.case-btn,
.resume-btn,
.nav-links a,
.socials a {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease,
    color 0.25s ease,
    opacity 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(79, 57, 246, 0.45);
}

.btn-secondary:hover,
.case-btn:hover,
.resume-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 134, 255, 0.5);
}

.nav-links a:hover {
  color: rgba(255, 255, 255, 0.9);
}

.socials a:hover {
  transform: translateY(-3px);
  opacity: 1;
  border-color: rgba(124, 134, 255, 0.45);
}

/* Projects title gradient */
.intro h1 {
  background-size: 200% auto;
  animation: gradient-drift 14s ease-in-out infinite;
}

/* Contact profile orbit */
.profile-ring-dashed {
  animation: profile-ring-spin 140s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  body:has(.projects-page),
  .intro h1 {
    background-size: auto;
    animation: none;
  }

  body.home-scroll-bg .scroll-bg {
    animation: none;
    background-size: auto;
  }

  body.home-scroll-bg .page::before,
  body.home-scroll-bg .page::after,
  body.home-scroll-bg .hero-blob {
    opacity: 1;
    transition: none;
  }

  .floating-icon:hover,
  .card:hover,
  .metric-card:hover,
  .clarity-card:hover,
  .impact-card:hover,
  .btn-primary:hover,
  .btn-secondary:hover,
  .case-btn:hover,
  .resume-btn:hover,
  .socials a:hover {
    transform: none;
  }
}

/* Custom gradient cursor */
@keyframes cursor-gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

html.has-custom-cursor,
html.has-custom-cursor * {
  cursor: none !important;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c86ff 0%, #c27aff 52%, #f6339a 100%);
  background-size: 200% 200%;
  animation: cursor-gradient-shift 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 99999;
  box-shadow:
    0 0 10px rgba(124, 134, 255, 0.55),
    0 0 22px rgba(194, 122, 255, 0.28);
  transition:
    width 0.25s ease,
    height 0.25s ease,
    margin 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.2s ease;
  will-change: transform;
}

.custom-cursor.is-hover {
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  box-shadow:
    0 0 14px rgba(124, 134, 255, 0.65),
    0 0 28px rgba(246, 51, 154, 0.35);
}

.custom-cursor.is-active {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
}

@media (pointer: coarse) {
  html.has-custom-cursor,
  html.has-custom-cursor * {
    cursor: auto !important;
  }

  .custom-cursor {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.has-custom-cursor,
  html.has-custom-cursor * {
    cursor: auto !important;
  }

  .custom-cursor {
    display: none !important;
  }
}
