CSS
.card-stack {
position: relative;
width: 200px;
}
.card-stack::before,
.card-stack::after {
content: "";
position: absolute;
border-radius: 12px;
transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}
.card-stack::before {
background: #d6c9ff;
width: 100%;
height: 100%;
top: 8px;
left: 6px;
z-index: 0;
}
.card-stack::after {
background: #ffc8d6;
width: 100%;
height: 100%;
top: 4px;
left: 3px;
z-index: 0;
}
.card-stack:hover::before {
transform: translate(4px, 6px) rotate(3deg);
}
.card-stack:hover::after {
transform: translate(-3px, 4px) rotate(-2deg);
}
.stack-main {
position: relative;
z-index: 1;
background: #fff;
border-radius: 12px;
padding: 20px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.stack-main h4 {
font-size: 13px;
font-weight: 700;
color: #1a1a2e;
margin-bottom: 4px;
}
.stack-main p {
font-size: 11px;
color: #b8b6d4;
line-height: 1.5;
margin-bottom: 12px;
}
.stack-btn {
font-size: 11px;
padding: 5px 14px;
border-radius: 6px;
background: #1a1a2e;
color: #fff;
border: none;
cursor: pointer;
}
/* parent stage backdrop (so the demo renders standalone) */
[class^="stage-"] {
width: 100%;
min-height: 200px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
padding: 2.5rem 1.5rem;
box-sizing: border-box;
}
.stage-7 {
background: #f5f3ee;
}