/* Laserpointer-Jagd der Startseiten-Katze (app/hero-cat-hunt.js). Zustaende
   auf .mascotCompanion.heroCat: .is-hunting fuer die ganze Jagd, dazu der
   Reihe nach .is-stalking (lauern), .is-leaping (Sprung), .is-landed (auf dem
   Zeiger), .is-vanishing (verpuffen), .is-returning (wieder auf dem C). Der
   Flug selbst ist eine Web-Animation auf der Katze (transform); hier stehen
   Haltung, Augen, Ohren, Schwanz, Pfoten, Verpuffen und Wiedererscheinen.
   Haltung liegt auf .mascotCompanion-figure, damit das ruhige Atmen der
   Figur (.coachCat, home.css) ungestoert weiterlaeuft. */

.mascotCompanion.heroCat.is-hunting { z-index: 60; }
/* Waehrend sie jagt, ist sie nicht zu greifen und nicht zu streicheln. */
.heroCat.is-hunting .coachCat { pointer-events: none; cursor: var(--mp-cur-arrow); }
.heroCat .mascotCompanion-figure { transform-origin: 50% 78%; }
/* Unterwegs landet sie oft auf goldener Schrift: eine knappe dunkle Kontur
   haelt die goldenen Linien dort lesbar (kein Leuchten, kein Lichtfleck). */
