/* Overlap Grid Configuration */
.skills-grid-home.overlap-deck {
    position: relative;
    z-index: 10;
    margin-top: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 2rem !important;
    max-width: 1120px !important;
    margin: 0 auto !important;
    width: 100% !important;
}

.skills-deck-frame {
    position: relative;
    width: 100%;
}

.deck-label {
    display: none;
}

.deck-axis {
    display: none;
}

/* Glassmorphic Cards with Custom High-End Styling */
.skills-grid-home.overlap-deck .skill-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-radius: 1.25rem !important;
    padding: 2.2rem 1.8rem 3.4rem !important; /* Increased padding-bottom from 2rem to 3.4rem to prevent text truncation by clip-path */
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    width: 320px !important;
    height: 330px !important; /* Flat card look - standby height 330px to comfortably fit points on hover */
    overflow: hidden !important;
    transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 600ms ease, 
                box-shadow 600ms ease, 
                background-color 600ms ease,
                height 600ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.skills-grid-home.overlap-deck .skill-card-shell {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    transition: transform 180ms ease-out;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Hover Growth State */
.skills-grid-home.overlap-deck .skill-card:hover,
.skills-grid-home.overlap-deck .skill-card.is-active {
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 30px 65px rgba(0, 0, 0, 0.75) !important;
    height: 400px !important;
    padding-bottom: 1.8rem !important;
}

/* Custom Bulletless List items (Flow layout, avoids overlay bugs) */
.skills-grid-home.overlap-deck .skill-card .skill-points {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    transition: opacity 350ms ease,
                max-height 500ms cubic-bezier(0.16, 1, 0.3, 1),
                margin-top 500ms cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none !important;
    width: 100% !important;
}

.skills-grid-home.overlap-deck .skill-card:hover .skill-points,
.skills-grid-home.overlap-deck .skill-card.is-active .skill-points {
    opacity: 1 !important;
    max-height: 250px !important;
    margin-top: 0.8rem !important; /* Reduced margin to fit cleanly in 330px height */
    pointer-events: auto !important;
}

.skills-grid-home.overlap-deck .skill-card .skill-points li {
    position: relative !important;
    padding-left: 0.95rem !important;
    margin-bottom: 0.35rem !important; /* Tighter margins */
    font-size: 0.75rem !important;
    line-height: 1.45 !important; /* Tight line height for elegance and space saving */
    color: rgba(255, 255, 255, 0.55) !important;
    letter-spacing: 0.03em !important;
}

.skills-grid-home.overlap-deck .skill-card .skill-points li::before {
    content: "? !important;
    position: absolute !important;
    left: 0 !important;
    color: rgba(16, 185, 129, 0.9) !important; /* Unified bullet color to Card 1's emerald green */
    opacity: 0.85 !important;
    font-weight: bold !important;
    font-size: 0.9rem !important;
    top: -1px !important;
}

/* Custom Card Keyword Styling */
.skills-grid-home.overlap-deck .skill-card .card-keyword {
    font-family: var(--font-ui), monospace !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.15em !important;
    color: rgba(16, 185, 129, 0.8) !important; /* Unified keyword styling to Card 1's emerald green on mobile */
    margin-top: 1rem !important;
    text-transform: uppercase !important;
    opacity: 0.8 !important;
    max-height: 40px !important;
    overflow: hidden !important;
    transition: opacity 300ms ease,
                max-height 450ms cubic-bezier(0.16, 1, 0.3, 1),
                margin-top 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.skills-grid-home.overlap-deck .skill-card:hover .card-keyword,
.skills-grid-home.overlap-deck .skill-card.is-active .card-keyword {
    opacity: 0 !important;
    max-height: 0 !important;
    margin-top: 0 !important;
}

/* Card top transitions */
.skills-grid-home.overlap-deck .skill-card .skill-card-top,
.skills-grid-home.overlap-deck .skill-card h3,
.skills-grid-home.overlap-deck .skill-card .skill-divider {
    transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.skills-grid-home.overlap-deck .skill-card:hover .skill-card-top,
.skills-grid-home.overlap-deck .skill-card.is-active .skill-card-top {
    opacity: 0.5 !important;
    margin-bottom: 1rem !important;
}

/* ================= Individual Card Distinct Themes with Backgrounds ================= */

/* Card 1: Emerald Precision Theme */
.overlap-deck .skill-card-1 {
    background-image: linear-gradient(180deg, rgba(16, 30, 24, 0.25) 0%, rgba(8, 8, 8, 0.9) 100%), url('assets/images/skills_left.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    border: 1px solid rgba(16, 185, 129, 0.12) !important;
    box-shadow: 0 30px 65px rgba(0, 0, 0, 0.65) !important;
}

.overlap-deck .skill-card-1:hover {
    border-color: rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.1), 0 30px 70px rgba(0, 0, 0, 0.85) !important;
}

.overlap-deck .skill-card-1 .skill-card-no {
    color: rgba(16, 185, 129, 0.8) !important;
}

.overlap-deck .skill-card-1 .skill-divider {
    background: rgba(16, 185, 129, 0.35) !important;
}

.overlap-deck .skill-card-1 .skill-card-icon {
    color: rgba(16, 185, 129, 0.8) !important;
}

/* Card 2: Golden Sand Engine Theme (Featured) - Unified to Emerald Green */
.overlap-deck .skill-card-2 {
    background-image: linear-gradient(180deg, rgba(38, 32, 24, 0.3) 0%, rgba(8, 8, 8, 0.9) 100%), url('assets/images/skills_center.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    border: 1px solid rgba(16, 185, 129, 0.12) !important;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.02), 0 30px 65px rgba(0, 0, 0, 0.7) !important;
}

.overlap-deck .skill-card-2:hover {
    border-color: rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 0 45px rgba(16, 185, 129, 0.16), 0 30px 75px rgba(0, 0, 0, 0.88) !important;
}

.overlap-deck .skill-card-2 .skill-card-no {
    color: rgba(16, 185, 129, 0.8) !important;
    text-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.overlap-deck .skill-card-2 .skill-divider {
    background: rgba(16, 185, 129, 0.35) !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.overlap-deck .skill-card-2 .skill-card-icon {
    color: rgba(16, 185, 129, 0.8) !important;
}

/* Card 3: Cinematic Amber Crimson Theme - Unified to Emerald Green */
.overlap-deck .skill-card-3 {
    background-image: linear-gradient(180deg, rgba(42, 18, 18, 0.25) 0%, rgba(8, 8, 8, 0.9) 100%), url('assets/images/skills_right.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    border: 1px solid rgba(16, 185, 129, 0.12) !important;
    box-shadow: 0 30px 65px rgba(0, 0, 0, 0.65) !important;
}

.overlap-deck .skill-card-3:hover {
    border-color: rgba(16, 185, 129, 0.4) !important;
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.1), 0 30px 70px rgba(0, 0, 0, 0.85) !important;
}

.overlap-deck .skill-card-3 .skill-card-no {
    color: rgba(16, 185, 129, 0.8) !important;
}

.overlap-deck .skill-card-3 .skill-divider {
    background: rgba(16, 185, 129, 0.35) !important;
}

.overlap-deck .skill-card-3 .skill-card-icon {
    color: rgba(16, 185, 129, 0.8) !important;
}

.overlap-deck .skill-card-3::after {
    content: "REC [●]";
    position: absolute;
    top: 2.1rem;
    right: 2.1rem;
    font-family: var(--font-ui), monospace;
    font-size: 0.52rem;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.25);
    transition: color 350ms ease;
}

.overlap-deck .skill-card-3:hover::after {
    color: #ff3333;
    animation: pulseRed 1s ease-in-out infinite alternate;
}

@keyframes pulseRed {
    from { opacity: 0.6; }
    to { opacity: 1; text-shadow: 0 0 8px rgba(255, 51, 51, 0.7); }
}

/* ==========================================================================
   Responsive Refinements & 3D Styling
   ========================================================================== */

/* Desktop Landscape View: 3D Curved Cylindrical Deck */
@media (min-width: 900px) {
    .about-layout-new {
        display: block !important;
        width: 100%;
    }

    .about-manifesto {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2.2rem !important;
        width: 100% !important;
        max-width: 1360px !important;
        margin: 0 auto !important;
        padding: 2.5rem 5.5rem !important;
    }

    .manifesto-copy {
        max-width: 48rem !important;
        margin: 0 auto !important;
    }

    .about-right-new {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }

    .skills-header-new {
        text-align: center !important;
        margin-bottom: 1.2rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* 3D Cylindrical Deck Configuration: Wide movie layout that stretches across the screen */
    .skills-grid-home.overlap-deck {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: flex-start !important;
        flex-wrap: nowrap !important;
        gap: 0.75rem !important; /* Tight gaps for panoramic layout */
        perspective: 2200px !important;
        transform-style: preserve-3d !important;
        padding: 0 4.6rem 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 22.5rem !important; /* Adjusted to fit the 330px cards beautifully */
    }

    .skills-deck-frame {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        position: relative !important;
        left: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .skills-deck-frame::before {
        display: none !important;
    }

    .skills-deck-frame::after {
        display: none !important;
    }

    .deck-label {
        display: none !important;
    }

    .deck-label-left {
        left: 2rem;
    }

    .deck-label-right {
        right: 1.35rem;
        top: 2.6rem;
        transform: rotate(90deg);
        transform-origin: top right;
        color: rgba(255, 255, 255, 0.4);
    }

    .deck-axis {
        display: none !important;
    }

    .skills-grid-home.overlap-deck .skill-card {
        width: 31vw !important;
        max-width: 480px !important;
        min-width: 300px !important;
        height: 330px !important; /* Standby height 330px */
        padding: 1.6rem 1.4rem 3.2rem !important; /* Increased padding-bottom to 3.2rem to push texts above bottom curved clip-path */
        border-radius: 0.15rem !important;
        margin: 0 !important;
        opacity: 0.85 !important;
        filter: brightness(0.9) blur(0) saturate(0.95) !important;
        transition: transform 650ms cubic-bezier(0.16, 1, 0.3, 1), 
                    border-color 650ms ease, 
                    box-shadow 650ms ease, 
                    filter 650ms cubic-bezier(0.16, 1, 0.3, 1),
                    height 650ms cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 650ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    .skills-grid-home.overlap-deck .skill-card::before {
        content: "";
        position: absolute;
        inset: 0;
        background:
            linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.2) 58%, rgba(0, 0, 0, 0.66) 100%),
            radial-gradient(120% 85% at 50% 0%, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 48%);
        z-index: 1;
        pointer-events: none;
    }

    .skills-grid-home.overlap-deck .skill-card-1 {
        transform: scale(0.94) !important;
        z-index: 2 !important;
        transform-origin: right center !important;
        clip-path: polygon(0% 0%, 25% 4.28%, 50% 7.78%, 75% 10.5%, 100% 12.44%, 100% 87.56%, 75% 89.5%, 50% 92.22%, 25% 95.72%, 0% 100%) !important;
    }

    .skills-grid-home.overlap-deck .skill-card-2 {
        transform: scale(0.94) !important;
        z-index: 5 !important;
        filter: brightness(1) contrast(1) saturate(0.98) !important;
        clip-path: polygon(0% 12.44%, 25% 13.61%, 50% 14.0%, 75% 13.61%, 100% 12.44%, 100% 87.56%, 75% 86.39%, 50% 86.0%, 25% 86.39%, 0% 87.56%) !important;
    }

    .skills-grid-home.overlap-deck .skill-card-3 {
        transform: scale(0.94) !important;
        z-index: 2 !important;
        transform-origin: left center !important;
        clip-path: polygon(0% 12.44%, 25% 10.5%, 50% 7.78%, 75% 4.28%, 100% 0%, 100% 100%, 75% 95.72%, 50% 92.22%, 25% 89.5%, 0% 87.56%) !important;
    }

    .skills-grid-home.overlap-deck .skill-card:hover,
    .skills-grid-home.overlap-deck .skill-card.is-active {
        transform: scale(1.03) rotateY(0deg) !important; /* Subtle zoom factor scale(1.03) */
        height: 400px !important;
        padding-bottom: 1.8rem !important;
        z-index: 10 !important;
        opacity: 1 !important;
        filter: brightness(1.06) contrast(1.02) saturate(1.03) !important;
        border-color: rgba(255, 255, 255, 0.28) !important;
        box-shadow: 0 45px 90px rgba(0, 0, 0, 0.84) !important;
        clip-path: none !important;
        border-radius: 0.65rem !important;
        transition-delay: 0s !important;
    }

    /* Hover dimming is now implicit because the default state is already cinematic standby */

    .skills-grid-home.overlap-deck .skill-card h3 {
        font-size: clamp(1.35rem, 1.48vw, 1.85rem) !important;
        line-height: 1.12 !important;
        max-width: 82% !important;
    }

    .skills-grid-home.overlap-deck .skill-card .skill-card-top {
        width: 100%;
        margin-bottom: auto;
    }

    .skills-grid-home.overlap-deck .skill-card .card-keyword {
        margin-top: auto !important;
        font-size: 0.58rem !important;
        letter-spacing: 0.16em !important;
        color: rgba(16, 185, 129, 0.8) !important; /* Unified desktop keyword to emerald green */
    }

    .skills-grid-home.overlap-deck .skill-card .skill-points li {
        font-size: 0.72rem !important;
        line-height: 1.45 !important; /* Ensure tight spacing on desktop hover */
        color: rgba(255, 255, 255, 0.72) !important;
    }

    .skills-grid-home.overlap-deck .skill-card .skill-card-no {
        font-size: clamp(1.65rem, 2.15vw, 2.25rem) !important;
    }

    .skills-grid-home.overlap-deck .skill-card-1 .skill-card-no,
    .skills-grid-home.overlap-deck .skill-card-3 .skill-card-no {
        opacity: 0.88 !important;
    }

    .skills-grid-home.overlap-deck .skill-card-2 .skill-card-no {
        opacity: 0.94 !important;
    }
}

/* Tablet & Mobile View: Vertically Stacked or Wrapped */
@media (max-width: 899px) {
    .about-layout-new {
        display: block !important;
        width: 100%;
    }

    .about-manifesto {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem !important;
        padding: 2.2rem 1.8rem !important;
    }

    .manifesto-copy {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .about-right-new {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }

    .skills-header-new {
        text-align: center !important;
        margin-bottom: 2rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .skills-grid-home.overlap-deck {
        margin-top: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 1.5rem !important;
        width: 100% !important;
    }

    .skills-deck-frame {
        width: 100%;
    }

    .skills-grid-home.overlap-deck .skill-card {
        width: 100% !important;
        max-width: 320px !important;
        height: 330px !important; /* Flat card height 330px */
        margin: 0 !important;
        padding: 2.2rem 1.8rem 3.4rem !important; /* Unified mobile padding */
    }

    .skills-grid-home.overlap-deck .skill-card:hover,
    .skills-grid-home.overlap-deck .skill-card.is-active {
        transform: scale(1.02) translateY(-3px) !important; /* Scale zoom on mobile hover */
        height: 410px !important;
        padding-bottom: 1.8rem !important;
    }
}

/* Mobile Portrait Stacked Cards */
@media (max-width: 600px) {
    .skills-grid-home.overlap-deck {
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.5rem !important;
    }
    
    .skills-grid-home.overlap-deck .skill-card {
        width: 100% !important;
        max-width: 340px !important;
    }
}

/* Global spacing overrides to tighten the sections */
.about-section {
    padding-top: 2.2rem !important;
    padding-bottom: 2.2rem !important;
}

.coverage-section {
    margin-top: 1.5rem !important;
}

/* Homepage Staggered Animations */
.skills-deck-frame.reveal .skill-card {
    opacity: 0 !important;
    transform: translateY(40px) !important;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), width 0.5s ease, height 0.5s ease !important;
}
.skills-deck-frame.reveal.is-visible .skill-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
.skills-deck-frame.reveal.is-visible .skill-card-1 { transition-delay: 0.1s !important; }
.skills-deck-frame.reveal.is-visible .skill-card-2 { transition-delay: 0.25s !important; }
.skills-deck-frame.reveal.is-visible .skill-card-3 { transition-delay: 0.4s !important; }

/* Text Delayed Intro */
.about-layout-new.reveal .manifesto-copy {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.6s, transform 0.8s ease 0.6s;
}
.about-layout-new.reveal.is-visible .manifesto-copy {
    opacity: 1;
    transform: translateY(0);
}

