.steps {
  margin: 44px 0;
}

.steps__grid {
  width: 100%;
  /* max-width: 980px; */
  margin: 0 auto;

  display: grid;
  gap: 16px;
}

.steps__item {
  position: relative;
  overflow: hidden;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: center;
  gap: 30px;

  min-height: 176px;
  padding: 22px 22px 22px 26px;

  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)), var(--card);

  border: 1px solid var(--line);
  border-radius: 16px;

  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);

  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.steps__item:hover {
  transform: translateY(-2px);

  background: linear-gradient(180deg, rgba(255, 49, 90, 0.035), rgba(255, 255, 255, 0.01)), var(--card);

  border-color: rgba(255, 49, 90, 0.24);

  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.26),
    0 0 24px rgba(255, 49, 90, 0.045);
}

/* Desktop number */

.steps__number {
  display: none;
}

.steps__item::before {
  content: attr(data-step);

  position: absolute;
  left: 18px;
  bottom: 12px;
  z-index: 0;

  color: rgba(255, 255, 255, 0.035);
  font-size: 58px;
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.06em;

  pointer-events: none;
}

/* Content */

.steps__content {
  order: 1;

  position: relative;
  z-index: 2;

  min-width: 0;

  padding-left: 56px;
  padding-right: 24px;
}

.steps__content h3 {
  margin: 0 0 9px;

  color: var(--text);
  font-size: 22px;
  font-weight: 850;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.steps__text {
  max-width: 520px;
  margin: 0;

  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;

  overflow-wrap: anywhere;
}

.steps__text p {
  margin: 0 0 9px;
}

.steps__text p:last-child {
  margin-bottom: 0;
}

/* Image */

.steps__image {
  order: 2;

  width: 100%;
  max-width: 300px;

  justify-self: end;

  overflow: hidden;

  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 14px;

  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.steps__image img {
  display: block;

  width: 100%;
  aspect-ratio: 16 / 10;

  object-fit: cover;

  transition:
    transform 0.32s ease,
    opacity 0.32s ease;
}

.steps__image:hover img {
  transform: scale(1.04);
}

/* Tablet */

@media (max-width: 900px) and (min-width: 701px) {
  .steps__grid {
    max-width: 820px;
  }

  .steps__item {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 22px;

    min-height: 160px;
    padding: 20px;
  }

  .steps__content {
    padding-left: 46px;
  }

  .steps__item::before {
    left: 15px;
    bottom: 11px;

    font-size: 52px;
  }

  .steps__content h3 {
    font-size: 20px;
  }

  .steps__text {
    max-width: 460px;
    font-size: 13.5px;
    line-height: 1.6;
  }

  .steps__image {
    max-width: 250px;
  }
}

/* Mobile */

@media (max-width: 700px) {
  .steps {
    margin: 30px 0;
  }

  .steps__grid {
    max-width: none;
    gap: 12px;
  }

  .steps__item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
      'number title'
      'text text'
      'image image';

    gap: 10px 12px;

    min-height: 0;
    padding: 14px;

    border-radius: 13px;
  }

  .steps__item::before {
    display: none;
  }

  .steps__number {
    grid-area: number;

    position: static;

    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;
    font-size: 14px;
    font-weight: 850;
    line-height: 1;

    background: rgba(255, 49, 90, 0.1);
    border: 1px solid rgba(255, 49, 90, 0.24);
    border-radius: 10px;
  }

  .steps__content {
    display: contents;
    padding-left: 0;
  }

  .steps__content h3 {
    grid-area: title;

    align-self: center;
    margin: 0;

    font-size: 18px;
    line-height: 1.2;
  }

  .steps__text {
    grid-area: text;

    max-width: none;

    font-size: 13px;
    line-height: 1.58;
  }

  .steps__text p {
    margin-bottom: 7px;
  }

  .steps__image {
    grid-area: image;

    max-width: none;
    margin-top: 2px;

    border-radius: 11px;
  }

  .steps__image img {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 420px) {
  .steps__item {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px 10px;

    padding: 12px;
  }

  .steps__number {
    width: 36px;
    height: 36px;

    border-radius: 9px;
    font-size: 13px;
  }

  .steps__content h3 {
    font-size: 16px;
  }

  .steps__text {
    font-size: 12.5px;
    line-height: 1.52;
  }

  .steps__image {
    border-radius: 10px;
  }
}

@media (hover: none) {
  .steps__item:hover {
    transform: none;
  }

  .steps__image:hover img {
    transform: none;
  }
}
