@charset "UTF-8";

/* The original images remain the accessible, no-JS / no-WebGL fallback. */
.member-motion-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: transform 220ms ease;
}

.member-motion-canvas[hidden] {
  display: none;
}

.has-idle-animation > img {
  opacity: 0;
}

.member-hua .member-motion-canvas {
  transform: scaleX(-1);
}

.member-hua .portrait-button:hover .member-motion-canvas,
.member-hua .portrait-button:focus-visible .member-motion-canvas {
  transform: scaleX(-1) translateY(-6px) rotate(-1.5deg);
}

.member-yue .portrait-button:hover .member-motion-canvas,
.member-yue .portrait-button:focus-visible .member-motion-canvas {
  transform: translateY(-6px) rotate(1.5deg);
}

.pet-portrait:hover .member-motion-canvas {
  transform: translateY(-3px) rotate(-3deg);
}

.members-caption-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-caption {
  flex-wrap: wrap;
  gap: 18px 24px;
}

.stage-caption p.family-motto {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 17px;
  border: 1px solid #EDDBD3;
  border-radius: 19px;
  background: #FFF8F4;
  color: var(--ink);
  box-shadow: 0 3px 0 #EADFD633;
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: .025em;
}

.stage-caption p.family-motto > span {
  margin: 0;
  color: inherit;
}

.family-motto-badge {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
}

.family-motto-badge img {
  display: block;
  width: 24px;
  height: 24px;
}

.family-motto-text {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 7px;
  padding-block: 4px;
}

.motto-phrase {
  display: inline-flex;
  white-space: nowrap;
}

.motto-phrase:nth-child(1) { color: #8A6BA8; }
.motto-phrase:nth-child(2) { color: #C29B3D; }
.motto-phrase:nth-child(3) { color: #6F9065; }

.motto-letter {
  display: inline-block;
  transform-origin: 50% 88%;
  animation: family-letter-hop var(--motto-wave-duration, 5.7s) ease-in-out infinite both;
  animation-delay: var(--letter-delay, 0s);
}

.family-motto.is-motion-paused .motto-letter {
  animation-play-state: paused;
}

/* The complete sentence is read once, never as nineteen separate glyphs. */
.family-motto .motto-readable {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes family-letter-hop {
  0%, 6%, 100% {
    transform: translateY(0) scale(1);
    text-shadow: 0 1px 0 #FFFFFF;
  }
  2.2% {
    transform: translateY(-6px) scale(1.08, 1.05) rotate(-3deg);
    text-shadow: 0 4px 0 #EADFD680;
  }
  4.3% {
    transform: translateY(1px) scale(1.04, .94) rotate(1deg);
    text-shadow: 0 1px 0 #FFFFFF;
  }
}

@media (max-width: 760px) {
  .stage-caption p.family-motto {
    gap: 9px;
    padding: 11px 12px;
    border-radius: 16px;
    font-size: 18px;
    letter-spacing: .01em;
  }

  .family-motto-badge {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .family-motto-badge img {
    width: 22px;
    height: 22px;
  }

  .members-caption-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .member-motion-canvas {
    transition: none;
  }

  .family-motto .motto-letter {
    animation: none;
    transform: none;
    text-shadow: none;
  }
}
