/* Peeking cat: the sister site's cat, ears and eyes only, peeks over a ledge at
   the right end of the header and links to that site.
   Shared by getfelix.dev and ninelives.getfelix.dev; keep the two copies identical.
   Each site sets the --peek-* colours and draws its own cat inside .peek-cat.

   It sits in the header's flex row, so it never covers content. It stands on
   the header's bottom edge, and a short ledge there clips the cat; on hover or keyboard focus the cat rises
   and the tooltip shows. Hover is gated on (hover: hover) because a tap leaves
   :hover stuck on touch screens. */
.peek {
  position: relative;
  flex: none;
  align-self: flex-end;
  display: block;
  width: 44px;
  height: 42px;
  margin-left: 6px;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.peek-box {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 10px 10px 0 0;
}
.peek::after {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--peek-ledge);
}
.peek-cat {
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 40px;
  height: 40px;
  transform: translateY(12px);
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.25, 1.15);
}
.peek-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: peek-blink 9s infinite;
}
/* Irregular on purpose: one blink, a long gap, then a quick double. */
@keyframes peek-blink {
  0%, 36%, 39%, 79%, 81.5%, 84%, 86.5%, 100% { transform: scaleY(1); }
  37.5%, 80.2%, 85.2% { transform: scaleY(0.08); }
}
.peek-tip {
  position: absolute;
  top: calc(100% + 8px);
  right: -4px;
  z-index: 5;
  width: max-content;
  max-width: min(280px, calc(100vw - 32px));
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--peek-tip-line);
  background: var(--peek-tip-bg);
  color: var(--peek-tip-text);
  font: 500 13px/1.35 var(--peek-tip-font, system-ui, sans-serif);
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.peek-tip::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 22px;
  width: 9px;
  height: 9px;
  background: inherit;
  border-left: 1px solid var(--peek-tip-line);
  border-top: 1px solid var(--peek-tip-line);
  transform: rotate(45deg);
}
@media (hover: hover) {
  .peek:hover .peek-cat {
    transform: translateY(5px);
  }
  .peek:hover .peek-tip {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}
.peek:focus-visible {
  outline: 3px solid var(--peek-focus);
  outline-offset: 2px;
}
.peek:focus-visible .peek-cat {
  transform: translateY(5px);
}
.peek:focus-visible .peek-tip {
  opacity: 1;
  visibility: visible;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .peek-cat,
  .peek-tip {
    transition: none;
  }
  .peek-eye {
    animation: none;
  }
  .peek:hover .peek-cat,
  .peek:focus-visible .peek-cat {
    transform: translateY(12px);
  }
}
