  .cat-mascot-widget {
    --cat-mascot-size: 150px;
    --cat-mascot-ratio: 0.8216; /* width / height of the source image */
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }
  .cat-mascot-widget * { box-sizing: border-box; }

  .cat-mascot-widget[data-mode="fixed"] {
    position: fixed;
    right: 20px;
    bottom: 0px;
    z-index: 999999;
    pointer-events: none;
  }
  .cat-mascot-widget[data-mode="fixed"] .cat-mascot-figure {
    pointer-events: auto;
  }

  .cat-mascot-widget[data-mode="inline"] {
    position: relative;
    display: inline-block;
  }

  .cat-mascot-figure {
    position: relative;
    width: var(--cat-mascot-size);
    height: calc(var(--cat-mascot-size) / var(--cat-mascot-ratio));
    cursor: pointer;
    transform-origin: 30% 100%;
    transition: transform .18s ease;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,.28));
  }
  .cat-mascot-figure:hover { transform: translateY(-3px); }
  .cat-mascot-figure:focus-visible { outline: 3px solid #d6a94a; outline-offset: 4px; }

  .cat-mascot-figure.is-purring {
    animation: catMascotSquish .55s ease;
  }
  @keyframes catMascotSquish {
    0%   { transform: scale(1,1); }
    30%  { transform: scale(1.06,0.92) translateY(2px); }
    55%  { transform: scale(0.96,1.05) translateY(-2px); }
    80%  { transform: scale(1.02,0.99); }
    100% { transform: scale(1,1); }
  }

  .cat-mascot-img {
    display: block;
    width: 100%;
    height: 100%;
    -webkit-user-drag: none;
    user-select: none;
  }

  /* the eye center sits at 35.16% / 8.92% of the figure box */

  /* pupil: a real element that slides inside the iris toward the cursor */
  .cat-mascot-pupil {
    position: absolute;
    left: 35.16%;
    top: 8.92%;
    width: 3.4%;
    height: 5.6%;
    background: #100c08;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: transform;
  }

  .cat-mascot-glint {
    position: absolute;
    top: 14%;
    left: 20%;
    width: 42%;
    height: 32%;
    background: rgba(255,255,255,.85);
    border-radius: 50%;
  }

  /* eyelid used to fake a blink over the eye */
  .cat-mascot-eyelid {
    position: absolute;
    left: 35.16%;
    top: 8.92%;
    width: 8.5%;
    height: 6.4%;
    background: #201f1d;
    border-radius: 50%;
    transform: translate(-50%, -50%) scaleY(0);
    transform-origin: center;
    pointer-events: none;
    z-index: 2;
  }
  .cat-mascot-eyelid.is-blinking {
    animation: catMascotBlink .22s ease;
  }
  @keyframes catMascotBlink {
    0%   { transform: translate(-50%, -50%) scaleY(0); }
    45%  { transform: translate(-50%, -50%) scaleY(1); }
    100% { transform: translate(-50%, -50%) scaleY(0); }
  }

  .cat-mascot-bubble {
    position: absolute;
    top: -6%;
    left: 40%;
    background: #fff;
    color: #2b2b2b;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    padding: 5px 11px;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
    opacity: 0;
    transform: translate(0, 6px) scale(.85);
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
    white-space: nowrap;
  }
  .cat-mascot-bubble::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: -5px;
    width: 10px;
    height: 10px;
    background: #fff;
    clip-path: polygon(100% 0, 0 0, 100% 100%);
  }
  .cat-mascot-bubble.is-visible {
    opacity: 1;
    transform: translate(0, -8px) scale(1);
  }

  /* ---------- site menu ---------- */
  .cat-mascot-widget .cat-mascot-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    min-width: 168px;
    max-width: calc(100vw - 24px);
    padding: 6px;
    background: #17140f;
    color: #efe8d8;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0,0,0,.35), 0 0 0 1px rgba(214,169,74,.22);
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(.96);
    transform-origin: calc(100% - var(--cat-mascot-size) / 2) 100%;
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }
  .cat-mascot-widget.is-menu-open .cat-mascot-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .18s ease, transform .18s ease, visibility 0s;
  }
  /* inline mode: the cat sits in the flow, so anchor the menu to its left edge */
  .cat-mascot-widget[data-mode="inline"] .cat-mascot-menu {
    right: auto;
    left: 0;
    transform-origin: calc(var(--cat-mascot-size) / 2) 100%;
  }
  /* flipped below the cat when there is no room above (set by JS) */
  .cat-mascot-widget.is-menu-below .cat-mascot-menu {
    bottom: auto;
    top: calc(100% + 12px);
  }

  /* little pointer toward the cat */
  .cat-mascot-widget .cat-mascot-menu::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: calc(var(--cat-mascot-size) / 2 - 6px);
    width: 12px;
    height: 6px;
    background: #17140f;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
  }
  .cat-mascot-widget[data-mode="inline"] .cat-mascot-menu::after {
    right: auto;
    left: calc(var(--cat-mascot-size) / 2 - 6px);
  }
  .cat-mascot-widget.is-menu-below .cat-mascot-menu::after {
    bottom: auto;
    top: -6px;
    transform: scaleY(-1);
  }

  .cat-mascot-widget .cat-mascot-menu ul,
  .cat-mascot-widget .cat-mascot-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .cat-mascot-widget .cat-mascot-menu li::marker { content: ""; }
  .cat-mascot-widget .cat-mascot-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
    border: 0;
    transition: background .15s ease, color .15s ease;
  }
  .cat-mascot-widget .cat-mascot-menu a:hover,
  .cat-mascot-widget .cat-mascot-menu a:focus-visible {
    background: rgba(214,169,74,.14);
    color: #f0c766;
    text-decoration: none;
    outline: none;
  }
  .cat-mascot-widget .cat-mascot-menu a:focus-visible {
    box-shadow: inset 0 0 0 2px #d6a94a;
  }
  /* small amber dot marks the page you're on */
  .cat-mascot-widget .cat-mascot-menu a[aria-current="page"]::after {
    content: "";
    margin-left: auto;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d6a94a;
  }

  @media (max-width: 640px) {
    .cat-mascot-widget[data-mode="fixed"] { right: 12px; }
    .cat-mascot-widget[data-mode="fixed"] { --cat-mascot-size: 52px !important; }
  }

  @media (prefers-reduced-motion: reduce) {
    .cat-mascot-figure, .cat-mascot-pupil, .cat-mascot-bubble,
    .cat-mascot-widget .cat-mascot-menu, .cat-mascot-widget .cat-mascot-menu a { transition: none; }
    .cat-mascot-figure.is-purring, .cat-mascot-eyelid.is-blinking { animation: none; }
  }
