/* 
 * Ultra Premium Animations V3
 * Rich reveals, 3D, parallax, page transitions
 */

/* ═══════════════════════════════════════
   SCROLL REVEAL BASE
   ═══════════════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(50px);
  filter: blur(18px);
  transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo), filter 1.1s var(--ease-out-expo);
  will-change: opacity, transform, filter;
}

.reveal.active {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) rotate(0) scale(1);
}

/* Directional Variants */
.fade-up {
  transform: translateY(60px);
}

.fade-down {
  transform: translateY(-60px);
}

.fade-left {
  transform: translateX(-60px);
}

.fade-right {
  transform: translateX(60px);
}

.fade-in {
  transform: none;
}

.fade-up.active,
.fade-down.active,
.fade-left.active,
.fade-right.active,
.fade-in.active {
  transform: translate(0, 0);
}

/* Scale Reveal */
.scale-in {
  transform: scale(0.85);
  opacity: 0;
}

.scale-in.active {
  transform: scale(1);
  opacity: 1;
  filter: blur(0);
}

/* Zoom Reveal */
.zoom-in {
  transform: scale(0.9);
  opacity: 0;
}

.zoom-in.active {
  transform: scale(1);
  opacity: 1;
  filter: blur(0);
}

/* Rotate Reveal */
.rotate-in {
  transform: translateY(40px) rotate(3deg);
  opacity: 0;
}

.rotate-in.active {
  transform: translateY(0) rotate(0);
  opacity: 1;
  filter: blur(0);
}

/* Blur Reveal */
.blur-in {
  filter: blur(10px);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s var(--ease-out-expo), transform 1s var(--ease-out-expo), filter 1.2s var(--ease-out-expo);
}

.blur-in.active {
  filter: blur(0);
  opacity: 1;
  transform: translateY(0);
}

/* Clip Reveal */
.clip-up {
  clip-path: inset(100% 0 0 0);
  opacity: 1;
  transition: clip-path 1.2s var(--ease-in-out-circ);
}

.clip-up.active {
  clip-path: inset(0 0 0 0);
}

.clip-left {
  clip-path: inset(0 100% 0 0);
  opacity: 1;
  transition: clip-path 1.2s var(--ease-in-out-circ);
}

.clip-left.active {
  clip-path: inset(0 0 0 0);
}

/* ═══════════════════════════════════════
   STAGGER DELAYS
   ═══════════════════════════════════════ */

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ═══════════════════════════════════════
   IMAGE REVEAL BLOCK (Sweep)
   ═══════════════════════════════════════ */

.img-reveal-block {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.img-reveal-block::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--bg-surface-light), var(--bg-elevated));
  transform-origin: left;
  transition: transform 1.2s var(--ease-in-out-circ);
  z-index: 2;
}

.reveal.active .img-reveal-block::after,
.img-reveal-block.active::after {
  transform: scaleX(0);
  transform-origin: right;
}

.img-reveal-block img {
  transform: scale(1.2);
  transition: transform 2s var(--ease-out-expo) 0.3s;
  display: block;
}

.reveal.active .img-reveal-block img {
  transform: scale(1);
}

/* ═══════════════════════════════════════
   FLOATING ANIMATIONS
   ═══════════════════════════════════════ */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(1deg); }
  75% { transform: translateY(5px) rotate(-1deg); }
}

.float { animation: float 6s ease-in-out infinite; }
.float-slow { animation: floatSlow 8s ease-in-out infinite; }

/* ═══════════════════════════════════════
   PULSE / GLOW ANIMATIONS
   ═══════════════════════════════════════ */

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(199, 166, 120, 0.1); }
  50% { box-shadow: 0 0 40px rgba(199, 166, 120, 0.25); }
}

@keyframes pulseGoldText {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.pulse-glow { animation: pulseGlow 3s ease-in-out infinite; }

/* ═══════════════════════════════════════
   TEXT SPLIT ANIMATION (JS-driven)
   ═══════════════════════════════════════ */

.split-text .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(-40deg);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

.split-text.active .char {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

/* ═══════════════════════════════════════
   LINE DRAW
   ═══════════════════════════════════════ */

.line-draw {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--brand-gold), transparent);
  transition: width 1.5s var(--ease-out-expo);
}

.line-draw.active {
  width: 100%;
}

/* ═══════════════════════════════════════
   PARALLAX SUBTLE CLASS
   ═══════════════════════════════════════ */

