.transformation {
  background: var(--paper);
  padding-top: clamp(90px, 9vw, 140px);
  padding-bottom: clamp(90px, 9vw, 140px);
}

.transformation-head {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: clamp(40px, 8vw, 120px);
  align-items: end;
  margin-bottom: clamp(38px, 5vw, 68px);
}

.transformation-head h2 {
  font-size: clamp(44px, 4.4vw, 70px);
  line-height: 1.02;
}

.transformation-head h2 em {
  color: #76907c;
}

.transformation-head p {
  margin: 0 0 5px;
  max-width: 470px;
  color: #657068;
  font-size: 16px;
}

.transformation-slider {
  max-width: 1220px;
  margin: 0 auto;
}

.transformation-list {
  display: grid;
  gap: clamp(68px, 8vw, 118px);
}

.transformation-item-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  max-width: 1220px;
  margin: 0 auto 22px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.transformation-item-head span {
  color: var(--orange);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
}

.transformation-item-head h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(26px, 2.4vw, 38px);
  font-weight: 400;
  line-height: 1.1;
}

.before-after-slider {
  --position: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 2048 / 1360;
  overflow: hidden;
  border-radius: 22px;
  background: #d9d8d2;
  box-shadow: 0 24px 65px rgba(14, 45, 32, .16);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.before-after-slider__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

.before-after-slider__after {
  clip-path: inset(0 0 0 var(--position));
}

.before-after-slider__label {
  position: absolute;
  z-index: 3;
  top: 24px;
  padding: 9px 14px;
  border-radius: 2px;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .15em;
  line-height: 1;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .18);
  pointer-events: none;
}

.before-after-slider__label--before {
  left: 24px;
  background: var(--forest);
}

.before-after-slider__label--after {
  right: 24px;
  background: var(--orange);
}

.before-after-slider__line {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: var(--position);
  width: 3px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 0 0 1px rgba(15, 35, 25, .12), 0 0 18px rgba(0, 0, 0, .22);
  transform: translateX(-50%);
  pointer-events: none;
}

.before-after-slider__handle {
  position: absolute;
  z-index: 5;
  left: var(--position);
  top: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 8px 28px rgba(5, 24, 15, .3);
  transform: translate(-50%, -50%);
  font-size: 18px;
  line-height: 1;
  outline: none;
}

.before-after-slider__handle:focus-visible {
  box-shadow: 0 0 0 5px rgba(230, 109, 54, .35), 0 8px 28px rgba(5, 24, 15, .3);
}

.before-after-slider__instructions {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 850px) {
  .transformation-head {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .transformation-head p {
    font-size: 15px;
  }
}

@media (max-width: 720px) {
  .transformation {
    padding-top: 78px;
    padding-bottom: 78px;
  }

  .transformation-head {
    margin-bottom: 32px;
  }

  .transformation-list {
    gap: 60px;
  }

  .transformation-item-head {
    margin-bottom: 16px;
  }

  .transformation-head h2 {
    font-size: clamp(39px, 11.5vw, 50px);
  }

  .before-after-slider {
    aspect-ratio: 3 / 2;
    border-radius: 14px;
    box-shadow: 0 16px 42px rgba(14, 45, 32, .15);
  }

  .before-after-slider__label {
    top: 13px;
    padding: 8px 10px;
    font-size: 8px;
  }

  .before-after-slider__label--before { left: 13px; }
  .before-after-slider__label--after { right: 13px; }

  .before-after-slider__handle {
    width: 50px;
    height: 50px;
    gap: 5px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .before-after-slider__handle,
  .before-after-slider__after,
  .before-after-slider__line {
    transition: none;
  }
}
