/* ==========================================
   PORTFOLIO PAGE — Mosaic tiles (visual language from home tiles)
   ========================================== */

/* ---- HERO ---- */
.portfolio-dark .pf-hero {
    padding: 200px 0 80px;
    min-height: 55vh;
    display: flex;
    align-items: flex-end;
    position: relative;
    overflow: hidden;
    background: var(--color-bg);
}
.portfolio-dark .pf-hero::before {
    content: none;
}

.portfolio-dark .pf-hero::after {
    content: '';
    position: absolute;
    right: 4vw;
    bottom: 92px;
    width: min(360px, 42vw);
    height: 1px;
    background: var(--color-line);
    transform: rotate(-3deg);
    box-shadow: none;
    pointer-events: none;
}
.pf-hero__inner {
    position: relative;
    z-index: 1;
}
.pf-hero__tag {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: .25em;
    color: rgba(242, 239, 230, .48);
    margin-bottom: var(--spacing-xl);
    text-shadow: none;
}
.pf-hero__title {
    font-size: clamp(4.5rem, 14vw, 12rem);
    line-height: .82;
    color: #fff;
    margin: 0;
    font-weight: 800;
    text-shadow: none;
}
.pf-hero__title-line { display: block; }
.pf-hero__title .text-italic { color: var(--color-accent-light); }

/* ---- FILTERS ---- */
.portfolio-dark .pf-filters {
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid var(--color-line);
    position: sticky;
    top: 68px;
    z-index: 50;
    background: rgba(21, 21, 26, .94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.portfolio-dark .pf-filters__list {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}
.portfolio-dark .pf-filters__btn {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: .1em;
    background: #000;
    border: 1px solid var(--color-line);
    border-radius: 0;
    padding: 8px 20px;
    cursor: pointer;
    color: rgba(255,255,255,.5);
    clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
    transition: color .3s ease, border-color .3s ease, transform .3s var(--ease-out-expo), box-shadow .3s ease;
}
.portfolio-dark .pf-filters__btn:hover {
    border-color: var(--jinx-pink);
    color: #fff;
    transform: skewX(-6deg);
    box-shadow: none;
}
.portfolio-dark .pf-filters__btn--active {
    background: var(--jinx-pink);
    color: var(--jinx-paper);
    border-color: var(--jinx-pink);
    box-shadow: none;
}

/* ---- PROJECT INDEX ---- */
.pf-tiles-section {
    padding: var(--spacing-xl) 0 var(--spacing-5xl);
    background: #0F0F14;
}

.pf-tiles-grid {
    display: block;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    border-top: 1px solid var(--color-line);
}

.pf-tile {
    position: relative;
    display: grid;
    grid-template-columns: 60px 72px minmax(0, 1.45fr) minmax(120px, .8fr) minmax(120px, .8fr) 110px 42px;
    gap: 16px;
    align-items: center;
    min-height: 112px;
    padding: 18px 0;
    overflow: visible;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--color-line);
    text-decoration: none;
    color: #fff;
    clip-path: none;
    transition: background .35s ease, border-color .35s ease, color .35s ease;
}

.pf-tile::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -16px;
    width: 3px;
    background: var(--jinx-pink);
    opacity: 0;
    transform: scaleY(.35);
    transform-origin: center;
    transition: opacity .25s ease, transform .35s var(--ease-out-expo);
    pointer-events: none;
}

.pf-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(90deg, rgba(var(--jinx-pink-rgb), .08), transparent 44%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.pf-tile:hover {
    background: rgba(242, 239, 230, .02);
    border-bottom-color: rgba(var(--jinx-pink-rgb), .52);
}

.pf-tile:hover::before {
    opacity: 1;
    transform: scaleY(1);
}

.pf-tile:hover::after { opacity: 1; }

.pf-tile.filtered-out {
    display: none;
}

/* ---- TILE IMAGE ---- */
.pf-tile__image {
    position: relative;
    z-index: 1;
    grid-column: 2;
    grid-row: 1;
    width: 56px;
    height: 72px;
    overflow: hidden;
    background: #15151A;
    border: 1px solid var(--color-line);
}

.pf-tile__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .7s var(--ease-out-expo);
    filter: none;
}

.pf-tile:hover .pf-tile__image img {
    transform: scale(1.08);
    filter: none;
}

.pf-tile__no-image {
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,.03);
}

/* ---- TILE OVERLAY ---- */
.pf-tile__overlay {
    display: contents;
}

