/* Works Section Styles */
:root {
    --hover-easing: cubic-bezier(0.23, 1, 0.32, 1);
    --return-easing: cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

#work {
    background-color: #BCAAA4;
    padding: 80px 0;
}

#work .section-title {
    color: #5D4037;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    font-size: 28px;
}

/* Product CTA Button (詳細/お問い合わせ) */
.product-cta {
    margin-bottom: 60px;
}

.works-container {
    padding: 0 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
    text-align: left; /* カード内のテキストは左寄せを維持 */
}

/* Card Wrapper */
.card-wrap {
    margin: 10px;
    transform: perspective(800px);
    transform-style: preserve-3d;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

/* Card Hover Effects */
.card-wrap:hover .card-info {
    transform: translateY(0);
}

.card-wrap:hover .card-info p {
    opacity: 1;
}

.card-wrap:hover .card-info,
.card-wrap:hover .card-info p {
    transition: 0.6s var(--hover-easing);
}

.card-wrap:hover .card-info:after {
    transition: 5s var(--hover-easing);
    opacity: 1;
    transform: translateY(0);
}

.card-wrap:hover .card-bg {
    transition: 
        0.6s var(--hover-easing),
        opacity 5s var(--hover-easing);
    opacity: 0.8;
}

.card-wrap:hover .card {
    transition:
        0.6s var(--hover-easing),
        box-shadow 2s var(--hover-easing);
    box-shadow:
        rgba(255, 255, 255, 0.2) 0 0 40px 5px,
        rgba(255, 255, 255, 1) 0 0 0 1px,
        rgba(0, 0, 0, 0.66) 0 30px 60px 0,
        inset #333 0 0 0 5px,
        inset white 0 0 0 6px;
}

/* Card Base */
.card {
    position: relative;
    flex: 0 0 240px;
    width: 240px;
    height: 320px;
    background-color: #333;
    overflow: hidden;
    border-radius: 10px;
    box-shadow:
        rgba(0, 0, 0, 0.66) 0 30px 60px 0,
        inset #333 0 0 0 5px,
        inset rgba(255, 255, 255, 0.5) 0 0 0 6px;
    transition: 1s var(--return-easing);
}

/* Card Background Image */
.card-bg {
    opacity: 0.5;
    position: absolute;
    top: -20px; 
    left: -20px;
    width: 100%;
    height: 100%;
    padding: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    transition:
        1s var(--return-easing),
        opacity 5s 1s var(--return-easing);
    pointer-events: none;
}

/* Card Info */
.card-info {
    padding: 20px;
    position: absolute;
    bottom: 0;
    color: #fff;
    transform: translateY(40%);
    transition: 0.6s 1.6s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.card-info p {
    opacity: 0;
    text-shadow: rgba(0, 0, 0, 1) 0 2px 3px;
    transition: 0.6s 1.6s cubic-bezier(0.215, 0.61, 0.355, 1);
    font-size: 14px;
    margin-top: 10px;
    line-height: 1.4;
}

.card-info * {
    position: relative;
    z-index: 1;
}

.card-info:after {
    content: '';
    position: absolute;
    top: 0; 
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
    background-blend-mode: overlay;
    opacity: 0;
    transform: translateY(100%);
    transition: 5s 1s var(--return-easing);
}

.card-info h1 {
    font-size: 24px;
    font-weight: 700;
    text-shadow: rgba(0, 0, 0, 0.5) 0 10px 10px;
    margin: 0;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: #333;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background-color 0.3s;
    font-size: 14px;
}

.cta-button:hover {
    background-color: #555;
}

/* Button Container for centering */
#work {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    #work {
        padding: 60px 0;
    }
    
    .works-container {
        padding: 0 20px;
    }
    
    .card {
        width: 280px;
        height: 350px;
    }
    
    .card-info h1 {
        font-size: 20px;
    }
    
    .card-info p {
        font-size: 13px;
    }
}