/* ================================================================
   VALTUTE MEDIA — PREMIUM PARALLAX SYSTEM v2
   Mesh Gradient · Particles · Depth · Glassmorphism · Sticky Scroll
================================================================ */

/* ── 1. Smooth Scroll Root ──────────────────────────────────── */
html {
  scroll-behavior: auto; /* JS handles smooth scrolling */
}

/* ── 2. Grain / Noise Overlay ───────────────────────────────── */
.vp-grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  background-repeat: repeat;
  animation: vp-grain-shift 0.5s steps(2) infinite;
}
@keyframes vp-grain-shift {
  0%  { transform: translate(0,   0);   }
  25% { transform: translate(-2%, 1%);  }
  50% { transform: translate(1%,  -2%); }
  75% { transform: translate(2%,  2%);  }
}

/* ── 3. Mesh Gradient Background ───────────────────────────── */
.vp-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Mesh layer 1 — cyan node */
.vp-mesh-node {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  will-change: transform, opacity;
}
.vp-mesh-node-1 {
  width: 70vw; height: 70vw;
  max-width: 900px; max-height: 900px;
  background: radial-gradient(circle at center,
    rgba(0, 229, 255, 0.07) 0%,
    rgba(0, 180, 255, 0.04) 40%,
    transparent 70%
  );
  top: -20%; left: -15%;
  animation: mesh-float-1 22s ease-in-out infinite;
}
.vp-mesh-node-2 {
  width: 60vw; height: 60vw;
  max-width: 750px; max-height: 750px;
  background: radial-gradient(circle at center,
    rgba(185, 0, 255, 0.065) 0%,
    rgba(120, 0, 200, 0.03) 40%,
    transparent 70%
  );
  top: 25%; right: -20%;
  animation: mesh-float-2 28s ease-in-out infinite;
}
.vp-mesh-node-3 {
  width: 50vw; height: 50vw;
  max-width: 600px; max-height: 600px;
  background: radial-gradient(circle at center,
    rgba(0, 229, 255, 0.05) 0%,
    transparent 70%
  );
  bottom: -10%; left: 30%;
  animation: mesh-float-3 26s ease-in-out infinite;
}
.vp-mesh-node-4 {
  width: 40vw; height: 40vw;
  max-width: 500px; max-height: 500px;
  background: radial-gradient(circle at center,
    rgba(185, 0, 255, 0.05) 0%,
    transparent 70%
  );
  top: 55%; left: 55%;
  animation: mesh-float-4 32s ease-in-out infinite;
}
.vp-mesh-node-5 {
  width: 45vw; height: 45vw;
  max-width: 550px; max-height: 550px;
  background: radial-gradient(circle at center,
    rgba(100, 200, 255, 0.04) 0%,
    transparent 70%
  );
  top: 10%; left: 40%;
  animation: mesh-float-5 35s ease-in-out infinite;
}

@keyframes mesh-float-1 {
  0%,100% { transform: translate(0,     0)     scale(1);    }
  20%      { transform: translate(4%,   3%)    scale(1.04); }
  40%      { transform: translate(-2%,  7%)    scale(0.97); }
  60%      { transform: translate(6%,   -3%)   scale(1.02); }
  80%      { transform: translate(-3%,  -5%)   scale(1.05); }
}
@keyframes mesh-float-2 {
  0%,100% { transform: translate(0,     0)     scale(1);    }
  25%      { transform: translate(-5%,  4%)    scale(1.06); }
  50%      { transform: translate(3%,   -6%)   scale(0.95); }
  75%      { transform: translate(-2%,  5%)    scale(1.03); }
}
@keyframes mesh-float-3 {
  0%,100% { transform: translate(0,     0)     scale(1);    }
  33%      { transform: translate(-4%,  -3%)   scale(1.07); }
  66%      { transform: translate(5%,   4%)    scale(0.96); }
}
@keyframes mesh-float-4 {
  0%,100% { transform: translate(0,     0)     scale(1);    }
  30%      { transform: translate(5%,   -7%)   scale(1.1);  }
  60%      { transform: translate(-6%,  3%)    scale(0.92); }
}
@keyframes mesh-float-5 {
  0%,100% { transform: translate(0,     0)     scale(1);    }
  40%      { transform: translate(-3%,  -4%)   scale(1.05); }
  70%      { transform: translate(4%,   6%)    scale(0.98); }
}

