/* Tea & Biscuits — deliberately simple website pet */

.biscuit--pet .biscuit__face {
  font-size: 2rem;
}

.website-pet-choice {
  position: fixed;
  right: 22px;
  bottom: 112px;
  z-index: 56;

  width: min(330px, calc(100vw - 32px));
  padding: 18px;

  color: #243f35;
  background: #fffaf0;

  border: 2px solid #b58b48;
  border-radius: 16px;

  box-shadow: 0 12px 30px rgb(31 24 15 / 24%);
}

.website-pet-choice::after {
  content: "";
  position: absolute;
  right: 42px;
  bottom: -12px;

  width: 20px;
  height: 20px;

  background: #fffaf0;
  border-right: 2px solid #b58b48;
  border-bottom: 2px solid #b58b48;
  transform: rotate(45deg);
}

.website-pet-choice h2 {
  margin: 0 0 7px;

  color: #243f35;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.website-pet-choice p {
  margin: 0;
  color: #564a3d;
  font-size: 0.92rem;
  line-height: 1.45;
}

.website-pet-choice__actions {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}

.website-pet-choice button {
  min-height: 44px;
  padding: 0 14px;

  color: white;
  background: #315348;

  border: 2px solid #9d7840;
  border-radius: 10px;

  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.website-pet-choice button:hover {
  background: #243f35;
}

.website-pet-choice button:focus-visible {
  outline: 3px solid #587940;
  outline-offset: 3px;
}

.website-pet {
  --pet-coat: #b9783e;
  --pet-dark: #5a351f;
  position: fixed;
  right: 28px;
  bottom: 10px;
  z-index: 55;
  width: 112px;
  height: 94px;
  padding: 0;
  border: 0;
  appearance: none;
  color: inherit;
  background: transparent;
  opacity: 0;
  pointer-events: auto;
  user-select: none;
  cursor: pointer;
  transform: translateY(24px);
  transition:
    left 4.2s ease-in-out,
    opacity 280ms ease,
    transform 280ms ease;
}

.website-pet:focus-visible {
  outline: 3px solid #efd095;
  outline-offset: 4px;
  border-radius: 18px;
}

.website-pet.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.website-pet.is-arriving {
  transition:
    left 1.5s ease-out,
    opacity 280ms ease,
    transform 280ms ease;
}

.website-pet.is-scurrying {
  transition:
    left 1.5s ease-out,
    opacity 280ms ease,
    transform 280ms ease;
}

.website-pet.is-retreating {
  transition:
    left 1.8s ease-in,
    opacity 280ms ease,
    transform 280ms ease;
}

.website-pet__body {
  position: absolute;
  left: 31px;
  bottom: 14px;
  width: 66px;
  height: 48px;
  border: 3px solid var(--pet-dark);
  border-radius: 48% 52% 38% 42%;
  background: var(--pet-coat);
  transition:
    bottom 260ms ease,
    height 260ms ease;
}

.website-pet__head {
  position: absolute;
  left: 9px;
  bottom: 29px;
  width: 51px;
  height: 48px;
  border: 3px solid var(--pet-dark);
  border-radius: 48% 48% 44% 44%;
  background: var(--pet-coat);
  transition: bottom 260ms ease;
}

.website-pet__head::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 25px;
  width: 27px;
  height: 18px;
  border-radius: 50%;
  background: #dca56e;
  transform: translateX(-50%);
}

.website-pet__ear {
  position: absolute;
  top: -13px;
  width: 19px;
  height: 26px;
  border: 3px solid var(--pet-dark);
  background: var(--pet-coat);
}

.website-pet__ear--left {
  left: 0;
  border-radius: 70% 30% 65% 35%;
  transform: rotate(-18deg);
}

.website-pet__ear--right {
  right: 0;
  border-radius: 30% 70% 35% 65%;
  transform: rotate(18deg);
}

.website-pet__eye {
  position: absolute;
  top: 19px;
  width: 5px;
  height: 6px;
  border-radius: 50%;
  background: #171717;
  transform-origin: center;
  animation: pet-blink 5.8s ease-in-out infinite;
}

.website-pet__eye--left { left: 13px; }
.website-pet__eye--right { right: 13px; }

.website-pet__nose {
  position: absolute;
  left: 50%;
  top: 31px;
  width: 8px;
  height: 6px;
  border-radius: 50% 50% 60% 60%;
  background: var(--pet-dark);
  transform: translateX(-50%);
  z-index: 1;
}

.website-pet__tail {
  position: absolute;
  right: 2px;
  bottom: 42px;
  width: 38px;
  height: 16px;
  border: 6px solid var(--pet-dark);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 30px 0 0;
  transform-origin: left bottom;
  animation: pet-tail 2.6s ease-in-out infinite;
}

