/* Homepage desktop pet: a lightweight, fully animated cartoon pig. */
.pig-pet-shell {
  --pig-pink: #f6a8b8;
  --pig-light: #ffd7df;
  --pig-deep: #dc7288;
  --pig-ink: #58393e;
  --look-x: 0px;
  --look-y: 0px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 170;
  width: 132px;
  height: 154px;
  pointer-events: none;
  user-select: none;
  touch-action: none;
  transition: opacity .2s ease;
}

.pig-pet-shell[hidden],
.pig-pet-summon[hidden] { display: none; }

.pig-pet-stage {
  position: absolute;
  inset: 22px 0 0;
  pointer-events: auto;
  cursor: grab;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.pig-pet-stage:focus-visible {
  outline: 3px solid rgba(15, 110, 86, .28);
  outline-offset: 3px;
  border-radius: 50%;
}

.pig-pet-shell.is-dragging .pig-pet-stage { cursor: grabbing; }

.pig-pet-close {
  position: absolute;
  top: 13px;
  right: 4px;
  z-index: 8;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(88, 57, 62, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: #745b60;
  box-shadow: 0 4px 12px rgba(65, 46, 49, .14);
  font: 600 19px/1 "Segoe UI", sans-serif;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(4px) scale(.9);
  transition: opacity .18s ease, transform .18s ease, color .18s ease;
}

.pig-pet-shell:hover .pig-pet-close,
.pig-pet-close:focus-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.pig-pet-close:hover { color: #b4445a; }
.pig-pet-close:focus-visible { outline: 3px solid rgba(15, 110, 86, .25); }

.pig-speech {
  position: absolute;
  left: 50%;
  bottom: 132px;
  width: max-content;
  max-width: min(210px, calc(100vw - 32px));
  padding: 9px 13px;
  border: 1px solid rgba(88, 57, 62, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .97);
  color: #493a3d;
  box-shadow: 0 8px 22px rgba(47, 40, 41, .14);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px) scale(.96);
  transform-origin: 50% 100%;
  transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1);
  pointer-events: none;
}

.pig-speech::after {
  content: "";
  position: absolute;
  left: calc(50% - 6px);
  bottom: -6px;
  width: 11px;
  height: 11px;
  border-right: 1px solid rgba(88, 57, 62, .1);
  border-bottom: 1px solid rgba(88, 57, 62, .1);
  background: #fff;
  transform: rotate(45deg);
}

.pig-pet-shell.is-talking .pig-speech {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.pig-ground-shadow {
  position: absolute;
  left: 23px;
  bottom: 5px;
  width: 88px;
  height: 17px;
  border-radius: 50%;
  background: rgba(39, 59, 52, .15);
  filter: blur(3px);
  animation: pig-shadow-breathe 2.8s ease-in-out infinite;
}

.pig-direction {
  position: absolute;
  inset: 0;
  transform-origin: 50% 85%;
  transition: transform .2s ease;
}

.pig-pet-shell.is-facing-left .pig-direction { transform: scaleX(-1); }

.pig-character {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 112px;
  height: 116px;
  filter: drop-shadow(0 7px 5px rgba(76, 52, 57, .12));
  transform-origin: 50% 92%;
  animation: pig-idle 2.8s ease-in-out infinite;
}

.pig-body {
  position: absolute;
  left: 23px;
  bottom: 9px;
  width: 70px;
  height: 58px;
  border: 2px solid var(--pig-ink);
  border-radius: 48% 48% 43% 43%;
  background: linear-gradient(150deg, var(--pig-light) 0%, var(--pig-pink) 75%);
}

.pig-belly {
  position: absolute;
  left: 14px;
  top: 20px;
  width: 40px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 232, 236, .48);
}

.pig-leg {
  position: absolute;
  bottom: 0;
  width: 21px;
  height: 25px;
  border: 2px solid var(--pig-ink);
  border-radius: 9px 9px 11px 11px;
  background: var(--pig-pink);
  transform-origin: 50% 0;
}

.pig-leg::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: -1px;
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: var(--pig-ink);
  opacity: .75;
}

.pig-leg-left { left: 27px; }
.pig-leg-right { right: 25px; }

.pig-arm {
  position: absolute;
  z-index: 3;
  top: 68px;
  width: 18px;
  height: 38px;
  border: 2px solid var(--pig-ink);
  border-radius: 50%;
  background: var(--pig-pink);
  transform-origin: 50% 6px;
}

.pig-arm-left { left: 18px; transform: rotate(19deg); }
.pig-arm-right { right: 17px; transform: rotate(-22deg); }