/* ── 4. Particle Canvas ─────────────────────────────────────── */
#vp-particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
}

/* ── 5. Scroll Progress Bar ──────────────────────────────────── */
.vp-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg,
    #00E5FF 0%,
    #B900FF 60%,
    #00E5FF 100%
  );
  background-size: 200% 100%;
  animation: vp-progress-shimmer 3s linear infinite;
  z-index: 10000;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.7), 0 0 4px rgba(185, 0, 255, 0.5);
  pointer-events: none;
  transition: width 0.08s linear;
  display: none;
}
@keyframes vp-progress-shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── 6. Cursor Glow ──────────────────────────────────────────── */
.vp-cursor {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle,
    rgba(0, 229, 255, 0.045) 0%,
    rgba(185, 0, 255, 0.02) 50%,
    transparent 70%
  );
  filter: blur(30px);
  will-change: transform;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

/* ── 6b. Cursor Depth Layer (NEW) ─────────────────────────── */
.vp-cursor-depth {
  position: fixed;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle,
    rgba(185, 0, 255, 0.08) 0%,
    rgba(0, 229, 255, 0.04) 40%,
    transparent 70%
  );
  filter: blur(20px);
  will-change: transform, opacity;
  top: 0; left: 0;
  transform: translate(-50%, -50%) scale(0.8);
  mix-blend-mode: color-dodge;
  opacity: 0;
}

/* ── 7. Reveal System ────────────────────────────────────────── */
[data-vp-reveal] {
  opacity: 0;
  will-change: opacity, transform;
  transition:
    opacity  0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-vp-reveal="up"]    { transform: translateY(60px); }
[data-vp-reveal="down"]  { transform: translateY(-40px); }
[data-vp-reveal="left"]  { transform: translateX(-60px); }
[data-vp-reveal="right"] { transform: translateX(60px); }
[data-vp-reveal="scale"] { transform: scale(0.88) translateY(30px); }
[data-vp-reveal="fade"]  { transform: none; }
[data-vp-reveal].vp-in {
  opacity: 1;
  transform: none;
}

/* Stagger delays */
[data-vp-delay="1"] { transition-delay: 0.08s !important; }
[data-vp-delay="2"] { transition-delay: 0.16s !important; }
[data-vp-delay="3"] { transition-delay: 0.24s !important; }
[data-vp-delay="4"] { transition-delay: 0.32s !important; }
[data-vp-delay="5"] { transition-delay: 0.40s !important; }
[data-vp-delay="6"] { transition-delay: 0.50s !important; }

/* ── 8. Hero Text Line Reveal ────────────────────────────────── */
.vp-line-wrap {
  overflow: hidden;
  display: block;
}
.vp-line-inner {
  display: block;
  transform: translateY(105%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.vp-line-inner.vp-in {
  transform: translateY(0);
}

/* ── 9. Glassmorphism Cards v2 ───────────────────────────────── */
.vp-card {
  position: relative;
  background: rgba(8, 8, 20, 0.6);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(0, 229, 255, 0.1);
  border-radius: 20px;
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 40px rgba(0, 229, 255, 0.015);
  transform-style: preserve-3d;
  will-change: transform;
  transition:
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.5s ease;
  overflow: hidden;
}
.vp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(0, 229, 255, 0.04) 0%,
    transparent 50%,
    rgba(185, 0, 255, 0.03) 100%
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.vp-card:hover::before { opacity: 1; }
.vp-card:hover {
  border-color: rgba(0, 229, 255, 0.22);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.65),
    0 0 40px rgba(0, 229, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 60px rgba(0, 229, 255, 0.025);
}

/* ── 9b. Card Glow Effect (NEW) ──────────────────────────── */
.vp-card-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(0, 229, 255, 0.3) 0%,
    rgba(185, 0, 255, 0.15) 40%,
    transparent 70%
  );
  filter: blur(40px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  will-change: opacity;
}

.vp-hovering .vp-card-glow {
  transition: opacity 0.2s ease;
}

/* Enhanced glassmorphism for service and pricing cards */
.service-card,
.pricing-card,
.vp-glass,
.about-bullet {
  position: relative;
  background: rgba(8, 8, 20, 0.5);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(0, 229, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, border-color, box-shadow;
}

.service-card:hover,
.pricing-card:hover,
.vp-glass:hover,
.about-bullet:hover {
  background: rgba(8, 8, 20, 0.7);
  border-color: rgba(0, 229, 255, 0.15);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 229, 255, 0.05),
    inset 0 0 40px rgba(0, 229, 255, 0.02);
}

/* ── 10. Sticky Showcase Section ────────────────────────────── */
.vp-showcase {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.vp-showcase-sticky {
  position: sticky;
  top: 120px;
  align-self: start;
}
.vp-showcase-visual {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(0, 229, 255, 0.12);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(0, 229, 255, 0.04);
  aspect-ratio: 4/3;
  transition: box-shadow 0.6s ease;
}
.vp-showcase-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.vp-showcase-visual:hover img {
  transform: scale(1.08);
}
.vp-showcase-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 229, 255, 0.08) 0%,
    transparent 50%,
    rgba(185, 0, 255, 0.06) 100%
  );
  pointer-events: none;
}