.website-pet__legs {
  position: absolute;
  left: 44px;
  bottom: 4px;
  width: 43px;
  height: 18px;
  border-right: 8px solid var(--pet-dark);
  border-left: 8px solid var(--pet-dark);
  border-radius: 0 0 8px 8px;
  opacity: 1;
  transition:
    opacity 180ms ease,
    transform 260ms ease;
}

.website-pet:not(.is-walking) .website-pet__body {
  animation: pet-breathe 3.8s ease-in-out infinite;
}

.website-pet:not(.is-walking) .website-pet__ear--right {
  animation: pet-ear-twitch 7.2s ease-in-out infinite;
}

.website-pet--cat {
  --pet-coat: #7d8790;
  --pet-dark: #3e4952;
}

.website-pet--cat .website-pet__ear {
  top: -15px;
  width: 20px;
  height: 22px;
  border-radius: 4px 90% 4px 45%;
}

.website-pet--cat .website-pet__head::before {
  top: 35px;
  width: 28px;
  height: 1px;
  border-radius: 0;
  background: #3e4952;
  box-shadow:
    -2px -4px 0 -0.25px #3e4952,
    2px 4px 0 -0.25px #3e4952;
}

.website-pet--cat .website-pet__nose {
  top: 30px;
  width: 7px;
  height: 6px;
  border-radius: 60% 60% 45% 45%;
  background: #d7a0a1;
}

.website-pet--cat .website-pet__tail {
  right: -1px;
  bottom: 33px;
  width: 25px;
  height: 48px;
  border-width: 7px;
  border-radius: 0 26px 0 0;
  animation: pet-cat-tail 3.8s ease-in-out infinite;
}

.website-pet.is-facing-right {
  transform: scaleX(-1);
}

.website-pet.is-facing-right.is-visible {
  transform: scaleX(-1) translateY(0);
}

.website-pet.is-walking .website-pet__body {
  animation: pet-bob 420ms ease-in-out infinite alternate;
}

.website-pet.is-walking .website-pet__legs {
  animation: pet-steps 360ms ease-in-out infinite alternate;
}

.website-pet.is-resting .website-pet__body {
  height: 35px;
  bottom: 8px;
}

.website-pet.is-resting .website-pet__head {
  bottom: 13px;
}

.website-pet.is-resting .website-pet__legs {
  opacity: 0;
  transform: translateY(6px);
}

.website-pet.is-sleeping {
  cursor: pointer;
}

.website-pet.is-sleeping .website-pet__eye {
  height: 3px;
  border-radius: 0 0 50% 50%;
  animation: none;
  transform: scaleY(.45);
}

.website-pet.is-sleeping .website-pet__tail {
  animation-play-state: paused;
}

.website-pet.is-sleeping .website-pet__body {
  animation: pet-sleep-breathe 5.2s ease-in-out infinite;
}

.website-pet--cat.is-seeking-attention .website-pet__body {
  height: 42px;
  bottom: 11px;
}

.website-pet--cat.is-seeking-attention .website-pet__head {
  bottom: 25px;
  transform: rotate(-3deg);
}

.website-pet--cat.is-seeking-attention .website-pet__eye {
  animation: none;
  transform: scaleY(1);
}

.website-pet--cat.is-seeking-attention .website-pet__tail {
  animation-duration: 1.5s;
}

@keyframes pet-tail {
  50% { transform: rotate(13deg); }
}

@keyframes pet-cat-tail {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(9deg); }
}

@keyframes pet-blink {
  0%, 43%, 47%, 100% { transform: scaleY(1); }
  45% { transform: scaleY(0.12); }
}

@keyframes pet-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}

@keyframes pet-sleep-breathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(1px) scaleY(.97); }
}

@keyframes pet-ear-twitch {
  0%, 86%, 90%, 94%, 100% { transform: rotate(18deg); }
  88%, 92% { transform: rotate(27deg); }
}

@keyframes pet-bob {
  to { transform: translateY(-3px); }
}

@keyframes pet-steps {
  to { transform: skewX(16deg); }
}

@media (max-width: 700px) {
  .website-pet-choice {
    right: 12px;
    bottom: 76px;
  }

  .website-pet-choice__actions {
    display: grid;
  }

  .website-pet {
    right: 12px;
    bottom: 4px;
    width: 76px;
    transform: scale(.64) translateY(24px);
    transform-origin: bottom right;
  }

  .website-pet.is-visible {
    transform: scale(.64) translateY(0);
  }

  .website-pet.is-facing-right.is-visible {
    transform: scaleX(-1) scale(.64) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .website-pet-choice,
  .website-pet,
  .website-pet * {
    animation: none !important;
    transition: opacity 160ms ease !important;
  }
}
