:root {
    --projects-bg: #121212;
    --projects-bg-deep: #0a0a0a;
    --projects-gold: #FFD700;
    --projects-gold-dark: #FFAA00;
    --projects-muted: #cccccc;
    --projects-faint: #777777;
    --projects-card: rgba(24, 24, 24, 0.76);
    --projects-line: rgba(255, 215, 0, 0.2);
    --projects-shadow: 0 16px 38px rgba(0, 0, 0, 0.38);
}

body.projects-page {
    min-height: 100vh;
    background-color: #121212;
}

#particles-js {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.48;
    pointer-events: none;
}

.projects-page-shell {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 126px 0 92px;
}

.projects-hero {
    position: relative;
    display: grid;
    justify-items: center;
    max-width: 850px;
    margin: 0 auto 34px;
    text-align: center;
}

.hero-title {
    margin: 0;
    color: var(--projects-gold);
    font-family: "Baby Doll", cursive, sans-serif;
    font-size: clamp(2.7rem, 7vw, 5rem);
    font-weight: 400;
    line-height: 0.95;
    text-shadow: 0 0 18px rgba(255, 215, 0, 0.64), 0 10px 34px rgba(0, 0, 0, 0.48);
}

.hero-subtitle {
    max-width: 720px;
    margin: 20px auto 0;
    color: var(--projects-muted);
    font-size: 1.04rem;
    line-height: 1.72;
}

.projects-container {
    display: grid;
    gap: 24px;
}

.filters-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn,
.project-link {
    min-height: 42px;
    border: 1px solid rgba(255, 215, 0, 0.24);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 215, 0, 0.07);
    font-family: "Baby Doll", cursive, sans-serif;
    cursor: pointer;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        background 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease;
}

.category-btn {
    padding: 0 16px;
    font-size: 0.96rem;
}

.category-btn:hover,
.category-btn.active,
.project-link:hover {
    color: #111;
    border-color: transparent;
    background: linear-gradient(135deg, var(--projects-gold), var(--projects-gold-dark));
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.28);
    transform: translateY(-1px);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: min(330px, 100%);
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.42);
}

.search-icon {
    color: #ffd700;
    font-size: 0.95rem;
}

.search-input {
    width: 100%;
    min-height: 44px;
    border: 0;
    outline: 0;
    color: #fff;
    background: transparent;
    font: inherit;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.46);
}

.projects-masonry {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.project-card {
    position: relative;
    display: flex;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
        rgba(10, 10, 10, 0.56);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    transition:
        transform 220ms ease,
        border-color 220ms ease,
        box-shadow 220ms ease;
}

.project-card:hover {
    border-color: rgba(255, 215, 0, 0.42);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

body.projects-page:not(.projects-ready) .project-card {
    opacity: 0;
    transform: translateY(12px);
}

body.projects-ready .project-card {
    animation: projectCardReveal 680ms var(--ease-decelerate) both;
    animation-delay: calc(var(--project-index, 0) * 70ms);
}

@keyframes projectCardReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-image-container {
    position: relative;
    flex: 0 0 42%;
    min-height: 248px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

.project-image {
    width: 100%;
    height: 100%;
    min-height: 248px;
    object-fit: cover;
    filter: saturate(0.92) contrast(1.05);
    transition: transform 360ms ease, filter 360ms ease;
}

.project-card:hover .project-image {
    filter: saturate(1.05) contrast(1.08);
    transform: scale(1.035);
}

.project-status,
.project-featured-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    font-family: "Baby Doll", cursive;
}

.project-status {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 8px 11px;
    color: #101010;
    background: #ffd700;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.28);
}

.project-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.project-featured-label {
    width: max-content;
    padding: 7px 11px;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
}

.project-header {
    display: grid;
    gap: 9px;
}

.project-title {
    margin: 0;
    color: #fff;
    font-family: "Baby Doll", cursive;
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    font-weight: 400;
    line-height: 1;
}

.project-meta,
.project-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.95rem;
}

.project-date i {
    color: #ffd700;
}

.project-description {
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    line-height: 1.65;
}

.project-people {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.project-avatar-stack {
    display: flex;
}

.project-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    margin-left: -8px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.38);
    border-radius: 50%;
    color: #ffd700;
    background: #131313;
    font-family: "Baby Doll", cursive;
}

.project-avatar:first-child {
    margin-left: 0;
}

.project-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-people-label {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.9rem;
}

.project-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    text-decoration: none;
}

.loading-spinner {
    grid-column: 1 / -1;
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 72px 20px;
    color: #ffd700;
    font-family: "Baby Doll", cursive;
}

.loading-spinner .material-icons {
    font-size: 2rem;
    animation: projectsSpinner 1.6s ease-in-out infinite;
}

.no-results-message {
    color: #ffd700;
    text-align: center;
}

@keyframes projectsSpinner {
    0%,
    100% {
        opacity: 0.55;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-6px);
    }
}

@media (max-width: 980px) {
    .projects-page-shell {
        padding-top: 126px;
    }

    .filters-container {
        align-items: stretch;
        flex-direction: column;
    }

    .projects-masonry {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-card,
    .project-card.featured-project {
        grid-column: span 1;
        flex-direction: column;
    }

    .project-image-container {
        flex-basis: auto;
        min-height: 220px;
    }
}

@media (max-width: 640px) {
    .projects-page-shell {
        width: min(100% - 22px, 1180px);
        padding-bottom: 56px;
    }

    .hero-title {
        font-size: 3.1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .categories {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-btn {
        width: 100%;
        padding: 0 10px;
    }

    .projects-masonry {
        grid-template-columns: 1fr;
    }

    .project-content {
        padding: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-card,
    .project-image,
    .category-btn,
    .project-link,
    .loading-spinner .material-icons {
        animation: none;
        transition: none;
    }
}
