/* hvck labs landing v13: the raccoon heist (js/heist.js). One ear on a tile edge; the act itself (he peeks over the
   nav logo and steals the v) on a fixed overlay that never takes a click. The sprite is drawn at a whole-pixel scale and moves in whole-pixel steps, so it stays crisp. */

.hv-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the sprite off the LCD: its silhouette keeps the screen's colour, so he reads on ink */
.hv-spr { display: block; overflow: visible; image-rendering: pixelated; }
.hv-spr.flip { transform: scaleX(-1); }
.hv-spr .hv-px-w { fill: var(--hv-spr-fill, #C3C6BD); }
.hv-spr .hv-px-l { fill: var(--hv-spr-ink, #1B1D1A); fill-opacity: .24; }
.hv-spr .hv-px-m { fill: var(--hv-spr-ink, #1B1D1A); fill-opacity: .6; }
.hv-spr .hv-px-i { fill: var(--hv-spr-ink, #1B1D1A); }

/* the peek: a window on the tile's edge; the sprite rises in it from behind the edge (--hv-y, set by the script) */
/* above the fixed nav (z 50, Kacper: "the raccoon popping can overlap the navbar"), under the menu overlay (70) */
.hv-peek { --hv-s: 3px; --hv-y: calc(16 * var(--hv-s)); --hv-top: 0px; position: absolute; z-index: 51; overflow: hidden; overflow: clip; pointer-events: none;
  width: calc(46 * var(--hv-s)); height: calc(24 * var(--hv-s)); }
.hv-peek.is-left, .hv-peek.is-right { width: calc(24 * var(--hv-s)); height: calc(46 * var(--hv-s)); }
.hv-peek-b { position: absolute; left: 0; top: 0; margin: 0; padding: 0; border: 0; background: none; line-height: 0; cursor: pointer; pointer-events: none;
  transform-origin: 0 0; transform: translateY(var(--hv-y));
  transition: transform .24s steps(4, end); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* one ear at rest, it pops up and sinks back in whole-pixel steps; peeking more is a short spring (v13 "one ear") */
.hv-peek[data-at="more"] .hv-peek-b, .hv-peek[data-at="eyes"] .hv-peek-b { transition: transform .26s cubic-bezier(.3, 1.45, .55, 1); }
.hv-peek.is-right .hv-peek-b { transform: translateX(calc(24 * var(--hv-s) - var(--hv-y))) rotate(90deg); }
.hv-peek.is-left .hv-peek-b { transform: translate(var(--hv-y), calc(46 * var(--hv-s))) rotate(-90deg); }
/* he draws over the nav but only takes the pointer below it (--hv-top: how far the nav reaches into the window), so the
   nav's controls under him always stay clickable; the button itself takes no pointer, the hit area inside it does */
.hv-peek-hit { position: absolute; left: 0; right: 0; bottom: 0; top: max(0px, calc(var(--hv-top) - var(--hv-y))); pointer-events: auto;
  transition: top .24s steps(4, end); }
/* the cut moves with the same timing as the button, so the pointer never drops out of him mid-rise (Chromium) */
.hv-peek[data-at="more"] .hv-peek-hit, .hv-peek[data-at="eyes"] .hv-peek-hit { transition: top .26s cubic-bezier(.3, 1.45, .55, 1); }
.hv-peek[data-at="hidden"] .hv-peek-hit { pointer-events: none; }
/* at rest the target is the ear and a little around it (48 x 24 at 3px), not the whole strip over the edge */
.hv-peek.is-rest .hv-peek-b { clip-path: inset(0 calc(27 * var(--hv-s)) 0 calc(3 * var(--hv-s))); }
.hv-peek-b:focus { outline: none; }
.hv-peek-b:focus-visible .hv-spr { outline: none; }
/* fix round (P2-4): the ring on the window, so the clip never cuts it */
.hv-peek:has(.hv-peek-b:focus-visible) { outline: 2px solid #FF3D00; outline-offset: 3px; }
.hv-peek[hidden] { display: none; }

/* the heist itself */
.hv-heist { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; overflow: hidden; contain: strict; }
.hv-run { position: absolute; left: 0; top: 0; z-index: 1; line-height: 0; }
.hv-loot { position: absolute; left: 0; top: 0; overflow: visible; z-index: 2; }
.hv-loot.under { z-index: 0; }

@media (prefers-reduced-motion: reduce) {
  .hv-peek-b, .hv-peek[data-at] .hv-peek-b, .hv-peek-hit, .hv-peek[data-at] .hv-peek-hit { transition: none; }
}
