.features {
  background-color: var(--opt-white);
}

.features__wrap {
  display: flex;
  flex-direction: column;
  gap: 64px;
  max-width: 1152px;
  width: 100%;
  min-width: 0;
}

.features__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 822px;
  text-align: center;
}

.features__title {
  margin-top: 0;
}

.features__lead {
  margin: 0;
  font-size: 22px;
  line-height: 1.5;
  color: #151515;
}

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

.feature-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--fc-edge, var(--fc-line));
  border-radius: 22px;
  background-color: var(--opt-white);
  transition: box-shadow 0.25s ease, transform 0.25s ease, translate 0.18s ease-out;
}

/* Only where there is a pointer to hover with (a tap left the card lifted). */
@media (hover: hover) {
  .feature-card:hover {
    box-shadow: 0 30px 60px -36px rgba(var(--fc-rgb), 0.32);
    transform: translateY(-3px);
  }
}

.feature-card--orange {
  --fc-line: #f6dec4;
  --fc-accent: #d9700a;
  --fc-rgb: 217, 112, 10;
  --fc-glow: #ffe2c2;
  --fc-tint: #fff6ec;
}

.feature-card--blue {
  --fc-line: #d4e2f8;
  --fc-accent: #2563eb;
  --fc-rgb: 37, 99, 235;
  --fc-glow: #d3e3ff;
  --fc-tint: #f2f7ff;
}

.feature-card--purple {
  --fc-line: #ddd4f6;
  --fc-accent: #6d4bd8;
  --fc-rgb: 109, 75, 216;
  --fc-glow: #e3daff;
  --fc-tint: #f6f3ff;
}

.feature-card--pink {
  --fc-line: #f5d3df;
  --fc-accent: #d23b6e;
  --fc-rgb: 210, 59, 110;
  --fc-glow: #ffd9e6;
  --fc-tint: #fff4f8;
}

.feature-card--amber {
  --fc-line: #f2e3b0;
  --fc-accent: #b88700;
  --fc-rgb: 184, 135, 0;
  --fc-glow: #ffefb3;
  --fc-tint: #fffbeb;
}

.feature-card--teal {
  --fc-line: #cbe9e6;
  --fc-accent: #0e8c88;
  --fc-rgb: 14, 140, 136;
  --fc-glow: #cdf1ee;
  --fc-tint: #f0fbfa;
}

.feature-card--indigo {
  --fc-line: #d5dbf6;
  --fc-accent: #3f51d6;
  --fc-rgb: 63, 81, 214;
  --fc-glow: #dce1ff;
  --fc-tint: #f4f6ff;
}

.feature-card--rust {
  --fc-line: #f5dcc6;
  --fc-accent: #c2650e;
  --fc-rgb: 194, 101, 14;
  --fc-glow: #ffe4cc;
  --fc-tint: #fff7ef;
}

.feature-card--sky {
  --fc-line: #cbe5f5;
  --fc-accent: #0b83c8;
  --fc-rgb: 11, 131, 200;
  --fc-glow: #cdebff;
  --fc-tint: #f0f9ff;
}

.feature-card--lime {
  --fc-line: #dcebc0;
  --fc-accent: #5b8a00;
  --fc-rgb: 91, 138, 0;
  --fc-glow: #e4f3c4;
  --fc-tint: #f8fcee;
}

.feature-card--violet {
  --fc-line: #e6d3f5;
  --fc-accent: #8a3fc2;
  --fc-rgb: 138, 63, 194;
  --fc-glow: #ebd9fa;
  --fc-tint: #fbf5ff;
}

.feature-card--green {
  --fc-edge: #e6efe9;
  --fc-line: #d6eadd;
  --fc-accent: #008744;
  --fc-rgb: 0, 135, 68;
  --fc-glow: #cfefdb;
  --fc-tint: #f1faf4;
}

.feature-card__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 230px;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(420px 220px at 50% 0%, var(--fc-glow), transparent 70%),
    linear-gradient(180deg, var(--fc-tint), var(--opt-white));
}

.feature-card__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(var(--fc-rgb), 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--fc-rgb), 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
  mask-image: radial-gradient(closest-side, #000, transparent);
}