.pf-tile__num {
    position: relative;
    z-index: 1;
    grid-column: 1;
    grid-row: 1;
    font-family: var(--font-display), sans-serif;
    font-size: clamp(1.45rem, 2vw, 2.2rem);
    font-weight: 800;
    color: rgba(242, 239, 230, .18);
    line-height: 1;
    transition: color .35s ease, transform .35s var(--ease-out-expo);
    user-select: none;
}

.pf-tile:hover .pf-tile__num {
    color: var(--jinx-pink);
    transform: translateX(4px);
}

.pf-tile__info {
    display: contents;
}

.pf-tile__cat {
    position: relative;
    z-index: 1;
    grid-column: 4;
    grid-row: 1;
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: .15em;
    color: rgba(242, 239, 230, .62);
    display: block;
    transform: none;
    opacity: 1;
    transition: color .3s ease;
}

.pf-tile:hover .pf-tile__cat {
    color: var(--jinx-paper);
}

.pf-tile__title {
    position: relative;
    z-index: 1;
    grid-column: 3;
    grid-row: 1;
    font-family: var(--font-display), sans-serif;
    font-size: clamp(1.35rem, 2.6vw, 2.15rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    color: #fff;
    display: block;
    line-height: 1;
    transform: none;
    transition: transform .45s var(--ease-out-expo), color .3s ease;
}

.pf-tile:hover .pf-tile__title {
    transform: translateX(10px);
    color: var(--jinx-paper);
    text-shadow: none;
}

.pf-tile__client,
.pf-tile__year {
    position: relative;
    z-index: 1;
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    line-height: 1.45;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(242, 239, 230, .72);
}

.pf-tile__client {
    grid-column: 5;
    grid-row: 1;
}

.pf-tile__year {
    grid-column: 6;
    grid-row: 1;
    color: rgba(242, 239, 230, .48);
}

.pf-tile__arrow {
    position: relative;
    z-index: 1;
    grid-column: 7;
    grid-row: 1;
    display: block;
    font-size: 1.2rem;
    color: var(--jinx-pink);
    text-align: right;
    margin-top: 0;
    transform: none;
    opacity: 1;
    transition: transform .35s var(--ease-out-expo), color .3s ease;
}

.pf-tile:hover .pf-tile__arrow {
    color: var(--jinx-pink);
    transform: translateX(4px);
    text-shadow: none;
}

/* ---- CTA DARK ---- */
.cta-dark {
    background: #0C0C0C !important;
    position: relative;
    overflow: hidden;
}
.cta-dark::before {
    content: none;
}
.cta-dark .cta-label { color: rgba(255,255,255,.35); }
.cta-dark h2 { color: #fff; }
.cta-dark h2 .text-italic { color: var(--color-accent-light); }
.cta-dark p { color: rgba(255,255,255,.5); }
.cta-dark .btn-ghost { border-color: rgba(255,255,255,.2); color: #fff; }
.cta-dark .btn-ghost::before { background: #fff; }
.cta-dark .btn-ghost:hover { color: #000; }

/* ---- RESPONSIVE ---- */
@media(max-width:1100px) {
    .pf-tile {
        grid-template-columns: 48px 64px minmax(0, 1.3fr) minmax(112px, .8fr) minmax(100px, .7fr) 72px 32px;
        gap: 14px;
    }
}

@media(max-width:768px) {
    .portfolio-dark .pf-hero { padding: 140px 0 40px; min-height: 40vh; }
    .pf-hero__title { font-size: clamp(3rem, 12vw, 5rem); }
    .portfolio-dark .pf-filters { position: relative; top: 0; }
    .portfolio-dark .pf-filters__btn { font-size: .6rem; padding: 6px 14px; }
    .pf-tiles-grid { padding: 0 var(--spacing-lg); }
    .pf-tile {
        grid-template-columns: 38px 52px minmax(0, 1fr) 28px;
        gap: 12px;
        min-height: 96px;
        padding: 14px 0;
    }
    .pf-tile__image {
        grid-column: 2;
        width: 48px;
        height: 60px;
    }
    .pf-tile__num {
        grid-column: 1;
        font-size: 1.25rem;
    }
    .pf-tile__title {
        grid-column: 3;
        grid-row: 1;
        font-size: clamp(1rem, 5.6vw, 1.45rem);
        line-height: 1.05;
    }
    .pf-tile__cat {
        grid-column: 3;
        grid-row: 2;
        font-size: .62rem;
    }
    .pf-tile__client,
    .pf-tile__year {
        display: none;
    }
    .pf-tile__arrow {
        grid-column: 4;
        font-size: 1rem;
    }
}
