/* 
 * Animations V4 — Zero blur, clean fade/slide reveals
 */

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

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

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

/* Directional Variants */
.fade-up    { transform: translateY(50px); }
.fade-down  { transform: translateY(-50px); }
.fade-left  { transform: translateX(-50px); }
.fade-right { transform: translateX(50px); }
.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.88); opacity: 0; }
.scale-in.active { transform: scale(1);    opacity: 1; }

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

/* Rotate Reveal */
.rotate-in        { transform: translateY(30px) rotate(2deg); opacity: 0; }
.rotate-in.active { transform: translateY(0) rotate(0);       opacity: 1; }

/* Blur-in becomes simple fade-up (no blur) */
.blur-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.blur-in.active {
  opacity: 1;
  transform: translateY(0);
}

/* Clip Reveal */
.clip-up {
  clip-path: inset(100% 0 0 0);
  opacity: 1;
  transition: clip-path 1s 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 1s 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 1s 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.15);
  transition: transform 1.5s var(--ease-out-expo) 0.2s;
  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;
  transform: translateY(30px);
  transition:
    opacity 0.6s var(--ease-out-expo),
    transform 0.6s var(--ease-out-expo);
}

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

/* ═══════════════════════════════════════
   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
   ═══════════════════════════════════════ */

.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;
}

.page-transition-overlay.exiting {
  visibility: visible;
  animation: pageRevealFade 1s cubic-bezier(0.22, 0.68, 0, 1) forwards;
}

@keyframes pageRevealFade {
  0%   { opacity: 1;    visibility: visible; transform: scale(1.02) skewY(0.3deg); }
  40%  { opacity: 0.4;  transform: scale(1.005) skewY(-0.15deg); }
  100% { opacity: 0;    transform: scale(1) skewY(0); visibility: hidden; }
}

.page-transition-overlay.entering {
  visibility: visible;
  animation: pageNavFade 0.5s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

@keyframes pageNavFade {
  0%   { opacity: 0; visibility: visible; transform: scale(1); }
  100% { opacity: 0.95; transform: scale(1.01) skewY(0.2deg); }
}

.blur-fade-enter {
  animation: fadeInSimple 0.8s ease-out both;
}

@keyframes fadeInSimple {
  from { opacity: 0; }
  to   { opacity: 1; }
}

html.page-boot main {
  animation: fadeInSimple 0.8s ease-out both;
}

html.page-leaving main {
  animation: fadeOutLeave 0.5s ease-in forwards;
}

@keyframes fadeOutLeave {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ═══════════════════════════════════════
   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 {
    opacity: 1;
    transform: none;
    transition-duration: 0.5s;
  }

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

  .img-reveal-block img { transform: scale(1.06); }
  .scroll-cinematic {
    opacity: 1;
    transform: none;
  }
}

/* ═══════════════════════════════════════
   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; }
  .img-reveal-block::after { display: none; }
  .marquee-content { animation: none; }
  .page-transition-overlay {
    opacity: 0 !important;
    visibility: hidden !important;
    animation: none !important;
  }
  html.page-boot main,
  html.page-leaving main {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
