/* ==========================================================================
   Mascot (recruiter view only)
   Additive file: every selector is prefixed `mascot`, except the one hero
   spacing rule at the bottom. Behaviour lives in assets/js/mascot.js.
   Sprite sheets: two 3×3 grids (directions + reactions), cell = row-major index.
   Based on page-mascot by Kamran Ahmed (MIT): https://github.com/nilbuild/page-mascot
   ========================================================================== */

/* --- Header: avatar badge (replaces the "A" monogram tile) ---------------- */
/* Head-only crops (120px = 3× of 40px) made from source/abdul-*.webp, so the
   header doesn't load the 72 KB sheets. Hovering the brand shows the delighted face. */
.mascot-static {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 32%, #ffffff, #dde7f8);
  box-shadow: inset 0 0 0 1px rgba(30, 95, 204, 0.2), 0 6px 14px -8px rgba(18, 20, 23, 0.45);
}
.mascot-static::before,
.mascot-static::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/mascot/abdul-badge.webp") center / 100% 100% no-repeat;
}
.mascot-static::after {
  background-image: url("../img/mascot/abdul-badge-delighted.webp");
  opacity: 0;
}
.rv-brand:hover .mascot-static::before {
  opacity: 0;
}
.rv-brand:hover .mascot-static::after {
  opacity: 1;
}

/* Phones (≤640px, where the site switches to its mobile header): the badge
   stays hidden while the hero mascot is on screen and slides in once it
   scrolls away. mascot.js toggles .mascot-away; this rule only applies here. */
@media (max-width: 640px) {
  .rv-brand.mascot-ready .mascot-static {
    transition: width 320ms var(--ease-out, ease), opacity 260ms ease, transform 320ms var(--ease-out, ease),
      margin 320ms var(--ease-out, ease);
  }
  .rv-brand.mascot-away .mascot-static,
  /* before the first check (set by the inline <head> script) — prevents a flash */
  .mascot-js .rv-brand:not(.mascot-ready) .mascot-static {
    width: 0;
    opacity: 0;
    transform: scale(0.4);
    margin-right: -11px; /* cancels .rv-brand's 11px gap so the name sits flush */
  }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  .rv-brand.mascot-ready .mascot-static {
    transition: none;
  }
}

/* --- Hero: interactive (follows the cursor, reacts when clicked) ---------- */
.mascot {
  position: relative;
  display: block;
  flex: none;
  align-self: flex-start;
  width: 96px;
  height: 96px;
  margin: 0 0 8px -18px; /* optical alignment: the face sits inside padded cells */
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.mascot:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.mascot__layer {
  position: absolute;
  inset: 0;
  background-size: 300% 300%;
  background-repeat: no-repeat;
  background-position: 50% 50%;
  pointer-events: none;
}
.mascot__layer--directions {
  background-image: url("../img/mascot/abdul-directions.webp");
}
.mascot__layer--reactions {
  background-image: url("../img/mascot/abdul-reactions.webp");
  opacity: 0;
}
.mascot.is-reacting .mascot__layer--directions {
  opacity: 0;
}
.mascot.is-reacting .mascot__layer--reactions {
  opacity: 1;
}

/* --- Hero: location line moved below the role ---------------------------- */
.rv-hero__role + .rv-kicker {
  margin-top: 16px;
}
