/* ============================================================
   ByEco — "Retire the boiler" before/after slider. Standalone.
   Ported from the New Design Green heat-pump concept (4 Jul 2026).
   Self-contained: tokens, helpers and fonts are all here. If you drop it
   into a page that already loads assets/tech/tech.css (the homepage),
   the token and helper blocks below are duplicates and can be deleted.
   ============================================================ */

/* ---- design tokens (same values as assets/tech/tech.css) ---- */
.compare {
  --bg-2: #061711;
  --ink: #ecf5ec;
  --ink-faint: #7f9a8b;
  --lime: #c8f04b;
  --line: rgba(214, 255, 214, 0.12);
  --line-soft: rgba(214, 255, 214, 0.06);
  --font-display: "Clash Display", "General Sans", -apple-system, sans-serif;
  --font-body: "General Sans", -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(20px, 4vw, 64px);
}
.compare *, .compare *::before, .compare *::after { box-sizing: border-box; }

/* ---- helpers, scoped to the section ---- */
.compare .mono { font-family: var(--font-mono); font-size: 0.72em; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }
.compare .eyebrow { display: flex; align-items: center; gap: 10px; color: var(--lime); margin: 0 0 22px; font-size: 0.72rem; }
.compare .eyebrow i { font-style: normal; color: var(--ink-faint); }
.compare .section-title { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.025em; text-wrap: balance; color: var(--ink); }
.compare .section-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--lime); letter-spacing: 0; }

.compare {
  padding: clamp(96px, 13vw, 200px) 0 clamp(72px, 9vw, 140px);
  background: var(--bg-2); color: var(--ink); font-family: var(--font-body);
  border-block: 1px solid var(--line-soft); -webkit-font-smoothing: antialiased;
}
.compare-container { width: min(1440px, 100% - var(--gutter) * 2); margin-inline: auto; }
.compare .section-head { margin-bottom: clamp(48px, 6vw, 88px); max-width: 60rem; }
.compare .section-title { font-size: clamp(2.3rem, 5.2vw, 4.4rem); margin: 0; }
.compare .eyebrow { margin-top: 0; }

/* title word reveal */
.compare [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.compare [data-split] .wi { display: inline-block; }

.ba {
  position: relative; aspect-ratio: 16 / 8.5; min-height: 340px; border-radius: clamp(16px, 2vw, 28px);
  overflow: clip; border: 1px solid var(--line); user-select: none; -webkit-user-select: none; touch-action: pan-y;
  cursor: ew-resize;
}
.ba-side { position: absolute; inset: 0; }
.ba-side img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-before { clip-path: inset(0 50% 0 0); will-change: clip-path; }
.ba-before img { filter: saturate(0.7) contrast(1.02); }
.ba-tag {
  position: absolute; top: 18px; left: 18px; padding: 0.6em 1em; border-radius: 999px;
  background: rgba(4, 16, 11, 0.65); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); font-size: 0.58rem; color: var(--ink);
}
.ba-tag-r { left: auto; right: 18px; color: var(--lime); border-color: rgba(200, 240, 75, 0.4); }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px;
  background: var(--lime); cursor: ew-resize; will-change: left; outline: none;
}
.ba-grip {
  position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: 56px; height: 56px; border-radius: 50%; background: var(--lime); color: #06130c;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  box-shadow: 0 0 0 8px rgba(200, 240, 75, 0.18), 0 8px 32px rgba(0, 0, 0, 0.45);
  transition: scale 0.3s var(--ease-out);
}
.ba:active .ba-grip { scale: 1.12; }
.ba-handle:focus-visible .ba-grip { box-shadow: 0 0 0 3px #06130c, 0 0 0 6px var(--lime), 0 8px 32px rgba(0, 0, 0, 0.45); }
.ba-grip i { font-style: normal; font-size: 12px; }
.ba-caption { margin: 20px 0 0; color: var(--ink-faint); font-size: 0.58rem; text-align: center; }

@media (max-width: 860px) {
  .ba { aspect-ratio: 4 / 4.4; }
}
