.works-section {
  position: relative;
  padding: 78px clamp(18px, 4vw, 64px) 96px;
}

.works-list {
  display: grid;
  gap: 34px;
  max-width: 1280px;
  margin: 42px auto 0;
}

.work-card {
  display: grid;
  grid-template-columns: 330px 1fr;
  overflow: hidden;
  border: 1px solid rgba(13, 45, 81, .1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 16px 34px rgba(19, 45, 76, .12);
}

.work-copy {
  padding: 48px 34px;
}

.work-copy p:first-of-type,
.detail-copy p:first-of-type {
  color: var(--navy);
  font-family: "Noto Serif JP", serif;
  font-size: 26px;
  font-weight: 600;
}

.work-copy h3 {
  margin: 12px 0 14px;
  color: var(--navy);
  font-family: "Noto Serif JP", serif;
  font-size: 28px;
  line-height: 1.45;
}

.work-copy p {
  color: var(--muted);
  font-weight: 500;
}

.before-after {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  background: #e8edf1;
}

.compare-image {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  margin: 0;
  overflow: hidden;
}

.compare-image img,
.sheet-image img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.compare-slider .compare-image {
  position: absolute;
  inset: 0;
}

.compare-slider .compare-before {
  z-index: 1;
  clip-path: inset(0 calc(100% - var(--compare, 50%)) 0 0);
}

.before-after figcaption {
  position: absolute;
  top: 22px;
  left: 22px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #333;
  font-size: 13px;
  font-weight: 700;
}

.compare-after figcaption {
  right: 22px;
  left: auto;
}

.compare-line {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: var(--compare, 50%);
  width: 2px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 1px rgba(13, 45, 81, .12);
  transform: translateX(-50%);
  pointer-events: none;
}

.compare-mark {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: var(--compare, 50%);
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: #fff;
  box-shadow: 0 10px 20px rgba(12, 34, 58, .16);
  transform: translate(-50%, -50%);
  font-size: 17px;
  font-weight: 700;
  pointer-events: none;
}

.compare-range {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: ew-resize;
  opacity: 0;
}

.compare-slider:focus-within .compare-mark {
  outline: 3px solid rgba(17, 66, 111, .36);
  outline-offset: 4px;
}

.image-pos-0 img { object-position: 17% 25%; }
.image-pos-1 img { object-position: 50% 25%; }
.image-pos-2 img { object-position: 83% 25%; }
.image-pos-3 img { object-position: 17% 80%; }
.image-pos-4 img { object-position: 50% 80%; }
.image-pos-5 img { object-position: 83% 80%; }

.work-detail {
  max-width: 1180px;
  margin: 0 auto;
  padding: 150px clamp(18px, 4vw, 64px) 96px;
}

.detail-copy {
  margin-bottom: 34px;
}

.detail-copy h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.before-after.detail {
  min-height: 520px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-body {
  max-width: 820px;
  margin: 42px auto 0;
  padding: 36px;
  border-left: 3px solid var(--sand);
  background: #fff;
}

.detail-body h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-family: "Noto Serif JP", serif;
}

@media (max-width: 760px) {
  .work-card {
    grid-template-columns: 1fr;
    max-width: none;
    margin-inline: auto;
  }

  .before-after {
    min-height: 320px;
  }
}

@media (max-width: 560px) {
  .works-section {
    padding: 76px 22px 96px;
  }

  .work-copy {
    padding: 34px 26px 30px;
  }

  .work-copy p:first-of-type {
    margin: 8px 0;
    font-size: 22px;
  }

  .work-copy h3 {
    font-size: 24px;
  }

  .before-after {
    height: 220px;
    min-height: 0;
  }

  .before-after.detail {
    height: 250px;
    min-height: 0;
  }

  .compare-mark {
    top: 50%;
    width: 54px;
    height: 54px;
    font-size: 18px;
  }

  .before-after figcaption {
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    font-size: 11px;
  }

  .compare-after figcaption {
    right: 12px;
    left: auto;
  }
}

@media (max-width: 400px) {
  .work-card {
    border-radius: 8px;
  }

  .before-after {
    height: 200px;
  }
}

@media (max-width: 760px) {
  .works-section {
    padding: 88px 22px 104px;
  }

  .works-list {
    gap: 44px;
    margin-top: 50px;
  }

  .work-card {
    min-height: 560px;
  }

  .work-copy {
    padding: 38px 28px 34px;
  }

  .work-copy p {
    line-height: 2;
  }

  .before-after {
    height: 240px;
  }

  .compare-mark {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 400px) {
  .before-after {
    height: 220px;
  }
}