.parallax-smooth {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@media (max-width: 768px) {
  .parallax-smooth {
    background-attachment: scroll;
  }
}

/* ═══════════════════════════════════════
   SCROLL DRIVEN PARALLAX (JS enhanced)
   ═══════════════════════════════════════ */

[data-parallax] {
  will-change: transform;
  transition: transform 0.1s linear;
}

.scroll-cinematic {
  opacity: 0.52;
  filter: blur(18px) saturate(0.86);
  transform: translateY(42px) scale(0.985);
  transition:
    opacity 1s var(--ease-out-expo),
    filter 1.15s var(--ease-out-expo),
    transform 1.15s var(--ease-out-expo);
  will-change: transform, opacity, filter;
}

.scroll-cinematic.is-in-view {
  opacity: 1;
  filter: blur(0) saturate(1);
  transform: translateY(0) scale(1);
}

/* ═══════════════════════════════════════
   MARQUEE / INFINITE SCROLL TEXT
   ═══════════════════════════════════════ */

.marquee-wrapper {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.marquee-wrapper::before,
.marquee-wrapper::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.marquee-wrapper::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-pure), transparent);
}

.marquee-wrapper::after {
  right: 0;
  background: linear-gradient(90deg, transparent, var(--bg-pure));
}

.marquee-content {
  display: inline-flex;
  gap: 4rem;
  animation: marquee 30s linear infinite;
}

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

.marquee-content span {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--glass-white-strong);
  font-style: italic;
  white-space: nowrap;
}

/* ═══════════════════════════════════════
   PAGE TRANSITION OVERLAY
   ═══════════════════════════════════════ */

/* L'overlay est INVISIBLE par défaut. Le JS lui ajoute une classe pour l'activer. */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(199, 166, 120, 0.07), transparent 45%),
    radial-gradient(circle at 80% 60%, rgba(63, 43, 31, 0.22), transparent 38%),
    linear-gradient(165deg, #0e0d0c 0%, #080807 48%, #121110 100%);
  z-index: 99998;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

/* Chargement initial : le voile apparaît opaque puis se dissipe */
.page-transition-overlay.exiting {
  visibility: visible;
  animation: pageReveal 1.5s cubic-bezier(0.33, 1, 0.32, 1) forwards;
}

@keyframes pageReveal {
  0% {
    opacity: 0.85;
    visibility: visible;
    filter: blur(6px);
  }
  50% {
    opacity: 0.3;
    filter: blur(2px);
  }
  100% {
    opacity: 0;
    filter: blur(0);
    visibility: hidden;
  }
}

/* Navigation interne : voile qui recouvre progressivement avant le changement de page */
.page-transition-overlay.entering {
  visibility: visible;
  animation: pageNavCover 1.5s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

@keyframes pageNavCover {
  0% {
    opacity: 0;
    visibility: visible;
    filter: blur(0);
  }
  40% {
    opacity: 0.5;
    filter: blur(2px);
  }
  100% {
    opacity: 0.85;
    filter: blur(4px);
  }
}

.blur-fade-enter {
  animation: blurFadeIn 1.5s cubic-bezier(0.33, 1, 0.32, 1) both;
}

@keyframes blurFadeIn {
  0% {
    opacity: 0.88;
    filter: blur(8px);
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

html.page-boot main {
  animation: mainContentEase 1.5s cubic-bezier(0.33, 1, 0.32, 1) both;
}

@keyframes mainContentEase {
  0% {
    opacity: 0.94;
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

html.page-leaving main {
  animation: mainContentLeave 1.5s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

@keyframes mainContentLeave {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
  100% {
    opacity: 0.65;
    filter: blur(5px);
    transform: translateY(-6px);
  }
}

/* ═══════════════════════════════════════
   COUNTER ANIMATION (JS-driven)
   ═══════════════════════════════════════ */

.counter {
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════
   CARD TILT SHINE EFFECT
   ═══════════════════════════════════════ */

.card-shine {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(199, 166, 120, 0.08) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  border-radius: inherit;
  z-index: 3;
}

.luxury-card:hover .card-shine {
  opacity: 1;
}

/* ═══════════════════════════════════════
   MOBILE-SPECIFIC ANIMATIONS
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
  .reveal {
    transform: translateY(30px);
    transition-duration: 0.8s;
    filter: blur(10px);
  }

  .fade-up { transform: translateY(40px); }
  .fade-left { transform: translateX(-30px); }
  .fade-right { transform: translateX(30px); }

  .img-reveal-block img { transform: scale(1.1); }
  .scroll-cinematic {
    opacity: 0.75;
    filter: blur(10px);
    transform: translateY(24px) scale(0.995);
  }
}

/* ═══════════════════════════════════════
   HOVER MAGNETIC EFFECT (JS-driven)
   ═══════════════════════════════════════ */

.magnetic {
  transition: transform 0.3s var(--ease-out-expo);
}

/* ═══════════════════════════════════════
   SMOOTH SCROLL BEHAVIOR
   ═══════════════════════════════════════ */

html {
  scroll-behavior: smooth;
}

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

  .reveal { opacity: 1; transform: none; filter: none !important; }
  .img-reveal-block::after { display: none; }
  .marquee-content { animation: none; }
  .page-transition-overlay {
    opacity: 0 !important;
    visibility: hidden !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
  }
  html.page-boot main,
  html.page-leaving main {
    animation: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
