/* Product Explanation Section */
.product-explanation {
  background: rgba(255, 255, 255, 0.95);
  position: relative;
  overflow: hidden;
}

.product-explanation::before {
  display: none;
}

.product-explanation .container {
  position: relative;
  z-index: 1;
}

.product-explanation .container {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.product-explanation .container.visible {
  opacity: 1;
  transform: translateY(0);
}

.product-explanation .section-title {
  display: inline-block;
}

.product-explanation .section-title span {
  display: inline-block;
}

.product-explanation .section-title span:nth-child(1) { animation: letterWave 0.5s ease-out 0.1s forwards; }
.product-explanation .section-title span:nth-child(2) { animation: letterWave 0.5s ease-out 0.15s forwards; }
.product-explanation .section-title span:nth-child(3) { animation: letterWave 0.5s ease-out 0.2s forwards; }
.product-explanation .section-title span:nth-child(4) { animation: letterWave 0.5s ease-out 0.25s forwards; }
.product-explanation .section-title span:nth-child(5) { animation: letterWave 0.5s ease-out 0.3s forwards; }
.product-explanation .section-title span:nth-child(6) { animation: letterWave 0.5s ease-out 0.35s forwards; }
.product-explanation .section-title span:nth-child(7) { animation: letterWave 0.5s ease-out 0.4s forwards; }
.product-explanation .section-title span:nth-child(8) { animation: letterWave 0.5s ease-out 0.45s forwards; }
.product-explanation .section-title span:nth-child(9) { animation: letterWave 0.5s ease-out 0.5s forwards; }
.product-explanation .section-title span:nth-child(10) { animation: letterWave 0.5s ease-out 0.55s forwards; }
.product-explanation .section-title span:nth-child(11) { animation: letterWave 0.5s ease-out 0.6s forwards; }
.product-explanation .section-title span:nth-child(12) { animation: letterWave 0.5s ease-out 0.65s forwards; }
.product-explanation .section-title span:nth-child(13) { animation: letterWave 0.5s ease-out 0.7s forwards; }
.product-explanation .section-title span:nth-child(14) { animation: letterWave 0.5s ease-out 0.75s forwards; }
.product-explanation .section-title span:nth-child(15) { animation: letterWave 0.5s ease-out 0.8s forwards; }
.product-explanation .section-title span:nth-child(16) { animation: letterWave 0.5s ease-out 0.85s forwards; }
.product-explanation .section-title span:nth-child(17) { animation: letterWave 0.5s ease-out 0.9s forwards; }
.product-explanation .section-title span:nth-child(18) { animation: letterWave 0.5s ease-out 0.95s forwards; }
.product-explanation .section-title span:nth-child(19) { animation: letterWave 0.5s ease-out 1.0s forwards; }

/* Cards */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  perspective: 1000px;
}

.card {
  background: var(--white);
  color: var(--dark-text);
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(20px);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: cardBreath 4s ease-in-out infinite;
}

@keyframes cardBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}

/* Mobile entrance animation */
@media (max-width: 768px) {
  .card {
    animation: mobileCardEntrance 0.8s ease-out forwards;
  }
  
  .card:nth-child(1) {
    animation-delay: 0.1s;
  }
  
  .card:nth-child(2) {
    animation-delay: 0.3s;
  }
  
  .card:nth-child(3) {
    animation-delay: 0.5s;
  }
  
  .card-spotlight {
    display: none;
  }
  
  .card:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  }
  
  .card:hover .card-icon {
    transform: none;
    text-shadow: none;
  }
}

@keyframes mobileCardEntrance {
  0% {
    opacity: 0;
    transform: scale(0.95);
    box-shadow: 0 0 0 rgba(250, 195, 17, 0);
  }
  30% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(250, 195, 17, 0.3);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 rgba(250, 195, 17, 0);
  }
}

.card-content {
  position: relative;
  z-index: 1;
}

.card:nth-child(1) {
  animation: fadeInUp 0.5s ease-out 0.2s forwards;
}

.card:nth-child(2) {
  animation: fadeInUp 0.5s ease-out 0.4s forwards;
}

.card:nth-child(3) {
  animation: fadeInUp 0.5s ease-out 0.6s forwards;
}

