/* Projects Sidebar Filters */
.project-filter-sidebar {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, -8px);
    width: min(860px, calc(100vw - 96px));
    padding: 18px;
    background: rgba(248, 252, 250, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 24px 44px rgba(15, 43, 37, 0.12), inset 0 0 0 1px rgba(62, 207, 178, 0.08);
    border-radius: 34px 82px 34px 82px;
    opacity: 0;
    pointer-events: none;
    z-index: 1204;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, box-shadow 0.24s ease;
}

.project-filter-sidebar h3 {
    display: none;
}

.project-filter-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@keyframes filter-attention {
    0%, 100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, 8px);
    }
}

#side-controls.attention-bounce {
    animation: filter-attention 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-filter-sidebar.is-open,
body.projects-filter-open .project-filter-sidebar {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

/* Projects Layout - Flowing */
.project-layout {
    display: flex;
    width: 100%;
    margin: 0 auto;
    align-items: stretch;
    position: relative;
}

.project-main {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding-left: 0;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
}

.projects-container[data-project-swipe="page"] {
    touch-action: pan-y;
}

.project-card {
    background: var(--bg-membrane);
    border-radius: 40px 100px 40px 100px;
    padding: 60px 40px;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: var(--neu-light-outer);
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 520px;
    /* Increased to accommodate content comfortably */
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
}

.project-card.page-enter,
.project-card.page-exit-active {
    pointer-events: none;
}

.project-card.page-enter {
    opacity: 0;
    transform: translate3d(calc(var(--page-direction, 1) * 34px), 0, 0) scale(0.96);
}

.project-card.page-enter.page-enter-active {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    transition:
        opacity 0.34s cubic-bezier(0.23, 1, 0.32, 1),
        transform 0.44s cubic-bezier(0.23, 1, 0.32, 1);
    transition-delay: calc(var(--page-slot, 0) * 55ms);
}

.project-card.page-exit-active {
    opacity: 0;
    transform: translate3d(calc(var(--page-direction, 1) * -28px), 0, 0) scale(0.97);
    transition:
        opacity 0.24s cubic-bezier(0.4, 0, 1, 1),
        transform 0.24s cubic-bezier(0.4, 0, 1, 1);
    transition-delay: calc((2 - var(--page-slot, 0)) * 40ms);
}

.project-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    min-height: 4.4rem;
    /* Standardizes space for 2 lines of title */
    display: block;
    text-align: center;
    line-height: 1.18;
    padding-inline: 8px;
    width: 100%;
    white-space: normal;
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
    text-wrap: balance;
}

.project-card p {
    flex-grow: 1;
    /* This pushes the tech group to the bottom */
    margin-bottom: 30px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-card:nth-child(1) {
    transform: translateX(calc(100% + 40px)) scale(0.5);
}

.project-card:nth-child(3) {
    transform: translateX(calc(-100% - 40px)) scale(0.5);
}

#hero-projects.show-projects .project-card {
    opacity: 1;
    transform: scale(1) translate(0, 0);
}

#hero-projects.show-projects .project-card:nth-child(2) {
    transition-delay: 0.3s;
    transition-duration: 1s;
}

#hero-projects.show-projects .project-card:nth-child(1),
#hero-projects.show-projects .project-card:nth-child(3) {
    transition-delay: 1s;
    transition-duration: 1.2s;
}

/* Cell Absorption Logic - Reverse movement */
#hero-projects.absorbing .project-card {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

#hero-projects.absorbing .project-card:nth-child(1) {
    transform: translateX(calc(100% + 40px)) scale(0.5);
    transition-delay: 0s;
}

#hero-projects.absorbing .project-card:nth-child(3) {
    transform: translateX(calc(-100% - 40px)) scale(0.5);
    transition-delay: 0s;
}

#hero-projects.absorbing .project-card:nth-child(2) {
    transform: scale(0.6);
    transition-delay: 0.4s;
    /* Absorbs side cards first */
}

.project-card:hover {
    border-radius: 100px 40px 100px 40px;
    transform: scale(1.02);
    box-shadow: var(--organic-glow), 20px 20px 40px rgba(0, 0, 0, 0.05);
    background: white;
}

.project-card h3 {
    font-size: clamp(1.85rem, 2.25vw, 2.2rem);
    margin-bottom: 20px;
    font-weight: 800;
    background: linear-gradient(45deg, var(--text-deep), var(--primary-ethereal));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-card p {
    color: var(--text-soft);
    line-height: 1.8;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
    border: 1px solid var(--btn-secondary-border);
    border-radius: var(--btn-radius);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--btn-secondary-shadow);
    transition: transform 0.24s ease, box-shadow 0.24s ease, color 0.24s ease, border-color 0.24s ease, filter 0.24s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    text-decoration: none;
    text-align: center;
    position: relative;
}

#hero-intro-content.show-about .btn,
#hero-intro-content.show-client .btn {
    margin-top: 40px;
}

#hero-intro-content.show-about .hero-action-row .btn,
#hero-intro-content.show-client .hero-action-row .btn {
    margin-top: 0;
}

#hero-intro-content.show-about .hero-action-row,
#hero-intro-content.show-client .hero-action-row {
    width: 100%;
    max-width: 740px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 16px;
    margin-top: 20px;
}

.btn:hover {
    transform: translateY(0);
    box-shadow: var(--btn-secondary-shadow-pressed);
    color: var(--text-deep);
    border-color: rgba(255, 255, 255, 0.78);
}

.btn:active {
    transform: translateY(1px) scale(0.995);
}

.btn-ghost {
    background: rgba(239, 246, 244, 0.8);
    color: var(--text-deep);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 18px rgba(15, 43, 37, 0.08);
}

.btn-ghost:hover {
    background: rgba(245, 251, 249, 0.92);
    box-shadow: 0 10px 20px rgba(15, 43, 37, 0.1);
}

.btn-sm {
    padding: 10px 25px;
    font-size: 0.75rem;
}

.filter-btn {
    border-radius: 28px;
    width: 100%;
    min-width: 0;
    text-align: center;
    min-height: 58px;
    padding: 11px 18px;
    font-size: 0.82rem;
    letter-spacing: 1.1px;
    text-transform: none;
    color: var(--text-deep);
    background: rgba(255, 255, 255, 0.78);
    border: 2px solid rgba(15, 43, 37, 0.22);
    box-shadow: 0 8px 18px rgba(15, 43, 37, 0.06);
}

.filter-btn.active {
    background: linear-gradient(135deg, #168269 0%, #2cb89d 55%, #7af7df 100%);
    color: #ecfff9;
    border-color: rgba(15, 43, 37, 0.45);
    box-shadow: 0 0 20px rgba(var(--signal-rgb), 0.35), var(--neu-light-inner);
}

.filter-btn:hover {
    transform: translateY(0) scale(1.01);
    box-shadow:
        inset 6px 6px 12px rgba(160, 170, 180, 0.24),
        inset -6px -6px 12px rgba(255, 255, 255, 0.76);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin-top: 30px;
    padding-bottom: 20px;
}

.pagination-dots {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
}

.pagination-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.pagination-dots .dot:hover {
    background: rgba(var(--primary-rgb), 0.4);
    transform: scale(1.3);
}

.pagination-dots .dot.active {
    background: var(--accent-organic);
    width: 12px;
    border-radius: 4px;
    transform: scale(1.1);
}

.pagination-dots .dot.active:hover {
    transform: scale(1.2);
}

#page-info {
    font-family: var(--font-headers);
    font-weight: 800;
    color: var(--primary-ethereal);
    font-size: 1.2rem;
}

