/* P349 - rare, non-intrusive mascot idle animation. Original art unchanged.
   Special motions are only enabled after the companion JS signals inactivity. */
.baykus-mascot[class*="bilge-p349--"] {
  isolation: isolate;
}
.baykus-mascot[class*="bilge-p349--"]::before,
.baykus-mascot[class*="bilge-p349--"]::after {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

/* Sleep: small head nod, closed-eye overlay and fleeting Zzz. */
@keyframes bilge-p349-sleep {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%, 72% { transform: translateY(2px) rotate(4deg); }
  85% { transform: translateY(1px) rotate(2deg); }
}
@keyframes bilge-p349-sleep-eye {
  0%, 94%, 100% { opacity: 0; }
  15%, 84% { opacity: 1; }
}
@keyframes bilge-p349-z {
  0%, 100% { opacity: 0; transform: translateY(5px) scale(.7); }
  25%, 65% { opacity: .9; transform: translateY(-4px) scale(1); }
  85% { opacity: 0; transform: translateY(-12px) scale(1.05); }
}
.baykus-mascot--idle.bilge-p349--sleep::after {
  content: "Zᶻ";
  right: 0;
  top: 5%;
  color: #c67c32;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(255,255,255,.8);
  animation: bilge-p349-z 4.7s ease-out both;
}

/* Glasses wipe: a tiny soft cloth sweeps over the existing lenses. */
@keyframes bilge-p349-wipe {
  0%, 100% { opacity: 0; transform: translate(-12px, 5px) rotate(-25deg) scale(.7); }
  17% { opacity: .96; }
  40% { opacity: .96; transform: translate(12px, -3px) rotate(16deg) scale(1); }
  68% { opacity: .96; transform: translate(-9px, 4px) rotate(-14deg) scale(1); }
  87% { opacity: .8; }
}
@keyframes bilge-p349-sparkle {
  0%, 65%, 100% { opacity: 0; transform: scale(.4); }
  78% { opacity: 1; transform: scale(1.15); }
}
.baykus-mascot--idle.bilge-p349--glasses::before {
  content: "✦";
  top: 23%;
  left: 67%;
  font-size: 14px;
  color: #f4b33b;
  text-shadow: 0 0 5px rgba(255,255,255,.95);
  animation: bilge-p349-sparkle 2.6s ease both;
}
.baykus-mascot--idle.bilge-p349--glasses::after {
  content: "";
  width: 16%;
  height: 13%;
  left: 47%;
  top: 34%;
  border: 1px solid #b99f7b;
  border-radius: 45% 55% 50% 45%;
  background: linear-gradient(135deg, #fff9e9 0%, #d9c4a6 90%);
  box-shadow: 0 1px 2px rgba(91,60,33,.18);
  animation: bilge-p349-wipe 2.6s ease-in-out both;
}

/* Short hovering flight: the owl leaves and returns to exactly the same place. */
@keyframes bilge-p349-flight {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  18% { transform: translate(-3px, -9px) rotate(-4deg); }
  36% { transform: translate(1px, -18px) rotate(4deg); }
  57% { transform: translate(3px, -15px) rotate(-3deg); }
  79% { transform: translate(-2px, -6px) rotate(2deg); }
}
@keyframes bilge-p349-shadow {
  0%, 100% { opacity: .85; transform: scale(1); }
  40%, 58% { opacity: .32; transform: scale(.72); }
}
.baykus-mascot--idle.bilge-p349--flight .baykus-mascot__ground {
  animation: bilge-p349-shadow 2.7s ease-in-out both;
}

/* Small floating heart, rare; no extra images or libraries. */
@keyframes bilge-p349-heart {
  0% { opacity: 0; transform: translateY(9px) scale(.3) rotate(-13deg); }
  28% { opacity: 1; transform: translateY(0) scale(1) rotate(-7deg); }
  76% { opacity: 1; transform: translateY(-13px) scale(1.08) rotate(9deg); }
  100% { opacity: 0; transform: translateY(-24px) scale(.85) rotate(13deg); }
}
.baykus-mascot--idle.bilge-p349--heart::after {
  content: "♥";
  top: 10%;
  right: 4%;
  color: #ec7080;
  font-size: 27px;
  text-shadow: 0 2px 3px rgba(116,40,46,.2);
  animation: bilge-p349-heart 2.3s ease-in-out both;
}

@media (prefers-reduced-motion: no-preference) {
  .baykus-mascot--idle.bilge-p349--sleep .baykus-mascot__art {
    animation: bilge-p349-sleep 4.7s ease-in-out both !important;
  }
  .baykus-mascot--idle.bilge-p349--sleep .baykus-mascot__wink {
    animation: bilge-p349-sleep-eye 4.7s ease-in-out both !important;
  }
  .baykus-mascot--idle.bilge-p349--glasses .baykus-mascot__wink,
  .baykus-mascot--idle.bilge-p349--flight .baykus-mascot__wink {
    opacity: 0 !important;
    animation: none !important;
  }
  .baykus-mascot--idle.bilge-p349--flight .baykus-mascot__art {
    animation: bilge-p349-flight 2.7s ease-in-out both !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .baykus-mascot[class*="bilge-p349--"]::before,
  .baykus-mascot[class*="bilge-p349--"]::after {
    display: none !important;
    animation: none !important;
  }
  .baykus-mascot[class*="bilge-p349--"] .baykus-mascot__art,
  .baykus-mascot[class*="bilge-p349--"] .baykus-mascot__wink,
  .baykus-mascot[class*="bilge-p349--"] .baykus-mascot__ground {
    animation: none !important;
    transition: none !important;
  }
}

/* Hidden launcher: replace the generic bird glyph with the existing brand owl.
   Pure CSS: React render/role/aria-label and click behavior stay unchanged. */
button[aria-label="Baykuşu göster"] > svg {
  display: none !important;
}
button[aria-label="Baykuşu göster"]::after {
  content: "";
  display: block;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  background: url("/brand/bilge-owl.png?v=2") center / contain no-repeat;
}
