/* MuskVest 3D Enhancements */

/* Canvas containers */
.canvas-3d-container {
  width: 100%;
  height: 100%;
  min-height: 300px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(31, 87, 32, 0.1) 0%, rgba(47, 125, 50, 0.05) 100%);
}

.feature-card .canvas-3d-container {
  min-height: 280px;
  margin-bottom: 16px;
}

/* Hero 3D canvas */
.hero-3d-canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* Smooth transitions for 3D elements */
canvas {
  display: block;
  image-rendering: crisp-edges;
  image-rendering: -webkit-optimize-contrast;
}

/* Performance optimization for mobile */
@media (max-width: 768px) {
  .canvas-3d-container {
    min-height: 200px;
  }

  .feature-card .canvas-3d-container {
    min-height: 200px;
  }
}

/* Glow effect for 3D cards */
.feature-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 250, 247, 0.98) 100%);
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, rgba(47, 125, 50, 0.2) 0%, rgba(78, 166, 83, 0.1) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::before {
  opacity: 1;
}

/* Animation for reveal elements */
.reveal {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for multiple reveals */
.grid-3 > .reveal:nth-child(1) { animation-delay: 0.1s; }
.grid-3 > .reveal:nth-child(2) { animation-delay: 0.2s; }
.grid-3 > .reveal:nth-child(3) { animation-delay: 0.3s; }

.grid-4 > .reveal:nth-child(1) { animation-delay: 0.1s; }
.grid-4 > .reveal:nth-child(2) { animation-delay: 0.2s; }
.grid-4 > .reveal:nth-child(3) { animation-delay: 0.3s; }
.grid-4 > .reveal:nth-child(4) { animation-delay: 0.4s; }

/* Holographic text effect for headers */
.section-head h2 {
  background: linear-gradient(135deg, var(--fg) 0%, var(--primary) 50%, var(--fg) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

/* Glow on hover */
.card-hover {
  box-shadow: 0 0 20px rgba(47, 125, 50, 0.1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-hover:hover {
  box-shadow: 0 0 40px rgba(47, 125, 50, 0.25), 0 20px 50px -20px rgba(15, 26, 18, 0.2);
}

/* 3D perspective for cards */
@supports (perspective: 1000px) {
  .feature-card {
    perspective: 1000px;
    transform-style: preserve-3d;
  }

  .feature-card:hover {
    transform: rotateX(2deg) rotateY(2deg);
  }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .canvas-3d-container {
    min-height: 250px;
  }
}

@media (max-width: 640px) {
  .canvas-3d-container {
    min-height: 180px;
  }

  .reveal {
    animation-duration: 0.4s;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .canvas-3d-container {
    background: linear-gradient(135deg, rgba(47, 125, 50, 0.15) 0%, rgba(31, 87, 32, 0.08) 100%);
  }

  .feature-card {
    background: linear-gradient(135deg, rgba(15, 26, 18, 0.8) 0%, rgba(31, 87, 32, 0.6) 100%);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .card-hover,
  .feature-card:hover {
    animation: none;
    transition: none;
    transform: none;
  }

  canvas {
    animation: none;
  }
}
