.projects-section {
    width: 100%;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.projects-inner {
    display: flex;
    flex-direction: column;
}

.projects-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Main spatial layout managed below in section ── SPATIAL PROJECT LIST ── */

.section-badge {
    top: 80px !important;
    /* Adjusted for 80px padding */
    right: 60px !important;
    font-size: 0.7rem !important;
    padding: 8px 18px !important;
    opacity: 0.8;
}

/* ── HEADER ── */
.projects-header-top {
    display: flex;
    flex-direction: column;
    /* margin-bottom: 60px; */
}

.projects-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--mid);
    margin-bottom: 14px;
}

.projects-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--ink);
    /* margin-bottom: 8px; */
}

.projects-sub {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--mid);
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 40px;
}

/* ── SPATIAL PROJECT LIST ── */
.projects-spatial-container {
    position: relative;
    width: 100%;
    min-height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px 0;
}

.projects-list {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    /* Support multiple rows */
    gap: 40px;
    width: 100%;
    max-width: 1300px;
}

/* ── CINEMATIC PROJECT CARD ── */
.project-card {
    position: relative;
    width: 540px;
    min-height: 280px;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.05);
    z-index: 1;
    isolation: isolate;
    /* Forces internal children to stay in their z-index order */
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    z-index: -2;
    transition: background 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s;
    pointer-events: none;
    border-radius: 20px;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.5px;
    background: linear-gradient(to right, transparent 10%, var(--accent) 50%, transparent 90%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 5;
}

/* Card hover lift moved to animations.css for specificity */


.project-card:hover::after {
    /* Background remains stable as requested */
    background: rgba(255, 255, 255, 0.96);
}

/* Hover effects simplified as requested */






/* ── APP ICON ── */
.app-icon-wrap {
    padding: 32px 32px 0 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    /* Eliminated gap for maximum proximity as requested */
    position: relative;
    z-index: 2;
    /* Float above the glass filter layer */
}

.app-icon {
    width: 60px;
    height: 60px;
    /* Increased for more dominance as requested */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    /* Removed border as requested */
    position: relative;
    transition: all 0.4s ease;
}

.project-card:hover .app-icon {
    /* Internal elements stay fixed relative to card to emphasize unified whole-card lift */
    transform: none;
}

.gold-mesh-svg,
.vault-mesh-svg,
.deploy-lens-svg,
.flow-icon-svg {
    width: 52px;
    height: 52px;
}



.project-info {
    padding: 18px 32px 32px 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    /* Float above the glass filter layer */
}



.project-name {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0;
    letter-spacing: -0.01em;
    line-height: 1.0;
}

.project-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0;
}

.feature-pill {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--mid);
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 7px 15px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.feature-pill img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.feature-pill:hover {
    background: rgba(112, 125, 255, 0.08);
    /* Maintain the blueish hover */
    backdrop-filter: blur(14px) saturate(200%);
    border-color: rgba(112, 125, 255, 0.3);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(112, 125, 255, 0.1);
}

.project-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

.pill-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    /* background: rgba(112, 125, 255, 0.05); */
    /* border: 1px solid rgba(112, 125, 255, 0.1); */
}

.pill-trigger:hover {
    transform: translateY(-1.5px);
}

.pill-trigger.active {
    background: rgba(112, 125, 255, 0.2);
    border-color: rgba(112, 125, 255, 0.5);
}

.pill-trigger .trigger-icon {
    width: 28px;
    height: 28px;
}

.pill-trigger .chevron-icon {
    width: 22px;
    height: 22px;
    color: var(--mid);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pill-trigger.active .chevron-icon {
    transform: rotate(180deg);
}

/* ── SECURITY LIST LAYOUT ── */
.security-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.sec-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.sec-item-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    fill: url(#secGrad);
    /* Apply premium blue gradient globally */
    opacity: 1;
}

.sec-list-item:last-child {
    border-bottom: none;
}

.sec-list-item:hover {
    transform: translateX(4px);
}

.sec-item-content {
    flex: 1;
}

.sec-item-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    font-size: 0.85rem;
}

