
/* ========================================
   WHY SECTION — Reimagined Card Grid
   ======================================== */

.why-section {
  background: #0e1012;
  position: relative;
  overflow: hidden;
  padding: 80px 0;
}

.why-section .section-head h2 {
  color: #ffffff;
}


.why-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(255, 107, 53, 0.07), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(124, 58, 237, 0.07), transparent 60%);
  pointer-events: none;
}

.why-subtitle {
  color: var(--text-muted, rgba(255,255,255,0.5));
  font-size: 1.05rem;
  margin-top: 12px;
  text-align: center;
}

/* --- Grid layout --- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 56px;
}

/* Lead card spans 2 cols, 2 rows */
.why-card--lead {
  grid-column: span 2;
  grid-row: span 2;
}

/* --- Base card --- */
.why-card {
  position: relative;
  border-radius: 20px;
  padding: 30px 28px 28px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: default;
  min-height: 200px;
  transition: transform 0.35s cubic-bezier(.22,1,.36,1), opacity 0.7s cubic-bezier(.22,1,.36,1);
}

.why-card:hover {
  transform: translateY(-5px);
}

/* Animated gradient border via pseudo-element */
.why-card__border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.04) 50%,
    rgba(255, 255, 255, 0.10) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: background 0.4s;
  pointer-events: none;
}

.why-card:hover .why-card__border {
  background: linear-gradient(
    135deg,
    rgba(var(--card-accent-rgb, 255,107,53), 0.7) 0%,
    rgba(var(--card-accent-rgb, 255,107,53), 0.2) 50%,
    rgba(var(--card-accent-rgb, 255,107,53), 0.5) 100%
  );
}

/* Glow blob */
.why-card__glow {
  position: absolute;
  z-index: -1;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(var(--card-accent-rgb, 255,107,53), 0.18), transparent 70%);
  filter: blur(30px);
  transition: opacity 0.4s, transform 0.4s;
  opacity: 0.5;
}

.why-card:hover .why-card__glow {
  opacity: 1;
  transform: scale(1.2);
}

/* Number badge */
.why-card__num {
  position: absolute;
  top: 20px;
  right: 22px;
  font-family: var(--font-mono, monospace);
  font-size: 0.62rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.why-card:hover .why-card__num {
  color: rgba(var(--card-accent-rgb, 255,107,53), 0.7);
}

/* Icon circle */
.why-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}

.why-card:hover .why-card__icon {
  background: rgba(var(--card-accent-rgb, 255,107,53), 0.12);
  border-color: rgba(var(--card-accent-rgb, 255,107,53), 0.3);
}

.why-card__icon svg {
  width: 20px;
  height: 20px;
  stroke: rgba(255,255,255,0.65);
  transition: stroke 0.3s;
}

.why-card:hover .why-card__icon svg {
  stroke: rgba(var(--card-accent-rgb, 255,107,53), 1);
}

/* Text */
.why-card h4 {
  font-family: var(--font-display, serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  line-height: 1.3;
  margin: 0;
}

.why-card--lead h4 {
  font-size: 1.55rem;
  max-width: 22ch;
  line-height: 1.2;
}

.why-card p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.52);
  line-height: 1.65;
  margin: 0;
}

.why-card--lead p {
  font-size: 1rem;
  max-width: 52ch;
  color: rgba(255,255,255,0.6);
}

/* Tech tags on lead card */
.why-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.why-card__tags span {
  padding: 5px 14px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.03em;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.why-card:hover .why-card__tags span {
  background: rgba(var(--card-accent-rgb, 255,107,53), 0.1);
  border-color: rgba(var(--card-accent-rgb, 255,107,53), 0.25);
  color: rgba(255,255,255,0.85);
}

/* CTA card */
.why-card--cta {
  background: linear-gradient(135deg, rgba(255,107,53,0.15) 0%, rgba(255,107,53,0.05) 100%);
  border: 1px solid rgba(255,107,53,0.25);
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  text-decoration: none;
  cursor: pointer;
  min-height: 160px;
}

.why-card--cta .why-card__cta-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,107,53,0.0) 0%, rgba(255,107,53,0.12) 100%);
  opacity: 0;
  transition: opacity 0.4s;
  border-radius: inherit;
}

.why-card--cta:hover .why-card__cta-bg {
  opacity: 1;
}

.why-card__cta-label {
  font-family: var(--font-display, serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  line-height: 1.45;
  position: relative;
  z-index: 1;
}

.why-card__cta-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,107,53,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, border-color 0.3s, transform 0.35s cubic-bezier(.22,1,.36,1);
  position: relative;
  z-index: 1;
}

.why-card--cta:hover .why-card__cta-arrow {
  background: #ff6b35;
  border-color: #ff6b35;
  transform: translateX(4px);
}

.why-card__cta-arrow svg {
  width: 16px;
  height: 16px;
  stroke: #ff6b35;
  transition: stroke 0.3s;
}

.why-card--cta:hover .why-card__cta-arrow svg {
  stroke: #fff;
}

/* =========================
   JS accent colour bridging
   ========================= */
/* We use data-accent to set custom props via JS inline below */

/* =========================
   Responsive
   ========================= */
@media (max-width: 1024px) {
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .why-card--lead {
    grid-column: span 2;
    grid-row: span 1;
  }
  .why-card--lead h4 {
    font-size: 1.35rem;
  }
}

@media (max-width: 640px) {
  .why-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .why-card--lead {
    grid-column: span 1;
    min-height: auto;
  }
  .why-card {
    min-height: auto;
    padding: 24px 20px;
  }
}
