/* ═══════════════════════════════════════════════════════════════
   projects.css — Projects Section
   ═══════════════════════════════════════════════════════════════ */

/* Slow fade-in animation for My Projects heading */
@keyframes slowFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation classes for Projects header */
.projects-header-animate .mb-\[10px\],
.projects-header-animate h2 {
    opacity: 0;
    transform: translateY(30px);
    transition: none;
}

/* Before animation state - hidden */
#projects.before-animation .projects-header-animate .mb-\[10px\],
#projects.before-animation .projects-header-animate h2 {
    opacity: 0;
    transform: translateY(30px);
}

/* Animate in state - trigger animations */
#projects.animate-in .projects-header-animate .mb-\[10px\] {
    animation: slowFadeInUp 1.2s ease-out forwards;
    animation-delay: 0.2s;
}

#projects.animate-in .projects-header-animate h2 {
    animation: slowFadeInUp 1.4s ease-out forwards;
    animation-delay: 0.4s;
}

.projects-section {
    padding: var(--space-section-py) var(--space-section-px);
    background: var(--color-bg-section);
    text-align: center;
}

/* Prevent section from affecting others - isolation and containment */
#projects {
    position: relative;
    contain: layout style;
    will-change: auto;
    box-sizing: border-box;
    /* Ensure section doesn't overflow or affect siblings */
    overflow: visible;
    isolation: isolate;
}

#projects.is-locked {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
    box-sizing: border-box;
    contain: none;
    /* Maintain same horizontal padding when locked - matches HTML default */
    padding-left: clamp(1rem, 8vw, 12rem) !important;
    padding-right: clamp(1rem, 8vw, 12rem) !important;
}

/* Disable locking animation on medium and small screens to prevent layout issues */
@media (max-width: 1023px) {
    #projects {
        position: relative !important;
        contain: layout style !important;
    }
    
    #projects.is-locked {
        position: relative !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        z-index: 1 !important;
        width: auto !important;
        background: none !important;
    }
    
    body.projects-locked {
        overflow: auto !important;
        height: auto !important;
    }
}

/* Ensure consistent padding on large screens when locked */
@media (min-width: 1024px) and (max-width: 1279px) {
    #projects.is-locked {
        padding-left: clamp(1rem, 6vw, 8rem) !important;
        padding-right: clamp(1rem, 6vw, 8rem) !important;
    }
}

@media (max-width: 639px) {
    #projects {
        position: relative !important;
    }
    
    #projects.is-locked {
        position: relative !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* ── Label ── */
.projects-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: var(--space-md);
}

.projects-label img {
    width: 28px;
}

.projects-label span {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: var(--label-span-font-size);
    font-weight: var(--label-span-font-weight);
    letter-spacing: var(--label-span-letter-spacing);
    text-transform: uppercase;
}

/* ── Heading ── */
.projects-heading {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7.2rem);
    font-weight: 900;
    color: var(--color-dark);
    text-transform: uppercase;
    letter-spacing: 6px;
    margin-bottom: var(--space-xl);
    line-height: 1;
    margin-top: 0;
}

/* ── Filter Bar ── */
.projects-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.filter-btn {
    font-family: var(--font-inter);
    font-weight: 500;
    font-size: 1rem;
    color: var(--color-dark);

    padding: 10px 24px;
    border-radius: 999px;
    border: 2px solid transparent;
    background: #fff;

    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    white-space: nowrap;
}

.filter-btn:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.filter-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ── Grid ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.project-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition:
        transform 0.4s var(--transition-ease),
        box-shadow 0.4s var(--transition-ease),
        opacity 0.4s ease,
        scale 0.4s ease;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 4/5;
    opacity: 1;
    scale: 1;
}

.project-card.hide-anim {
    opacity: 0;
    scale: 0.9;
    pointer-events: none;
}

/* ── Project Card Overlay ── */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.55) 45%,
        rgba(0, 0, 0, 0) 100%
    );
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.35s ease,
        transform 0.35s ease;
    border-radius: inherit;
    box-sizing: border-box;
}

.project-card:hover .project-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* ── Figma Badge for Designing Projects ── */
.project-figma-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 99px;
    font-family: var(--font-inter);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--color-dark);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 5;
    transition:
        opacity 0.3s ease,
        transform 0.2s ease;
}

.project-figma-badge:hover {
    transform: scale(1.05);
}

.figma-badge-icon {
    width: 14px;
    height: 14px;
}

