/* ==========================================================================
   Features / Value Proposition section (Figma node 26:8, "Why learn with us?")
   ========================================================================== */

.features {
  padding: 96px 0;
  background-color: var(--color-white);
}

.features__container {
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.features__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.features__title {
  color: var(--color-heading);
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
}

.features__subtitle {
  color: var(--color-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.features__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 33px;
  background-color: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Bottom accent bar that grows in from the left on hover */
.features__card::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 3px;
  background-color: var(--color-brand);
  transition: width 0.4s ease;
}

.features__card:hover::after {
  width: 100%;
}

/* Applied by animations.js before a card scrolls into view; kept out of the
   base rule so the cards stay visible when JavaScript is unavailable. */
.features__card--pre-animate {
  opacity: 0;
  transform: translateY(20px);
}

.features__card.is-visible {
  animation: features-fade-slide-up 0.7s ease-out forwards;
}

/* Stagger: ~0.15s between each card as the row reveals */
.features__card:nth-child(1).is-visible { animation-delay: 0s; }
.features__card:nth-child(2).is-visible { animation-delay: 0.15s; }
.features__card:nth-child(3).is-visible { animation-delay: 0.3s; }
.features__card:nth-child(4).is-visible { animation-delay: 0.45s; }

.features__card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(3, 108, 66, 0.12);
  background-color: #f0fdf4;
}

.features__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  background-color: var(--color-bg-subtle);
  border-radius: 8px;
}

.features__icon-img {
  width: auto;
  height: auto;
  max-width: 25px;
  max-height: 25px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.features__card:hover .features__icon-img {
  transform: scale(1.15) rotate(-8deg);
}

.features__card-title {
  margin-bottom: 8px;
  color: var(--color-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}

.features__card-text {
  color: var(--color-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

@keyframes features-fade-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
