/* ============================================
   MAISON DALI - SURREAL CSS MASTERPIECE
   Inspired by Salvador Dalí's artistic genius
   ============================================ */

/* ========== VARIABLES ========== */
:root {
  --dali-gold: #D4AF37;
  --dali-cream: #F5F5DC;
  --dali-burgundy: #5D0002;
  --dali-navy: #1a1a2e;
  --dali-black: #000000;
}

/* ========== SMOOTH SCROLLING ========== */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  position: relative;
  
  /* High-gloss reflective deep red background - RGB(93, 0, 2) 50% darker */
  /* Base color layer - 50% darker: RGB(46.5, 0, 1) ≈ RGB(47, 0, 1) */
  background-color: rgb(47, 0, 1);
  
  /* Multi-layered gradient for glass-like reflective finish */
  background-image:
    /* Darkening overlay - reduces brightness by 50% */
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0.5) 100%
    ),
    /* Top highlight - simulates light reflection from above (reduced) */
    radial-gradient(
      ellipse 80% 30% at 50% 0%,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.04) 30%,
      transparent 60%
    ),
    /* Center glossy sheen - adds depth and luster (reduced) */
    radial-gradient(
      ellipse 70% 50% at 50% 40%,
      rgba(255, 255, 255, 0.03) 0%,
      transparent 50%
    ),
    /* Diagonal light streak - creates polished surface effect (reduced) */
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.06) 0%,
      transparent 20%,
      transparent 40%,
      rgba(255, 255, 255, 0.02) 60%,
      transparent 80%
    ),
    /* Subtle vignette - enhances glass depth at edges (increased) */
    radial-gradient(
      ellipse at center,
      transparent 0%,
      rgba(0, 0, 0, 0.4) 100%
    ),
    /* Deep red base with slight color variation for richness (darker) */
    linear-gradient(
      180deg,
      rgb(47, 0, 1) 0%,
      rgb(40, 0, 1) 50%,
      rgb(47, 0, 1) 100%
    );
  
  /* Ensure layers blend smoothly */
  background-blend-mode: multiply, screen, overlay, soft-light, multiply, normal;
}

/* ========== CUSTOM CURSOR (GOLDEN DRIPPING CUTLERY) ========== */
/* Default cursor - golden dripping fork and knife */
body {
  cursor: url('/static/golden-cutlery-cursor-32.png') 16 16, auto;
}

/* Interactive elements - golden dripping cutlery with scale effect */
a, button, .liquid-button, .magnetic, [role="button"] {
  cursor: url('/static/golden-cutlery-cursor-32.png') 16 16, pointer;
}

/* Custom cursor follower for enhanced surreal effect */
#custom-cursor {
  position: fixed;
  width: 48px;
  height: 48px;
  background-image: url('/static/golden-cutlery-cursor-64.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
  z-index: 10000;
  transition: all 0.2s ease;
  opacity: 0.9;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.6));
}

/* Hover state - scale and rotate effect */
#custom-cursor.hover-state {
  transform: scale(1.3) rotate(-10deg);
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.8));
}

/* Golden dripping trail effect */
#cursor-trail {
  position: fixed;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.8) 0%, rgba(212, 175, 55, 0.4) 50%, transparent 100%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.7;
  transition: all 0.2s ease;
}

/* Enhanced hover effect for interactive elements */
a:hover ~ #custom-cursor,
button:hover ~ #custom-cursor {
  transform: scale(1.5) rotate(-15deg);
  filter: drop-shadow(0 0 15px rgba(212, 175, 55, 1));
}

/* ========== MELTING CLOCK ANIMATION (DALÍ'S PERSISTENCE OF MEMORY) ========== */
@keyframes melt {
  0%, 100% {
    transform: scaleY(1) translateY(0);
    filter: blur(0px);
  }
  50% {
    transform: scaleY(1.3) translateY(5px);
    filter: blur(1px);
  }
}

@keyframes drip {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 120%, 0 120%);
  }
}

.melting {
  animation: melt 4s ease-in-out infinite;
  transform-origin: top center;
}

.dripping {
  animation: drip 3s ease-in-out infinite;
}

/* ========== LIQUID MORPHING BACKGROUND ========== */
@keyframes liquid-morph {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    background: linear-gradient(135deg, var(--dali-gold) 0%, var(--dali-burgundy) 100%);
  }
  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    background: linear-gradient(135deg, var(--dali-burgundy) 0%, var(--dali-navy) 100%);
  }
  50% {
    border-radius: 70% 30% 50% 50% / 30% 50% 70% 50%;
    background: linear-gradient(135deg, var(--dali-navy) 0%, var(--dali-gold) 100%);
  }
  75% {
    border-radius: 40% 70% 60% 30% / 70% 50% 40% 60%;
    background: linear-gradient(135deg, var(--dali-gold) 0%, var(--dali-burgundy) 100%);
  }
}

