.comparison-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(234, 174, 54, .26);
  border-radius: 8px;
  background: #111;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .52);
}

.comparison-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #060606;
  touch-action: none;
  cursor: ew-resize;
}

.comparison-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.comparison-after {
  z-index: 1;
}

.comparison-before-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: var(--reveal, 0%);
  left: auto;
  overflow: hidden;
}

.comparison-before-wrap img {
  right: 0;
  width: calc(100% / max(var(--reveal-value, .001), .001));
  max-width: none;
}

.comparison-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  right: var(--reveal, 0%);
  z-index: 4;
  width: 2px;
  transform: translateX(1px);
  background: #eaae36;
  opacity: 0;
  transition: opacity .18s cubic-bezier(.42, 0, .58, 1);
}

.comparison-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(234, 174, 54, .8);
  border-radius: 50%;
  background: rgba(0, 0, 0, .78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .42);
}

.comparison-handle::after {
  content: "< >";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #eaae36;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  white-space: nowrap;
}

.comparison-card:hover .comparison-handle,
.comparison-card:focus-within .comparison-handle,
.comparison-card.is-active .comparison-handle {
  opacity: 1;
}

.comparison-card.is-auto-sliding .comparison-before-wrap,
.comparison-card.is-auto-sliding .comparison-handle {
  transition: width .75s cubic-bezier(.16, 1, .3, 1), right .75s cubic-bezier(.16, 1, .3, 1);
}

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

.comparison-meta {
  padding: 1rem;
}

.comparison-meta h3 {
  margin: 0;
  color: #fff;
  font-size: 1.15rem;
}

.comparison-meta p {
  margin: .35rem 0 0;
  color: #eaae36;
  font-weight: 800;
  line-height: 1.45;
}

.comparison-auto-button {
  display: none;
  width: 100%;
  min-height: 44px;
  margin-top: .85rem;
  border: 1px solid rgba(234, 174, 54, .72);
  border-radius: 6px;
  color: #000;
  background: #eaae36;
  font-weight: 900;
  cursor: pointer;
}

.comparison-badges {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  left: .75rem;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  pointer-events: none;
}

.comparison-badges span {
  border: 1px solid rgba(234, 174, 54, .55);
  border-radius: 999px;
  padding: .35rem .55rem;
  color: #fff;
  background: rgba(0, 0, 0, .68);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (hover: none) {
  .comparison-handle {
    opacity: 1;
  }
}

@media (max-width: 620px) {
  .comparison-frame {
    aspect-ratio: 3 / 4;
  }

  .comparison-meta {
    padding: .8rem;
  }

  .comparison-meta h3 {
    font-size: .95rem;
  }

  .comparison-meta p {
    font-size: .78rem;
  }

  .comparison-auto-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
