/* =========================================================
   Site motion — aggressive helpers + custom cursor
   ========================================================= */

/* Keep intro targets hidden until GSAP has set their start state */
html.js-motion body:not(.motion-ready) main .once-in,
html.js-motion body:not(.motion-ready) #navScroll,
html.js-motion body:not(.motion-ready) #vineet-big-name .big-name,
html.js-motion body:not(.motion-ready) #vineet-big-name .hero-badge,
html.js-motion body:not(.motion-ready) #callMeBtn {
  visibility: hidden !important;
}

/* Extra guard: never show the name at rest before intro starts */
html.js-motion body:not(.motion-ready) #vineet-big-name .big-name,
html.js-motion body:not(.motion-ready) #vineet-big-name .big-name h1 {
  opacity: 0 !important;
}

/* Perspective for rotateX reveals */
main,
#abouts,
#gallery-1,
section.position-relative {
  perspective: 1200px;
  transform-style: preserve-3d;
}

#preloaderpage {
  will-change: transform;
}

#preloaderpage .loader-curve {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

#preloaderpage .loader-curve-inner {
  width: 160%;
  height: 900%;
  position: absolute;
  left: 50%;
  top: 0;
  border-radius: 50%;
  transform: translateX(-50%);
  background: linear-gradient(160deg, #0d080a 0%, #1a0a0e 50%, #0a0a0a 100%);
}

.motion-clip {
  overflow: hidden;
  display: block;
}

.motion-clip > .motion-line-inner {
  display: block;
  will-change: transform;
}

.motion-img-wrap {
  overflow: hidden;
  display: block;
  border-radius: inherit;
}

.motion-img-wrap img,
.channel-card .img-thumbnail,
#gallery-1 .img-fluid {
  will-change: transform;
  backface-visibility: hidden;
}

.magnetic {
  display: inline-flex;
  will-change: transform;
  cursor: none;
}

#navScroll .nav-link.magnetic {
  display: inline-flex;
}

#callMeBtn.magnetic {
  display: flex;
}

#abouts .channel-card.magnetic {
  display: block;
  cursor: none;
}

.once-in,
.motion-reveal,
.channel-card,
.display-huge {
  will-change: transform, opacity;
}

/* Hide default cursor on desktop when custom cursor is active */
@media (min-width: 900px) {
  html.js-motion body,
  html.js-motion a,
  html.js-motion button,
  html.js-motion .nav-link,
  html.js-motion input,
  html.js-motion textarea,
  html.js-motion .magnetic {
    cursor: none !important;
  }
}

/* ---------- Animated circular cursor ---------- */
#motion-cursor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2147483000;
}

#motion-cursor .mc-core {
  position: fixed;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  opacity: 0;
  scale: 0.7;
  will-change: transform, opacity;
  pointer-events: none;
}

#motion-cursor .mc-orb,
#motion-cursor .mc-ring,
#motion-cursor .mc-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Center glow orb */
#motion-cursor .mc-orb {
  width: 10px;
  height: 10px;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #c8102e 55%, #8b0a1e 100%);
  box-shadow: 0 0 12px rgba(200, 16, 46, 0.75), 0 0 28px rgba(200, 16, 46, 0.35);
  z-index: 4;
  animation: mc-orb-breathe 2.2s ease-in-out infinite;
}

/* Outer dashed ring — slow spin */
#motion-cursor .mc-ring-a {
  width: 44px;
  height: 44px;
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
  border-top-color: #c8102e;
  border-right-color: rgba(200, 16, 46, 0.35);
  z-index: 2;
  animation: mc-spin 6s linear infinite;
}

/* Mid solid ring — reverse spin */
#motion-cursor .mc-ring-b {
  width: 30px;
  height: 30px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-bottom-color: #c8102e;
  border-left-color: transparent;
  z-index: 3;
  animation: mc-spin-rev 3.5s linear infinite;
}