.sec-item-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.25;
}

.sec-item-desc strong {
    color: white;
    font-weight: 600;
}

/* ── CODEQL POPUP (Card-Overlay) ── */
.codeql-card-popup {
    font-family: 'Inter';
    position: absolute;
    inset: 12px;
    background: #1c1c1e;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 20px;
    z-index: 150;
    overflow-y: auto;
    /* Handle overflow if screen is small */

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px) scale(0.96);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);

    display: flex;
    flex-direction: column;
    padding: 24px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

/* Hide scrollbar for clean look */
.codeql-card-popup::-webkit-scrollbar {
    width: 0;
}

.codeql-card-popup.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.close-popup {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.close-popup img {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.popup-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.popup-header .popup-icon {
    width: 28px;
    height: 28px;
}

.popup-header h4 {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.015em;
}

.popup-body p {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: #d1d5db;
    line-height: 1.45;
    margin-bottom: 18px;
}

.popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-top: auto;
}

.popup-stat-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 14px 10px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.popup-stat-item:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}

.p-stat-val {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: white;
    margin-bottom: 2px;
}

.p-stat-lbl {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}



.feature-pill.pill-codeql {
    background: linear-gradient(135deg, rgba(47, 58, 143, 0.9), rgba(107, 115, 255, 0.9));
    background-size: cover;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(107, 115, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}



.feature-pill.pill-codeql .pill-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.feature-pill.pill-codeql:hover {
    transform: translateY(-2.5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(107, 115, 255, 0.6);
    filter: brightness(1.2);
}

/* Base typography and layout for project info are now managed above */
.project-desc {
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--mid);
}

/* ── PILL BUTTONS ── */
.project-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.btn-spatial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 100px;
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.btn-spatial:hover {
    border-color: transparent;
    color: var(--white);
    font-weight: 800;
    background: linear-gradient(90deg, #5B6CFF 0%, #8A5CFF 33%, #D946EF 66%, #5B6CFF 100%);
    background-size: 300% 100%;
    animation: gradientForward 2s linear infinite;
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(138, 92, 255, 0.2);
}

@keyframes gradientForward {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.btn-spatial svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), fill 0.3s ease;
}

.btn-spatial:hover .win-btn-svg {
    fill: var(--white);
}

/* ── BOTTOM BRANDING ── */
/* Bottom branding styles removed */

/* Bottom branding removed */



/* Divider line between meta items */
.meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.meta-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #2a2a28;
    flex-shrink: 0;
}

.meta-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #383836;
    letter-spacing: 0.04em;
}



/* Card variants removed to match unified theme */

.gold-mesh-svg {
    width: 36px !important;
    height: 36px !important;
}

