.works-page {
  color: var(--color-text);
}

.works {
  position: relative;
  min-height: calc(163px + min(1020.163px, 53.13349vw));
  margin-top: var(--header-height);
  padding-top: 110px;
  overflow: hidden;
  background: var(--color-gray-bg);
}

.works-heading {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.works-heading__en {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.5;
}

.works-heading__title {
  margin: 0;
  font-size: clamp(36px, 3.01917vw, 58px);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
}

.works-heading__intro {
  margin: 22px 0 0;
  font-size: 16px;
  line-height: 2;
  letter-spacing: 0.17em;
}

.works-map {
  position: absolute;
  top: 110px;
  left: calc(50% + 15px);
  width: min(1310px, 68.229167vw);
  transform: translateX(-50%);
}

.works-map__image {
  display: block;
  width: 100%;
  height: auto;
}

.works-pin {
  position: absolute;
  top: var(--pin-top);
  left: var(--pin-left);
  z-index: 1;

  width: 5.147%;
  margin: -0.168% 0 0 -0.168%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transform-origin: center bottom;
  transition: transform 0.25s ease;
}

.works-pin img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center bottom;
  animation: works-pin-sway var(--pin-duration) ease-in-out var(--pin-delay) infinite;
}

.works-pin:hover,
.works-pin:focus-visible {
  z-index: 2;
  transform: scale(1.12);
}

.works-pin:focus-visible,
.works-modal__close:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 5px;
}

@keyframes works-pin-sway {
  0%, 100% {
    transform: rotate(-3.5deg);
  }
  50% {
    transform: rotate(3.5deg);
  }
}

.works-modal {
  width: min(980px, calc(100% - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--color-text);
}

.works-modal::backdrop {
  background: rgb(0 0 0 / 45%);
}

.works-modal__content {
  position: relative;
  padding: 78px 60px 54px;
}

.works-modal__controls {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 0;
}

.works-modal__close {
  position: absolute;
  top: 30px;
  right: 24px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;

  background: #fff;
  color: var(--color-text);
  cursor: pointer;
}

.works-modal__close::before,
.works-modal__close::after {
  position: absolute;
  top: 23px;
  left: 2px;
  width: 44px;
  height: 1px;
  background: currentColor;
  content: '';
  transform: rotate(45deg);
}

.works-modal__close::after {
  transform: rotate(-45deg);
}

.works-modal__overview {
  display: grid;
  grid-template-columns: minmax(0, 460fr) minmax(0, 350fr);
  gap: 50px;
  align-items: start;
}

.works-modal__illustration {
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-gray-bg);
}

.works-modal__body {
  padding-top: 30px;
}

.works-modal__title,
.works-modal__products-title {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.works-modal__text {
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.works-modal__products-title {
  margin-top: 34px;
}

.works-products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.works-products__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid #aaa;
  object-fit: contain;
}

.works-products__name {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

@media (min-width: 901px) and (max-width: 1400px) {
  .works {
    min-height: 0;
    padding: 70px 0 60px;
  }

  .works-map {
    position: relative;
    top: auto;
    left: 50%;
    width: min(1310px, 90vw);
    margin-top: 24px;
  }
}

@media (max-width: 900px) {
  .works {
    min-height: 0;
    padding: 28px 0 30px;
  }

  .works-heading {
    width: calc(100% - 80px);
  }

  .works-heading__en {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .works-heading__title {
    font-size: clamp(28px, 8.53333vw, 48px);
    line-height: 1.25;
  }

  .works-heading__intro {
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: 0.05em;
  }

  .works-map {
    position: relative;
    top: auto;
    left: -51.38vw;
    width: 172.85vw;
    margin-top: 14px;
    transform: none;
  }

  .works-modal {
    width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    border-radius: 5px;
  }

  .works-modal__content {
    padding: 56px 20px 28px;
  }

  .works-modal__close {
    top: 10px;
    right: 10px;

    width: 44px;
    height: 44px;
  }

  .works-modal__close::before,
  .works-modal__close::after {
    top: 21px;
    left: 8px;
    width: 28px;
  }

  .works-modal__overview {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .works-modal__body {
    padding-top: 0;
  }

  .works-modal__text {
    margin-top: 8px;
  }

  .works-modal__products-title {
    margin-top: 30px;
  }

  .works-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 22px;
  }
}

@media (max-width: 900px) {
  .works--sp-scroll .works-map-scroll {
    margin-top: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .works--sp-scroll .works-map {
    left: 0;
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .works-pin img {
    animation: none;
  }

  .works-pin {
    transition: none;
  }
}
