/* Comparison section */
.compare-section {
  position: relative;
  z-index: 10;
  padding: 4rem 1.5rem 6rem;
  pointer-events: auto;
}

.compare-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.compare-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.compare-eyebrow {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.8rem;
  color: rgba(180, 170, 175, 0.65);
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  text-transform: lowercase;
}

.compare-title {
  font-family: var(--font);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.55rem;
}

.compare-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 42ch;
  margin: 0 auto 1.35rem;
  line-height: 1.5;
}

.compare-toggle {
  display: inline-flex;
  padding: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  gap: 0.15rem;
  backdrop-filter: blur(8px);
}

.compare-toggle-btn {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(180, 175, 180, 0.7);
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.compare-toggle-btn:hover {
  color: var(--text);
}

.compare-toggle-btn.is-active {
  background: rgba(245, 220, 228, 0.95);
  color: #1a1216;
  box-shadow: 0 0 18px var(--accent-glow);
}

/* Panel */
.compare-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

.compare-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.compare-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.compare-card {
  flex: 1;
  padding: 1.25rem 1.35rem;
  background: rgba(22, 22, 28, 0.45);
  border: 1px solid rgba(232, 90, 120, 0.1);
  border-radius: 1rem;
  backdrop-filter: blur(6px);
}

.compare-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-red {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-soft);
}

.status-dot-white {
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.compare-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.compare-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Slider */
.compare-slider-wrap {
  position: relative;
  min-height: 320px;
}

.compare-slider-labels {
  position: absolute;
  top: 1rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  pointer-events: none;
}

.compare-slider-labels-left {
  left: 1rem;
  text-align: left;
}

.compare-slider-labels-right {
  right: 1rem;
  text-align: right;
}

.compare-slider-fps {
  font-size: 0.7rem;
  color: #7a7a7a;
}

.compare-slider-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.compare-slider {
  --compare-pos: 52;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: min(380px, 55vh);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(16, 16, 20, 0.8);
  user-select: none;
  touch-action: none;
  contain: layout style paint;
}

.compare-slider.is-dragging {
  cursor: ew-resize;
}

.compare-slider.is-dragging .compare-video {
  pointer-events: none;
}

.compare-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.compare-layer-after {
  z-index: 2;
  inset: 0;
  clip-path: inset(0 0 0 calc(var(--compare-pos) * 1%));
}

.compare-after-inner {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.compare-slider.is-dragging .compare-layer-after,
.compare-slider.is-dragging .compare-divider {
  will-change: clip-path, left;
}

.compare-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  background: #0a0a0e;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--compare-pos) * 1%);
  width: 2px;
  margin-left: -1px;
  background: #ffffff;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  transform: translateZ(0);
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.compare-handle-bar {
  width: 2px;
  height: 14px;
  background: #1a1a1a;
  border-radius: 1px;
}

.compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 6;
}

.compare-play-btn {
  position: absolute;
  inset: 0;
  z-index: 7;
  margin: auto;
  width: fit-content;
  height: fit-content;
  padding: 0.55rem 1.1rem;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(28, 28, 34, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.compare-play-btn[hidden] {
  display: none !important;
}

.compare-slider-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.72rem;
  color: #6a6a6a;
  letter-spacing: 0.03em;
  pointer-events: none;
  z-index: 5;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Scroll reveal */
.reveal .reveal-item {
  opacity: 0;
  transform: translateY(36px);
  transition:
    opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible .reveal-item {
  opacity: 1;
  transform: translateY(0);
}

.compare-panel.reveal-item {
  transform: translateY(56px) scale(0.98);
}

.reveal.is-visible .compare-panel.reveal-item {
  transform: translateY(0) scale(1);
}

@media (max-width: 900px) {
  .compare-panel-grid {
    grid-template-columns: 1fr;
  }

  .compare-slider {
    min-height: 340px;
  }
}

@media (max-width: 520px) {
  .compare-toggle {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
  }

  .compare-toggle-btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .compare-section {
    padding: 3rem 1rem 4rem;
  }

  .compare-slider-labels-left,
  .compare-slider-labels-right {
    max-width: 42%;
  }

  .compare-slider-name {
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal .reveal-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