/* Hide Figma Badge when overlay appears */
.project-card:hover .project-figma-badge {
    opacity: 0;
    pointer-events: none;
}

/* ══════════════════════
   Square Icon Buttons
══════════════════════ */
.overlay-icon-row {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(10px);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    transition-delay: 0s;
}

.project-card:hover .overlay-icon-row {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.15s; /* Wait for the overlay to animate in first */
}

.overlay-square-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1); /* Increased opacity for visibility */
    border: 1px solid rgba(255, 255, 255, 0.4); /* Increased border opacity */
    backdrop-filter: blur(1px); /* Less blur */
    -webkit-backdrop-filter: blur(2px);
    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.overlay-square-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.square-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Ensure icons are white */
}

.project-screenshot {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* ── Load more ── */
.load-more-wrap {
    text-align: center;
    margin-top: 2.5rem;
}

#load-more-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Visibility toggle (used by JS instead of style.display) */
.is-hidden {
    display: none;
}

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */

/* XL screens (1280px - 1535px): Larger sizes optimized for XL */
@media (min-width: 1280px) and (max-width: 1535px) {
    /* No padding override - uses HTML default spacing */
    
    /* Header spacing */
    #projects .flex.justify-center.\32xl\:justify-start {
        margin-bottom: 36px !important;
    }

    /* Label styling */
    #projects .mb-\[10px\] {
        margin-bottom: 10px !important;
    }

    #projects .gap-\[7px\] {
        gap: 8px !important;
    }

    #projects .h-\[7px\].w-\[7px\] {
        width: 8px !important;
        height: 8px !important;
    }

    #projects .text-\[14px\] {
        font-size: 17px !important;
    }

    /* Larger heading on XL */
    #projects h2.text-\[28px\] {
        font-size: 36px !important;
        line-height: 1.4 !important;
    }

    /* Gap between sidebar and content */
    #projects .flex.flex-col.\32xl\:flex-row.gap-\[30px\] {
        gap: 32px !important;
    }

    /* Project list spacing */
    #projects-list {
        gap: 12px !important;
    }

    /* Larger project tabs */
    .project-tab {
        font-size: 18px !important;
        border-radius: 50px !important;
    }

    /* Card styling - slightly smaller */
    .project-card-stacking {
        padding: 10px !important;
        border-radius: 10px !important;
    }

    .project-card-stacking > div:first-child {
        gap: 14px !important;
    }

    /* Image container - slightly smaller on XL */
    .project-card-stacking .xl\:w-\[450px\].\32xl\:w-\[519px\] {
        width: 380px !important;
        max-width: 380px !important;
    }

    .project-card-stacking img[alt*="Project"] {
        height: 450px !important;
        max-height: 450px !important;
    }

    /* Icon sizes */
    .project-card-stacking img[alt*="Icon"] {
        width: 52px !important;
        height: 52px !important;
    }

    /* Platform buttons */
    .project-card-stacking .w-\[36px\].h-\[36px\],
    .project-card-stacking .md\:w-\[40px\].md\:h-\[40px\],
    .project-card-stacking .lg\:w-\[44px\].lg\:h-\[44px\] {
        width: 40px !important;
        height: 40px !important;
    }

    .project-card-stacking a[href] img[src*="apple"],
    .project-card-stacking a[href] img[src*="android"] {
        width: 21px !important;
        height: 21px !important;
    }

    .project-card-stacking .gap-\[8px\],
    .project-card-stacking .md\:gap-\[10px\] {
        gap: 9px !important;
    }

    /* Content area - slightly smaller */
    .project-card-stacking .xl\:min-h-\[520px\].\32xl\:min-h-\[592px\] {
        padding: 20px !important;
        min-height: 450px !important;
    }

    /* Typography */
    .project-card-stacking h3 {
        font-size: 22px !important;
        margin-bottom: 12px !important;
    }

    .project-card-stacking p {
        font-size: 16px !important;
        line-height: 1.65 !important;
    }

    /* Container */
    #project-card-container {
        min-height: auto !important;
    }

    .project-card-stacking .mb-\[20px\].xl\:mb-0 {
        margin-bottom: 16px !important;
    }
}