.liquid-shape {
  position: absolute;
  animation: liquid-morph 15s ease-in-out infinite;
  filter: blur(60px);
  opacity: 0.15;
  z-index: 0;
}

/* ========== FLOATING ELEMENTS ========== */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-30px) rotate(5deg);
  }
  66% {
    transform: translateY(-15px) rotate(-5deg);
  }
}

@keyframes float-slow {
  0%, 100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-50px) translateX(20px) rotate(10deg);
  }
  66% {
    transform: translateY(-25px) translateX(-20px) rotate(-10deg);
  }
}

.floating {
  animation: float 8s ease-in-out infinite;
}

.floating-slow {
  animation: float-slow 15s ease-in-out infinite;
}

/* ========== SURREAL PARTICLE SYSTEM ========== */
.particle {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  animation: particle-float 10s linear infinite;
}

@keyframes particle-float {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(1) rotate(360deg);
  }
}

/* ========== DISTORTION EFFECTS ========== */
@keyframes distort {
  0%, 100% {
    filter: hue-rotate(0deg) contrast(1);
    transform: skew(0deg) scale(1);
  }
  25% {
    filter: hue-rotate(5deg) contrast(1.1);
    transform: skew(1deg) scale(1.01);
  }
  75% {
    filter: hue-rotate(-5deg) contrast(1.1);
    transform: skew(-1deg) scale(1.01);
  }
}

.distort-hover:hover {
  animation: distort 0.6s ease-in-out infinite;
}

/* ========== GLITCH EFFECT ========== */
@keyframes glitch {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  10% {
    clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%);
    transform: translate(-2px, 2px);
  }
  20% {
    clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
    transform: translate(2px, -2px);
  }
  30% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transform: translate(0, 0);
  }
}

.glitch-effect {
  position: relative;
}

.glitch-effect::before,
.glitch-effect::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.glitch-effect:hover::before {
  color: #ff00ff;
  animation: glitch 0.3s infinite;
  opacity: 0.8;
  z-index: -1;
}

.glitch-effect:hover::after {
  color: #00ffff;
  animation: glitch 0.4s infinite reverse;
  opacity: 0.8;
  z-index: -2;
}

/* ========== PERSPECTIVE 3D TRANSFORMS ========== */
.perspective-container {
  perspective: 1000px;
  perspective-origin: center center;
}

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

.tilt-3d:hover {
  transform: rotateY(10deg) rotateX(-5deg) scale(1.05);
  box-shadow: 0 30px 60px rgba(212, 175, 55, 0.3);
}

