/* Isilumko "Lumo" owl mascot - styles. Tweak the custom properties below, or override them from your own CSS. */
.owl-mascot {
  --owl-size: clamp(170px, 18vw, 270px);        /* width of the owl */
  --owl-right: 16px;
  --owl-bottom: 6px;
  --owl-z: 9999;

  --owl-bubble-bg: #ffffff;
  --owl-bubble-ink: #2d1f18;
  --owl-bubble-border: rgba(122, 10, 34, 0.14);  /* Isilumko maroon, very light */
  --owl-bubble-shadow: 0 10px 30px -8px rgba(45, 25, 15, 0.28), 0 2px 6px rgba(45, 25, 15, 0.1);
  --owl-bubble-font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  position: fixed;
  right: var(--owl-right);
  bottom: var(--owl-bottom);
  z-index: var(--owl-z);
  width: var(--owl-size);
  pointer-events: none;            /* the owl never blocks clicks on the page (only its body reacts to a poke) */
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.owl-mascot.is-ready { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .owl-mascot { --owl-size: clamp(120px, 34vw, 160px); --owl-right: 8px; }
}

/* ---- the owl ---- */
.owl-walker { position: relative; width: 100%; will-change: transform; }       /* moved sideways by the script when it walks */
.owl-stage { position: relative; width: 100%; aspect-ratio: var(--owl-aspect, 0.668); }
.owl-flip, .owl-rock, .owl-bounce, .owl-breath { position: absolute; inset: 0; }
.owl-rock { transform-origin: 50% 96%; }                                        /* waddle / wave sway */
.owl-bounce { transform-origin: 50% 100%; }                                     /* hops, squash & stretch */
.owl-breath { transform-origin: 50% 100%; animation: owl-breathe 4.6s ease-in-out infinite; }
.owl-rig { position: absolute; inset: 0; transition: opacity 0.4s ease; }
.owl-rig.is-hidden { opacity: 0; }
.owl-body { position: absolute; inset: 0; transform-origin: 50% 100%; will-change: transform; }
.owl-pose, .owl-eye, .owl-headimg { position: absolute; display: block; max-width: none; -webkit-user-drag: none; pointer-events: none; }
.owl-pose { visibility: hidden; }                                               /* only the current pose frame is shown */
.owl-pose.is-on { visibility: visible; }
.owl-headact { position: absolute; }
.owl-head { position: absolute; inset: 0; will-change: transform; }
.owl-headvar { position: absolute; inset: 0; visibility: hidden; }              /* one per expression (rest, open beak, happy ...) */
.owl-headvar.is-on { visibility: visible; }
.owl-headimg { inset: 0; width: 100%; height: 100%; }
.owl-eye { will-change: transform; }
.owl-shadow {
  position: absolute; left: 14%; right: 14%; bottom: -2.5%; height: 6%;
  background: radial-gradient(closest-side, rgba(40, 24, 14, 0.28), rgba(40, 24, 14, 0));
  filter: blur(2px);
}
/* clickable area (an ellipse over the owl) */
.owl-hit {
  position: absolute; left: 14%; top: 8%; width: 72%; height: 90%;
  border-radius: 46%; pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
@keyframes owl-breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.003, 1.01); }
}

/* ---- speech bubble ---- */
.owl-bubble-pos {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2%);
  width: max-content;
  max-width: min(270px, calc(100vw - 24px));
  transform: translateX(calc(-50% + var(--owl-bshift, 0px)));     /* centred over the head, nudged back on screen near the edges */
  pointer-events: none;
}
.owl-bubble {
  position: relative;
  padding: 11px 15px 12px;
  background: var(--owl-bubble-bg);
  color: var(--owl-bubble-ink);
  font: var(--owl-bubble-font);
  border: 1px solid var(--owl-bubble-border);
  border-radius: 18px;
  box-shadow: var(--owl-bubble-shadow);
  transform-origin: calc(50% - var(--owl-bshift, 0px)) 100%;      /* grows out of the tail, above the owl's head */
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.26s ease-out, transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-wrap: anywhere;
}
.owl-bubble[hidden] { display: none; }
.owl-bubble.is-visible { opacity: 1; transform: none; }
.owl-bubble.is-leaving { opacity: 0; transform: translateY(4px) scale(0.97); transition: opacity 0.42s ease-in, transform 0.42s ease-in; }

/* tail pointing at the owl's head */
.owl-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: calc(50% - 7px - var(--owl-bshift, 0px));
  width: 14px; height: 14px;
  background: var(--owl-bubble-bg);
  border-right: 1px solid var(--owl-bubble-border);
  border-bottom: 1px solid var(--owl-bubble-border);
  border-bottom-right-radius: 4px;
  transform: rotate(45deg);
}

/* the invisible full text sets the bubble's final size; the typed text is laid on top of it */
.owl-bubble__text { display: grid; }
.owl-bubble__ghost, .owl-bubble__typed { grid-area: 1 / 1; white-space: pre-wrap; }
.owl-bubble__ghost { visibility: hidden; }
.owl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* dark sites: add data-theme="dark" to the .owl-mascot element, or set the --owl-bubble-* variables yourself */
.owl-mascot[data-theme="dark"] { --owl-bubble-bg: #2b211c; --owl-bubble-ink: #f7ebe2; --owl-bubble-border: rgba(255, 255, 255, 0.12); }

@media (prefers-reduced-motion: reduce) {
  .owl-breath { animation: none; }
  .owl-rig { transition: none; }
  .owl-mascot, .owl-bubble, .owl-bubble.is-leaving { transition-duration: 0.01s; }
}
