/* =============================================================
   GRADEGUIDER — SERVICES ("What We Have to Offer")
   Card grid modelled on the EdVisa reference: numbered media
   panel, a floating title card that straddles its lower edge,
   copy, then a "Learn more" affordance.

   Everything is prefixed .gg-svc* / .gg-services* so it cannot
   collide with the Creatino template.
   ============================================================= */

.gg-services {
  --svc-ink: #101214;
  --svc-ink-soft: #5c605b;
  --svc-ink-muted: #7c807a;
  --svc-line: rgba(36, 44, 25, 0.10);
  --svc-bg: #ffffff;

  position: relative;
  z-index: 1;
  padding: 96px 0 104px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcf7 55%, #f6f8ee 100%);
  font-family: "DM Sans", "Epilogue", system-ui, sans-serif;
  color: var(--svc-ink);
}

.gg-services__inner {
  width: min(calc(100% - 72px), 1680px);
  margin: 0 auto;
}

/* ---------- heading ---------- */

.gg-services__head {
  max-width: 760px;
  margin: 0 auto 58px;
  text-align: center;
}

.gg-services__eyebrow {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6e8e16;
}

.gg-services__title {
  margin: 0;
  font-family: "DM Sans", "Epilogue", system-ui, sans-serif;
  font-size: clamp(32px, 3.4vw, 50px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.028em;
  color: var(--svc-ink);
}

.gg-services__lede {
  max-width: 640px;
  margin: 18px auto 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--svc-ink-soft);
}

/* ---------- grid ---------- */

.gg-services__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  align-items: stretch;
}

/* ---------- card ----------
   --svc-tint / --svc-tint-soft are set per card inline, so one
   rule set covers all four colourways. */

.gg-svc {
  --svc-tint: #82a51f;
  --svc-tint-soft: #eef5df;

  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--svc-bg);
  border: 1px solid var(--svc-line);
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(38, 45, 24, 0.05);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.34s ease,
              border-color 0.34s ease;
}

.gg-svc:hover,
.gg-svc:focus-within {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--svc-tint) 34%, transparent);
  box-shadow: 0 20px 44px rgba(38, 45, 24, 0.12);
}

/* media panel */

.gg-svc__media {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 19px 19px 0 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 68% 28%,
      color-mix(in srgb, var(--svc-tint) 22%, transparent), transparent 62%),
    linear-gradient(150deg,
      var(--svc-tint-soft) 0%,
      color-mix(in srgb, var(--svc-tint-soft) 55%, #ffffff) 100%);
}

.gg-svc__media img {
  position: absolute;
  inset: 0;
  width: 78%;
  height: 78%;
  margin: auto;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gg-svc:hover .gg-svc__media img {
  transform: scale(1.05);
}

/* numbered badge */

.gg-svc__num {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(38, 45, 24, 0.12);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--svc-tint);
}

/* floating title card straddling the media edge */

.gg-svc__head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: -40px 16px 0;
  padding: 15px 17px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(38, 45, 24, 0.10);
}

.gg-svc__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--svc-tint-soft);
}

.gg-svc__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--svc-tint);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gg-svc__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.012em;
  color: var(--svc-ink);
}

/* body */

.gg-svc__desc {
  margin: 18px 22px 0;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--svc-ink-soft);
}

.gg-svc__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 18px 22px 24px;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--svc-tint);
  text-decoration: none;
  cursor: pointer;
  transition: gap 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

/* pushes the link to the bottom so ragged copy still lines up */
.gg-svc__desc { flex: 1 1 auto; }

.gg-svc__more svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gg-svc__more:hover,
.gg-svc__more:focus-visible {
  gap: 13px;
  color: color-mix(in srgb, var(--svc-tint) 78%, #000);
}

/* =============================================================
   REVEAL
   Visible by default; .gg-animate (added by JS after first
   paint) opts into the entrance. A stalled animation can never
   leave a card invisible - the same guarantee the hero has.
   ============================================================= */

.gg-services.gg-animate .gg-svc,
.gg-services.gg-animate .gg-services__head > * {
  opacity: 0;
  animation: gg-svc-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.gg-services.gg-animate .gg-services__head > *:nth-child(1) { animation-delay: 0.02s; }
.gg-services.gg-animate .gg-services__head > *:nth-child(2) { animation-delay: 0.09s; }
.gg-services.gg-animate .gg-services__head > *:nth-child(3) { animation-delay: 0.16s; }

.gg-services.gg-animate .gg-svc:nth-child(1) { animation-delay: 0.22s; }
.gg-services.gg-animate .gg-svc:nth-child(2) { animation-delay: 0.30s; }
.gg-services.gg-animate .gg-svc:nth-child(3) { animation-delay: 0.38s; }
.gg-services.gg-animate .gg-svc:nth-child(4) { animation-delay: 0.46s; }

@keyframes gg-svc-rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 1250px) {
  .gg-services__inner { width: calc(100% - 48px); }
  .gg-services__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}

@media (max-width: 991px) {
  .gg-services { padding: 76px 0 84px; }
  .gg-services__head { margin-bottom: 44px; }
}

@media (max-width: 700px) {
  .gg-services { padding: 60px 0 68px; }
  .gg-services__inner { width: calc(100% - 36px); }
  .gg-services__grid { grid-template-columns: 1fr; gap: 20px; }
  .gg-services__title { font-size: clamp(27px, 7.6vw, 36px); }
  .gg-svc__media { aspect-ratio: 16 / 10; }
}

/* =============================================================
   MOTION SAFETY
   ============================================================= */

@media (prefers-reduced-motion: reduce) {
  .gg-services *,
  .gg-services *::before,
  .gg-services *::after {
    animation: none !important;
    transition: none !important;
  }
  .gg-services.gg-animate .gg-svc,
  .gg-services.gg-animate .gg-services__head > * {
    opacity: 1;
    transform: none;
  }
}

/* color-mix is well supported, but keep a sane result if it is not */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .gg-svc:hover { border-color: var(--svc-tint); }
  .gg-svc__media {
    background: linear-gradient(150deg, var(--svc-tint-soft) 0%, #ffffff 100%);
  }
}
