/* ==========================================================================
   Services — "W czym pomagamy"
   Sits on its own raised panel. An editorial index rather than a grid of
   identical cards: each capability is one row — icon tile, number and title,
   what it does, and examples as chips — so the list can be scanned by eye.
   ========================================================================== */

.services {
  isolation: isolate;
  overflow: hidden;
}

/* dot field in the top corner, fading towards the content */
.services::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: min(44rem, 70%);
  height: 32rem;
  background: radial-gradient(circle, rgb(255 255 255 / 0.1) 0 1px, transparent 1.5px) 100% 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 100% 0%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse 80% 75% at 100% 0%, #000, transparent 70%);
  pointer-events: none;
}

.services__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 5rem);
  align-items: end;
}

.services__aside .section-lead {
  margin-top: 0;
}

.services__nudge {
  margin-top: 1.5rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.services__list {
  margin-top: clamp(3rem, 2rem + 4vw, 5rem);
  border-top: 1px solid var(--color-line);
}

/* ---- One capability ------------------------------------------------------------- */

.service {
  position: relative;
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 0.95fr) minmax(0, 1.3fr) minmax(0, 0.95fr);
  gap: 1rem clamp(1.5rem, 3vw, 3rem);
  align-items: start;
  padding-block: clamp(1.75rem, 1.4rem + 1vw, 2.5rem);
  border-bottom: 1px solid var(--color-line-soft);
}

/* hover surface, a little wider than the row itself */
.service::before {
  content: "";
  position: absolute;
  inset: 0.5rem -1.25rem;
  z-index: -1;
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 0.03);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service__tile {
  display: grid;
  place-items: center;
  width: 4.25rem;
  aspect-ratio: 1;
  border: 1px solid var(--color-line-soft);
  border-radius: 1rem;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.05), rgb(255 255 255 / 0.01));
  transition: border-color 0.3s ease;
}

.service__icon {
  width: 2.75rem;
  transition: fill 0.3s ease;
}

.service__head {
  display: grid;
  gap: 0.6rem;
}

.service__number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--color-accent);
}

.service__title {
  font-size: clamp(1.3125rem, 1.15rem + 0.5vw, 1.625rem);
  font-weight: 400;
  font-variation-settings: "opsz" 32;
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.service__text {
  padding-top: 1.55rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  text-wrap: pretty;
}

.service__examples {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  padding-top: 1.45rem;
}

.service__examples li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

/* "Z bloga:" an article about this area, under its text (only on the Polish page, only once one is published) */
.service__more {
  grid-column: 3 / -1;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.service__more-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
}

@media (hover: hover) and (pointer: fine) {
  .service:hover::before {
    opacity: 1;
  }

  .service:hover .service__tile {
    border-color: rgb(242 163 94 / 0.45);
  }

  .service:hover .service__icon {
    fill: var(--color-accent);
  }
}

/* ---- Tablet and phone --------------------------------------------------------- */

@media (max-width: 1023.98px) {
  .services__header {
    grid-template-columns: minmax(0, 1fr);
  }

  .service {
    grid-template-columns: 4.25rem minmax(0, 1fr);
    gap: 0.9rem 1.5rem;
  }

  .service__tile {
    grid-row: span 3;
    width: 3.75rem;
  }

  .service__icon {
    width: 2.4rem;
  }

  .service__text,
  .service__examples {
    padding-top: 0;
  }

  .service__more {
    grid-column: 2 / -1;
  }
}

@media (max-width: 639.98px) {
  .service {
    grid-template-columns: 3.25rem minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
  }

  .service__tile {
    grid-row: auto;
    width: 3.25rem;
    border-radius: 0.85rem;
  }

  .service__icon {
    width: 2.1rem;
  }

  .service__text,
  .service__examples,
  .service__more {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service::before,
  .service__tile,
  .service__icon {
    transition: none;
  }
}