/* Below XL (under 1280px): Compact layout for My Projects Section */
@media (max-width: 1279px) {
    /* No padding override - uses HTML default spacing */

    /* Reduce header margin bottom */
    #projects .flex.justify-center.\32xl\:justify-start {
        margin-bottom: 24px !important;
    }

    /* Reduce label spacing and size */
    #projects .mb-\[10px\] {
        margin-bottom: 8px !important;
    }

    #projects .gap-\[7px\] {
        gap: 6px !important;
    }

    /* Smaller diamond indicator */
    #projects .h-\[7px\].w-\[7px\] {
        width: 7px !important;
        height: 7px !important;
    }

    /* Reduce label font size */
    #projects .text-\[14px\] {
        font-size: 15px !important;
    }

    /* Reduce heading font size */
    #projects h2.text-\[28px\] {
        font-size: 26px !important;
        line-height: 1.35 !important;
    }

    /* Reduce gap between left sidebar and content */
    #projects .flex.flex-col.\32xl\:flex-row.gap-\[30px\] {
        gap: 20px !important;
    }

    /* Make sidebar take less space */
    #projects .\32xl\:max-w-\[280px\] {
        max-width: 100% !important;
    }

    /* Reduce project list spacing */
    #projects-list {
        gap: 10px !important;
    }

    /* Reduce project tab padding and font size */
    .project-tab {
        font-size: 15px !important;
    }

    /* Reduce project card padding */
    .project-card-stacking {
        padding: 10px !important;
        border-radius: 8px !important;
    }

    /* Reduce card inner gap - target the flex container inside card */
    .project-card-stacking > div:first-child {
        gap: 12px !important;
    }

    /* Reduce image container width */
    .project-card-stacking .xl\:w-\[450px\].\32xl\:w-\[519px\] {
        width: 340px !important;
        max-width: 340px !important;
    }

    /* Reduce image height */
    .project-card-stacking img[alt*="Project"] {
        height: 400px !important;
        max-height: 400px !important;
    }

    /* Reduce icon sizes */
    .project-card-stacking img[alt*="Icon"] {
        width: 46px !important;
        height: 46px !important;
    }

    /* Reduce platform link button sizes */
    .project-card-stacking .w-\[36px\].h-\[36px\],
    .project-card-stacking .md\:w-\[40px\].md\:h-\[40px\],
    .project-card-stacking .lg\:w-\[44px\].lg\:h-\[44px\] {
        width: 38px !important;
        height: 38px !important;
    }

    .project-card-stacking a[href] img[src*="apple"],
    .project-card-stacking a[href] img[src*="android"] {
        width: 20px !important;
        height: 20px !important;
    }

    /* Reduce platform links gap */
    .project-card-stacking .gap-\[8px\],
    .project-card-stacking .md\:gap-\[10px\] {
        gap: 8px !important;
    }

    /* Reduce content padding and min-height */
    .project-card-stacking .xl\:min-h-\[520px\].\32xl\:min-h-\[592px\] {
        padding: 18px !important;
        min-height: 400px !important;
    }

    /* Reduce title spacing and size */
    .project-card-stacking h3 {
        font-size: 20px !important;
        margin-bottom: 10px !important;
    }

    /* Reduce description font size */
    .project-card-stacking p {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    /* Adjust container to fit smaller cards */
    #project-card-container {
        min-height: auto !important;
    }

    /* Reduce top section margin */
    .project-card-stacking .mb-\[20px\].xl\:mb-0 {
        margin-bottom: 16px !important;
    }
}

