/* Gallery Morph Section Styles - Scroll Animation Version */

/* Override white title/line for the gallery section's white background */
#section1 .section-title-vertical {
    color: #111;
    text-shadow: none;
}

#section1 .section-title-vertical:after {
    background-color: #111;
}

.gallery-morph-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #0d0d0d;
    overflow: hidden;
}

/* Intro Text (Fades out during scroll) */
.morph-intro-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease, filter 0.5s ease;
    pointer-events: none;
}

.morph-intro-text.fade-out {
    opacity: 0;
    filter: blur(10px);
}

.section-heading-light {
    color: #fff;
}

.morph-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 1rem;
}

/* Arc Active Content (Fades in after morph) */
.morph-active-content {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    padding: 0 20px;
}

.morph-active-content.fade-in {
    opacity: 1;
}

.morph-subtitle-active {
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Morphing Cards Container */
.morph-cards-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    perspective: 1000px;
}

/* Individual Morphing Card */
.morph-card {
    position: absolute;
    width: 60px;
    height: 85px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

.morph-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.morph-card:hover .morph-card-inner {
    transform: rotateY(180deg);
}

/* Card Front and Back */
.morph-card-front,
.morph-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.morph-card-front {
    background-color: #e5e5e5;
}

.morph-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.morph-card-front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}

.morph-card:hover .morph-card-front::after {
    background: rgba(0, 0, 0, 0);
}

.morph-card-back {
    background: #111;
    transform: rotateY(180deg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.morph-card-back-label {
    font-size: 8px;
    color: #60a5fa;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.morph-card-back-title {
    font-size: 10px;
    color: #ffffff;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
}

/* Animation States */
.morph-card.phase-scatter {
    opacity: 0;
}

.morph-card.phase-line,
.morph-card.phase-circle,
.morph-card.phase-arc {
    opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .morph-card {
        width: 50px;
        height: 70px;
    }
    
    .morph-intro-text h2,
    .morph-active-content h2 {
        font-size: 1.5rem;
    }
    
    .morph-subtitle,
    .morph-subtitle-active {
        font-size: 11px;
    }
}

/* Smooth transitions for all cards */
.morph-card {
    transition: 
        transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.5s ease,
        left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        top 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* User prevented from selecting text during animations */
.gallery-morph-container {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

