.cd {
  position: absolute;
  inset: 0;
  background: #f5f3ee;
  color: #000;
  font-family: "Cormorant Variable", serif;
  font-weight: 300;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
  --cd-bone: #f5f3ee;
  --cd-line: #d8401f;
  --cd-slow: cubic-bezier(0.4, 0, 0.2, 1);
}
.cd *,
.cd *::before,
.cd *::after {
  box-sizing: border-box;
}

.cd-label,
.cd-range,
.cd-spec {
  font-family: "Cormorant Variable", serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  white-space: nowrap;
}

/* the field */
.cd-field {
  position: absolute;
  left: 36px;
  top: 36px;
  width: 176px;
}
.cd-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  line-height: 18px;
  color: #000000b3;
  transition: color 600ms var(--cd-slow);
}
.cd-field:focus-within .cd-label {
  color: #000;
}
.cd-unit {
  margin-right: -0.3em;
}
.cd-group {
  position: relative;
  display: block;
  height: 180px;
}
.cd-input {
  all: unset;
  position: absolute;
  left: 5.5px;
  top: 8.25px;
  width: 170px;
  height: 110px;
  font-family: inherit;
  font-size: 116px;
  font-weight: 300;
  line-height: 110px;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  color: #000;
  caret-color: var(--cd-line);
  animation: 700ms var(--cd-slow) both;
}
.cd-input::selection {
  background: #0000001f;
}
@keyframes cd-fade-a {
  from {
    opacity: 0.3;
  }
}
@keyframes cd-fade-b {
  from {
    opacity: 0.3;
  }
}
/* at rest, one hairline under the figure */
.cd-rule {
  position: absolute;
  left: 0;
  right: 0;
  top: 117px;
  height: 1px;
  background: #00000047;
}
/* with focus, a hairline frame fades in around the figure, and a second, coloured line draws in under it */
.cd-frame {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 110px;
  border: 1px solid #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms var(--cd-slow);
}
.cd-frame::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: -6px;
  height: 1px;
  background: var(--cd-line);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 700ms var(--cd-slow);
}
.cd-field:focus-within .cd-frame {
  opacity: 1;
}
.cd-field:focus-within .cd-frame::after {
  transform: none;
}

.cd-step {
  all: unset;
  position: absolute;
  top: 138px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #00000047;
  color: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 600ms var(--cd-slow), color 600ms var(--cd-slow), box-shadow 600ms var(--cd-slow), opacity 600ms var(--cd-slow);
}
.cd-step[data-slot="number-input-decrement"] {
  left: 0;
}
.cd-step[data-slot="number-input-increment"] {
  left: 50px;
}
.cd-step svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}
.cd-step:hover {
  box-shadow: inset 0 0 0 1px #000;
}
.cd-step:active {
  background: #000;
  color: var(--cd-bone);
  box-shadow: inset 0 0 0 1px #000;
  transition-duration: 80ms;
}
.cd-step[data-disabled] {
  opacity: 0.28;
  cursor: default;
  box-shadow: inset 0 0 0 1px #00000047;
  background: none;
  color: #000;
}
.cd-range {
  position: absolute;
  right: 0;
  top: 149px;
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.2em;
  margin-right: -0.2em;
  color: #000000a6;
}

/* the wall */
.cd-wall {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cd-drawing {
  position: absolute;
  inset: 0;
  width: 540px;
  height: 540px;
  fill: none;
  stroke: #000;
  stroke-width: 1;
}
.cd-window {
  stroke-width: 0.75;
}
.cd-floor {
  position: absolute;
  left: 36px;
  right: 36px;
  top: 452px;
  height: 1px;
  background: #000;
}
/* the curtains: the linen itself, hung from the pole, as long as the drop */
.cd-panel {
  position: absolute;
  top: 83px;
  width: 50px;
  height: calc(var(--cd-hem) - 83px);
  background: var(--cd-linen) 0 0 / 230px 460px;
  transition: height 900ms var(--cd-slow);
}
.cd-panel.cd-left {
  left: 230px;
}
.cd-panel.cd-right {
  left: 444px;
  background-position: -120px 0;
}
.cd-pool {
  position: absolute;
  top: 452px;
  height: calc(3px + var(--cd-pool) * 1px);
  width: calc(50px + var(--cd-pool) * 1.5px);
  translate: -50% -100%;
  border-radius: 60% 60% 0 0 / 100% 100% 0 0;
  background: var(--cd-linen) -40px -300px / 230px 460px;
  opacity: min(1, var(--cd-pool));
  transition: height 900ms var(--cd-slow), width 900ms var(--cd-slow), opacity 300ms;
}
.cd-pool.cd-left {
  left: 255px;
}
.cd-pool.cd-right {
  left: 469px;
}
/* the one coloured line: from the hem to the floor */
.cd-gap {
  position: absolute;
  left: 213px;
  top: var(--cd-hem);
  width: 9px;
  height: calc(452px - var(--cd-hem) + 1px);
  border-top: 1px solid var(--cd-line);
  border-bottom: 1px solid var(--cd-line);
  background: linear-gradient(var(--cd-line), var(--cd-line)) 4px 0 / 1px 100% no-repeat;
  transition: top 900ms var(--cd-slow), height 900ms var(--cd-slow), opacity 600ms var(--cd-slow);
}
.cd-gap[data-none] {
  opacity: 0;
}
.cd-break {
  position: absolute;
  right: 336px;
  top: 425px;
  font-size: 17px;
  font-style: italic;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  animation: cd-in 800ms var(--cd-slow) both;
}
@keyframes cd-in {
  from {
    opacity: 0.2;
  }
}

/* the order, under the floor line */
.cd-order {
  position: absolute;
  left: 36px;
  right: 36px;
  top: 468px;
  height: 40px;
}
.cd-spec {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 0.26em;
  color: #000000b3;
}
.cd-sum {
  position: absolute;
  left: 0;
  top: 19px;
  font-size: 17px;
  font-weight: 500;
  line-height: 22px;
  white-space: nowrap;
}
.cd-metres,
.cd-total {
  display: inline-block;
  animation: cd-in 800ms var(--cd-slow) both;
}
.cd-total {
  position: absolute;
  right: 0;
  top: 6px;
  font-size: 34px;
  font-weight: 400;
  line-height: 36px;
  letter-spacing: 0.01em;
}
