/* ╔══════════════════════════════════════════════════════════════════╗
   ║  INFINITY PROTOCOL — APPLE x GOOGLE x FIGMA VISUAL ENGINE      ║
   ║  Ahmed Ashraf Portfolio — Awalim Group                         ║
   ╚══════════════════════════════════════════════════════════════════╝ */

/* 🍏 APPLE: VISION OS PHYSICAL GLASS & DEEP BLURS */
:root {
  --infinity-glass: rgba(255, 255, 255, 0.02);
  --infinity-border: rgba(255, 255, 255, 0.08);
  --infinity-glow: rgba(163, 207, 43, 0.15);
  --infinity-shadow: rgba(0, 0, 0, 0.8);
  --spring-easing: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001);
}

.infinity-glass, 
.glass-card, 
.bento-card, 
.vproj-card, 
.service-card, 
.milestone-card {
  background: var(--infinity-glass);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--infinity-border);
  box-shadow: 
    inset 0 1px 1px rgba(255,255,255,0.1),
    inset 0 -1px 1px rgba(0,0,0,0.5),
    0 20px 40px var(--infinity-shadow);
  border-radius: 24px;
  transition: transform 0.4s var(--spring-easing), border-color 0.3s ease, box-shadow 0.3s ease;
}

.infinity-glass:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(163,207,43,0.4);
  box-shadow: 
    inset 0 1px 1px rgba(163,207,43,0.2),
    inset 0 -1px 1px rgba(0,0,0,0.5),
    0 30px 60px var(--infinity-shadow);
  z-index: 10;
}

/* 🎨 FIGMA: PIXEL PERFECT MICRO-INTERACTIONS & INSETS */
.magnetic-btn, .vsh-btn-primary, .btn-primary {
  transition: transform 0.6s var(--spring-easing), box-shadow 0.6s var(--spring-easing), filter 0.3s ease !important;
  will-change: transform;
}

.magnetic-btn:hover {
  filter: brightness(1.2);
  box-shadow: 0 10px 30px var(--infinity-glow), inset 0 0 10px rgba(255,255,255,0.2) !important;
}

/* 🌀 GOOGLE: FLUID MATERIAL RIPPPLES */
.sv6-ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
  transform: scale(0);
  animation: sv6RippleAnim 0.8s cubic-bezier(0.1, 0, 0.3, 1);
  pointer-events: none;
  filter: blur(2px);
  mix-blend-mode: overlay;
}

@keyframes sv6RippleAnim {
  0% { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0; }
}

/* 🎯 FIGMA: THE BLOB STICKY CURSOR */
.vs-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999999; /* Above noise layer (999999) */
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  will-change: width, height, transform, border-radius;
}

.vs-cursor.blob-active {
  background: rgba(163,207,43,0.25);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  mix-blend-mode: normal;
  border: 1px solid rgba(163,207,43,0.8);
  box-shadow: 0 0 20px rgba(163,207,43,0.4), 0 0 40px rgba(163,207,43,0.2);
  /* Always visible — no blend mode interference */
}

/* Default state: difference mode makes it pop on both dark/light */
.vs-cursor:not(.blob-active) {
  mix-blend-mode: difference;
}

/* 🍏 APPLE: TEXT REVEAL PARALLAX SCROLL */
.scroll-reveal-text span {
  opacity: 0.1;
  transition: opacity 0.1s ease;
}

/* 🌍 HERO INFINITY DEPTH */
.vsh-inner {
  transform-style: preserve-3d;
  perspective: 1200px;
}

.infinity-layer {
  transition: transform 0.1s linear;
  will-change: transform;
}

/* NOISE GRAIN - CINEMATIC FEEL */
.infinity-noise {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none !important; /* Never block mouse events */
  user-select: none !important;
  z-index: 100; /* Low z-index — below ALL interactive elements */
  opacity: 0.03;
  background: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%" height="100%" filter="url(%23noise)"/%3E%3C/svg%3E');
}

/* ═════════════════════════════════════════════════════════
   SPATIAL STORE TEASER (APPLE VISION OS STYLE)
═════════════════════════════════════════════════════════ */
.spatial-store-teaser {
  padding: 100px 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, transparent, rgba(163,207,43,0.02) 50%, transparent);
}

