.services {
  padding: 60px 0;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 40px;
  position: relative;
  padding-bottom: 20px;
}

.services__line {
  position: absolute;
  display: block;
  width: calc(100% + 80px);
  max-width: calc(100vw - 40px);
  left: 50%;
  transform: translateX(-50%);
  height: 20px;
  border: 1px solid var(--accent);
  bottom: 0;
}

.services__grid::before,
.services__grid::after {
  display: block;
  content: '';
  width: 27px;
  height: calc(50% - 35px);
  border: 1px solid var(--accent);
  bottom: 30px;
  position: absolute;
}

.services__grid::before {
  left: -27px;
}

.services__grid::after {
  right: -27px;
}


.services__card {
  position: relative;
  padding: 27px 25px 28px;
  height: 100%;
  border: 1px solid var(--accent);
    display: flex;
    flex-direction: column;
}

.services__card::before {
  position: absolute;
  pointer-events: none;
  display: block;
  content: '';
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  top: 5px;
  left: 5px;
  border: 1px solid var(--accent);
}


.services__card span {
  position: absolute;
  top: -10px;
  width: 20px;
  height: 20px;
  border: 1px solid var(--accent);
  display: none;
  align-items: center;
  justify-content: center;
}

.services__card span::after {
  display: block;
  content: '';
  width: 16px;
  height: 16px;
  background-color: var(--secondary);
}

.services__card:nth-child(n + 4) span:nth-child(1) {
  display: flex;
}


.services__card:not(:nth-child(3)):nth-child(3n) span:nth-child(2) {
  display: flex;
}

.services__card span:nth-child(1) {
  left: -11px;
}
.services__card span:nth-child(2) {
  right: -11px;
}

.services__index {
  color: var(--accent);
  font-family: 'EdgeLine', var(--font);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--accent);
  font-size: 30px;
  width: max-content;
  line-height: 100%;
}

.services__title {
  margin-top: 20px;
}

.services__description {
  margin-top: 10px;
  margin-bottom: 20px;
  color: var(--color-muted);
}

.services__link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-underline-offset: 0.125em;
  margin-top: auto;
  color: var(--secondary);
  text-decoration: underline;
}

.services__footer {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

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

  .services__grid::after,
  .services__grid::before {
    width: 15px;
  }

  .services__grid::after {
    right: -15px;
  }

.services__grid::before {
  left: -15px;
}
}

@media (max-width: 768px) {
  .services {
    padding: 22px 0;
  }

  .services__footer {
    margin-top: 20px;
  }

  .services__button {
    max-width: 100%;
  }

  .services__grid {
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }

  .services__card::after {
    display: none;
  }

  .services__grid::after,
  .services__grid::before {
    display: none;
  }

  .services__line {
    display: none;
  }
  
  .services__card span:nth-child(1) {
    display: none;
    left: -5px;
  }
  .services__card span:nth-child(2) {
    display: none;
    right: -5px;
  }

  .services__card:nth-child(odd) span:nth-child(1) {
    top: calc(100% - 10px);
    display: flex;
    z-index: 3;
  }

  .services__card:nth-child(odd) span:nth-child(2) {
    top: calc(100% - 10px);
    display: flex;
    z-index: 3;
  }

  .services__index {
    font-size: 24px;
  }
}
