html {
  box-sizing: border-box;
}


*, *:before, *:after {
  box-sizing: inherit;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 1rem;
  background-color: black;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.comparison-page {
  width: min(900px, 100%);
  margin: 0 auto;
}

.comparison-copy {
  margin: 0 auto 1rem;
  text-align: center;
}

.comparison-copy h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.comparison-copy p,
.comparison-home {
  margin: 0;
  color: #d1d5db;
}

.comparison-home {
  margin-top: 0.8rem;
  text-align: center;
}

.comparison-home a {
  color: #99f6e4;
}

.container {
  --split-position: 60%;
  position: relative;
  width: min(800px, 100%);
  aspect-ratio: 3958 / 3993;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid gray;
}

.resize-handle {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.container .img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.container .background-img {
  filter: brightness(130%);
}
.container .foreground-img {
  clip-path: inset(0 calc(100% - var(--split-position)) 0 0);
  z-index: 1;
}

.container .slider-divider {
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split-position);
  width: 2px;
  background: rgba(255, 255, 255, 0.92);
  transform: translateX(-1px);
  z-index: 3;
}
.container .slider {
  position: absolute;
  inset: 0;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 100%;
  z-index: 4;
  border: 0;
  background: transparent;
  outline: none;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: none;
}
.container .slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  cursor: pointer;
}
.container .slider::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.container:focus-within {
  outline: 3px solid #5eead4;
  outline-offset: 3px;
}

.container .slider-button {
  pointer-events: none;
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: white;
  left: var(--split-position);
  top: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 25;
  transform: translate(-50%, -50%);
}

.container .slider-button:after {
  content: "";
  padding: 3px;
  display: inline-block;
  border: solid #5D5D5D;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
  z-index: 25;
}
.container .slider-button:before {
  content: "";
  padding: 3px;
  display: inline-block;
  border: solid #5D5D5D;
  border-width: 0 2px 2px 0;
  transform: rotate(135deg);
  z-index: 26;
}

.comparison-label {
  position: absolute;
  top: 0.75rem;
  z-index: 2;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  pointer-events: none;
}

.comparison-label-earlier {
  left: 0.75rem;
}

.comparison-label-later {
  right: 0.75rem;
}

@media screen and (max-width: 720px) {
    .container .slider-button {
      pointer-events: none;
      position: absolute;
      width: 60px;
      height: 60px;
      border-radius: 50%;
      background-color: white;
      left: var(--split-position);
      top: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 25;
      transform: translate(-50%, -50%);
    }

    .container .slider-button:after {
      content: "";
      padding: 5px;
      display: inline-block;
      border: solid #5D5D5D;
      border-width: 0 4px 4px 0;
      transform: rotate(-45deg);
      z-index: 25;
    }
    .container .slider-button:before {
      content: "";
      padding: 5px;
      display: inline-block;
      border: solid #5D5D5D;
      border-width: 0 4px 4px 0;
      transform: rotate(135deg);
      z-index: 26;
    }
}