.feature-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px 24px;
  border-top: 1px solid var(--opt-line-soft);
}

.feature-card__title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.06;
  color: var(--opt-ink);
  letter-spacing: -0.03em;
}

.feature-card__text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--opt-muted-strong);
}

.features-cta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 28px;
  padding: 26px 30px;
  border-radius: 22px;
  background-color: rgba(246, 250, 247, 0.92);
}

.features-cta__brand {
  flex: 1 1 420px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.features-cta__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(127, 211, 164, 0.35);
  border-radius: 22px;
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 40px rgba(0, 135, 68, 0.15);
}

.features-cta__title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--opt-green);
}

.features-cta__copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.features-cta__sub {
  margin: 0;
  font-size: 14.5px;
  color: var(--opt-ink);
}

@media (max-width: 1103.98px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet: two columns whose cards are narrower than the widest mock-up (369px), so
   the artwork is scaled down a little rather than being cut off. */
@media (min-width: 746px) and (max-width: 879.98px) {
  .features__wrap {
    gap: 40px;
  }

  .feature-card__visual .fv {
    zoom: 0.86;
  }
}

@media (max-width: 745.98px) {
  .features__wrap {
    gap: 40px;
  }

  .features__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* One card per row: no need for the roomy 230px artwork area. */
  .feature-card__visual {
    height: 204px;
    padding: 12px;
  }
}

/* Phone. One column of twelve cards is a long page, so every card gives up some air:
   a shorter artwork area, tighter padding and smaller type; the artwork itself is
   scaled only as far as the screen forces it (it is never wider than the card). */
@media (max-width: 575.98px) {
  .features__wrap {
    gap: 32px;
  }

  .features__head {
    gap: 16px;
  }

  .features__lead {
    font-size: 17px;
    line-height: 1.5;
  }

  .features__grid {
    gap: 16px;
  }

  .feature-card {
    border-radius: 18px;
  }

  .feature-card__visual .fv {
    zoom: 0.9;
  }

  .feature-card__body {
    padding: 18px 20px 20px;
  }

  .feature-card__title {
    font-size: 18px;
  }

  .feature-card__text {
    font-size: 14px;
    line-height: 1.5;
  }

  /* The closing call-to-action: the brand row on top, a full-width button below. */
  .features-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
    border-radius: 18px;
  }

  .features-cta__brand {
    flex: 0 0 auto;
    gap: 14px;
  }

  .features-cta__icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .features-cta__title {
    font-size: 20px;
  }

  .features-cta .button {
    width: 100%;
  }
}

@media (max-width: 389.98px) {
  .feature-card__visual .fv {
    zoom: 0.82;
  }
}

@media (max-width: 359.98px) {
  .feature-card__visual .fv {
    zoom: 0.74;
  }
}

/* Tablet and small laptop (576px-1199px). */
@media (min-width: 576px) and (max-width: 1199.98px) {
  /* The closing banner's brand block asked for 420px, so at 746-799px (banner 716-770px wide)
     420 + 28 + the 260px button did not fit and the button dropped under the brand on its
     own line, leaving the right half of the banner empty. At 800px and up the same banner
     already sat in one row, with the title on two lines. 350px is the least the brand needs
     for "All-in-one WordPress / performance." beside its icon, so the row now holds from about
     728px; below that the button still goes underneath, as before. */
  .features-cta__brand {
    flex: 1 1 350px;
  }

  /* Cards at this width are 340-480px wide: a last line of one word ("CDN.", "need.", "site.",
     "itself.") was common. */
  .feature-card__text {
    text-wrap: pretty;
  }
}

/* Three columns just above 1100px make the cards 338-368px wide. The widest artwork, "Page
   caching" (317px), then had 10px to spare on each side and its browser frame and "/about"
   pill touched the card edge. A slight scale-down gives it the margin the other cards have;
   from 1140px the cards are wide enough and it is full size. */
@media (min-width: 1104px) and (max-width: 1139.98px) {
  .feature-card__visual .fv {
    zoom: 0.92;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-card {
    transition: none;
  }

  .feature-card:hover {
    transform: none;
  }
}
