/* ========================================
   WORK PAGE — Matrix Theme Portfolio Grid
   vanini.space
   ======================================== */

/* ============ BACKGROUND ART ============ */
.work-bg-art {
    position: fixed;
    z-index: 0;
    top: 50%;
    left: 50%;
    width: 300vmax;
    height: 300vmax;
    transform: translate(-50%, -50%);
    background: url('/static/img/design-155.jpg') center center / cover no-repeat;
    opacity: 0.06;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* ============ HERO ============ */
.work-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 160px 40px 64px;
}

.work-title {
    font-family: var(--font-display);
    font-size: 16vw;
    font-weight: 700;
    line-height: 0.85;
    letter-spacing: 6px;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    gap: 0.02em;
    overflow: hidden;
    background: linear-gradient(
        180deg,
        rgba(0, 255, 65, 1) 0%,
        rgba(0, 255, 65, 0.7) 40%,
        rgba(0, 255, 65, 0.35) 70%,
        rgba(0, 255, 65, 0.15) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.work-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: charReveal 0.8s ease-out forwards;
}

.work-title .char:nth-child(1) { animation-delay: 0.05s; }
.work-title .char:nth-child(2) { animation-delay: 0.10s; }
.work-title .char:nth-child(3) { animation-delay: 0.15s; }
.work-title .char:nth-child(4) { animation-delay: 0.20s; }

.work-sub {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 20px;
    opacity: 0;
    animation: fadeUp 0.8s ease-out 0.35s forwards;
}

/* ============ FILTER BAR ============ */
.filter-bar {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 0 40px 48px;
    opacity: 0;
    animation: fadeUp 0.8s ease-out 0.45s forwards;
}

.filter-pill {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    height: 30px;
    padding: 0 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.filter-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--matrix-green);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s ease-out;
    z-index: 0;
}

.filter-pill span {
    position: relative;
    z-index: 1;
}

.filter-pill:hover::before,
.filter-pill:active::before,
.filter-pill.active::before {
    transform: scaleX(1);
}

.filter-pill:hover,
.filter-pill:active,
.filter-pill.active {
    color: var(--bg-primary);
    border-color: var(--matrix-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.15);
}

/* ============ PROJECT GRID (CSS columns masonry) ============ */
.work-grid {
    position: relative;
    z-index: 1;
    column-count: 3;
    column-gap: 16px;
    padding: 0 40px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============ EMPTY STATE ============ */
.work-empty {
    text-align: center;
    padding: 80px 20px;
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeUp 0.8s ease-out 0.5s forwards;
}

.work-empty::before {
    content: '[ ]';
    display: block;
    font-size: 3rem;
    color: var(--matrix-green);
    opacity: 0.3;
    margin-bottom: 20px;
}

/* ============ PROJECT CARD ============ */
.work-card {
    break-inside: avoid;
    margin-bottom: 16px;
    display: block;
    color: inherit;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease-out forwards;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.4s ease;
}

.work-card:nth-child(1) { animation-delay: 0.1s; }
.work-card:nth-child(2) { animation-delay: 0.15s; }
.work-card:nth-child(3) { animation-delay: 0.2s; }
.work-card:nth-child(4) { animation-delay: 0.25s; }
.work-card:nth-child(5) { animation-delay: 0.3s; }
.work-card:nth-child(6) { animation-delay: 0.35s; }
.work-card:nth-child(7) { animation-delay: 0.4s; }
.work-card:nth-child(8) { animation-delay: 0.45s; }

.work-card:hover,
.work-card:active {
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.12), 0 0 50px rgba(0, 255, 65, 0.05);
}

/* ---- Card image area ---- */
.work-card-img {
    overflow: hidden;
    position: relative;
    border-radius: 4px;
    aspect-ratio: 4 / 3;
}

.work-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.work-card:hover .work-card-img img,
.work-card:active .work-card-img img {
    transform: scale(1.04);
}

/* Placeholder for cards without images */
.work-card-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(0, 255, 65, 0.04) 8px,
        rgba(0, 255, 65, 0.04) 16px
    );
}

/* Hover tag label slides up from bottom */
.work-card-tag-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--matrix-green);
    background: linear-gradient(to top, rgba(15, 15, 23, 0.85) 0%, transparent 100%);
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s ease-out, opacity 0.4s ease;
    pointer-events: none;
}

.work-card:hover .work-card-tag-overlay,
.work-card:active .work-card-tag-overlay {
    transform: translateY(0);
    opacity: 1;
}

/* ---- Card info ---- */
.work-card-info {
    padding: 12px 2px 4px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.work-card-name {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 400;
    color: var(--matrix-green);
    letter-spacing: 1px;
    transition: opacity 0.4s ease;
}

.work-card-desc {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.work-card-tags {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============ CARD HIDDEN (filter) ============ */
.work-card.card-hidden {
    display: none;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1024px) {
    .work-hero {
        padding: 140px 32px 56px;
    }

    .work-grid {
        padding: 0 32px 64px;
    }

    .filter-bar {
        padding: 0 32px 40px;
    }
}

@media (max-width: 768px) {
    .work-hero {
        padding: 120px 24px 48px;
    }

    .work-title {
        font-size: 20vw;
    }

    .work-grid {
        column-count: 2;
        column-gap: 12px;
        padding: 0 24px 56px;
    }

    .work-card {
        margin-bottom: 12px;
    }

    .filter-bar {
        padding: 0 24px 36px;
        gap: 6px;
    }

    .filter-pill {
        height: 28px;
        padding: 0 12px;
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .work-hero {
        padding: 100px 16px 36px;
    }

    .work-title {
        font-size: 24vw;
    }

    .work-sub {
        font-size: 11px;
        letter-spacing: 0.08em;
        margin-top: 14px;
    }

    .work-grid {
        column-count: 1;
        column-gap: 0;
        padding: 0 16px 48px;
    }

    .work-card {
        margin-bottom: 20px;
    }

    .filter-bar {
        padding: 0 16px 28px;
    }

    .work-card-name {
        font-size: 15px;
    }

    .work-card-tags {
        font-size: 9px;
    }
}

@media (pointer: coarse) {
    .filter-pill {
        min-height: 44px;
    }
}

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

@keyframes charReveal {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .work-title .char,
    .work-sub,
    .filter-bar,
    .work-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