/* Gradient Masking Logic to match badges */
.logo-gradient-silver {
    background: linear-gradient(135deg, #e0e0e0, #95a5a6);
    -webkit-mask: url('../assets/projects/security.svg') no-repeat center;
    mask: url('../assets/projects/security.svg') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.logo-gradient-custom {
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    -webkit-mask: url('../assets/projects/deploy.svg') no-repeat center;
    mask: url('../assets/projects/deploy.svg') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.logo-gradient-flow {
    background: linear-gradient(135deg, #059669, #10B981);
    -webkit-mask: url('../assets/projects/flow.svg') no-repeat center;
    mask: url('../assets/projects/flow.svg') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.vault-mesh-svg {
    width: 36px !important;
    height: 36px !important;
}

.deploy-lens-svg {
    width: 36px !important;
    height: 36px !important;
}

.flow-icon-svg {
    width: 36px !important;
    height: 36px !important;
}

.btn-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: var(--ink);
    color: var(--white);
    border: none;
    border-radius: 100px;
    padding: 11px 22px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
    width: auto;
}

.btn-preview:hover {
    background: #000000;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-preview svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.product-card .btn-source:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

/* ── STACK MODAL (POPUP) ── */
.stack-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stack-modal.open {
    display: flex;
    opacity: 1;
}

.stack-modal-content {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    padding: 40px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
}

.stack-modal.open .stack-modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--ink);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.stack-modal h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 12px;
}

.stack-modal-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stack-category h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #58A6FF;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.stack-category p {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--mid);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 1200px) {
    .projects-list {
        gap: 24px;
    }

    .project-card {
        width: 100%;
        max-width: 480px;
    }

    .project-name {
        font-size: 1.8rem;
    }
}

@media (max-width: 1024px) {
    .projects-list {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .project-card {
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .project-card {
        max-width: 100%;
    }

    .app-icon-wrap {
        padding: 24px 24px 0 24px;
        gap: 12px;
        /* Reduced gap from 16px for tighter grouping */
    }

    .app-icon {
        width: 52px;
        height: 52px;
    }

    .project-name {
        font-size: 1.6rem;
    }

    .project-info {
        padding: 20px 24px 24px 24px;
    }

    .project-features {
        margin: 16px 0;
        gap: 6px;
    }

    .feature-pill {
        padding: 5px 10px;
        font-size: 0.62rem;
    }

    .pill-trigger .trigger-icon {
        width: 32px;
        /* Increased for mobile/tablet */
        height: 32px;
    }

    .pill-trigger .chevron-icon {
        width: 18px;
        /* Proportional increase */
        height: 18px;
    }

    .pill-trigger {
        padding: 5px 10px;
    }

    /* Popup Responsive Adjustments */
    .codeql-card-popup {
        inset: 16px;
        /* Back to original more spacious inset */
        padding: 24px;
    }

    .popup-header {
        margin-bottom: 20px;
        gap: 12px;
    }

    .popup-header h4 {
        font-size: 1rem;
    }

    .popup-body p {
        margin-bottom: 16px;
        font-size: 0.7rem;
    }

    .security-list {
        gap: 0;
    }

    .sec-list-item {
        padding: 10px 0;
        gap: 12px;
    }

    .sec-item-title {
        font-size: 0.8rem;
    }

    .sec-item-desc {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .projects-eyebrow {
        font-size: 0.68rem;
        letter-spacing: 0.15em;
        margin-bottom: 12px;
    }

    .projects-title {
        font-size: clamp(2.3rem, 10vw, 2.8rem);
    }

    .pill-trigger .trigger-icon {
        width: 24px;
        /* Even larger on very small phones for better tap target */
        height: 24px;
    }

    .pill-trigger {
        padding: 4px 10px;
    }

    /* Ultra-small mobile popup adjustments */
    .codeql-card-popup {
        inset: 12px;
        /* Increased from 4px for better breathing room */
        padding: 20px;
    }

    .popup-header h4 {
        font-size: 0.95rem;
    }

    .sec-list-item {
        padding: 8px 0;
    }

    .sec-item-icon {
        width: 16px;
        height: 16px;
    }

    .close-popup {
        width: 24px;
        height: 24px;
        top: 16px;
        right: 16px;
    }

    .close-popup img {
        width: 10px;
        height: 10px;
    }
}

.projects-sub {
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.projects-spatial-container {
    margin-top: 20px;
}

.app-icon-wrap {
    padding: 20px 20px 0 20px;
    gap: 10px;
    /* Even tighter gap for small mobile */
}

.app-icon {
    width: 44px;
    height: 44px;
}

.project-name {
    font-size: 1.3rem;
}

.feature-pill {
    font-size: 0.65em;
}





.project-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-spatial {
    flex: 1 1 40%;
    padding: 12px 6px;
    font-size: 0.7rem;
    gap: 6px;
}

.btn-wide-mobile {
    order: 1;
    flex: 1 1 100%;
}

.btn-spatial svg {
    width: 14px;
    height: 14px;
}