/* Below XL (under 1280px): Compact layout for My Projects Section */
@media (max-width: 1279px) {
    /* Reduce section padding */
    #projects {
        isolation: isolate;
    }

    /* Reduce header margin bottom */
    #projects .flex.justify-center.\32xl\:justify-start {
        margin-bottom: 24px !important;
    }

    /* Reduce label spacing and size */
    #projects .mb-\[10px\] {
        margin-bottom: 8px !important;
    }

    #projects .gap-\[7px\] {
        gap: 6px !important;
    }

    /* Smaller diamond indicator */
    #projects .h-\[7px\].w-\[7px\] {
        width: 7px !important;
        height: 7px !important;
    }

    /* Reduce label font size */
    #projects .text-\[14px\] {
        font-size: 15px !important;
    }

    /* Reduce heading font size */
    #projects h2.text-\[28px\] {
        font-size: 26px !important;
        line-height: 1.35 !important;
    }

    /* Reduce gap between left sidebar and content */
    #projects .flex.flex-col.\32xl\:flex-row.gap-\[30px\] {
        gap: 20px !important;
    }

    /* Make sidebar take less space */
    #projects .\32xl\:max-w-\[280px\] {
        max-width: 100% !important;
    }

    /* Reduce project list spacing */
    #projects-list {
        gap: 10px !important;
    }

    /* Reduce project tab padding and font size */
    .project-tab {
        font-size: 15px !important;
    }

    /* Reduce project card padding */
    .project-card-stacking {
        padding: 10px !important;
        border-radius: 8px !important;
    }

    /* FORCE ROW LAYOUT - Override Tailwind's flex-col */
    .project-card-stacking > div.flex.flex-col {
        flex-direction: row !important;
        gap: 14px !important;
    }

    /* Reduce image container width and force proper sizing */
    .project-card-stacking .w-full.max-w-\[400px\] {
        width: 280px !important;
        max-width: 280px !important;
        flex-shrink: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Reduce image height */
    .project-card-stacking img[alt*="Project"] {
        height: 340px !important;
        max-height: 340px !important;
        margin-top: 0 !important;
    }

    /* Reduce icon sizes */
    .project-card-stacking img[alt*="Icon"] {
        width: 44px !important;
        height: 44px !important;
    }

    /* Reduce platform link button sizes */
    .project-card-stacking .w-\[36px\].h-\[36px\],
    .project-card-stacking .md\:w-\[40px\].md\:h-\[40px\],
    .project-card-stacking .lg\:w-\[44px\].lg\:h-\[44px\] {
        width: 38px !important;
        height: 38px !important;
    }

    .project-card-stacking a[href] img[src*="apple"],
    .project-card-stacking a[href] img[src*="android"] {
        width: 20px !important;
        height: 20px !important;
    }

    /* Reduce platform links gap */
    .project-card-stacking .gap-\[8px\],
    .project-card-stacking .md\:gap-\[10px\] {
        gap: 8px !important;
    }

    /* Reduce content padding and min-height */
    .project-card-stacking .flex-1.relative.flex.flex-col {
        padding: 18px !important;
        min-height: 340px !important;
    }

    /* Reduce title spacing and size */
    .project-card-stacking h3 {
        font-size: 19px !important;
        margin-bottom: 10px !important;
    }

    /* Reduce description font size */
    .project-card-stacking p {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    /* Adjust container to fit smaller cards */
    #project-card-container {
        min-height: auto !important;
    }

    /* Reduce top section margin */
    .project-card-stacking .mb-\[20px\] {
        margin-bottom: 14px !important;
    }
}

/* Large tablet and below: Further reductions */
@media (max-width: 1023px) {
    #projects h2.text-\[28px\] {
        font-size: 24px !important;
    }

    .project-tab {
        font-size: 14px !important;
    }

    .project-card-stacking .xl\:w-\[450px\].\32xl\:w-\[519px\] {
        width: 300px !important;
        max-width: 300px !important;
    }

    .project-card-stacking img[alt*="Project"] {
        height: 360px !important;
        max-height: 360px !important;
    }

    .project-card-stacking .xl\:min-h-\[520px\].\32xl\:min-h-\[592px\] {
        padding: 16px !important;
        min-height: 360px !important;
    }

    .project-card-stacking h3 {
        font-size: 18px !important;
    }

    .project-card-stacking p {
        font-size: 14px !important;
    }
}

/* Large tablet and below: Further reductions */
@media (max-width: 1023px) {
    /* Ensure section doesn't affect siblings on tablets - proper containment */
    #projects {
        margin-bottom: 0 !important;
        clear: both !important;
        position: relative !important;
    }
    
    /* Disable stacking for cards on tablets */
    .project-card-stacking {
        position: relative !important;
    }

    #projects .flex.justify-center.\32xl\:justify-start {
        margin-bottom: 20px !important;
    }

    #projects h2.text-\[28px\] {
        font-size: 22px !important;
    }

    .project-tab {
        font-size: 14px !important;
    }

    /* FORCE ROW LAYOUT on tablets */
    .project-card-stacking > div.flex.flex-col {
        flex-direction: row !important;
        gap: 12px !important;
    }

    .project-card-stacking .w-full.max-w-\[400px\] {
        width: 220px !important;
        max-width: 220px !important;
        flex-shrink: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .project-card-stacking img[alt*="Project"] {
        height: 280px !important;
        max-height: 280px !important;
        margin-top: 0 !important;
        object-fit: cover !important;
        border-radius: 8px !important;
    }

    .project-card-stacking .flex-1.relative.flex.flex-col {
        padding: 14px !important;
        min-height: 280px !important;
    }

    .project-card-stacking img[alt*="Icon"] {
        width: 40px !important;
        height: 40px !important;
    }

    .project-card-stacking .w-\[36px\].h-\[36px\],
    .project-card-stacking .md\:w-\[40px\].md\:h-\[40px\],
    .project-card-stacking .lg\:w-\[44px\].lg\:h-\[44px\] {
        width: 36px !important;
        height: 36px !important;
    }

    .project-card-stacking a[href] img[src*="apple"],
    .project-card-stacking a[href] img[src*="android"] {
        width: 18px !important;
        height: 18px !important;
    }

    .project-card-stacking h3 {
        font-size: 18px !important;
        margin-bottom: 10px !important;
    }

    .project-card-stacking p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    .project-card-stacking .mb-\[20px\] {
        margin-bottom: 12px !important;
    }
}

