/* GRADEWIPE — V2 spectral lightbar comparison. All rules scoped to .gradewipe. */

.gradewipe {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
}

.gradewipe-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgba(255, 247, 232, .16);
  background: #08070a;
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, .75),
    inset 0 1px 0 rgba(255, 255, 255, .05);
  cursor: ew-resize;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.gradewipe-frame[data-dragging='true'] { cursor: grabbing; }

.gradewipe-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* GRADE is the full base layer. */
.gradewipe-graded {
  z-index: 1;
  filter: contrast(1.16) saturate(1.12) brightness(.93) sepia(.08) hue-rotate(-6deg);
}

.gradewipe-grade-look {
  position: absolute;
  inset: 0;
  z-index: 1;
  box-shadow: inset 0 0 130px rgba(0, 0, 0, .6);
  pointer-events: none;
}

.gradewipe-grade-look::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 18%, rgba(255, 190, 120, .10), transparent 55%);
  mix-blend-mode: soft-light;
}

/* LOG is clipped to the left of the lightbar. */
.gradewipe-log {
  z-index: 2;
  filter: grayscale(.5) contrast(.62) brightness(1.28) saturate(.42);
  clip-path: inset(0 calc(100% - var(--wipe, 50%)) 0 0);
  will-change: clip-path;
}

.gradewipe-log-lift {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(150, 150, 142, .14);
  mix-blend-mode: lighten;
  clip-path: inset(0 calc(100% - var(--wipe, 50%)) 0 0);
  will-change: clip-path;
  pointer-events: none;
}

/* Top legibility scrim shared by both halves. */
.gradewipe-frame::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  height: 80px;
  background: linear-gradient(rgba(0, 0, 0, .4), transparent);
  pointer-events: none;
}

.gradewipe-label {
  position: absolute;
  top: 20px;
  z-index: 4;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  color: rgba(234, 227, 212, .85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
  pointer-events: none;
}

.gradewipe-label-log {
  left: 22px;
  opacity: var(--log-label-opacity, .66);
}

.gradewipe-label-grade {
  right: 22px;
  opacity: var(--grade-label-opacity, .66);
}

/* Divider: dispersion bloom, lighter mid band, and a near-white core. */
.gradewipe-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--wipe, 50%);
  z-index: 5;
  width: 0;
  transform: none;
  pointer-events: none;
}

.gradewipe-handle::before,
.gradewipe-handle::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.gradewipe-handle::before {
  left: -6px;
  width: 13px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(91, 141, 239, .6) 10%,
    rgba(209, 91, 214, .65) 50%,
    rgba(227, 162, 74, .6) 90%,
    transparent
  );
  filter: blur(7px);
  opacity: .9;
  mix-blend-mode: screen;
}

.gradewipe-handle::after {
  left: -1.5px;
  width: 3px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(150, 190, 250, .5) 8%,
    rgba(230, 210, 250, .8) 50%,
    rgba(250, 210, 160, .5) 92%,
    transparent
  );
  filter: blur(1.5px);
  mix-blend-mode: screen;
}

.gradewipe-core {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -.75px;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 253, 248, .98) 6%,
    rgba(255, 253, 248, .98) 94%,
    transparent
  );
  box-shadow: 0 0 10px 1px rgba(209, 91, 214, .55);
}

.gradewipe-grip {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 2;
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 253, 248, .88);
  border-radius: 50%;
  background: rgba(226, 214, 232, .12);
  box-shadow: 0 0 7px 1px rgba(209, 91, 214, .34);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.gradewipe-grip-halo {
  position: absolute;
  inset: -8px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(190, 160, 235, .18) 0 40%,
    rgba(209, 91, 214, .14) 50%,
    transparent 72%
  );
  filter: blur(3px);
}

.gradewipe-grip::before,
.gradewipe-grip::after {
  content: '';
  position: absolute;
  top: 50%;
  z-index: 2;
  box-sizing: border-box;
  width: 5px;
  height: 5px;
  border-top: 1px solid rgba(255, 251, 242, .94);
  border-right: 1px solid rgba(255, 251, 242, .94);
  background: none;
  padding: 0;
  opacity: 1;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, .45));
}

.gradewipe-grip::before {
  left: 14px;
  transform: translateY(-50%) rotate(-135deg);
}

.gradewipe-grip::after {
  right: 13px;
  transform: translateY(-50%) rotate(45deg);
}

.gradewipe-handle:focus-visible { outline: none; }

.gradewipe-handle:focus-visible .gradewipe-grip {
  outline: 1px solid var(--amber);
  outline-offset: 4px;
}

.gradewipe-tooltip {
  position: absolute;
  top: calc(50% - 40px);
  left: 0;
  z-index: 3;
  display: block;
  padding: 3px 7px;
  border: 1px solid rgba(255, 247, 232, .16);
  border-radius: 4px;
  background: rgba(10, 9, 8, .72);
  color: rgba(234, 227, 212, .9);
  font-size: 10px;
  letter-spacing: .06em;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity .12s ease;
  pointer-events: none;
}

.gradewipe-frame[data-dragging='true'] .gradewipe-tooltip { opacity: 1; }

.gradewipe-caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 14px;
  color: rgba(234, 227, 212, .38);
  font-size: 10.5px;
  letter-spacing: .14em;
}

@media (max-width: 520px) {
  .gradewipe-caption { font-size: 9px; }
}
