/* ==========================================
   AVENORA - FUTURISTIC EFFECTS
   Special immersive dark luxury effects
   ========================================== */

/* ==========================================
   1. PRELOADER
   ========================================== */

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0A0A0A;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.8s;
}

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

/* Fallback: if JS fails, preloader auto-hides after 4s */
@keyframes preloaderFallback {
  0%, 90% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; pointer-events: none; }
}
.preloader {
  animation: preloaderFallback 4s ease forwards;
}

.preloader-logo,
.av-preloader-logo {
  width: 180px !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  animation: preloaderPulse 1.5s ease-in-out infinite;
}

@keyframes preloaderPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1); }
}

.preloader-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 6px;
  text-transform: uppercase;
  opacity: 0.8;
}

.preloader-bar-container {
  width: 120px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.preloader-bar {
  width: 120px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 20px;
}

.preloader-bar-fill,
.preloader-bar .preloader-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, #C8A96E, #E8D5A8);
  border-radius: 2px;
  width: 0;
  animation: preloaderProgress 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes preloaderProgress {
  0% { width: 0; }
  30% { width: 40%; }
  60% { width: 70%; }
  100% { width: 100%; }
}

/* ==========================================
   2. CUSTOM CURSOR
   ========================================== */

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: #FFFFFF;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease,
              height 0.2s ease,
              background 0.2s ease;
  will-change: transform;
}

.cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease,
              height 0.3s ease,
              border-color 0.3s ease,
              background-color 0.3s ease;
  will-change: transform;
}

.cursor-outline.hover {
  width: 60px;
  height: 60px;
  border-color: #C8A96E;
  background-color: rgba(200, 169, 110, 0.05);
}

.cursor-dot.hover {
  width: 4px;
  height: 4px;
  background: #C8A96E;
}

.cursor-dot.click {
  width: 12px;
  height: 12px;
  background: rgba(200, 169, 110, 0.5);
}

.cursor-outline.click {
  width: 30px;
  height: 30px;
}

/* Hide default cursor on non-touch devices */
@media (hover: hover) and (pointer: fine) {
  body.has-custom-cursor {
    cursor: none;
  }

  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor input,
  body.has-custom-cursor textarea,
  body.has-custom-cursor select,
  body.has-custom-cursor [role="button"] {
    cursor: none;
  }
}

/* Hide on touch devices */
@media (hover: none), (pointer: coarse) {
  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }
}

/* ==========================================
   3. MARQUEE BAND
   ========================================== */

.marquee-band {
  overflow: hidden;
  white-space: nowrap;
  padding: 2rem 0;
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.marquee-inner {
  display: flex;
  animation: marquee 20s linear infinite;
  will-change: transform;
}

.marquee-text {
  font-family: 'Playfair Display', serif;
  font-size: 5rem;
  font-weight: 800;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.06);
  padding: 0 2rem;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}

.marquee-text.filled {
  -webkit-text-stroke: 0;
  color: rgba(255, 255, 255, 0.04);
}

.marquee-separator {
  display: inline-flex;
  align-items: center;
  padding: 0 2rem;
  color: rgba(255, 255, 255, 0.1);
  font-size: 2rem;
}

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

.marquee-band.reverse .marquee-inner {
  animation-direction: reverse;
}

.marquee-band.slow .marquee-inner {
  animation-duration: 40s;
}

.marquee-band.fast .marquee-inner {
  animation-duration: 10s;
}

.marquee-band:hover .marquee-inner {
  animation-play-state: paused;
}

/* ==========================================
   4. GRAIN OVERLAY
   ========================================== */

.grain-overlay {
  position: fixed;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  width: 200%;
  height: 200%;
  z-index: 9997;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  animation: grainAnimation 8s steps(10) infinite;
}

@keyframes grainAnimation {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  20% { transform: translate(-15%, 5%); }
  30% { transform: translate(7%, -25%); }
  40% { transform: translate(-5%, 25%); }
  50% { transform: translate(-15%, 10%); }
  60% { transform: translate(15%, 0%); }
  70% { transform: translate(0%, 15%); }
  80% { transform: translate(3%, 35%); }
  90% { transform: translate(-10%, 10%); }
}

/* ==========================================
   5. 3D TILT CARDS
   ========================================== */

.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.3s ease;
}

.tilt-card .tilt-inner {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

.tilt-card .tilt-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.1) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
  z-index: 2;
}

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

.tilt-card .tilt-content {
  position: relative;
  z-index: 1;
  transform: translateZ(20px);
}

/* ==========================================
   6. IMAGE REVEAL
   ========================================== */

