/* ==========================================================================
   TechAbbot – business challenges we solve
   Markup: partials/challenges.html (generated by tools/build-challenges.js)
   No script.

   Light section with soft brand-colour glows, six white cards and a
   green-to-blue call-to-action panel.

     below 640px    1 column
     640px and up   2 columns x 3 rows
     1024px and up  3 columns x 2 rows
   ========================================================================== */

.challenges {
  padding-block: clamp(48px, 6vw, 88px);
  border-top: 1px solid var(--c-border);
  background:
    radial-gradient(42% 46% at 100% 0%, rgba(11, 109, 145, 0.11), transparent 70%),
    radial-gradient(42% 46% at 0% 100%, rgba(38, 150, 94, 0.11), transparent 70%),
    var(--c-bg-alt);
}

/* Heading block ----------------------------------------------------------- */

.challenges__head {
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
}

.challenges__title {
  margin: 14px 0 0;
  font-size: clamp(1.625rem, 1.2rem + 1.9vw, 2.5rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.challenges__intro {
  max-width: 46em;
  margin: 16px auto 0;
  color: var(--c-text-muted);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
}

/* Cards --------------------------------------------------------------------- */

.challenges__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(16px, 2vw, 24px);
  margin: clamp(32px, 4vw, 52px) 0 0;
  padding: 0;
  list-style: none;
}

.challenges__cell { display: flex; }

.challenge-card {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: clamp(22px, 2.2vw, 28px);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  background: var(--c-bg);
  box-shadow: 0 14px 30px -24px rgba(37, 55, 70, 0.45);
  overflow: hidden;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

/* Gradient edge down the left side, drawn on hover. */
.challenge-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--c-green), var(--c-blue));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 260ms ease;
}

.challenge-card:hover {
  border-color: rgba(11, 109, 145, 0.3);
  box-shadow: 0 24px 40px -24px rgba(11, 109, 145, 0.5);
  transform: translateY(-6px);
}

.challenge-card:hover::before { transform: scaleY(1); }

.challenge-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.challenge-card__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--c-green), var(--c-blue));
  color: #fff;
  box-shadow: 0 10px 18px -10px rgba(11, 109, 145, 0.7);
  transition: transform 220ms ease;
}

.challenge-card:hover .challenge-card__icon { transform: rotate(-6deg) scale(1.06); }

.challenge-card__icon svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Large outlined card number, purely decorative. */
.challenge-card__number {
  color: transparent;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  -webkit-text-stroke: 1.5px #D3DEE6;
  transition: -webkit-text-stroke-color 220ms ease;
  user-select: none;
}

.challenge-card:hover .challenge-card__number { -webkit-text-stroke-color: rgba(38, 150, 94, 0.6); }

.challenge-card__title {
  margin: 20px 0 0;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.challenge-card__text {
  margin: 10px 0 0;
  color: var(--c-text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Related capability: a quiet pill pinned to the foot of the card. */
.challenge-card__tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin: auto 0 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: #EAF4F1;
  color: #1B6E46;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
}

/* The tag's auto margin pins it to the bottom; this keeps a gap above it. */
.challenge-card__text { padding-bottom: 20px; }

.challenge-card__tag::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-green);
}

/* Call-to-action panel ---------------------------------------------------- */

.challenges-cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-top: clamp(28px, 3.4vw, 44px);
  padding: clamp(26px, 3.4vw, 44px) clamp(20px, 4vw, 52px);
  border-radius: 20px;
  background: #0871A7 linear-gradient(90deg, #1F8549, #0871A7);
  color: #fff;
  box-shadow: 0 26px 44px -28px rgba(8, 113, 167, 0.85);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

/* Rings off the right edge and a dot grid on the left. */
.challenges-cta::before,
.challenges-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.challenges-cta::before {
  background: repeating-radial-gradient(circle at 100% 50%, transparent 0 38px, rgba(255, 255, 255, 0.1) 38px 40px) 100% 50% / 360px 360px no-repeat;
  -webkit-mask-image: radial-gradient(circle at 100% 50%, #000, transparent 340px);
  mask-image: radial-gradient(circle at 100% 50%, #000, transparent 340px);
}

.challenges-cta::after {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.2) 1.3px, transparent 1.8px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 28%);
  mask-image: linear-gradient(90deg, #000, transparent 28%);
}

.challenges-cta__title {
  margin: 0;
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.challenges-cta__text {
  max-width: 38em;
  margin: 10px 0 0;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.55;
}

.challenges-cta .btn {
  flex: none;
  box-shadow: 0 14px 24px -14px rgba(0, 0, 0, 0.55);
}

.challenges-cta :focus-visible { outline-color: #fff; outline-offset: 3px; }

/* Layout ------------------------------------------------------------------ */

@media (min-width: 640px) {
  .challenges__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
  .challenges-cta {
    flex-direction: row;
    justify-content: space-between;
    gap: 40px;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .challenges__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-card,
  .challenge-card::before,
  .challenge-card__icon { transition: none; }

  .challenge-card:hover,
  .challenge-card:hover .challenge-card__icon { transform: none; }
}