.vp-showcase-items { display: flex; flex-direction: column; gap: 2px; }
.vp-showcase-item {
  padding: 28px 32px;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.4s ease,
    border-color 0.4s ease,
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.vp-showcase-item:hover,
.vp-showcase-item.active {
  background: rgba(0, 229, 255, 0.04);
  border-color: rgba(0, 229, 255, 0.15);
  transform: translateX(6px);
}
.vp-showcase-item.active { border-color: rgba(0, 229, 255, 0.25); }
.vp-showcase-item .item-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.7;
}
.vp-showcase-item h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--text);
}
.vp-showcase-item p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── 11. Section separator lines ────────────────────────────── */
.vp-sep {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), rgba(185,0,255,0.6), transparent);
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 0 auto 64px;
}
.vp-sep.vp-in { width: min(600px, 100%); }

/* ── 12. Ambient section glow ────────────────────────────────── */
.vp-ambient {
  position: relative;
}
.vp-ambient::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(0, 229, 255, 0.05) 0%,
    transparent 70%
  );
  filter: blur(80px);
  pointer-events: none;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  animation: vp-ambient-pulse 8s ease-in-out infinite;
}
@keyframes vp-ambient-pulse {
  0%,100% { opacity: 0.6; transform: translateX(-50%) scale(1);    }
  50%      { opacity: 1;   transform: translateX(-50%) scale(1.15); }
}

/* ── 12b. Section Transition Effects (NEW) ──────────────────── */
section {
  opacity: 0.95;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

section.vp-section-in {
  opacity: 1;
  transform: translateZ(0);
}

/* Section fade-in with slight scale */
section[data-vp-reveal] {
  transform: scaleY(0.98) translateY(20px);
}

section[data-vp-reveal].vp-in {
  transform: scaleY(1) translateY(0);
}

/* Hero section special treatment */
.hero {
  opacity: 1;
  animation: hero-fade-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hero-fade-in {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Works grid animation */
.works-grid > * {
  opacity: 0;
  animation: grid-item-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.works-grid .w1 { animation-delay: 0s; }
.works-grid .w2 { animation-delay: 0.1s; }
.works-grid .w3 { animation-delay: 0.2s; }
.works-grid .w4 { animation-delay: 0.3s; }
.works-grid .w5 { animation-delay: 0.4s; }

@keyframes grid-item-in {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(40px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── 13. Number counter glow ────────────────────────────────── */
.stat-number {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.3));
}

/* ── 14. Performance / Accessibility ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vp-grain,
  .vp-mesh-node,
  [data-vp-reveal],
  .vp-line-inner,
  .vp-card,
  .vp-sep,
  #vp-particles {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 900px) {
  .vp-showcase {
    grid-template-columns: 1fr;
  }
  .vp-showcase-sticky {
    position: relative;
    top: 0;
  }
  .vp-mesh-node-4,
  .vp-mesh-node-5 { display: none; }
  .vp-mesh-node-1 { width: 100vw; height: 100vw; }
  .vp-mesh-node-2 { width: 80vw;  height: 80vw;  }
}

@media (max-width: 600px) {
  .vp-mesh-node-3 { display: none; }
  [data-vp-reveal] { transition-duration: 0.6s !important; }
  [data-vp-reveal="up"]   { transform: translateY(35px); }
  [data-vp-reveal="left"] { transform: translateX(-30px); }
}
