/* Scroll-scrub thermal transition — standalone, build.mjs won't touch this file */

.thermal-scrub {
  background: var(--b4);
  padding: 0 !important;
  overflow: visible !important;  /* kill .sec overflow:clip so sticky child can work */
  height: auto !important;
}
.thermal-scrub-track {
  position: relative;
  height: 420vh;        /* slow scroll so the cool change lands as a transformation, not a flash */
  display: block;
}
.thermal-scrub-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex; align-items: center;
  padding: clamp(40px, 6vw, 80px) 0;
  overflow: hidden;
}
.thermal-scrub .thermal-grid { width: 100%; }
.thermal-scrub .thermal-box { position: relative; }

/* Two stacked thermal images. .thermal-cold sits on top and reveals from the RIGHT
   edge as the user scrolls (--p ramps 0 → 1), wiping the hot amber view away to
   reveal the cool blue view with cold air flowing from the aircon. */
.thermal-film {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 72vh;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.45);
  background: #0E1A2B;
}
.thermal-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  user-select: none; pointer-events: none;
}
.thermal-cold {
  --p: 0;
  clip-path: inset(0 0 0 calc((1 - var(--p)) * 100%));
  transition: clip-path 180ms cubic-bezier(.4,.1,.25,1);
}

/* A hairline edge marks where the cool wipe meets the hot image, so the eye
   follows the transition instead of guessing. */
.thermal-film::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--edge, 0) * 100%);
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.65), transparent);
  box-shadow: 0 0 18px 2px rgba(94, 211, 224, .55);
  transform: translateX(-1px);
  pointer-events: none;
  opacity: var(--edge-on, 0);
  transition: opacity 180ms;
}

/* Top-left badge: 33° hot label, swaps to 23° cool label as the wipe completes.
   Position mirrored to the top-right so both corners show the before/after temp. */
.thermal-scrub .th-lab { z-index: 3; position: absolute; }
.thermal-scrub .th-hot { position: absolute; top: 14px; left: 14px; padding: 8px 14px; border-radius: 10px; background: rgba(217,97,43,.92); color:#fff; font-weight:700; letter-spacing:.02em; font-size: 20px; transition: background-color 500ms cubic-bezier(.4,.1,.25,1); min-width: 56px; text-align: center; }
.thermal-scrub .th-hot .t-h,
.thermal-scrub .th-hot .t-c { display: inline-block; transition: opacity 400ms cubic-bezier(.4,.1,.25,1), transform 400ms cubic-bezier(.4,.1,.25,1); }
.thermal-scrub .th-hot .t-c { position: absolute; left: 14px; right: 14px; top: 8px; opacity: 0; transform: translateY(-6px); }
.thermal-scrub.is-cooled .th-hot { background: rgba(94,211,224,.92); color:#0E1A2B; }
.thermal-scrub.is-cooled .th-hot .t-h { opacity: 0; transform: translateY(6px); }
.thermal-scrub.is-cooled .th-hot .t-c { opacity: 1; transform: translateY(0); }

/* Top-right mirror badge: live temperature ticking down as the wipe progresses. */
.thermal-scrub .th-live { position: absolute; top: 14px; right: 14px; padding: 8px 14px; border-radius: 10px; background: rgba(14,26,43,.72); color:#fff; font-weight:700; font-size: 20px; letter-spacing: .02em; z-index: 3; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.thermal-scrub .th-live .t-live { display: inline-block; }

/* Keep-scrolling hint */
.th-hint {
  position: absolute; left: 50%; bottom: 14px;
  transform: translateX(-50%);
  font-family: var(--mono, monospace); font-size: 11px; font-weight: 600;
  color: #fff; background: rgba(14,26,43,.6);
  padding: 6px 12px; border-radius: 999px;
  letter-spacing: .04em;
  z-index: 4;
  animation: th-hint-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes th-hint-pulse {
  0%, 100% { opacity: .85; transform: translate(-50%, 0); }
  50% { opacity: 1; transform: translate(-50%, 3px); }
}
.thermal-scrub.is-cooled .th-hint { opacity: 0; }

@media (max-width: 860px) {
  .thermal-scrub-track { height: 360vh; }
  .thermal-scrub-pin { padding: 32px 0; }
  .thermal-film { max-height: 55vh; }
  .thermal-scrub .th-hot, .thermal-scrub .th-live { font-size: 16px; padding: 6px 10px; min-width: 48px; }
}
