/* Custom Cursor Styles */

/* Custom cursor core */
.cursor-wrap {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999999;
  pointer-events: none;
  transform: translate3d(-9999px, -9999px, 0);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  will-change: transform;
  mix-blend-mode: multiply;
}

.cursor-inner {
  position: relative;
  width: 10px;
  height: 10px;
  transform: translate3d(-50%, -50%, 0);
}

.cursor-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out, filter 0.3s ease-out;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
  opacity: 0;
  visibility: hidden;
}

.cursor-logo:not(:empty) {
  opacity: 1;
  visibility: visible;
}

.cursor-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Christmas Hat */
.cursor-christmas-hat {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 35px;
  pointer-events: none;
  z-index: 10;
  margin-top: -35px;
  opacity: 1;
  visibility: visible;
}

.hat-base {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 12px;
  background: #DC143C;
  border-radius: 0 0 19px 19px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hat-base::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 8px;
  background: #FFFFFF;
  border-radius: 0 0 21px 21px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hat-top {
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 25px solid #DC143C;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.hat-pom-pom {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
}

.cursor-wrap.cursor-hover .cursor-christmas-hat {
  transform: translate(-50%, -50%) scale(1.1);
  margin-top: -38px;
}

.cursor-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 30% 30%, #ffffff, #999999 40%, #000000 75%);
  filter: blur(1px);
  opacity: 0 !important;
  visibility: hidden !important;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.65), 0 0 120px rgba(0, 0, 0, 0.7);
  transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
  display: none;
}

.cursor-wrap.cursor-active .cursor-halo {
  display: block;
  opacity: 0.9 !important;
  visibility: visible !important;
}

/* Hover state for interactive elements */
.cursor-wrap.cursor-hover {
  mix-blend-mode: normal;
}

.cursor-wrap.cursor-hover .cursor-halo {
  width: 72px;
  height: 72px;
  opacity: 1;
  filter: blur(2px);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.85), 0 0 180px rgba(0, 0, 0, 0.9);
}

.cursor-wrap.cursor-hover .cursor-logo {
  transform: translate(-50%, -50%) scale(1.2);
}

/* Particle trail */
.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999998;
  mix-blend-mode: multiply;
}

.cursor-trail-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scale(0.4);
  filter: blur(0.4px);
  will-change: transform, opacity, background;
  box-shadow: 0 0 6px currentColor;
}

/* Make later dots smaller and lighter using nth-child */
.cursor-trail-dot:nth-child(4),
.cursor-trail-dot:nth-child(5),
.cursor-trail-dot:nth-child(6),
.cursor-trail-dot:nth-child(7),
.cursor-trail-dot:nth-child(8),
.cursor-trail-dot:nth-child(9),
.cursor-trail-dot:nth-child(10),
.cursor-trail-dot:nth-child(11),
.cursor-trail-dot:nth-child(12) {
  width: 6px;
  height: 6px;
  opacity: 0.6;
}

.cursor-trail-dot:nth-child(13),
.cursor-trail-dot:nth-child(14),
.cursor-trail-dot:nth-child(15) {
  width: 4px;
  height: 4px;
  opacity: 0.4;
}

/* Mobile and touch: show normal cursor and hide custom one */
@media (pointer: coarse), (hover: none) {
  body {
    cursor: auto;
  }
  .cursor-wrap,
  .cursor-trail {
    display: none;
  }
}