.pig-tail {
  position: absolute;
  right: 7px;
  bottom: 32px;
  width: 22px;
  height: 22px;
  border: 4px solid var(--pig-deep);
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-12deg);
}

.pig-head {
  position: absolute;
  z-index: 4;
  left: 11px;
  top: 9px;
  width: 92px;
  height: 80px;
  border: 2px solid var(--pig-ink);
  border-radius: 48% 48% 46% 46%;
  background: linear-gradient(145deg, #ffe1e6 0%, var(--pig-pink) 72%);
}

.pig-ear {
  position: absolute;
  z-index: -1;
  top: -10px;
  width: 29px;
  height: 37px;
  border: 2px solid var(--pig-ink);
  background: var(--pig-pink);
}

.pig-ear::after {
  content: "";
  position: absolute;
  inset: 7px 6px 5px;
  border-radius: 60% 50%;
  background: #e98398;
  opacity: .8;
}

.pig-ear-left {
  left: 5px;
  border-radius: 75% 30% 60% 35%;
  transform: rotate(-23deg);
}

.pig-ear-right {
  right: 5px;
  border-radius: 30% 75% 35% 60%;
  transform: rotate(23deg);
}

.pig-brow {
  position: absolute;
  top: 22px;
  width: 13px;
  height: 5px;
  border-top: 2px solid rgba(88, 57, 62, .55);
  border-radius: 50%;
  transition: transform .18s ease;
}

.pig-brow-left { left: 21px; transform: rotate(-5deg); }
.pig-brow-right { right: 21px; transform: rotate(5deg); }

.pig-eye {
  position: absolute;
  top: 30px;
  width: 11px;
  height: 14px;
  border: 2px solid var(--pig-ink);
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  animation: pig-blink 5.2s infinite;
}

.pig-eye::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 4px;
  width: 4px;
  height: 5px;
  border-radius: 50%;
  background: var(--pig-ink);
  transform: translate(var(--look-x), var(--look-y));
  transition: transform .12s linear;
}

.pig-eye-left { left: 23px; }
.pig-eye-right { right: 23px; }

.pig-cheek {
  position: absolute;
  top: 48px;
  width: 18px;
  height: 9px;
  border-radius: 50%;
  background: rgba(218, 85, 112, .27);
}

.pig-cheek-left { left: 10px; }
.pig-cheek-right { right: 10px; }

.pig-snout {
  position: absolute;
  z-index: 2;
  left: 27px;
  top: 44px;
  width: 38px;
  height: 27px;
  border: 2px solid var(--pig-ink);
  border-radius: 48%;
  background: #f28fa3;
  cursor: pointer;
  transition: transform .16s ease;
}

.pig-snout::before,
.pig-snout::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 5px;
  height: 8px;
  border-radius: 50%;
  background: #9f5262;
}

.pig-snout::before { left: 8px; }
.pig-snout::after { right: 8px; }

.pig-scarf {
  position: absolute;
  z-index: 6;
  left: 21px;
  top: 74px;
  width: 72px;
  height: 15px;
  border: 2px solid #24594b;
  border-radius: 48%;
  background: #38a47f;
  transform: rotate(-2deg);
}

.pig-scarf::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 7px;
  width: 20px;
  height: 29px;
  border: 2px solid #24594b;
  border-radius: 4px 5px 11px 5px;
  background: #2b8d6d;
  transform: rotate(-12deg);
}

.pig-pet-shell.is-happy .pig-character { animation: pig-happy .68s ease; }
.pig-pet-shell.is-happy .pig-arm-left { animation: pig-wave .55s ease 2; }
.pig-pet-shell.is-booped .pig-snout { transform: scale(.78); }
.pig-pet-shell.is-booped .pig-character { animation: pig-boop .46s ease; }
.pig-pet-shell.is-booped .pig-brow-left { transform: translateY(2px) rotate(12deg); }
.pig-pet-shell.is-booped .pig-brow-right { transform: translateY(2px) rotate(-12deg); }
.pig-pet-shell.is-dragging .pig-character { animation: pig-dangle .48s ease-in-out infinite alternate; }
.pig-pet-shell.is-dragging .pig-ground-shadow { opacity: .25; transform: scale(.7); }

.pig-pet-shell.is-walking { transition: left 2.7s linear; }
.pig-pet-shell.is-walking .pig-character { animation: pig-walk .34s ease-in-out infinite alternate; }
.pig-pet-shell.is-walking .pig-leg-left { animation: pig-step-left .34s ease-in-out infinite alternate; }
.pig-pet-shell.is-walking .pig-leg-right { animation: pig-step-right .34s ease-in-out infinite alternate; }
.pig-pet-shell.is-walking .pig-tail { animation: pig-tail-wag .3s ease-in-out infinite alternate; }