/* ========== REVEAL ANIMATIONS ========== */
@keyframes reveal-from-left {
  from {
    opacity: 0;
    transform: translateX(-100px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

@keyframes reveal-from-right {
  from {
    opacity: 0;
    transform: translateX(100px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

@keyframes reveal-scale {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-10deg);
    filter: blur(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0);
  }
}

.reveal-left {
  animation: reveal-from-left 1s ease-out forwards;
}

.reveal-right {
  animation: reveal-from-right 1s ease-out forwards;
}

.reveal-scale {
  animation: reveal-scale 1s ease-out forwards;
}

/* ========== SURREAL TEXT EFFECTS ========== */
.text-shimmer {
  background: linear-gradient(90deg, 
    var(--dali-gold) 0%, 
    var(--dali-cream) 25%, 
    var(--dali-gold) 50%, 
    var(--dali-cream) 75%, 
    var(--dali-gold) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.text-glow {
  text-shadow: 
    0 0 10px var(--dali-gold),
    0 0 20px var(--dali-gold),
    0 0 30px var(--dali-gold),
    0 0 40px rgba(212, 175, 55, 0.5);
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% {
    text-shadow: 
      0 0 10px var(--dali-gold),
      0 0 20px var(--dali-gold),
      0 0 30px var(--dali-gold);
  }
  50% {
    text-shadow: 
      0 0 20px var(--dali-gold),
      0 0 40px var(--dali-gold),
      0 0 60px var(--dali-gold),
      0 0 80px rgba(212, 175, 55, 0.8);
  }
}

/* ========== MORPHING CARDS ========== */
.morph-card {
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.morph-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
  transform: scale(0);
  transition: transform 0.8s ease;
}

.morph-card:hover::before {
  transform: scale(1);
}

.morph-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 
    0 20px 60px rgba(212, 175, 55, 0.4),
    0 0 0 1px rgba(212, 175, 55, 0.2),
    inset 0 0 30px rgba(212, 175, 55, 0.1);
}

/* ========== LIQUID BUTTON EFFECT ========== */
.liquid-button {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.liquid-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.liquid-button:hover::before {
  width: 300px;
  height: 300px;
}

/* ========== PARALLAX LAYERS ========== */
.parallax-layer {
  transition: transform 0.3s ease-out;
  will-change: transform;
}

/* ========== BLOB ANIMATION ========== */
@keyframes blob {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  33% {
    border-radius: 70% 30% 50% 50% / 30% 60% 70% 40%;
  }
  66% {
    border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
  }
}

.blob {
  animation: blob 7s ease-in-out infinite;
}

/* ========== SURREAL LOADING ANIMATION ========== */
@keyframes surreal-spin {
  0% {
    transform: rotate(0deg) scale(1);
    border-radius: 50%;
  }
  25% {
    transform: rotate(90deg) scale(1.2);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  50% {
    transform: rotate(180deg) scale(1);
    border-radius: 50%;
  }
  75% {
    transform: rotate(270deg) scale(1.2);
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
  }
  100% {
    transform: rotate(360deg) scale(1);
    border-radius: 50%;
  }
}

.surreal-loader {
  width: 60px;
  height: 60px;
  border: 4px solid transparent;
  border-top-color: var(--dali-gold);
  border-right-color: var(--dali-burgundy);
  animation: surreal-spin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* ========== MIRROR EFFECT ========== */
.mirror-text {
  position: relative;
}

.mirror-text::after {
  content: attr(data-text);
  position: absolute;
  top: 100%;
  left: 0;
  transform: scaleY(-1);
  opacity: 0.3;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: blur(2px);
}

/* ========== WAVY TEXT ANIMATION ========== */
@keyframes wave {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.wavy-text span {
  display: inline-block;
  animation: wave 2s ease-in-out infinite;
}

.wavy-text span:nth-child(1) { animation-delay: 0s; }
.wavy-text span:nth-child(2) { animation-delay: 0.1s; }
.wavy-text span:nth-child(3) { animation-delay: 0.2s; }
.wavy-text span:nth-child(4) { animation-delay: 0.3s; }
.wavy-text span:nth-child(5) { animation-delay: 0.4s; }
.wavy-text span:nth-child(6) { animation-delay: 0.5s; }
.wavy-text span:nth-child(7) { animation-delay: 0.6s; }
.wavy-text span:nth-child(8) { animation-delay: 0.7s; }
.wavy-text span:nth-child(9) { animation-delay: 0.8s; }
.wavy-text span:nth-child(10) { animation-delay: 0.9s; }

/* ========== GLASS MORPHISM ========== */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 8px 32px 0 rgba(31, 38, 135, 0.37),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ========== INFINITE SCROLL EFFECT ========== */
@keyframes scroll-infinite {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.scroll-infinite {
  animation: scroll-infinite 30s linear infinite;
}

/* ========== HOVER DISTORTION ========== */
.hover-distort {
  transition: all 0.3s ease;
}

.hover-distort:hover {
  filter: url(#distortion-filter);
  transform: scale(1.05);
}

/* ========== MAGNETIC EFFECT ========== */
.magnetic {
  transition: transform 0.2s ease-out;
}

/* Applied via JavaScript for mouse proximity */

/* ========== CUSTOM SCROLLBAR (SURREAL) ========== */
::-webkit-scrollbar {
  width: 12px;
  background: var(--dali-black);
}

::-webkit-scrollbar-track {
  background: linear-gradient(to bottom, var(--dali-black), var(--dali-navy), var(--dali-black));
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--dali-gold), var(--dali-burgundy));
  border-radius: 10px;
  border: 2px solid var(--dali-black);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--dali-cream), var(--dali-gold));
  box-shadow: 0 0 10px var(--dali-gold);
}

/* ========== TEXT SELECTION ========== */
::selection {
  background: var(--dali-gold);
  color: var(--dali-black);
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

::-moz-selection {
  background: var(--dali-gold);
  color: var(--dali-black);
}

/* ========== IMAGE HOVER EFFECTS ========== */
.image-zoom {
  overflow: hidden;
  position: relative;
}

.image-zoom img {
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.image-zoom:hover img {
  transform: scale(1.15) rotate(2deg);
}

/* ========== NEON GLOW ========== */
.neon-border {
  box-shadow: 
    0 0 5px var(--dali-gold),
    0 0 10px var(--dali-gold),
    0 0 20px var(--dali-gold),
    0 0 40px rgba(212, 175, 55, 0.5),
    inset 0 0 10px rgba(212, 175, 55, 0.2);
  animation: neon-flicker 3s ease-in-out infinite;
}

@keyframes neon-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.95; }
  55% { opacity: 1; }
  60% { opacity: 0.98; }
}

/* ========== PERFORMANCE OPTIMIZATIONS ========== */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ========== PRINT STYLES ========== */
@media print {
  body::before,
  .liquid-shape,
  .particle,
  #custom-cursor,
  #cursor-trail {
    display: none !important;
  }
}

/* ========== AURORA BACKGROUND EFFECT ========== */
@keyframes aurora {
  0%, 100% {
    opacity: 0.3;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translateY(-30px) scale(1.1);
  }
}

.aurora {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, 
    rgba(212, 175, 55, 0.15) 0%,
    transparent 70%
  );
  animation: aurora 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* ========== SVG FILTER FOR DISTORTION ========== */
.svg-filters {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}