@media (max-width: 768px) {
  .cards-container:hover .card {
    transform: none;
  }
  
  .card-spotlight {
    display: none;
  }
  
  .card:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  }
  
  .card:hover .card-icon {
    transform: none;
    text-shadow: none;
  }
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.card:hover .card-icon {
  text-shadow: 0 0 15px rgba(250, 195, 17, 0.5);
  transform: scale(1.1) translateY(-5px);
  animation: iconBounce 0.6s ease infinite alternate;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--yellow-accent);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card:nth-child(1) .card-icon {
  animation: iconPulse 3s ease-in-out infinite 0s;
}

.card:nth-child(2) .card-icon {
  animation: iconPulse 3s ease-in-out infinite 0.5s;
}

.card:nth-child(3) .card-icon {
  animation: iconPulse 3s ease-in-out infinite 1s;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes iconBounce {
  0% { transform: scale(1.1) translateY(0); }
  100% { transform: scale(1.1) translateY(-10px); }
}

.card:hover .card-icon {
  transform: scale(1.1) translateY(-5px);
  text-shadow: 0 0 15px rgba(250, 195, 17, 0.5);
  animation: iconBounce 0.6s ease infinite alternate;
}

.card-spotlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at var(--x) var(--y),
    rgba(250, 195, 17, 0.05) 0%,
    rgba(250, 195, 17, 0) 70%
  );
  opacity: 0.3;
  transition: opacity 0.3s ease-out;
  pointer-events: none;
  z-index: 0;
}

.card:hover .card-spotlight {
  opacity: 1;
  background: radial-gradient(
    circle at var(--x) var(--y),
    rgba(250, 195, 17, 0.2) 0%,
    rgba(250, 195, 17, 0) 70%
  );
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card-description {
  color: var(--secondary-text);
}

/* Process Section */
.process {
  padding: 5rem 0;
  background-color: #f9f9f9;
  animation: fadeIn 0.8s ease-out;
}

.process-steps {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 3rem;
}

.step {
  flex: 1;
  min-width: 250px;
  text-align: center;
  padding: 2rem;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.step:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.step-number {
  width: 50px;
  height: 50px;
  background: var(--yellow-accent);
  color: var(--dark-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1.5rem;
}

.step-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark-bg);
}

.step-description {
  color: var(--secondary-text);
}

.card {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  overflow: visible; /* важно, чтобы свечение не обрезалось */
  z-index: 0;
}

/* Рамка */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 4px; /* толщина рамки */
  background: linear-gradient(45deg, rgba(255,140,0,0.8), rgba(255,165,0,1), rgba(255,140,0,0.8));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
  animation: glowBorder 2s linear infinite;
}

/* Свечение за рамкой */
.card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% + 60px);  /* увеличено для свечения за рамкой */
  height: calc(100% + 60px);
  border-radius: 16px;
  background: radial-gradient(circle, rgba(255,165,0,0.5) 0%, rgba(255,165,0,0) 70%);
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
  z-index: 0;
  filter: blur(30px); /* сильное блюр-свечение */
  animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes glowBorder {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); } /* мягкий пульс рамки */
}

@keyframes pulseGlow {
  0% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.1; transform: translate(-50%, -50%) scale(1.4); } /* более явный пульс */
  100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
}

.feature-item {
  position: relative;
  background: var(--white);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  overflow: visible; /* важно для свечения */
  z-index: 0;
}

/* Рамка */
.feature-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  padding: 3px; /* толщина рамки */
  background: linear-gradient(
    45deg,
    rgba(255,140,0,0.8),
    rgba(255,165,0,1),
    rgba(255,140,0,0.8)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
  animation: glowBorder 2s linear infinite;
}

/* Свечение за рамкой */
.feature-item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% + 40px);  /* немного меньше, чем для больших карточек */
  height: calc(100% + 40px);
  border-radius: 14px;
  background: radial-gradient(circle, rgba(255,165,0,0.5) 0%, rgba(255,165,0,0) 70%);
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
  z-index: 0;
  filter: blur(20px); /* чуть меньше блюра для компактных карточек */
  animation: pulseGlow 1.5s ease-in-out infinite;
}

@keyframes glowBorder {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); } /* мягкий пульс рамки */
}

@keyframes pulseGlow {
  0% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.1; transform: translate(-50%, -50%) scale(1.3); } /* явный пульс */
  100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
}
