.renovation {
  color: var(--ink);
  background: #fff;
}

.renovation__plan {
  padding: clamp(70px, 8.4vw, 146px) var(--gutter);
  background: #f4f4f2;
}

.renovation__layout {
  max-width: 1600px;
  margin-inline: auto;
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(42px, 8vw, 150px);
}

.renovation h2 {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  max-width: 11ch;
  font-size: clamp(44px, 5.5vw, 90px);
  font-weight: 480;
  letter-spacing: -.04em;
  line-height: 1.05;
  text-wrap: balance;
}

.renovation__steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.renovation__step {
  position: relative;
  padding-block: clamp(20px, 2.1vw, 34px) clamp(28px, 2.8vw, 45px);
  border-top: 1px solid #c9c9c5;
}

.renovation__step:last-child { padding-bottom: 0; }

.renovation__step::before {
  content: "";
  position: absolute;
  inset: -1px auto auto 0;
  width: 52px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
}

.renovation__step.in-view::before { transform: scaleX(1); }

.renovation__step h3 {
  margin-bottom: 10px;
  font-size: clamp(19px, 1vw + 18px, 30px);
  font-weight: 540;
  letter-spacing: -.032em;
  line-height: 1.16;
}

.renovation__step p,
.project-manager__intro p {
  max-width: 52ch;
  color: #4f4f4c;
  font-size: clamp(16px, 1.18vw, 19px);
  line-height: 1.55;
}

.project-manager {
  padding: clamp(68px, 8vw, 140px) var(--gutter);
  background: var(--white);
  color: var(--ink);
}

.project-manager__intro,
.basin-study {
  max-width: 1280px;
  margin-inline: auto;
}

.project-manager__intro h2 {
  max-width: 22ch;
  margin-bottom: clamp(18px, 1.9vw, 30px);
  font-size: clamp(36px, 5vw, 80px);
  font-weight: 480;
  letter-spacing: -.04em;
  line-height: 1.06;
  text-wrap: balance;
}

.project-manager__intro p { max-width: 60ch; }

.basin-study { margin-top: clamp(36px, 4.6vw, 76px); }

.basin-study h3 {
  margin-bottom: clamp(10px, 1.15vw, 18px);
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 540;
  letter-spacing: -.028em;
  line-height: 1.25;
}

.basin-study__viewer {
  --edge: clamp(12px, 2.1vw, 32px);
  --split: 50%;
  --handle-x: clamp(25px, var(--split), calc(100% - 25px));
  --handle-y: 50%;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  overflow: hidden;
}

.basin-study__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.basin-study__stage {
  position: relative;
  min-width: 0;
  width: 100%;
  aspect-ratio: 2.05 / 1;
  background: #dfdcd5;
}

.basin-study__stage--setout,
.basin-study__chat { grid-area: 1 / 1; }

.basin-study__stage--finish { grid-area: 2 / 1; }

.basin-study__stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.basin-study__label {
  position: absolute;
  top: var(--edge);
  left: var(--edge);
  padding: 5px 11px;
  border-radius: 4px;
  background: rgb(18 18 18 / 80%);
  color: #fff;
  font-size: clamp(12px, .95vw, 15px);
  font-weight: 550;
  line-height: 1.45;
  white-space: nowrap;
}

.basin-study__stage--finish .basin-study__label {
  right: var(--edge);
  left: auto;
}

.basin-study__viewer.is-interactive {
  touch-action: pan-y;
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
}

.is-interactive .basin-study__stage--finish { grid-area: 1 / 1; }

.is-interactive .basin-study__stage--setout {
  z-index: 1;
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.basin-study__viewer.is-interactive::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0 auto 0 var(--split);
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 1px 0 3px rgb(18 18 18 / 55%);
  pointer-events: none;
}

.basin-study__range,
.basin-study__handle {
  position: absolute;
  z-index: 4;
  left: var(--handle-x);
  top: var(--handle-y);
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
}

.basin-study__range {
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.basin-study__handle {
  display: none;
  place-items: center;
  color: #171715;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgb(0 0 0 / 32%);
}

.is-interactive .basin-study__handle { display: grid; }

.basin-study__range:focus-visible + .basin-study__handle {
  outline: 3px solid #075da9;
  outline-offset: -5px;
}

.basin-study__chat {
  position: relative;
  z-index: 3;
  align-self: end;
  display: grid;
  gap: 7px;
  width: min(23rem, calc(50% - var(--edge) - 30px));
  margin: var(--edge);
  pointer-events: none;
}

.basin-study__viewer.is-inspecting .basin-study__chat { visibility: hidden; }

.basin-study__message {
  justify-self: start;
  max-width: min(90%, 20rem);
  padding: .63em .95em;
  border-radius: 16px 16px 16px 4px;
  color: #222;
  background: #f3f3f1;
  font-size: clamp(14px, 1.06vw, 17px);
  line-height: 1.38;
}

.basin-study__sender {
  display: block;
  margin-bottom: 2px;
  color: #555550;
  font-size: .88em;
  font-weight: 650;
}

.basin-study__reply {
  justify-self: end;
  border-radius: 16px 16px 4px 16px;
  color: #fff;
  background: #1462ac;
}

.basin-study__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 18px;
  margin-top: 12px;
  color: #4f4f4c;
  font-size: clamp(12px, .95vw, 15px);
  line-height: 1.5;
}

.basin-study__credit { color: #62625d; }

.basin-study__caption {
  max-width: 66ch;
  margin-top: .5em;
  color: #4f4f4c;
  font-size: clamp(15px, 1.06vw, 17px);
  line-height: 1.5;
}

@media (prefers-reduced-motion: no-preference) {
  .renovation__step::before {
    transition: transform 480ms cubic-bezier(.16, 1, .3, 1);
  }

  .basin-study__message {
    transition: opacity 340ms ease-out, transform 340ms cubic-bezier(.16, 1, .3, 1);
  }

  .basin-study__reply { transition-delay: 220ms; }

  .basin-study__chat.is-pending .basin-study__message {
    opacity: 0;
    transform: translateY(7px);
    transition: none;
  }
}

@media (max-width: 800px) {
  .renovation__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
  }

  .renovation h2 { position: static; }

  .basin-study__stage { aspect-ratio: 1.45 / 1; }
}

@media (max-width: 560px) {
  .project-manager__intro h2 { font-size: clamp(31px, 9.2vw, 36px); }

  .basin-study__viewer { --handle-y: 40%; }
  .basin-study__stage { aspect-ratio: 1; min-height: 24rem; }
  .basin-study__stage img { object-position: 58% center; }
  .basin-study__chat { width: min(19rem, calc(100% - 2 * var(--edge))); }
}
