:root {
    --cover-timing: 0.8s;
    --cover-stagger: 0.1s;
    --cover-ease: cubic-bezier(0.66, 0.08, 0.19, 0.97);
    --title-stagger: 0.05s;
    --text-stagger: 0.02s;
    --text-timing: 0.6s;
    --text-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 9/12;
    display: flex;
    flex-direction: column;
    border-radius: 7px;
    box-shadow: rgba(255, 255, 255, 0.3) 0 5vw 6vw -8vw, rgba(255, 255, 255, 0) 0 4.5vw 5vw -6vw, rgba(50, 50, 80, 0.5) 0px 4vw 8vw -2vw, rgba(0, 0, 0, 0.8) 0px 4vw 5vw -3vw;
    transition: box-shadow 1s var(--cover-ease);
}

.card > * {
    z-index: 2;
}

.card > img {
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.8s cubic-bezier(0.66, 0.08, 0.19, 0.97);
}

/* Barra gris inicial con forma de flecha como la imagen */
.card::before {
    content: "";
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 75%;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    z-index: 3;
    clip-path: polygon(0 0, calc(100% - 25px) 0, 100% 50%, calc(100% - 25px) 100%, 0 100%);
    transition: all var(--cover-timing) var(--cover-ease);
}

/* Overlay de expansión completa */
.card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    z-index: 3;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: all var(--cover-timing) var(--cover-ease);
}

/* Contenedor del ícono y texto */
.overlay-content {
    position: absolute;
    bottom: 21px;
    left: 15px;
    display: flex;
    align-items: center;
    z-index: 4;
    transition: all var(--cover-timing) var(--cover-ease);
}

.paint-icon {
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.paint-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.overlay-text {
    color: white;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
    line-height: 1.1;
}

.card:hover::before,
.card:focus::before {
    opacity: 0;
}

.card:hover::after,
.card:focus::after {
    transform: scaleY(1);
}

.card:hover .overlay-content,
.card:focus .overlay-content {
    top: 30px;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, 0);
    flex-direction: column;
    text-align: center;
}

.card:hover .paint-icon,
.card:focus .paint-icon {
    width: 50px;
    height: 50px;
    margin-right: 0;
    margin-bottom: 12px;
}

.card:hover .paint-icon img,
.card:focus .paint-icon img {
    width: 28px;
    height: 28px;
}

.card:hover .overlay-text,
.card:focus .overlay-text {
    font-size: 20px;
    letter-spacing: 2px;
}

.card:hover,
.card:focus {
    box-shadow: white 0 5vw 6vw -9vw, var(--highlight) 0 5.5vw 5vw -7.5vw, rgba(50, 50, 80, 0.5) 0px 4vw 8vw -2vw, rgba(0, 0, 0, 0.8) 0px 4vw 5vw -3vw;
}

.card:hover h2 .char,
.card:hover p .word,
.card:focus h2 .char,
.card:focus p .word {
    opacity: 1;
    transform: translateY(0);
    color: inherit;
}

.card:hover h2 .char,
.card:focus h2 .char {
    transition-delay: calc(0.1s + var(--char-index) * var(--title-stagger));
}

.card:hover p .word,
.card:focus p .word {
    transition-delay: calc(0.1s + var(--word-index) * var(--text-stagger));
}

.card:hover img,
.card:focus img {
    transform: scale(1.1);
}

.card:nth-of-type(1) {
    --highlight: coral;
}

.card:nth-of-type(2) {
    --highlight: #56ffe5;
}

.text {
    position: absolute;
    inset: 20px;
    top: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--cover-timing) var(--cover-ease);
    z-index: 5;
    color: white;
    font-size: 16px;
    text-align: justify !important;
}

.card:hover .text,
.card:focus .text {
    opacity: 1;
    transform: translateY(0);
    top: 140px;
    text-align: center;
}

/* Botón Ver Más */
.btn-ver-mas {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #b60b0b 0, #fb1f1d 45.72%, #b60b0b 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: all 0.6s ease;
    z-index: 6;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

.btn-ver-mas:hover {
    background: linear-gradient(135deg, #fb1f1d 0, #b60b0b 45.72%, #fb1f1d 100%);
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.card:hover .btn-ver-mas,
.card:focus .btn-ver-mas {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0.3s;
}

h2 .char,
p .word {
    color: var(--highlight);
    display: inline-block;
    opacity: 0;
    position: relative;
    transform: translateY(20px);
    transition-property: transform, opacity, color;
    transition-timing-function: var(--text-ease);
    transition-duration: var(--text-timing), var(--text-timing), calc(var(--text-timing)*2);
}

main {
    display: grid;
    grid-auto-flow: column;
    column-gap: 10px;
    justify-content: center;
    bottom: 50px;
    position: relative;
}

.card {
    width: 90vw;
    max-width: 370px;
}

@media screen and (min-width: 600px) {
    .card {
        width: 40vw;
    }
}

@media screen and (min-width: 600px) {
    h1 {
        grid-column: 1/3;
    }
}