@import url(lower.css);

main {
  background-color: var(--bg-c);
}

section {
  overflow-x: hidden;
}
.top {
  padding: 0 10vw max(8vw, 100px);
  h2 {
    font-size: max(3.6vw, 2.2em);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-c);
    margin-bottom: max(5vw, 30px);
    span {
      font-size: 16px;
      font-weight: 500;
    }
    &:after {
      content: "";
      width: 1px;
      height: 5rem;
      background-color: currentColor;
      margin-top: 2rem;
    }
  }
  .lead {
    text-align: center;
    line-height: 2;
    color: var(--primary-c);
    margin-bottom: 2em;
    font-size: 16px;
    font-weight: 500;
  }
  .row {
    display: flex;
    gap: max(4vw, 3em);
    position: relative;
    align-items: start;

    & > * {
      flex: 1;
    }
    p {
      line-height: 2.1;
    }
    .image-area {
      border-radius: 20px;
      overflow: hidden;
      img:not(.treat img) {
        width: 100%;
        aspect-ratio: 16/9;
        object-fit: cover;
      }
    }
    &:first-of-type {
      .treat {
        &:first-child {
          inset: -5vw -3% auto auto;
          width: max(13%, 86px);
        }
        &:nth-child(2) {
          inset: auto 43% -3vw auto;
          width: max(10%, 80px);
          img {
            scale: -1 -1;
          }
        }
        &:nth-child(3) {
          inset: 14vw -3% auto auto;
          width: max(5%, 20px);
        }
      }
      .image-area {
        display: grid;
        img {
          &:first-child {
            grid-area: 1/1/2/3;
          }
          &:nth-child(2) {
            grid-area: 2/1/3/2;
          }
          &:nth-child(3) {
            grid-area: 2/2/3/3;
          }
        }
      }
    }
    &:last-of-type {
      margin-top: 80px;
      .treat {
        &:first-child {
          inset: -4vw auto auto 33%;
          width: max(12%, 90px);
        }
        &:nth-child(2) {
          inset: auto auto -2vw -3%;
          width: max(12%, 110px);
        }
      }
      img:not(.treat img) {
        aspect-ratio: auto;
      }
      .image-area {
        order: -1;
      }
    }
  }
}

.features {
  background-color: #fff;
  border-radius: max(3vw, 1.4em);
  margin-inline: 10vw;
  h2 {
    color: var(--primary-c);
    font-size: max(1.6vw, 16px);
    border-bottom: 1px solid;
    margin-bottom: 2rem;
    width: fit-content;
    margin-inline: auto;
    font-weight: 500;
  }
  ul {
    display: grid;
    grid-template-columns: repeat(2, calc((100% - 5%) / 2));
    gap: max(5vw, 50px) 5%;
  }
  li {
    position: relative;
    img {
      width: 100%;
      aspect-ratio: 16/9;
      object-fit: cover;
      border-radius: 1.2em;
      margin-bottom: 2px;
    }
  }
  .number {
    position: absolute;
    inset: 0.8rem auto auto 0.8rem;
    width: 16%;
    aspect-ratio: 1;
    background-color: var(--primary-c);
    border-radius: 50%;
    display: grid;
    place-items: center;
    place-content: center;
    font-size: 11px;
    font-weight: 300;
    gap: 2px;
    color: #fff;
    padding-top: 2px;
    container-type: inline-size;
    span {
      font-size: 40cqi;
      text-box: trim-both cap alphabetic;
    }
  }
  h3 {
    align-self: center;
    color: var(--primary-c);
    font-size: clamp(20px, 1.6vw, 25px);
    text-box: trim-both cap alphabetic;
    margin-block: 16px;
    text-align: center;
  }
  p {
    line-height: 1.8;
  }
}

.ending {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding-block: 0 max(8vw, 60px);
  margin-top: -2.5em;
  &::before {
    width: 1px;
    height: 5em;
    content: "";
    background-color: var(--primary-c);
    margin-bottom: 2em;
  }
  h2 {
    text-transform: none;
    font-size: max(3.6vw, 2.2em);
    color: var(--primary-c);
  }
  .lead {
    text-align: center;
    color: var(--primary-c);
    line-height: 2;
    margin-bottom: 1.4em;
    font-size: 16px;
    font-weight: 500;
  }
  .images {
    width: min(100%, 1000px);
    display: flex;
    overflow: hidden;
    border-radius: 1em;
    img {
      flex: 1;
      aspect-ratio: 8/5;
      width: calc(100% / 4);
      object-fit: cover;
      object-position: right;
    }
  }
}

@media (width < 1024px) {
  .top {
    padding-inline: 5vw;
  }
  .features {
    margin-inline: 5vw;
    .number {
      font-size: 9px;
    }
  }
}
@media (width < 768px) {
  .top {
    .lead {
      word-break: keep-all;
    }
    .row {
      flex-direction: column;
      &:first-of-type {
        .treat {
          &:first-child {
            inset: auto -7% 58vw auto;
          }
          &:nth-child(2) {
            inset: auto auto -14vw -5%;
          }
          &:nth-child(3) {
            inset: auto -6% 40vw auto;
          }
        }
      }

      &:last-of-type {
        .treat {
          &:first-child {
            inset: auto -4% 40vw auto;
          }
          &:nth-child(2) {
            inset: auto auto -14vw -5%;
          }
        }
        .image-area {
          order: 1;
        }
      }
    }
  }

  .features {
    margin-inline: 0;
    border-radius: 0;
    padding-bottom: 70px;
    h2 {
      margin-bottom: 2em;
    }
    ul {
      display: flex;
      flex-direction: column;
      width: min(100%, 380px);
      margin-inline: auto;
    }
    li {
      img {
        margin-bottom: 8px;
        border-radius: 1em;
      }
    }
  }

  .ending {
    &::before {
      margin-bottom: 3.5em;
    }
    .lead {
      word-break: keep-all;
    }
    .images {
      display: grid;
      grid-template-columns: repeat(2, 50%);
      img {
        width: 100%;
        &:nth-child(2) {
          order: -2;
        }
        &:nth-child(3) {
          order: -1;
        }
      }
    }
  }
}
