/**
 * Not AI slop (index.html · #slop): the same car from a general AI image
 * generator and from SolidMeta, one over the other. --pos (0–100) is where
 * the divider sits; the SolidMeta frame shows to the right of it. A
 * transparent range input on top does the dragging, so keyboard and screen
 * readers get a real slider. js/home.js sets --pos and plays a one-time hint.
 */

.slop-compare {
    max-width: 64rem;
    margin: 2.5rem auto 0;
}

.slop-stage {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.1rem;
    background: #0b1d28;
    user-select: none;
}

.slop-side {
    position: absolute;
    inset: 0;
}

.slop-side--sm {
    clip-path: inset(0 0 0 calc(var(--pos) * 1%));
}

.slop-side img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The stand-in frame says so until the real pair arrives */
/* Divider and knob */
.slop-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--pos) * 1%);
    width: 2px;
    margin-left: -1px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.slop-handle i {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: #fff;
    color: #0b1d28;
    font-size: 0.875rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
}

.slop-stage:hover .slop-handle i,
.slop-stage:has(.slop-range:active) .slop-handle i {
    transform: translate(-50%, -50%) scale(1.08);
}

.slop-stage:has(.slop-range:focus-visible) .slop-handle i {
    outline: 2px solid #05c7bb;
    outline-offset: 3px;
}

.slop-range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    appearance: none;
    -webkit-appearance: none;
}

/* Side labels */
.slop-chip,
.slop-ok {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(6, 18, 26, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
}

.slop-chip { top: 0.9rem; }
.slop-chip--ai { left: 0.9rem; color: #ffb3a7; border: 1px solid rgba(255, 122, 102, 0.45); }
.slop-chip--sm { right: 0.9rem; color: #7ff3ea; border: 1px solid rgba(5, 199, 187, 0.5); }

.slop-ok {
    right: 0.9rem;
    bottom: 0.9rem;
    color: #04201d;
    background: #05c7bb;
}

/* Defect pins on the generic image */
.slop-pin {
    position: absolute;
    left: calc(var(--x) * 1%);
    top: calc(var(--y) * 1%);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transform: translate(-0.75rem, -50%);
    pointer-events: none;
}

.slop-pin--left {
    flex-direction: row-reverse;
    transform: translate(calc(-100% + 0.75rem), -50%);
}

.slop-pin b,
.slop-legend li b {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #ff7a66;
    color: #2a0a05;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 700;
}

.slop-pin b { box-shadow: 0 0 0 4px rgba(255, 122, 102, 0.28); }

.slop-pin span {
    padding: 0.25rem 0.55rem;
    border-radius: 0.4rem;
    background: rgba(6, 18, 26, 0.8);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Below the frame: what each side is */
.slop-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2.5rem;
    margin-top: 1.5rem;
    text-align: left;
}

.slop-legend strong {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #ffb3a7;
}

.slop-legend__col--sm strong { color: #7ff3ea; }

.slop-legend ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.slop-legend li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.82);
}

.slop-legend p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
}

.slop-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #05c7bb;
}

.slop-link:hover { color: #7ff3ea; }

@media (max-width: 767px) {
    .slop-compare { margin-top: 1.75rem; }
    .slop-stage { border-radius: 0.8rem; }
    .slop-chip { top: 0.6rem; max-width: calc(50% - 1.6rem); padding: 0.25rem 0.55rem; font-size: 0.625rem; white-space: normal; }
    .slop-ok { display: none; }
    .slop-chip--ai { left: 0.6rem; }
    .slop-chip--sm { right: 0.6rem; }
    .slop-pin span { display: none; }
    .slop-pin, .slop-pin--left { transform: translate(-50%, -50%); }
    .slop-pin b { width: 1.25rem; height: 1.25rem; font-size: 0.625rem; }
    .slop-handle i { width: 2rem; height: 2rem; font-size: 0.75rem; }
    .slop-legend { grid-template-columns: 1fr; gap: 1.25rem; }
}