.heroCat.is-hunting .mascotCompanion-cat .coachCat {
  filter: drop-shadow(0 0 1px #05070c) drop-shadow(0 0 1.5px #05070c) drop-shadow(0 3px 5px rgba(0, 0, 0, .6));
}

/* ── Augen: gluehen rot, sobald sie lauert, bis kurz nach der Landung ── */
.heroCat .coachCat-eyeL,
.heroCat .coachCat-eyeR { transition: fill .35s ease, r .35s ease; }
.heroCat .coachCat-eyes { filter: drop-shadow(0 0 0 rgba(255, 70, 70, 0)); transition: filter .35s ease, transform .25s ease; }
.heroCat.is-stalking .coachCat-eyeL,
.heroCat.is-stalking .coachCat-eyeR,
.heroCat.is-leaping .coachCat-eyeL,
.heroCat.is-leaping .coachCat-eyeR { fill: #ff4b4b; r: 4.1px; }
.heroCat.is-stalking .coachCat-eyes,
.heroCat.is-leaping .coachCat-eyes,
.heroCat.is-landed .coachCat-eyes { animation: none; }
.heroCat.is-stalking .coachCat-eyes,
.heroCat.is-leaping .coachCat-eyes { filter: drop-shadow(0 0 2.5px rgba(255, 70, 70, .9)); }
/* Auf dem Zeiger kuehlen die Augen nach einem Moment wieder ab. */
.heroCat.is-landed .coachCat-eyeL,
.heroCat.is-landed .coachCat-eyeR { animation: heroCatEyeCool .6s ease .45s both; }
.heroCat.is-landed .coachCat-eyes { animation: heroCatEyeGlowOff .6s ease .45s both; }
/* ... und schaut nach unten, unter die Pfote. Auf der Augen-Gruppe, damit das
   Mitblicken der einzelnen Pupillen (mascot.js) es nicht ueberschreibt. */
.heroCat.is-landed .coachCat-eyes { transform: translateY(2px); }
@keyframes heroCatEyeCool {
  from { fill: #ff4b4b; r: 4.1px; }
  to { fill: currentColor; r: 3.4px; }
}
@keyframes heroCatEyeGlowOff {
  from { filter: drop-shadow(0 0 2.5px rgba(255, 70, 70, .9)); }
  to { filter: drop-shadow(0 0 0 rgba(255, 70, 70, 0)); }
}

/* ── Ohren flach, Schwanz zuckt: sie lauert ── */
.heroCat .coachCat-earL,
.heroCat .coachCat-earR { transform-box: fill-box; transition: transform .3s ease; }
.heroCat .coachCat-earL { transform-origin: 100% 100%; }
.heroCat .coachCat-earR { transform-origin: 0 100%; }
.heroCat.is-stalking .coachCat-earL,
.heroCat.is-leaping .coachCat-earL { transform: rotate(-16deg); }
.heroCat.is-stalking .coachCat-earR,
.heroCat.is-leaping .coachCat-earR { transform: rotate(16deg); }
.heroCat.is-stalking .coachCat-tail { animation: heroCatTailTwitch .24s ease-in-out infinite alternate; }
@keyframes heroCatTailTwitch {
  from { transform: rotate(3deg); }
  to { transform: rotate(-11deg); }
}

/* ── Haltung: ducken und wackeln, abspringen, landen ── */
.heroCat.is-stalking .mascotCompanion-figure { animation: heroCatStalk .82s ease-in-out both; }
@keyframes heroCatStalk {
  0% { transform: none; }
  28% { transform: translateY(3px) scale(1.04, .93); }
  50% { transform: translateY(3px) scale(1.04, .93) translateX(-1.6px); }
  64% { transform: translateY(3px) scale(1.04, .93) translateX(1.6px); }
  78% { transform: translateY(3px) scale(1.04, .93) translateX(-1.4px); }
  90% { transform: translateY(3px) scale(1.04, .93) translateX(1.2px); }
  100% { transform: translateY(4px) scale(1.06, .9); }
}
.heroCat.is-leaping .mascotCompanion-figure { animation: heroCatLeap var(--leap-ms, 520ms) ease-in-out both; }
@keyframes heroCatLeap {
  0% { transform: translateY(4px) scale(1.06, .9); }
  18% { transform: translateY(-2px) scale(.94, 1.1); }
  60% { transform: scale(.97, 1.05); }
  100% { transform: scale(1.02, .98); }
}
.heroCat.is-landed .mascotCompanion-figure { animation: heroCatLand .5s cubic-bezier(.3, .8, .3, 1) both; }
@keyframes heroCatLand {
  0% { transform: scale(1.02, .98); }
  22% { transform: translateY(2px) scale(1.14, .84); }
  58% { transform: translateY(-1px) scale(.97, 1.04); }
  100% { transform: none; }
}

/* Auf flachem Boden stehen die Pfoten gerade (hero-cat.js legt sie sonst
   per transform-Attribut an die Rundung des C); nach der Landung hebt sie
   die rechte Pfote kurz an und schaut nach, ob da etwas drunter ist. */
.heroCat.is-leaping .coachCat-pawL,
.heroCat.is-leaping .coachCat-pawR,
.heroCat.is-landed .coachCat-pawL,
.heroCat.is-landed .coachCat-pawR,
.heroCat.is-vanishing .coachCat-pawL,
.heroCat.is-vanishing .coachCat-pawR { transform: none; }
.heroCat.is-landed .coachCat-pawR {
  transform-box: fill-box;
  transform-origin: 0 100%;
  animation: heroCatPeek .6s ease .5s;
}
@keyframes heroCatPeek {
  0%, 100% { transform: none; }
  45% { transform: translateY(-5px) rotate(-16deg); }
}

/* ── Verpuffen und wieder auftauchen: kurzer heller Blitz, Funkeln am Hut ── */
.heroCat.is-vanishing .mascotCompanion-figure { animation: heroCatVanish .36s cubic-bezier(.5, 0, .8, .4) both; }
@keyframes heroCatVanish {
  0% { opacity: 1; transform: none; filter: brightness(1); }
  35% { opacity: 1; transform: translateY(1px) scale(1.08, .96); filter: brightness(1.6); }
  100% { opacity: 0; transform: translateY(-8px) scale(.2, .9) rotate(14deg); filter: brightness(2.4); }
}
.heroCat.is-returning .mascotCompanion-figure { animation: heroCatAppear .52s cubic-bezier(.2, .9, .3, 1.25) both; }
@keyframes heroCatAppear {
  0% { opacity: 0; transform: translateY(-10px) scale(.3, 1.2); filter: brightness(2.2); }
  45% { opacity: 1; filter: brightness(1.5); }
  100% { opacity: 1; transform: none; filter: brightness(1); }
}
.heroCat.is-vanishing .coachCat-sparkles,
.heroCat.is-returning .coachCat-sparkles { opacity: 1; animation: coachSparkleTwinkle .45s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .heroCat .mascotCompanion-figure,
  .heroCat .coachCat-eyeL,
  .heroCat .coachCat-eyeR,
  .heroCat .coachCat-eyes,
  .heroCat .coachCat-earL,
  .heroCat .coachCat-earR { animation: none; transition: none; }
}