.img-reveal {
  overflow: hidden;
  position: relative;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal.revealed {
  clip-path: inset(0 0 0 0);
}

.img-reveal img {
  transform: scale(1.2);
  transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.img-reveal.from-right { clip-path: inset(0 100% 0 0); }
.img-reveal.from-right.revealed { clip-path: inset(0 0 0 0); }
.img-reveal.from-left { clip-path: inset(0 0 0 100%); }
.img-reveal.from-left.revealed { clip-path: inset(0 0 0 0); }
.img-reveal.from-top { clip-path: inset(0 0 100% 0); }
.img-reveal.from-top.revealed { clip-path: inset(0 0 0 0); }

/* ==========================================
   7. HORIZONTAL SCROLL SECTION
   ========================================== */

.horizontal-section {
  overflow: hidden;
  position: relative;
}

.horizontal-track {
  display: flex;
  width: fit-content;
  will-change: transform;
}

.horizontal-panel {
  min-width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  position: relative;
  flex-shrink: 0;
}

.horizontal-panel:nth-child(odd) { background: #0A0A0A; }
.horizontal-panel:nth-child(even) { background: #111111; }

.horizontal-panel-content { max-width: 800px; width: 100%; }

.horizontal-panel-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.03);
  line-height: 1;
  margin-bottom: 1rem;
}

/* ==========================================
   8. BENTO GRID
   ========================================== */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 16px;
}

.bento-item {
  background: #1A1A1A;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.3s ease;
}

.bento-item:hover { border-color: rgba(255, 255, 255, 0.15); }
.bento-large { grid-column: span 2; grid-row: span 2; }
.bento-wide { grid-column: span 2; }
.bento-tall { grid-row: span 2; }

.bento-item .bento-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-item:hover .bento-media { transform: scale(1.05); }

.bento-item .bento-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.9) 0%, transparent 100%);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-item:hover .bento-overlay { transform: translateY(0); }

.bento-overlay-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 0.5rem;
}

.bento-overlay-text { font-size: 0.875rem; color: rgba(255, 255, 255, 0.7); }

