/* ===================================================== */
/* MEUZAVIM CUTTING-EDGE LAYER                            */
/* Aurora · 3D · Lenis · Glass · Morph cursor             */
/* ===================================================== */

/* AURORA — animated noise blobs behind hero */
.aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  mix-blend-mode: screen;
}
.aurora-blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}
.aurora-blob.b1 {
  background: radial-gradient(circle, #8B3FE0 0%, transparent 60%);
  top: -20%; left: -10%;
  animation: auroraDrift1 22s ease-in-out infinite;
}
.aurora-blob.b2 {
  background: radial-gradient(circle, #D4AF37 0%, transparent 60%);
  bottom: -20%; right: -10%;
  animation: auroraDrift2 28s ease-in-out infinite;
}
.aurora-blob.b3 {
  background: radial-gradient(circle, #5B2A86 0%, transparent 65%);
  top: 30%; left: 40%;
  width: 45vmax; height: 45vmax;
  animation: auroraDrift3 24s ease-in-out infinite;
}
.aurora-blob.b4 {
  background: radial-gradient(circle, #E5C158 0%, transparent 50%);
  bottom: 10%; left: -5%;
  width: 35vmax; height: 35vmax;
  opacity: 0.35;
  animation: auroraDrift4 30s ease-in-out infinite;
}
@keyframes auroraDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(15%, 10%) scale(1.1); }
  66% { transform: translate(-10%, 20%) scale(0.95); }
}
@keyframes auroraDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-20%, -15%) scale(1.15); }
  66% { transform: translate(10%, -10%) scale(0.9); }
}
@keyframes auroraDrift3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-40%, -60%) scale(1.2); }
}
@keyframes auroraDrift4 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(25%, -15%) scale(1.1) rotate(180deg); }
}

/* Grain / film texture overlay */
.aurora::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-radial-gradient(circle at 20% 30%, rgba(255,255,255,0.02) 0, transparent 1px),
    repeating-radial-gradient(circle at 80% 70%, rgba(255,255,255,0.02) 0, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  opacity: 0.6;
  mix-blend-mode: overlay;
}

/* MAGNETIC MORPHING CURSOR — replaces basic cursor */
@media (hover: hover) {
  body { cursor: none; }
  .morph-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 18px;
    height: 18px;
    background: var(--gold-500);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease,
                opacity 0.3s ease,
                border-radius 0.3s ease;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
  }
  .morph-cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 44px;
    height: 44px;
    border: 1.5px solid rgba(212, 175, 55, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                opacity 0.3s ease;
    transform: translate(-50%, -50%);
  }
  /* Hovering links/buttons */
  body.cursor-link .morph-cursor {
    width: 8px; height: 8px;
    background: var(--gold-300);
  }
  body.cursor-link .morph-cursor-ring {
    width: 60px; height: 60px;
    border-color: rgba(212, 175, 55, 0.85);
    border-width: 2px;
  }
  /* Hovering text/inputs */
  body.cursor-text .morph-cursor {
    width: 3px; height: 28px;
    background: var(--gold-300);
    border-radius: 2px;
  }
  body.cursor-text .morph-cursor-ring { opacity: 0; }
  /* Hovering images/visuals */
  body.cursor-visual .morph-cursor {
    width: 0; height: 0;
    opacity: 0;
  }
  body.cursor-visual .morph-cursor-ring {
    width: 90px; height: 90px;
    background: rgba(212, 175, 55, 0.12);
    border-color: var(--gold-500);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  body.cursor-visual .morph-cursor-ring::after {
    content: 'גלריה';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--gold-500);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
  }
  /* Hide default cursor on interactive elements */
  a, button, [role="button"], input, textarea, select, .clickable { cursor: none; }
}
@media (hover: none) {
  .morph-cursor, .morph-cursor-ring { display: none; }
}

/* GLASSMORPHISM — premium frosted panels */
.glass {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.glass-dark {
  background: rgba(15, 8, 21, 0.55);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(212, 175, 55, 0.15);
}
/* Apply glass to nav scrolled state */
.nav.scrolled {
  background: rgba(15, 8, 21, 0.7) !important;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

/* THREE.JS CANVAS container */
.three-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.showcase-stage canvas {
  outline: none;
  cursor: grab;
}
.showcase-stage canvas:active {
  cursor: grabbing;
}

/* When Three.js is active, hide SVG fallback */
body.three-active .room-svg {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

/* Variable font weight animation on hover */
@supports (font-variation-settings: normal) {
  .nav-links a {
    font-variation-settings: 'wght' 500;
    transition: font-variation-settings 0.4s ease;
  }
  .nav-links a:hover {
    font-variation-settings: 'wght' 800;
  }
  .hero h1 .ch {
    font-variation-settings: 'wght' 900;
    transition: font-variation-settings 0.6s ease;
  }
}

/* TEXT REVEAL on scroll — sweep mask */
.text-reveal {
  display: inline-block;
  overflow: hidden;
}
.text-reveal-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.text-reveal.in-view .text-reveal-inner {
  transform: translateY(0);
}

/* IMAGE REVEAL MASK */
.image-reveal {
  position: relative;
  overflow: hidden;
}
.image-reveal img {
  transform: scale(1.15);
  transition: transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.image-reveal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateX(0);
  transition: transform 1.2s cubic-bezier(0.7, 0, 0.3, 1);
  z-index: 2;
}
.image-reveal.in-view::before { transform: translateX(100%); }
.image-reveal.in-view img { transform: scale(1); }

/* SCROLL-SNAP / smoother section transitions */
html {
  scroll-snap-type: none; /* Lenis handles smoothness */
}

/* PROJECT CARDS — Bento-grid with hover scale + tilt */
.project-card {
  position: relative;
  transform-style: preserve-3d;
  perspective: 1500px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(212, 175, 55, 0.15) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: 24px;
  z-index: 1;
}
.project-card:hover::after { opacity: 1; }

/* PREMIUM LOADER with progress */
.loader {
  background: var(--ink) !important;
}
.loader-progress {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: rgba(212, 175, 55, 0.15);
  overflow: hidden;
  border-radius: 2px;
}
.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  animation: loaderProgress 1.6s ease forwards;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}
@keyframes loaderProgress {
  to { width: 100%; }
}
.loader-text {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--gold-400);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 700;
}

/* SECTION ENTRY ANIMATIONS - more cinematic */
.section-head {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.section-head.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* FANCY underline on links */
.nav-links a:not(.nav-cta) {
  position: relative;
}
.nav-links a:not(.nav-cta)::before {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: var(--gold-400);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links a:not(.nav-cta):hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

/* RESPONSIVE adjustments */
@media (max-width: 768px) {
  .aurora { opacity: 0.7; }
  .aurora-blob { filter: blur(50px); }
}

/* DARK mode aurora variants */
html[data-theme="dark"] .aurora { mix-blend-mode: screen; opacity: 0.7; }
