/* ==========================================================================
   TOP PHOTO - CATALOGUE D'ANIMATIONS (SECTION 4.2 DU CAHIER DES CHARGES)
   Animations GPU-accélérées à 60 fps avec support de prefers-reduced-motion
   ========================================================================== */

/* ==========================================================================
   1. ÉCRAN DE PRÉCHARGEMENT (PRELOADER)
   ========================================================================== */
#preloader {
  position: fixed;
  inset: 0;
  background-color: #0D0D0D;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

#preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-shutter-box {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 28px;
}

/* L'obturateur d'appareil photo animé */
.preloader-camera-lens {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid #FF5A00;
  box-shadow: 0 0 35px rgba(255, 90, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #111111;
}

.preloader-shutter-blade {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #FFD400;
  animation: pulseShutter 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.preloader-rotating-ring {
  position: absolute;
  inset: -12px;
  border: 2px dashed #FFD400;
  border-radius: 50%;
  animation: rotateBadge 8s linear infinite;
}

.preloader-logo-badge {
  width: 80px;
  height: 80px;
  object-fit: contain;
  z-index: 2;
  animation: breatheLogo 2.5s ease-in-out infinite;
}

.preloader-counter {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 950;
  color: #FFFFFF;
  letter-spacing: -1px;
}

.preloader-counter span {
  color: var(--color-primary);
}

.preloader-bar-track {
  width: 220px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  margin-top: 14px;
  overflow: hidden;
}

.preloader-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--grad-sunset);
  transition: width 0.15s ease-out;
}

.preloader-text {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: #888888;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 12px;
}

/* ==========================================================================
   2. CURSEUR PERSONNALISÉ OBJECTIF (DESKTOP)
   ========================================================================== */
.custom-lens-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease, border-color 0.25s ease, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  mix-blend-mode: difference;
}

.custom-lens-cursor::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-secondary);
}

.custom-cursor-label {
  display: none;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 900;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* État survol d'une image ou d'un lien */
.custom-lens-cursor.active-hover {
  width: 70px;
  height: 70px;
  border-color: var(--color-secondary);
  background: rgba(255, 212, 0, 0.85);
  mix-blend-mode: normal;
  box-shadow: 0 0 20px rgba(255, 212, 0, 0.6);
}

.custom-lens-cursor.active-hover::before {
  display: none;
}

.custom-lens-cursor.active-hover .custom-cursor-label {
  display: block;
}

@media (pointer: coarse), (max-width: 1024px) {
  .custom-lens-cursor {
    display: none !important;
  }
}

/* ==========================================================================
   3. CERCLES BOKEH FLOTTANTS D'ARRIÈRE-PLAN
   ========================================================================== */
.bokeh-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.bokeh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.28;
  animation: floatBokeh 18s ease-in-out infinite alternate;
}

.bokeh-orb-1 {
  width: 450px;
  height: 450px;
  background: #FF5A00;
  top: -100px;
  left: -100px;
  animation-duration: 22s;
}

.bokeh-orb-2 {
  width: 380px;
  height: 380px;
  background: #FFD400;
  top: 40%;
  right: -80px;
  animation-duration: 18s;
  animation-delay: -5s;
}

.bokeh-orb-3 {
  width: 320px;
  height: 320px;
  background: #FFA07A;
  bottom: 10%;
  left: 20%;
  animation-duration: 25s;
  animation-delay: -10s;
}

/* ==========================================================================
   KEYFRAMES OFFICIELLES
   ========================================================================== */
@keyframes rotateBadge {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseShutter {
  0% {
    transform: scale(0.92) rotate(0deg);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.08) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.92) rotate(360deg);
    opacity: 0.4;
  }
}

@keyframes breatheLogo {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes floatBokeh {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, -50px) scale(1.12);
  }
  100% {
    transform: translate(-30px, 30px) scale(0.95);
  }
}

@keyframes marqueeRoll {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes wheelScroll {
  0% {
    top: 6px;
    opacity: 1;
  }
  100% {
    top: 20px;
    opacity: 0;
  }
}

@keyframes pulseGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Révélation progressive des sections au scroll */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Micro-interaction Tilt sur cartes */
.tilt-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  transform-style: preserve-3d;
}

/* ==========================================================================
   GARDE-FOUS OBLIGATOIRES (SECTION 4.4 : PREFERS-REDUCED-MOTION)
   ========================================================================== */
@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;
  }
  .marquee-track {
    animation: none !important;
    transform: none !important;
  }
  .hero-badge-rotating img {
    animation: none !important;
  }
  .bokeh-orb {
    animation: none !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
