/**
 * Hover explainer card ("peek") + ambient lifestyle detail (the fly).
 * Both are pure enhancement: peek needs hover+fine pointer, the fly is
 * cosmetic and disabled under reduced motion / lite mode.
 */

.peek {
  position: fixed;
  z-index: 40;
  width: min(272px, 84vw);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 160ms ease, transform 160ms ease;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(180deg, #1d2126, #14171a);
  box-shadow:
    0 18px 44px -12px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 0 1px var(--ink, transparent) inset;
}

.peek.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Little pointer connecting the card back to the product it describes. */
.peek__arrow {
  position: absolute;
  left: var(--arrow-x, 50%);
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #14171a;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 2px 2px 0 -1px rgba(255, 255, 255, 0.08);
}

.peek--above .peek__arrow {
  top: -6px;
  bottom: auto;
  box-shadow: -2px -2px 0 -1px rgba(255, 255, 255, 0.08);
}

.peek__shot {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0c0d;
  border-bottom: 2px solid var(--ink, #444);
}

.peek__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.peek__noshot {
  display: grid;
  place-items: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.25);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
}

.peek__code {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(6, 8, 9, 0.82);
  color: var(--display-amber);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.peek__body {
  padding: 9px 11px 11px;
}

.peek__name {
  margin: 0 0 3px;
  color: #fff;
  font-family: var(--font-marque);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.peek__tease {
  margin: 0 0 6px;
  color: rgba(233, 234, 236, 0.78);
  font-size: 0.76rem;
  line-height: 1.3;
}

.peek__meta {
  margin: 0;
  color: rgba(233, 234, 236, 0.4);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
}

@media (max-width: 640px) {
  .peek {
    display: none;
  }
}

/* ====================================================================== */
/* AMBIENT: a fly drifting past the glass every so often                   */
/* ====================================================================== */

.bug {
  position: absolute;
  z-index: 9;
  width: 5px;
  height: 3px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a4a48, #0c0c0b 70%);
  box-shadow: 0 0 3px 1px rgba(0, 0, 0, 0.4);
  opacity: 0;
  animation: bugPath var(--bug-dur, 4200ms) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.bug::after {
  content: "";
  position: absolute;
  inset: -2px -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 70%);
  animation: bugWing 90ms steps(2) infinite;
}

@keyframes bugWing {
  50% {
    transform: scaleX(0.4);
  }
}

/* Drifting, slightly wandering flight path with a fade in/out at each end —
   real insect flight is jittery rather than a smooth arc. */
@keyframes bugPath {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  6% {
    opacity: 0.85;
  }
  25% {
    transform: translate(var(--bug-x1, 60px), var(--bug-y1, -14px));
  }
  50% {
    transform: translate(var(--bug-x2, 130px), var(--bug-y2, 10px));
  }
  75% {
    transform: translate(var(--bug-x3, 190px), var(--bug-y3, -8px));
  }
  94% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(var(--bug-x4, 250px), var(--bug-y4, 4px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .bug {
    display: none;
  }
}

[data-lite] .bug {
  display: none;
}
