/**
 * why-card — ขอบเรืองแสงนุ่ม ลดรอยหยัก ไม่โต้ตอบ
 */
.why-grid {
  overflow: visible;
  padding: 10px;
}

.why-card {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.38) !important;
  border-radius: var(--radius, 10px);
  background: rgba(var(--accent3-rgb, 168, 85, 247), 0.08) !important;
  box-shadow: inset 0 0 28px rgba(255, 255, 255, 0.035);
  transition: none !important;
  transform: none !important;
  cursor: default !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
  touch-action: none;
  pointer-events: none !important;
  animation: none !important;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.why-card,
.why-card * {
  user-select: none !important;
  -webkit-user-drag: none !important;
  pointer-events: none !important;
}

/* เส้นเรืองแสงแยกชั้น — ลดรอยหยักจาก border 1.5px */
.why-card::before {
  display: block !important;
  content: "" !important;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none !important;
  z-index: 3;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    inset 0 0 12px rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 7px rgba(255, 255, 255, 0.28),
    0 0 16px rgba(255, 255, 255, 0.16),
    0 0 32px rgba(255, 255, 255, 0.08);
  animation: whyBorderGlow 3.8s ease-in-out infinite;
}

.why-card::after {
  display: block !important;
  content: "" !important;
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius, 10px) + 1px);
  pointer-events: none !important;
  z-index: 4;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 4px rgba(255, 255, 255, 0.2),
    0 0 10px rgba(255, 255, 255, 0.12);
  opacity: 0.85;
  animation: whyBorderGlowOuter 3.8s ease-in-out infinite;
}

.why-card:nth-child(1)::before { animation-delay: 0s; }
.why-card:nth-child(2)::before { animation-delay: 0.5s; }
.why-card:nth-child(3)::before { animation-delay: 1s; }
.why-card:nth-child(4)::before { animation-delay: 1.5s; }

.why-card:nth-child(1)::after { animation-delay: 0s; }
.why-card:nth-child(2)::after { animation-delay: 0.5s; }
.why-card:nth-child(3)::after { animation-delay: 1s; }
.why-card:nth-child(4)::after { animation-delay: 1.5s; }

.why-card-shine {
  display: block !important;
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  z-index: 1;
  background: linear-gradient(
    225deg,
    rgba(var(--accent-rgb, 159, 171, 189), 0.12) 0%,
    transparent 60%
  ) !important;
  pointer-events: none !important;
}

.why-card:nth-child(2) .why-card-shine,
.why-card:nth-child(3) .why-card-shine,
.why-card:nth-child(4) .why-card-shine {
  background: linear-gradient(225deg, rgba(255, 255, 255, 0.06) 0%, transparent 60%) !important;
}

.why-card-icon,
.why-card-title,
.why-card-desc,
.why-tags {
  position: relative;
  z-index: 2;
}

.why-card:hover,
.why-card:focus,
.why-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.38) !important;
  transform: none !important;
}

@keyframes whyBorderGlow {
  0%, 100% {
    opacity: 0.72;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.16),
      inset 0 0 10px rgba(255, 255, 255, 0.04),
      0 0 0 1px rgba(255, 255, 255, 0.08),
      0 0 5px rgba(255, 255, 255, 0.2),
      0 0 12px rgba(255, 255, 255, 0.11),
      0 0 24px rgba(255, 255, 255, 0.05);
  }
  50% {
    opacity: 1;
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.3),
      inset 0 0 14px rgba(255, 255, 255, 0.07),
      0 0 0 1px rgba(255, 255, 255, 0.14),
      0 0 9px rgba(255, 255, 255, 0.38),
      0 0 20px rgba(255, 255, 255, 0.22),
      0 0 40px rgba(255, 255, 255, 0.1);
  }
}

@keyframes whyBorderGlowOuter {
  0%, 100% {
    opacity: 0.55;
    box-shadow:
      0 0 3px rgba(255, 255, 255, 0.14),
      0 0 8px rgba(255, 255, 255, 0.08);
  }
  50% {
    opacity: 0.95;
    box-shadow:
      0 0 6px rgba(255, 255, 255, 0.28),
      0 0 14px rgba(255, 255, 255, 0.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  .why-card::before,
  .why-card::after {
    animation: none !important;
    opacity: 0.88;
  }

  .why-card::before {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.22),
      0 0 8px rgba(255, 255, 255, 0.24),
      0 0 18px rgba(255, 255, 255, 0.12);
  }
}