/* Mobile and Small screens: Stack vertically with optimized image */
@media (max-width: 767px) {
    /* Uses HTML default horizontal spacing: sm:px-[clamp(1rem,3vw,2rem)] - consistent with all sections */
    
    /* Ensure proper containment on mobile */
    #projects {
        margin-bottom: 0 !important;
        clear: both !important;
        position: relative !important;
        overflow: visible !important;
    }
    
    /* Only show active card on mobile */
    .project-card-stacking {
        position: relative !important;
    }

    #projects .flex.justify-center.\32xl\:justify-start {
        margin-bottom: 18px !important;
    }

    #projects h2.text-\[28px\] {
        font-size: 20px !important;
    }

    #projects .flex.flex-col.\32xl\:flex-row.gap-\[30px\] {
        gap: 18px !important;
    }

    /* Container for project list - ensure proper width */
    #projects .w-full.\32xl\:max-w-\[280px\] {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 5px !important;
        overflow: visible !important;
    }

    /* Project tabs - horizontal scroll on mobile */
    #projects-list {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 10px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
        scrollbar-color: #0083CF #f0f0f0 !important;
        scroll-behavior: smooth !important;
    }

    /* Custom scrollbar styling */
    #projects-list::-webkit-scrollbar {
        height: 5px !important;
    }

    #projects-list::-webkit-scrollbar-track {
        background: #f0f0f0 !important;
        border-radius: 10px !important;
        margin-left: 4px !important;
        margin-right: 4px !important;
    }

    #projects-list::-webkit-scrollbar-thumb {
        background: #0083CF !important;
        border-radius: 10px !important;
    }

    #projects-list::-webkit-scrollbar-thumb:hover {
        background: #006ba3 !important;
    }

    /* Tab styling - ensure full visibility */
    .project-tab {
        font-size: 13px !important;
        padding: 8px 14px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        min-width: fit-content !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .project-card-stacking {
        padding: 8px !important;
    }

    /* VERTICAL STACK on mobile */
    .project-card-stacking > div.flex.flex-col {
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* Smaller width image container on mobile for better content visibility */
    .project-card-stacking .w-full.max-w-\[400px\] {
        width: 70% !important;
        max-width: 280px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Smaller mobile image - more space for content */
    .project-card-stacking img[alt*="Project"] {
        width: 100% !important;
        height: auto !important;
        max-height: 220px !important;
        min-height: 180px !important;
        margin-top: 0 !important;
        object-fit: cover !important;
        border-radius: 8px !important;
    }

    .project-card-stacking img[alt*="Icon"] {
        width: 36px !important;
        height: 36px !important;
    }

    .project-card-stacking .w-\[36px\].h-\[36px\],
    .project-card-stacking .md\:w-\[40px\].md\:h-\[40px\],
    .project-card-stacking .lg\:w-\[44px\].lg\:h-\[44px\] {
        width: 32px !important;
        height: 32px !important;
    }

    .project-card-stacking a[href] img[src*="apple"],
    .project-card-stacking a[href] img[src*="android"] {
        width: 16px !important;
        height: 16px !important;
    }

    .project-card-stacking .flex-1.relative.flex.flex-col {
        padding: 12px 14px !important;
        min-height: auto !important;
    }

    .project-card-stacking h3 {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }

    .project-card-stacking p {
        font-size: 13px !important;
        line-height: 1.55 !important;
    }

    .project-card-stacking .mb-\[20px\] {
        margin-bottom: 10px !important;
    }

    .project-card-stacking .gap-\[8px\],
    .project-card-stacking .md\:gap-\[10px\] {
        gap: 6px !important;
    }
}

/* Extra small screens: Even more compact */
@media (max-width: 480px) {
    /* Uses HTML default horizontal spacing: sm:px-[clamp(1rem,3vw,2rem)] */

    #projects h2.text-\[28px\] {
        font-size: 18px !important;
    }

    /* Tabs scroll with better spacing */
    #projects-list {
        gap: 8px !important;
    }

    .project-tab {
        font-size: 12px !important;
        padding: 7px 12px !important;
    }

    .project-card-stacking {
        padding: 6px !important;
    }

    /* Even smaller image on very small screens */
    .project-card-stacking .w-full.max-w-\[400px\] {
        width: 65% !important;
        max-width: 240px !important;
    }

    .project-card-stacking img[alt*="Project"] {
        max-height: 180px !important;
        min-height: 150px !important;
    }

    .project-card-stacking img[alt*="Icon"] {
        width: 34px !important;
        height: 34px !important;
    }

    .project-card-stacking .w-\[36px\].h-\[36px\],
    .project-card-stacking .md\:w-\[40px\].md\:h-\[40px\],
    .project-card-stacking .lg\:w-\[44px\].lg\:h-\[44px\] {
        width: 30px !important;
        height: 30px !important;
    }

    .project-card-stacking a[href] img[src*="apple"],
    .project-card-stacking a[href] img[src*="android"] {
        width: 15px !important;
        height: 15px !important;
    }

    .project-card-stacking .flex-1.relative.flex.flex-col {
        padding: 10px 12px !important;
    }

    .project-card-stacking h3 {
        font-size: 15px !important;
        margin-bottom: 7px !important;
    }

    .project-card-stacking p {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }

    .project-card-stacking .mb-\[20px\] {
        margin-bottom: 8px !important;
    }
}

