/* General styles for portfolio text */ .portfolio-text { position: relative; text-align: center; cursor: pointer; /* To indicate interactivity */ } /* Styling the title */ .portfolio-title { font-size: 1.5rem; color: #333; transition: transform 0.3s ease, color 0.3s ease; /* Smooth transition for hover effect */ } /* Styling the caption */ .portfolio-caption { font-size: 1rem; color: #666; opacity: 0; /* Initially hidden */ transform: translateY(10px); /* Slight offset for animation */ transition: transform 0.3s ease, opacity 0.3s ease; /* Smooth transition */ } /* Hover effect on the parent container */ .portfolio-text:hover .portfolio-title, .portfolio-text:hover .portfolio-caption { transform: translateY(-5px); /* Move both upward slightly */ color: #000; /* Change color for emphasis */ opacity: 1; /* Show the caption */ }