.bento-content {
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bento-stat {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.bento-label {
  font-size: 0.85rem;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ==========================================
   9. STATS COUNTER (FUTURISTIC)
   ========================================== */

.stat-number,
.stat-number-hero,
.stat-number-large,
.stat-number-secondary,
.counter-number,
.number-value,
.bento-stat {
  font-family: 'Space Grotesk', sans-serif;
}

.stat-label,
.stat-label-hero,
.stat-label-secondary,
.stat-desc,
.counter-label,
.number-label {
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ==========================================
   10. FOOTER IMMERSIVE REVEAL
   ========================================== */

.footer-reveal { position: relative; z-index: 1; }
.footer-reveal-wrapper { position: relative; z-index: 2; }

/* ==========================================
   11. GRADIENT LINES & DECORATIVE ELEMENTS
   ========================================== */

.gradient-line { height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent); }
.gradient-line-gold { height: 1px; background: linear-gradient(90deg, transparent, rgba(200, 169, 110, 0.3), transparent); }
.accent-dot { width: 6px; height: 6px; background: #C8A96E; border-radius: 50%; display: inline-block; }
.accent-line { width: 40px; height: 2px; background: #C8A96E; display: inline-block; }

/* ==========================================
   12. GLOW EFFECTS
   ========================================== */

.glow-blue { box-shadow: 0 0 30px rgba(0, 168, 232, 0.1); }
.glow-accent { box-shadow: 0 0 30px rgba(0, 212, 170, 0.1); }
.glow-gold { box-shadow: 0 0 30px rgba(200, 169, 110, 0.1); }
.glow-text-gold { text-shadow: 0 0 20px rgba(200, 169, 110, 0.3); }
.glow-text-blue { text-shadow: 0 0 20px rgba(0, 168, 232, 0.3); }

/* ==========================================
   13. SCROLL-TRIGGERED LINE ANIMATIONS
   ========================================== */

.line-draw { position: relative; }

.line-draw::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #C8A96E, #E8D5A8);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.line-draw.revealed::after,
.line-draw.animate-in::after { width: 100%; }

/* ==========================================
   14. TEXT EFFECTS
   ========================================== */

.text-outline { -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2); color: transparent; }
.text-outline-gold { -webkit-text-stroke: 1px rgba(200, 169, 110, 0.4); color: transparent; }
.text-reveal { overflow: hidden; }
.text-reveal span { display: inline-block; transform: translateY(100%); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.text-reveal.revealed span { transform: translateY(0); }

/* ==========================================
   15. MAGNETIC BUTTONS (CSS support)
   ========================================== */

.magnetic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic-btn .btn-text {
  position: relative;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   16. PARALLAX LAYERS
   ========================================== */

.parallax-container { position: relative; overflow: hidden; }

.parallax-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  will-change: transform;
}

.parallax-layer.slow { transform: translateY(calc(var(--scroll-y, 0) * 0.1)); }
.parallax-layer.medium { transform: translateY(calc(var(--scroll-y, 0) * 0.3)); }
.parallax-layer.fast { transform: translateY(calc(var(--scroll-y, 0) * 0.5)); }

/* ==========================================
   17. SPLIT TEXT ANIMATION SUPPORT
   ========================================== */

.split-text .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(50px) rotate(5deg);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

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

.split-text.revealed .char:nth-child(1) { transition-delay: 0.02s; }
.split-text.revealed .char:nth-child(2) { transition-delay: 0.04s; }
.split-text.revealed .char:nth-child(3) { transition-delay: 0.06s; }
.split-text.revealed .char:nth-child(4) { transition-delay: 0.08s; }
.split-text.revealed .char:nth-child(5) { transition-delay: 0.10s; }
.split-text.revealed .char:nth-child(6) { transition-delay: 0.12s; }
.split-text.revealed .char:nth-child(7) { transition-delay: 0.14s; }
.split-text.revealed .char:nth-child(8) { transition-delay: 0.16s; }
.split-text.revealed .char:nth-child(9) { transition-delay: 0.18s; }
.split-text.revealed .char:nth-child(10) { transition-delay: 0.20s; }
.split-text.revealed .char:nth-child(n+11) { transition-delay: 0.22s; }

/* ==========================================
   18. NOISE TEXTURE BACKGROUNDS
   ========================================== */

.bg-noise { position: relative; }

.bg-noise::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
  z-index: 0;
}

.bg-noise > * { position: relative; z-index: 1; }

/* ==========================================
   19. AMBIENT BACKGROUND ORB
   ========================================== */

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.15;
  animation: ambientOrbFloat 15s ease-in-out infinite;
}

@keyframes ambientOrbFloat {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(10px, -8px); }
  50% { transform: translate(-6px, 6px); }
  75% { transform: translate(-10px, -4px); }
}

.ambient-orb.blue { background: #C8A96E; width: 400px; height: 400px; }
.ambient-orb.teal { background: #D4B978; width: 300px; height: 300px; animation-delay: -5s; }
.ambient-orb.gold { background: #C8A96E; width: 250px; height: 250px; animation-delay: -10s; }

/* ==========================================
   20. RESPONSIVE OVERRIDES FOR FUTURISTIC
   ========================================== */

@media screen and (max-width: 1024px) {
  .cursor-dot, .cursor-outline { display: none !important; }
  body { cursor: auto !important; }
  .marquee-text { font-size: 2.5rem; }
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-large { grid-column: span 1; grid-row: span 1; }
  .bento-wide { grid-column: span 1; }
  .horizontal-section { overflow: visible; }
  .horizontal-track { flex-direction: column; width: 100%; }
  .horizontal-panel { min-width: 100%; height: auto; min-height: 60vh; }
  .ambient-orb { opacity: 0.08; }
  .ambient-orb.blue { width: 200px; height: 200px; }
  .ambient-orb.teal { width: 150px; height: 150px; }
  .ambient-orb.gold { width: 120px; height: 120px; }
}

@media screen and (max-width: 768px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .bento-item { border-radius: 16px; }
  .marquee-text { font-size: 2rem; }
  .marquee-band { padding: 1rem 0; }
  .grain-overlay { opacity: 0.03; }
  .tilt-card { perspective: none; }
  .tilt-card .tilt-shine { display: none; }
}

@media screen and (max-width: 480px) {
  .marquee-text { font-size: 1.5rem; }
  .bento-grid { gap: 8px; }
  .bento-item { border-radius: 12px; }
  .bento-content { padding: 1rem; }
  .horizontal-panel { padding: 2rem; min-height: 50vh; }
}

@media (prefers-reduced-motion: reduce) {
  /* Marquee garde son animation même en reduced motion */
  .grain-overlay { animation: none !important; }
  .ambient-orb { animation: none !important; }
  .preloader { display: none !important; }
  .tilt-card .tilt-shine { display: none; }
  .img-reveal { clip-path: none !important; }
  .img-reveal img { transform: none !important; }
  .split-text .char { opacity: 1 !important; transform: none !important; }
  [data-animate], .scroll-reveal, .scroll-reveal-left, .scroll-reveal-right, .scroll-reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}