/* Tablet: 2-col grid */
@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large mobile */
@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
    }

    .projects-heading {
        font-size: 2.5rem;
    }

    .projects-label span {
        font-size: 18px;
    }

    /* Filter: horizontal scroll on mobile */
    .projects-filter {
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .projects-filter::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    /* Overlay: Square icons on mobile */
    .project-overlay {
        padding: 8px;
    }

    .overlay-icon-row {
        gap: 8px;
    }

    .overlay-square-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .square-logo {
        width: 18px;
        height: 18px;
    }

    #load-more-btn {
        font-size: 0.9rem;
    }
}

/* Very small screens: single column */
@media (max-width: 360px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   STACKING SCROLL ANIMATION — My Projects Section
   Wheel-based approach with no extra height + CSS scroll control
   ═══════════════════════════════════════════════════════════════ */

/* Make body scroll-snap container */
html {
    scroll-behavior: smooth;
}

body.projects-locked {
    overflow: hidden;
    height: 100vh;
}

#projects {
    overflow: visible;
    position: relative;
    transition: none; /* No transition on position change to avoid glitch */
}

#projects.is-locked {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F5 100%);
    box-sizing: border-box;
}

/* Simple container - height set by JS to match card height exactly */
#project-card-container {
    position: relative;
    width: 100%;
}

/* Stacking cards */
.project-card-stacking {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform, opacity;
    transform-origin: center center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.project-card-stacking img {
    pointer-events: auto;
}


/* ══════════════════════════════════════════════════════════════
   MY PROJECTS SECTION ANIMATIONS - Initial scroll reveal only
   Does NOT interfere with existing card stacking animation
══════════════════════════════════════════════════════════════ */

/* Only hide elements BEFORE animation starts (controlled by JS) */
#projects.before-animation .flex.justify-center,
#projects.before-animation h2,
#projects.before-animation .flex.flex-col.\32xl\:flex-row,
#projects.before-animation #projects-list {
    opacity: 0;
}

#projects.before-animation .flex.justify-center {
    transform: translateY(20px);
}

#projects.before-animation h2 {
    transform: translateY(20px);
}

#projects.before-animation .flex.flex-col.\32xl\:flex-row {
    transform: translateY(20px);
}

#projects.before-animation #projects-list {
    transform: translateY(20px);
}

/* Transitions - always applied */
#projects .flex.justify-center {
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

#projects h2 {
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.1s;
}

#projects #projects-list {
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.2s;
}

#projects .flex.flex-col.\32xl\:flex-row {
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.3s;
}

/* Animated state - elements return to normal */
#projects.animate-in .flex.justify-center,
#projects.animate-in h2,
#projects.animate-in #projects-list,
#projects.animate-in .flex.flex-col.\32xl\:flex-row {
    opacity: 1;
    transform: none;
}

/* Keep project cards visible - they have their own stacking animation */
#projects .project-card-stacking {
    opacity: 1 !important;
}