.spatial-store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(163,207,43,0.1);
  border: 1px solid rgba(163,207,43,0.25);
  border-radius: 50px;
  padding: 8px 22px;
  margin-bottom: 30px;
  color: #a3cf2b;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.pulse-dot {
  width: 8px; height: 8px;
  background: #a3cf2b;
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 10px #a3cf2b;
}

.spatial-store-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -2px;
}

.spatial-store-desc {
  color: rgba(255,255,255,0.6);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 50px;
  line-height: 1.8;
}

.spatial-store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 50px;
}

/* Scroll Timeline for Grid */
@supports (animation-timeline: view()) {
  .spatial-store-grid {
    animation: spatialReveal linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 40%;
  }
}

.spatial-store-card {
  background: rgba(10, 15, 20, 0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 32px 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background 0.3s ease;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 10px 30px rgba(0,0,0,0.5);
}

.spatial-store-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(163,207,43,0.4);
  background: rgba(20, 30, 40, 0.8);
  box-shadow: inset 0 1px 1px rgba(163,207,43,0.2), 0 20px 40px rgba(0,0,0,0.6);
}

.ssc-icon {
  font-size: 3rem;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.ssc-title {
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
}

.ssc-price {
  color: #a3cf2b;
  font-weight: 900;
  font-size: 1.2rem;
  background: rgba(163,207,43,0.1);
  padding: 6px 14px;
  border-radius: 12px;
}

.spatial-payment-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 50px;
}

.spatial-payment-row span {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.spatial-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #a3cf2b, #00897b);
  border: none;
  border-radius: 50px;
  padding: 20px 50px;
  color: #021a1e;
  font-weight: 900;
  font-size: 1.2rem;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  box-shadow: 0 0 40px rgba(163,207,43,0.3);
}

.spatial-store-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 50px rgba(163,207,43,0.5);
}

/* Ambient Visuals */
.spatial-orb-bg {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(100px);
}
.spatial-orb-bg.orb-1 {
  bottom: -100px;
  right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(163,207,43,0.1), transparent 70%);
}
.spatial-orb-bg.orb-2 {
  top: -100px;
  left: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,224,198,0.08), transparent 70%);
}

/* ═════════════════════════════════════════════════════════
   AWALIM ECOSYSTEM (NEURAL MAP)
═════════════════════════════════════════════════════════ */
.eco-network {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eco-lines {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}

.eco-path {
  stroke-dasharray: 50;
  animation: ecoPulse 2s linear infinite;
}

@keyframes ecoPulse {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

.eco-core {
  position: absolute;
  z-index: 3;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20,30,40,0.9), rgba(10,15,20,0.95));
  border: 1px solid rgba(163,207,43,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 50px rgba(163,207,43,0.2), inset 0 0 20px rgba(163,207,43,0.1);
}

.pulse-core::after {
  content: '';
  position: absolute;
  top: -10px; left: -10px; right: -10px; bottom: -10px;
  border-radius: 50%;
  border: 1px solid rgba(163,207,43,0.3);
  animation: coreRipple 2s infinite ease-out;
}

@keyframes coreRipple {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.eco-core h3 {
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  margin: 10px 0 2px;
}
.eco-core span {
  color: #a3cf2b;
  font-size: 0.8rem;
  letter-spacing: 1px;
}
.eco-core .eco-icon {
  font-size: 2.5rem;
  color: #a3cf2b;
}

.eco-node {
  position: absolute;
  z-index: 2;
  width: 150px; height: 150px;
  border-radius: 24px;
  background: rgba(10,15,20,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.05), 0 10px 30px rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.eco-node-1 { top: 15%; left: 15%; transform: translate(-50%, -50%); }
.eco-node-2 { top: 15%; left: 85%; transform: translate(-50%, -50%); }
.eco-node-3 { top: 85%; left: 15%; transform: translate(-50%, -50%); }
.eco-node-4 { top: 85%; left: 85%; transform: translate(-50%, -50%); }

.eco-node h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 12px 0 2px;
}
.eco-node span {
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
}
.eco-node .eco-icon {
  font-size: 2.2rem;
  color: rgba(255,255,255,0.9);
}

@media (max-width: 768px) {
  .eco-network { height: 800px; }
  .eco-node-1 { top: 10%; left: 50%; }
  .eco-node-2 { top: 90%; left: 50%; }
  .eco-node-3 { top: 50%; left: 15%; }
  .eco-node-4 { top: 50%; left: 85%; }
  .eco-lines { display: none; }
}
