@import url(lower.css);

main {
  --h2-sz: max(3.4vw, 2em);
  background-color: var(--bg-c);
  padding-bottom: max(8vw, 60px);
}

.card {
  margin-inline: 10vw;
  background-color: #fff;
  border-radius: 3vw;
  padding: max(5vw, 50px) 5vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  h2 {
    text-align: center;
    margin-bottom: 3em;
    span {
      display: block;
      font-size: var(--h2-sz);
      font-weight: 300;
    }
  }
  ~ .card {
    margin-top: max(8vw, 70px);
  }
}

.raising {
  position: relative;
  padding-bottom: max(11vw, 120px);
  > p {
    text-align: center;
    line-height: 1.8;
    font-size: max(1.5vw, 15px);
    font-weight: 500;
  }
  > img {
    position: absolute;
    inset: auto -6vw 0;
  }
}

.case {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: max(2vw, 1em);
  width: 100%;
  margin-top: max(3vw, 2.4em);
  @media (width > 1220px) {
    padding-inline: 5vw;
  }
  > div {
    gap: 1em;
    color: var(--primary-c);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    place-content: center;
    border: 1px solid var(--primary-c);
    container-type: inline-size;
    img {
      max-height: 30cqi;
      max-width: 50cqi;
    }
  }
  h3 {
    text-align: center;
    font-size: min(6.8cqi, 16px);
    font-weight: 500;
  }
}

.resolve {
  padding-top: max(5vw, 30px);
  h3 {
    width: fit-content;
    margin: 0 auto 3rem;
    text-box: trim-both cap alphabetic;
    font-size: max(1.5vw, 14px);
    padding: 0.8em 2em;
    background-color: var(--primary-c);
    color: #fff;
    border-radius: 2em;
    position: relative;
    &:after {
      position: absolute;
      inset: auto 0 -0.8em;
      margin-inline: auto;
      content: "";
      width: 0.8em;
      height: 0.8em;
      clip-path: polygon(0 0, 100% 0, 50% 100%);
      background-color: var(--primary-c);
    }
    span {
      display: block;
      font-size: 1rem;
      text-align: center;
      text-transform: none;
      font-weight: 300;
    }
  }
  .lead {
    font-size: max(1.5vw, 15px);
    font-weight: 500;
    color: var(--primary-c);
    text-align: center;
    line-height: 1.8;
    word-break: keep-all;
  }
  .figure {
    display: flex;
    width: min(100%, 500px);
    margin-inline: auto;
    gap: max(3vw, 1em);
    color: var(--primary-c);
    padding-block: max(3vw, 30px);
    > div {
      flex: 1;
      display: grid;
      place-items: center;
      aspect-ratio: 1;
      border: 1px solid;
      border-radius: 50%;
      text-align: center;
      line-height: 1.7;
      font-weight: 500;
    }
  }
  .plus {
    align-self: center;
    position: relative;
    width: max(2vw, 1.4em);
    &::before,
    &::after {
      position: absolute;
      inset: 0 0 auto;
      height: 1px;
      background-color: currentColor;
      content: "";
    }
    &::before {
      translate: 0 calc(50% - 1px);
    }
    &::after {
      rotate: 90deg;
      transform-origin: center top;
    }
  }

  .body {
    display: flex;
    gap: max(5vw, 30px);
    padding-inline: 5vw;
    align-items: center;
    .image-area {
      flex: 1;
      position: relative;
      .treat {
        &:first-child {
          inset: 0 0 auto auto;
          width: max(36%, 86px);
        }
        &:nth-child(2) {
          inset: auto auto 0 0;
          width: max(32%, 80px);
          img {
            scale: -1 -1;
          }
        }
      }
      .pic {
        width: 100%;
      }
    }
    p {
      line-height: 2;
      width: 50%;
      color: var(--primary-c);
    }
  }
}

.other {
  .raising {
    padding-bottom: max(14vw, 80px);
  }
  .case {
    grid-template-columns: repeat(4, 1fr);
    @media (width > 1220px) {
      padding-inline: 0;
    }
    > div {
      img {
        max-width: auto;
        width: 30cqi;
      }
      &:nth-child(4) img {
        max-height: 24cqi;
      }
    }
    h3 {
      font-size: 6.8cqi;
    }
  }
  .body + .body {
    margin-top: max(3vw, 50px);
    .treat {
      &:first-child {
        inset: -15% 10% auto auto;
        width: max(36%, 86px);
      }
      &:nth-child(2) {
        inset: auto auto -7% -7%;
        width: max(48%, 80px);
        scale: 1 1;
      }
    }

    .image-area {
      flex: 0 0 32%;
      order: 1;
    }
  }
}

.more-things {
  .lead {
    text-align: center;
    line-height: 1.8;
    font-size: max(1.5vw, 15px);
    font-weight: 500;
  }
  ul {
    margin-top: max(5vw, 30px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5vw max(3%, 10px);
    img {
      width: 100%;
      aspect-ratio: 8/5;
      object-fit: cover;
      border-radius: 1em;
    }
    p {
      line-height: 1.7;
    }
  }
  h3 {
    font-size: max(1.4vw, 16px);
    font-weight: 500;
    color: var(--primary-c);
    padding-block: 0.8em 0.4em;
    text-align: center;
    span {
      font-size: 0.8em;
      display: block;
    }
  }
}

@media (width < 1024px) {
  .card {
    margin-inline: 5vw;
  }
  .resolve .body {
    padding-inline: 0;
  }
  .other {
    .case {
      width: min(100%, 520px);
      margin-inline: auto;
      grid-template-columns: repeat(2, 1fr);
    }
  }
  .more-things {
    ul {
      grid-template-columns: repeat(2, 1fr);
    }
  }
}

@media (width < 768px) {
  .hero h1 span {
    font-size: 1.25em;
  }
  .card {
    margin-inline: 0;
    border-radius: 0;
    h2 {
      margin-bottom: 1.4em;
    }
  }
  .case {
    grid-template-columns: repeat(2, 1fr);
  }
  .problem .case {
    width: min(100%, 520px);
    margin-inline: auto;
  }
  .raising {
    padding-bottom: max(14vw, 80px);
  }
  .resolve {
    h3 {
      padding: 1em 1.4em;
      border-radius: 1em;
      margin-bottom: 2rem;
    }
    .body {
      flex-direction: column;
      .image-area {
        order: 1;
        width: min(80%, 360px);
      }
      p {
        width: 100%;
      }
    }
  }
  .other .body {
    .image-area .treat:nth-child(2) {
      inset: auto auto -10% -10%;
      width: 36%;
    }

    + .body .treat {
      &:first-child {
        inset: -8% -2% auto auto;
        width: 32%;
      }
      &:nth-child(2) {
        inset: auto auto -12% -12%;
        width: 48%;
      }
    }
  }
  .more-things {
    .lead {
      word-break: keep-all;
    }
    h3 {
      word-break: keep-all;
      font-size: 13.4px;
      span {
        font-size: 0.66em;
      }
    }
    ul p {
      font-size: 11px;
    }
  }
}
