.features {
  padding: 100px 20px;
  text-align: center;

  position: relative;
  overflow: hidden;
}

/* Animated Gradient Overlay */
.features::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #1e293b 0%, rgba(30,41,59,0) 100%);
  animation: gradientPulse 12s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes gradientPulse {
  0% { transform: scale(1) translate(0,0); opacity: 0.7; }
  50% { transform: scale(1.2) translate(-5%, -5%); opacity: 1; }
  100% { transform: scale(1) translate(0,0); opacity: 0.7; }
}

.features .section-title {
  font-size: 2.8rem;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #60a5fa, #22d3ee, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 300% 300%;
  animation: gradientFlow 8s linear infinite;
  position: relative;
  z-index: 1;
  font-family: "IBM Plex Serif", serif;
}

.features .section-subtitle {
  font-size: 1.2rem;
  margin-bottom: 60px;
  color: #d1d5db;
  position: relative;
  z-index: 1;
  font-family: "Sansation", sans-serif;
}

.features::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100px; /* height of the fade */
  background: linear-gradient(to bottom, rgba(30,41,59,0) 0%, #1e293b 100%);
  pointer-events: none;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 75px;
  position: relative;
  z-index: 1;
}

/* Feature Card Base */
.feature-card {
  background: linear-gradient(145deg, rgba(30,41,59,0.9), rgba(15,23,42,0.95));
  border-radius: 18px;
  padding: 70px 100px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
}

/* Hidden initially (before scroll into view) */
.feature-card.hidden {
  opacity: 0;
  transform: translateY(40px);
}

/* Animate when visible */
.feature-card.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Staggered delay */
.feature-card.show:nth-child(1) { transition-delay: 0.2s; }
.feature-card.show:nth-child(2) { transition-delay: 0.4s; }
.feature-card.show:nth-child(3) { transition-delay: 0.6s; }
.feature-card.show:nth-child(4) { transition-delay: 0.8s; }

/* Glow Hover Effect */
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #60a5fa, #22d3ee, #a855f7);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

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

.feature-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0,0,0,0.45);
}

.feature-card h3 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: #fff;
  position: relative;
  z-index: 1;
  font-family: "Sansation", sans-serif;
}

.feature-card p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #cbd5e1;
  font-family: "Sansation", sans-serif;
  position: relative;
  z-index: 1;
}

.feature-icon {
    font-size: 2.5rem;
    color: #08e7c2; /* Gradient or colored effect can be added */
    margin-bottom: 20px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(10deg);
    color: #08e7c2; /* Hover gradient effect */
}

/* Mobile Responsive: 1 card per row below 768px */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}
