/* PINAPP — cursor.css — v5
   Curseur bioluminescent — teal nuit / violet jour
   Desktop >= 1024px uniquement
   ================================================================= */

@media (min-width: 1024px) {
  *,
  *::before,
  *::after {
    cursor: none !important;
  }
}

#pcursor {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition:
    width 200ms cubic-bezier(0.25, 0.1, 0.25, 1),
    height 200ms cubic-bezier(0.25, 0.1, 0.25, 1),
    opacity 150ms ease;
  will-change: left, top;
}
#pcursor.hover {
  width: 40px;
  height: 40px;
  opacity: 0.35;
}
#pcursor.clicking {
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 1;
}

#pcursor-trail {
  position: fixed;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  border: 1px solid transparent;
  background: transparent;
  will-change: left, top;
  transition:
    width 300ms cubic-bezier(0.45, 0.05, 0.55, 0.95),
    height 300ms cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
#pcursor-trail.hover {
  width: 60px;
  height: 60px;
}

/* Mobile / tablette — curseur natif */
@media (max-width: 1023px) {
  #pcursor,
  #pcursor-trail {
    display: none;
  }
  body {
    cursor: auto !important;
  }
}

/* =====================================================
   TOGGLE MODE — lune/soleil
   ===================================================== */

.mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 100px;
  border: 1px solid var(--border-card);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  cursor: pointer;
  transition: all var(--t-hover, 200ms);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  flex-shrink: 0;
}
.mode-toggle:hover {
  border-color: var(--teal);
  transform: scale(1.05) translateZ(0);
}
.mode-toggle:active {
  transform: scale(0.94) translateZ(0);
}

.icon-lune,
.icon-soleil {
  position: absolute;
  transition:
    opacity 500ms ease,
    transform 500ms ease;
}

/* Nuit : lune visible, soleil caché */
body:not(.mode-jour) .icon-lune {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
body:not(.mode-jour) .icon-soleil {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
}

/* Jour : soleil visible, lune cachée */
body.mode-jour .icon-soleil {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
body.mode-jour .icon-lune {
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
}

/* Transition de mode — fondu */
body.mode-switching {
  transition:
    background-color 500ms ease,
    color 300ms ease;
}

/* Pulse discret au premier chargement */
@keyframes toggle-pulse {
  0%,
  100% {
    transform: scale(1) translateZ(0);
  }
  50% {
    transform: scale(1.15) translateZ(0);
    box-shadow: 0 0 12px rgba(0, 229, 204, 0.4);
  }
}