/* Inner soft ring */
#motion-cursor .mc-ring-c {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(200, 16, 46, 0.5);
  background: rgba(200, 16, 46, 0.08);
  z-index: 3;
  animation: mc-spin 8s linear infinite;
}

/* Expanding pulse halo */
#motion-cursor .mc-pulse {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(200, 16, 46, 0.45);
  z-index: 1;
  animation: mc-pulse 1.8s ease-out infinite;
}

@keyframes mc-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes mc-spin-rev {
  to {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

@keyframes mc-pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.75);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.85);
    opacity: 0;
  }
}

@keyframes mc-orb-breathe {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 12px rgba(200, 16, 46, 0.75), 0 0 28px rgba(200, 16, 46, 0.35);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.25);
    box-shadow: 0 0 18px rgba(200, 16, 46, 0.95), 0 0 40px rgba(200, 16, 46, 0.5);
  }
}

/* Hover interactive targets — expand circle */
body.cursor-hover #motion-cursor .mc-core {
  transition: none;
}

body.cursor-hover #motion-cursor .mc-ring-a {
  width: 72px;
  height: 72px;
  border-color: rgba(200, 16, 46, 0.55);
  border-top-color: #fff;
  animation-duration: 2.4s;
}

body.cursor-hover #motion-cursor .mc-ring-b {
  width: 52px;
  height: 52px;
  border-color: rgba(255, 255, 255, 0.4);
  border-bottom-color: #c8102e;
  animation-duration: 1.6s;
}

body.cursor-hover #motion-cursor .mc-ring-c {
  width: 28px;
  height: 28px;
  background: rgba(200, 16, 46, 0.2);
}

body.cursor-hover #motion-cursor .mc-orb {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #e83a52 50%, #c8102e 100%);
}

body.cursor-hover #motion-cursor .mc-pulse {
  width: 72px;
  height: 72px;
  border-color: rgba(200, 16, 46, 0.6);
  animation-duration: 1.1s;
}

/* Click press */
body.cursor-down #motion-cursor .mc-core {
  filter: brightness(1.2);
}

body.cursor-down #motion-cursor .mc-ring-a,
body.cursor-down #motion-cursor .mc-ring-b,
body.cursor-down #motion-cursor .mc-ring-c {
  transform: translate(-50%, -50%) scale(0.82) !important;
  transition: transform 0.12s ease;
}

/* Text fields — slim vertical cue */
body.cursor-text #motion-cursor .mc-ring-a,
body.cursor-text #motion-cursor .mc-ring-b,
body.cursor-text #motion-cursor .mc-pulse {
  opacity: 0.25;
}

body.cursor-text #motion-cursor .mc-orb {
  width: 3px;
  height: 22px;
  border-radius: 2px;
  animation: none;
  box-shadow: 0 0 10px rgba(200, 16, 46, 0.6);
}

body.cursor-text #motion-cursor .mc-ring-c {
  width: 20px;
  height: 20px;
  background: transparent;
}

/* Smooth size transitions on rings */
#motion-cursor .mc-ring,
#motion-cursor .mc-orb,
#motion-cursor .mc-pulse {
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s ease,
    border-color 0.35s ease,
    opacity 0.3s ease;
}

@media (max-width: 899px) {
  #motion-cursor {
    display: none !important;
  }

  html.js-motion body,
  html.js-motion a,
  html.js-motion button {
    cursor: auto !important;
  }

  .magnetic {
    cursor: pointer !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js-motion body:not(.motion-ready) main .once-in,
  html.js-motion body:not(.motion-ready) #navScroll {
    visibility: visible !important;
  }

  .once-in,
  .motion-reveal,
  .magnetic,
  .motion-img-wrap img {
    transform: none !important;
    opacity: 1 !important;
  }

  #motion-cursor {
    display: none !important;
  }

  html.js-motion body {
    cursor: auto !important;
  }
}