.pig-pet-shell.is-sleepy .pig-eye {
  height: 6px;
  top: 36px;
  border-width: 0 0 2px;
  border-radius: 0 0 50% 50%;
  background: transparent;
  animation: none;
}
.pig-pet-shell.is-sleepy .pig-eye::after { display: none; }
.pig-pet-shell.is-sleepy .pig-character { animation: pig-sleep 3.2s ease-in-out infinite; }

.pig-heart {
  position: absolute;
  z-index: 10;
  left: 58px;
  top: 55px;
  width: 12px;
  height: 12px;
  background: #df6079;
  transform: rotate(45deg);
  pointer-events: none;
  animation: pig-heart-rise 1.15s ease-out forwards;
}

.pig-heart::before,
.pig-heart::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: inherit;
}
.pig-heart::before { left: -6px; }
.pig-heart::after { top: -6px; }

.pig-pet-summon {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 170;
  width: 48px;
  height: 48px;
  border: 2px solid var(--pig-ink, #58393e);
  border-radius: 50%;
  background: #f6a8b8;
  box-shadow: 0 7px 18px rgba(71, 49, 54, .18);
  cursor: pointer;
  animation: pig-summon-peek 2.5s ease-in-out infinite;
}

.pig-pet-summon::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 14px;
  width: 26px;
  height: 18px;
  border: 2px solid #58393e;
  border-radius: 50%;
  background: #f28fa3;
}

.pig-pet-summon::after {
  content: "••";
  position: absolute;
  left: 15px;
  top: 12px;
  color: #9f5262;
  font: 700 15px/18px sans-serif;
  letter-spacing: 3px;
}

.pig-pet-summon:hover { transform: translateY(-3px); }
.pig-pet-summon:focus-visible { outline: 3px solid rgba(15, 110, 86, .28); outline-offset: 3px; }

@keyframes pig-idle {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-3px) rotate(.8deg); }
}
@keyframes pig-shadow-breathe {
  0%, 100% { transform: scaleX(1); opacity: .7; }
  50% { transform: scaleX(.88); opacity: .45; }
}
@keyframes pig-blink {
  0%, 44%, 48%, 82%, 86%, 100% { transform: scaleY(1); }
  46%, 84% { transform: scaleY(.08); }
}
@keyframes pig-happy {
  0%, 100% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-18px) rotate(-5deg) scale(1.04); }
  65% { transform: translateY(-6px) rotate(4deg); }
}
@keyframes pig-wave {
  0%, 100% { transform: rotate(19deg); }
  50% { transform: rotate(105deg) translateY(-4px); }
}
@keyframes pig-boop {
  0%, 100% { transform: scale(1); }
  45% { transform: scaleX(1.08) scaleY(.9) translateY(4px); }
}
@keyframes pig-dangle {
  from { transform: rotate(-3deg) translateY(-4px); }
  to { transform: rotate(3deg) translateY(-7px); }
}
@keyframes pig-walk {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-5px) rotate(2deg); }
}
@keyframes pig-step-left {
  from { transform: rotate(11deg); }
  to { transform: rotate(-11deg); }
}
@keyframes pig-step-right {
  from { transform: rotate(-11deg); }
  to { transform: rotate(11deg); }
}
@keyframes pig-tail-wag {
  from { transform: rotate(-19deg) scale(.9); }
  to { transform: rotate(10deg) scale(1.08); }
}
@keyframes pig-sleep {
  0%, 100% { transform: translateY(1px) rotate(-1deg) scaleY(.98); }
  50% { transform: translateY(3px) rotate(1deg) scaleY(1.02); }
}
@keyframes pig-heart-rise {
  0% { opacity: 0; transform: translate(0, 0) rotate(45deg) scale(.4); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--heart-x), -72px) rotate(45deg) scale(1.08); }
}
@keyframes pig-summon-peek {
  0%, 100% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-3px) rotate(-3deg); }
  55% { transform: translateY(-3px) rotate(3deg); }
}

@media (max-width: 700px) {
  .pig-pet-shell {
    transform: scale(.84);
    transform-origin: 100% 100%;
  }
  .pig-pet-close { opacity: 1; }
  .pig-speech { max-width: 170px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pig-character,
  .pig-ground-shadow,
  .pig-eye,
  .pig-pet-summon { animation: none !important; }
  .pig-pet-shell.is-walking { transition-duration: .01ms; }
}
