/* =========================================================
   PROJECTS — homepage "Selected Work" + projects.html
   ---------------------------------------------------------
   Monochrome only. Every value below is a grey (r = g = b).
   Shared pieces first (tokens, plates, tags, links, cards),
   then the homepage section, then the projects page.
   ========================================================= */

:root {
    --pj-bg: #050505;
    --pj-surface: #101010;
    --pj-surface-2: #161616;
    --pj-border: #252525;
    --pj-border-strong: #3d3d3d;
    --pj-muted: #666666;          /* large / decorative text only (≈3.6:1) */
    --pj-secondary: #a3a3a3;      /* readable small text (≈8.4:1)          */
    --pj-text: #ffffff;
    --pj-highlight: #f5f5f5;

    --pj-ease: var(--mono-ease, cubic-bezier(0.22, 0.61, 0.36, 1));
    --pj-dur: 0.5s;
}

.pj-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}


/* ---------- Labels ---------- */

.pj-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--pj-secondary);
}

.pj-label::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: 0.6;
}

.pj-label--plain::before {
    display: none;
}

.pj-num {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;

    color: var(--pj-secondary);
}

.pj-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 4px 10px;

    border: 1px solid var(--pj-border-strong);
    border-radius: 99px;

    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;

    color: var(--pj-highlight);
}

.pj-status::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--pj-highlight);
}


/* ---------- Technology tags ---------- */

.pj-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.pj-tags li {
    padding: 5px 10px;

    border: 1px solid var(--pj-border);
    border-radius: 99px;

    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.02em;

    color: var(--pj-secondary);

    transition: border-color var(--pj-dur) var(--pj-ease), color var(--pj-dur) var(--pj-ease);
}


/* ---------- Links (repository / demo) ---------- */

.pj-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.pj-link {
    position: relative;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    min-height: 44px;              /* touch target */

    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;

    color: var(--pj-text);
}

.pj-link::after {
    content: "";

    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;

    height: 1px;

    background: currentColor;

    transform: scaleX(0.28);
    transform-origin: left;
    opacity: 0.5;

    transition: transform var(--pj-dur) var(--pj-ease), opacity var(--pj-dur) var(--pj-ease);
}

.pj-link:hover,
.pj-link:focus-visible {
    color: var(--pj-text);
}

.pj-link:hover::after,
.pj-link:focus-visible::after {
    transform: scaleX(1);
    opacity: 1;
}

.pj-arrow {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex: none;

    transition: transform var(--pj-dur) var(--pj-ease);
}

.pj-arrow path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
}

.pj-link:hover .pj-arrow,
.pj-link:focus-visible .pj-arrow {
    transform: translate(2px, -2px);
}

/* Outline button: white outline that fills on hover (matches .tf-btn) */
.pj-btn {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 48px;
    padding: 0 22px;

    overflow: hidden;

    border: 1px solid var(--pj-text);
    border-radius: 99px;

    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;

    color: var(--pj-text);

    isolation: isolate;

    transition: color 0.45s var(--pj-ease);
}

.pj-btn::before {
    content: "";

    position: absolute;
    inset: 0;
    z-index: -1;

    background: var(--pj-text);

    transform: translateY(101%);

    transition: transform 0.45s var(--pj-ease);
}

.pj-btn:hover,
.pj-btn:focus-visible {
    color: #000;
}

.pj-btn:hover::before,
.pj-btn:focus-visible::before {
    transform: translateY(0);
}

.pj-btn--ghost {
    border-color: var(--pj-border-strong);
}

.pj-btn:hover .pj-arrow,
.pj-btn:focus-visible .pj-arrow {
    transform: translate(2px, -2px);
}


/* ---------- Preview plates ---------- */

.pj-plate {
    position: relative;

    margin: 0;
}

.pj-plate__frame {
    position: relative;

    aspect-ratio: 16 / 10;

    overflow: hidden;

    border: 1px solid var(--pj-border);
    border-radius: 6px;

    background-color: var(--pj-surface);
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 18px 18px;
    background-position: 9px 9px;

    transition: border-color var(--pj-dur) var(--pj-ease);
}

.pj-plate__frame > .pv {
    position: absolute;
    inset: 7% 6%;

    width: 88%;
    height: 86%;

    transition: transform 0.9s var(--pj-ease);
}

.pj-plate__frame > img {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center top;

    filter: grayscale(1) brightness(0.82) contrast(1.04);

    transform: scale(1.001);

    transition: transform 1.1s var(--pj-ease), filter var(--pj-dur) var(--pj-ease);
}

/* soft vignette so screenshots sit into the dark plate */
.pj-plate__frame--image::after {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background: linear-gradient(180deg, rgba(5, 5, 5, 0) 55%, rgba(5, 5, 5, 0.55) 100%);
}

.pj-plate__cap {
    display: flex;
    justify-content: space-between;
    gap: 12px;

    margin-top: 10px;

    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--pj-secondary);
}

.pj-plate__cap span:first-child {
    color: var(--pj-muted);
}


/* ---------- SVG diagram strokes ---------- */

.pv {
    display: block;

    overflow: visible;

    font-family: inherit;
}

.pv * {
    vector-effect: non-scaling-stroke;
}

.pv-l    { fill: none; stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; }
.pv-m    { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1; }
.pv-s    { fill: none; stroke: rgba(255, 255, 255, 0.9);  stroke-width: 1.2; }
.pv-hair { fill: none; stroke: rgba(255, 255, 255, 0.09); stroke-width: 1; }
.pv-hair2 { fill: none; stroke: rgba(255, 255, 255, 0.24); stroke-width: 1; }
.pv-dash { stroke-dasharray: 3 3; }
.pv-noFill { fill: none; }
.pv-bg   { fill: var(--pj-surface); }
.pv-ff   { fill: rgba(255, 255, 255, 0.06); }
.pv-ff2  { fill: rgba(255, 255, 255, 0.1); }
.pv-f    { fill: var(--pj-highlight); stroke: none; }
.pv-soft { fill-opacity: 0.85; }
.pv-dot  { fill: rgba(255, 255, 255, 0.42); stroke: none; }
.pv-inv  { fill: none; stroke: var(--pj-bg); stroke-width: 1.2; }

.pv-t {
    font-size: 7.5px;
    font-weight: 500;
    letter-spacing: 0.14em;

    fill: rgba(255, 255, 255, 0.52);
    stroke: none;
}

.pv-t-strong { fill: rgba(255, 255, 255, 0.9); }
.pv-t-sm     { font-size: 7px; }
.pv-t-xs     { font-size: 6.4px; letter-spacing: 0.1em; }
.pv-t-inv    { fill: var(--pj-bg); }

.pv-scan {
    transform-box: view-box;
}

/* Hover: data starts to flow along the connectors */
@keyframes pj-flow {
    to { stroke-dashoffset: -14; }
}

@keyframes pj-scan {
    0%, 100% { transform: translateY(-26px); }
    50%      { transform: translateY(26px); }
}


/* ---------- Shared hover behaviour ---------- */

.pj-hover:hover .pj-plate__frame,
.pj-hover:focus-within .pj-plate__frame {
    border-color: rgba(255, 255, 255, 0.5);
}

.pj-hover:hover .pj-plate__frame > .pv {
    transform: scale(1.025) translateY(-2px);
}

.pj-hover:hover .pj-plate__frame > img {
    filter: grayscale(1) brightness(0.95) contrast(1.06);
    transform: scale(1.035) translateY(-1%);
}

.pj-hover:hover .pv-flow {
    stroke-dasharray: 2 5;
    animation: pj-flow 0.9s linear infinite;
}

.pj-hover:hover .pv-scan {
    animation: pj-scan 2.4s var(--pj-ease) infinite;
}

.pj-hover:hover .pj-tags li {
    border-color: var(--pj-border-strong);
    color: var(--pj-highlight);
}

.pj-title-link {
    color: inherit;

    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;

    transition: background-size 0.6s var(--pj-ease), color var(--pj-dur) var(--pj-ease);
}

.pj-hover:hover .pj-title-link,
.pj-title-link:focus-visible {
    color: var(--pj-text);
    background-size: 100% 1px;
}


/* ---------- "More" disclosure (overview + key features) ---------- */

.pj-more {
    border-top: 1px solid var(--pj-border);
}

.pj-more > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 44px;

    cursor: pointer;
    list-style: none;

    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--pj-secondary);

    transition: color var(--pj-dur) var(--pj-ease);
}

.pj-more > summary::-webkit-details-marker {
    display: none;
}

.pj-more > summary:hover,
.pj-more[open] > summary {
    color: var(--pj-text);
}

.pj-more__icon {
    position: relative;

    width: 11px;
    height: 11px;
}

.pj-more__icon::before,
.pj-more__icon::after {
    content: "";

    position: absolute;
    top: 5px;
    left: 0;

    width: 11px;
    height: 1px;

    background: currentColor;

    transition: transform 0.35s var(--pj-ease);
}

.pj-more__icon::after {
    transform: rotate(90deg);
}

.pj-more[open] .pj-more__icon::after {
    transform: rotate(0deg);
}

.pj-more__body {
    padding: 4px 0 18px;
}

.pj-more__body p {
    margin-bottom: 14px;

    font-size: 14px;
    line-height: 1.6;

    color: var(--pj-secondary);
}

.pj-features {
    margin: 0;
    padding: 0;

    list-style: none;

    counter-reset: pj-feature;
}

.pj-features li {
    counter-increment: pj-feature;

    display: flex;
    gap: 12px;

    padding: 9px 0;

    border-top: 1px solid var(--pj-border);

    font-size: 13px;
    line-height: 1.45;

    color: var(--pj-highlight);
}

.pj-features li::before {
    content: counter(pj-feature, decimal-leading-zero);

    flex: none;

    width: 22px;

    font-size: 10px;
    line-height: 19px;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;

    color: var(--pj-secondary);
}


/* =========================================================
   HOMEPAGE — SELECTED WORK
   ========================================================= */

.section-selected-work .sw-count {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--pj-secondary);
}

.section-selected-work .sw-head-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.sw-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 0 64px;

    border-top: 1px solid var(--pj-border);
}

.sw-lead {
    padding-top: 32px;
}

.sw-side {
    display: flex;
    flex-direction: column;

    padding-top: 96px;                 /* asymmetric offset */
}

.sw-item {
    display: grid;
    gap: 18px;
}

.sw-item__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.sw-index {
    font-size: clamp(44px, 5vw, 88px);
    font-weight: 300;
    line-height: 0.9;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;

    color: var(--pj-muted);

    transition: color var(--pj-dur) var(--pj-ease);
}

.sw-item:hover .sw-index {
    color: var(--pj-text);
}

.sw-title {
    margin: 0;

    font-size: clamp(28px, 3vw, 44px);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.03em;

    color: var(--pj-highlight);
}

.sw-subtitle {
    margin: 6px 0 0;

    font-size: 13px;
    line-height: 1.45;

    color: var(--pj-secondary);
}

.sw-desc {
    max-width: 52ch;
    margin: 0;

    font-size: 15px;
    line-height: 1.6;

    color: var(--pj-secondary);
}

.sw-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

/* Secondary entries: number, compact preview beside the text */
.sw-item--secondary {
    padding: 28px 0;

    border-bottom: 1px solid var(--pj-border);
}

.sw-item--secondary:first-child {
    padding-top: 0;
}

.sw-item--secondary .sw-title {
    font-size: clamp(22px, 2vw, 30px);
}

.sw-item--secondary .sw-index {
    font-size: clamp(36px, 3.4vw, 56px);
}

.sw-item--secondary .sw-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.sw-item--secondary {
    gap: 16px;
}

.sw-item--secondary .pj-plate__cap {
    display: none;
}

.sw-item--secondary .sw-desc {
    font-size: 14px;
}

/* CTA */
.sw-cta {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    margin-top: 72px;
    padding: 34px 0;

    border-top: 1px solid var(--pj-border);
    border-bottom: 1px solid var(--pj-border);

    color: var(--pj-text);

    transition: border-color var(--pj-dur) var(--pj-ease);
}

.sw-cta__text {
    font-size: clamp(26px, 4.4vw, 64px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.035em;
    text-transform: uppercase;

    transition: letter-spacing 0.7s var(--pj-ease);
}

.sw-cta__meta {
    display: flex;
    align-items: center;
    gap: 28px;

    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--pj-secondary);
}

.sw-cta__arrow {
    display: grid;
    place-items: center;

    width: 64px;
    height: 64px;
    flex: none;

    border: 1px solid var(--pj-border-strong);
    border-radius: 50%;

    transition: background-color 0.45s var(--pj-ease), border-color 0.45s var(--pj-ease), color 0.45s var(--pj-ease);
}

.sw-cta__arrow svg {
    width: 20px;
    height: 20px;

    transition: transform 0.45s var(--pj-ease);
}

.sw-cta__arrow path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.3;
}

.sw-cta:hover,
.sw-cta:focus-visible {
    color: var(--pj-text);
    border-color: rgba(255, 255, 255, 0.4);
}

.sw-cta:hover .sw-cta__text,
.sw-cta:focus-visible .sw-cta__text {
    letter-spacing: -0.02em;
}

.sw-cta:hover .sw-cta__arrow,
.sw-cta:focus-visible .sw-cta__arrow {
    background: var(--pj-text);
    border-color: var(--pj-text);
    color: #000;
}

.sw-cta:hover .sw-cta__arrow svg,
.sw-cta:focus-visible .sw-cta__arrow svg {
    transform: translateX(4px);
}

@media (max-width: 1199px) {
    .sw-grid {
        gap: 0 40px;
    }

    .sw-side {
        padding-top: 64px;
    }

    .sw-item--secondary .sw-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .sw-grid {
        grid-template-columns: 1fr;
    }

    .sw-side {
        padding-top: 48px;
    }

    .sw-item--secondary .sw-body {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    }

    .sw-cta {
        margin-top: 48px;
    }
}

@media (max-width: 575px) {
    .sw-item--secondary .sw-body {
        grid-template-columns: 1fr;
    }

    .sw-cta {
        padding: 24px 0;
    }

    .sw-cta__meta .sw-cta__count {
        display: none;
    }

    .sw-cta__arrow {
        width: 48px;
        height: 48px;
    }
}


/* =========================================================
   PROJECTS PAGE
   ========================================================= */

.page-projects .tf-header {
    position: relative;
    z-index: 5;
}

.pjp-section {
    position: relative;
}

/* ---------- A. Hero ---------- */

.pjp-hero {
    padding-top: 200px;
    padding-bottom: 96px;
}

.pjp-hero__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding-bottom: 20px;

    border-bottom: 1px solid var(--pj-border);
}

.pjp-hero__title {
    margin: 0;
    padding: 56px 0 40px;

    font-size: clamp(64px, 13vw, 208px);
    font-weight: 500;
    line-height: 0.88;
    letter-spacing: -0.055em;

    color: var(--pj-text);
}

.pjp-hero__title .dot {
    color: var(--pj-muted);
}

.pjp-hero__body {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 40px 64px;
    align-items: end;
}

.pjp-hero__lede {
    max-width: 44ch;
    margin: 0;

    font-size: 18px;
    line-height: 1.6;

    color: var(--pj-secondary);
}

.pjp-hero__total {
    display: flex;
    align-items: baseline;
    gap: 12px;

    margin-bottom: 20px;
}

.pjp-hero__total strong {
    font-size: clamp(48px, 6vw, 88px);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;

    color: var(--pj-text);
}

.pjp-hero__total span {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--pj-secondary);
}

/* Category index: each row jumps to the filtered archive */
.pjp-index {
    margin: 0;
    padding: 0;

    list-style: none;

    border-top: 1px solid var(--pj-border);
}

.pjp-index a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;

    min-height: 48px;
    padding: 12px 0;

    border-bottom: 1px solid var(--pj-border);

    font-size: 15px;
    font-weight: 500;

    color: var(--pj-highlight);

    transition: padding 0.45s var(--pj-ease), color 0.45s var(--pj-ease), border-color 0.45s var(--pj-ease);
}

.pjp-index a span:last-child {
    font-size: 12px;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;

    color: var(--pj-secondary);
}

.pjp-index a:hover,
.pjp-index a:focus-visible {
    padding-left: 10px;

    color: var(--pj-text);
    border-color: rgba(255, 255, 255, 0.4);
}


/* ---------- Section headings ---------- */

.pjp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 16px 32px;

    margin-bottom: 48px;
    padding-bottom: 20px;

    border-bottom: 1px solid var(--pj-border);
}

.pjp-head h2 {
    margin: 14px 0 0;

    font-size: clamp(36px, 5vw, 72px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.04em;

    color: var(--pj-text);
}

.pjp-head p {
    max-width: 40ch;
    margin: 0;

    font-size: 14px;
    line-height: 1.6;

    color: var(--pj-secondary);
}


/* ---------- B. Featured ---------- */

.pjp-featured {
    padding-bottom: 120px;
}

.pjf {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 40px 72px;
    align-items: start;

    padding: 56px 0;

    border-bottom: 1px solid var(--pj-border);
}

.pjf:first-of-type {
    padding-top: 0;
}

.pjf--flip .pjf__media {
    order: 2;
}

.pjf__body {
    display: grid;
    gap: 22px;

    padding-top: 8px;
}

.pjf__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
}

.pjf__index {
    font-size: clamp(64px, 7vw, 120px);
    font-weight: 300;
    line-height: 0.85;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;

    color: var(--pj-muted);

    transition: color var(--pj-dur) var(--pj-ease);
}

.pjf:hover .pjf__index {
    color: var(--pj-text);
}

.pjf__title {
    margin: 0;

    font-size: clamp(34px, 4vw, 60px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.04em;

    color: var(--pj-highlight);
}

.pjf__subtitle {
    margin: 10px 0 0;

    font-size: 14px;
    line-height: 1.5;

    color: var(--pj-secondary);
}

.pjf__desc {
    margin: 0;

    font-size: 17px;
    line-height: 1.6;

    color: var(--pj-highlight);
}

.pjf__overview {
    margin: 0;

    font-size: 15px;
    line-height: 1.65;

    color: var(--pj-secondary);
}

.pjf .pj-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
}

.pjf__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    padding-top: 6px;
}


/* ---------- C. Toolbar: filters + search ---------- */

.pjp-archive {
    padding-bottom: 140px;
}

/* Row 1: category filters. Row 2: result count + search. Sticks while browsing. */
.pj-toolbar {
    position: sticky;
    top: 0;
    z-index: 4;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "filters filters"
        "result  search";
    align-items: center;
    gap: 14px 24px;

    margin-bottom: 40px;
    padding: 14px 0 18px;

    transition: background-color 0.35s var(--pj-ease), box-shadow 0.35s var(--pj-ease);
}

/* Only once it is actually stuck to the top (set by projects-ui.js) */
.pj-toolbar.is-stuck {
    background-color: rgba(5, 5, 5, 0.94);
    box-shadow: 0 1px 0 var(--pj-border), -100vmax 0 0 rgba(5, 5, 5, 0.94), 100vmax 0 0 rgba(5, 5, 5, 0.94);
    clip-path: inset(0 -100vmax -1px -100vmax);
}

.pj-filters {
    grid-area: filters;

    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pj-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    min-height: 40px;
    padding: 0 16px;

    border: 1px solid var(--pj-border);
    border-radius: 99px;

    background: transparent;

    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    white-space: nowrap;

    color: var(--pj-secondary);

    cursor: pointer;

    transition: border-color 0.35s var(--pj-ease), color 0.35s var(--pj-ease), background-color 0.35s var(--pj-ease);
}

.pj-filter__count {
    font-size: 10px;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;

    opacity: 0.8;
}

.pj-filter:hover {
    border-color: var(--pj-border-strong);
    color: var(--pj-text);
}

.pj-filter[aria-pressed="true"] {
    border-color: var(--pj-text);
    background: var(--pj-text);
    color: #000;
}

.pj-filter:disabled {
    cursor: default;
    opacity: 0.38;
}

.pj-search {
    grid-area: search;

    position: relative;

    display: flex;
    align-items: center;

    width: 340px;
}

.pj-search__icon {
    position: absolute;
    left: 14px;

    width: 14px;
    height: 14px;

    pointer-events: none;

    color: var(--pj-secondary);
}

.pj-search__icon circle,
.pj-search__icon path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
}

.pj-search input {
    width: 100%;
    height: 44px;
    padding: 0 40px 0 38px;

    border: 1px solid var(--pj-border);
    border-radius: 99px;

    background: var(--pj-surface);

    font-family: inherit;
    font-size: 14px;

    color: var(--pj-text);

    transition: border-color 0.35s var(--pj-ease);
}

.pj-search input::placeholder {
    color: var(--pj-secondary);
    opacity: 1;
}

.pj-search input:focus {
    outline: none;
    border-color: var(--pj-text);
}

.pj-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
            appearance: none;
}

.pj-search__kbd {
    position: absolute;
    right: 12px;

    min-width: 20px;
    padding: 1px 6px;

    border: 1px solid var(--pj-border-strong);
    border-radius: 4px;

    font-family: inherit;
    font-size: 11px;
    text-align: center;

    color: var(--pj-secondary);

    pointer-events: none;
}

.pj-search__clear {
    position: absolute;
    right: 6px;

    display: none;
    place-items: center;

    width: 32px;
    height: 32px;

    border: 0;
    border-radius: 50%;

    background: transparent;

    color: var(--pj-secondary);

    cursor: pointer;
}

.pj-search__clear:hover {
    color: var(--pj-text);
}

.pj-search.has-value .pj-search__clear {
    display: grid;
}

.pj-search.has-value .pj-search__kbd {
    display: none;
}

.pj-result {
    grid-area: result;

    margin: 0;

    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;

    color: var(--pj-secondary);
}

.pj-result strong {
    font-weight: 500;
    color: var(--pj-text);
}


/* ---------- D. Archive grid ---------- */

.pj-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 72px 32px;
}

.pj-card {
    display: flex;
    flex-direction: column;
    gap: 18px;

    min-width: 0;
}

.pj-card.d-7  { grid-column: span 7; }
.pj-card.d-5  { grid-column: span 5; }
.pj-card.d-4  { grid-column: span 4; }
.pj-card.d-6  { grid-column: span 6; }
.pj-card.d-12 { grid-column: span 12; }

/* Push the narrower partner down a little: editorial stagger */
.pj-card.d-5.is-offset,
.pj-card.d-4.is-offset {
    margin-top: 64px;
}

.pj-card__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;

    padding-top: 14px;

    border-top: 1px solid var(--pj-border);

    transition: border-color var(--pj-dur) var(--pj-ease);
}

.pj-card:hover .pj-card__meta {
    border-color: rgba(255, 255, 255, 0.4);
}

.pj-card__num {
    font-size: clamp(40px, 4.2vw, 64px);
    font-weight: 300;
    line-height: 0.85;
    letter-spacing: -0.045em;
    font-variant-numeric: tabular-nums;

    color: var(--pj-muted);

    transition: color var(--pj-dur) var(--pj-ease);
}

.pj-card:hover .pj-card__num {
    color: var(--pj-text);
}

.pj-card__cat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;

    text-align: right;
}

.pj-card__flag {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;

    color: var(--pj-highlight);
}

.pj-card__title {
    margin: 0;

    font-size: 26px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.03em;

    color: var(--pj-highlight);
}

.pj-card.d-7 .pj-card__title,
.pj-card.d-12 .pj-card__title {
    font-size: clamp(28px, 2.8vw, 40px);
}

.pj-card__subtitle {
    margin: 6px 0 0;

    font-size: 13px;
    line-height: 1.45;

    color: var(--pj-secondary);
}

.pj-card__desc {
    margin: 0;

    font-size: 15px;
    line-height: 1.6;

    color: var(--pj-secondary);
}

.pj-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 20px;
}

/* Wide row card: preview left, text right */
.pj-card.d-12 {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas:
        "meta  meta"
        "media text";
    gap: 18px 48px;
}

.pj-card.d-12 .pj-card__meta  { grid-area: meta; }
.pj-card.d-12 .pj-plate       { grid-area: media; }
.pj-card.d-12 .pj-card__text  { grid-area: text; align-self: start; }

.pj-card__text {
    display: flex;
    flex-direction: column;
    gap: 16px;

    min-width: 0;
}

/* Entrance after a filter change */
.pj-card.is-entering {
    opacity: 0;
    transform: translateY(14px);
}

.pj-card {
    transition: opacity 0.6s var(--pj-ease), transform 0.6s var(--pj-ease);
}

/* Empty state */
.pj-empty {
    display: grid;
    justify-items: start;
    gap: 18px;

    padding: 72px 0;

    border-top: 1px solid var(--pj-border);
    border-bottom: 1px solid var(--pj-border);
}

.pj-empty[hidden] {
    display: none;
}

.pj-empty__title {
    margin: 0;

    font-size: clamp(28px, 3.4vw, 48px);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.035em;

    color: var(--pj-text);
}

.pj-empty p {
    max-width: 48ch;
    margin: 0;

    font-size: 15px;
    line-height: 1.6;

    color: var(--pj-secondary);
}


/* ---------- Closing CTA ---------- */

.pjp-outro {
    padding-bottom: 120px;
}

.pjp-outro__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 32px;

    padding-top: 48px;

    border-top: 1px solid var(--pj-border);
}

.pjp-outro h2 {
    max-width: 16ch;
    margin: 14px 0 0;

    font-size: clamp(36px, 5vw, 72px);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.04em;

    color: var(--pj-text);
}

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


/* ---------- Responsive ---------- */

@media (max-width: 1199px) {
    .pjp-hero {
        padding-top: 150px;
    }

    .pjf {
        gap: 32px 40px;
    }

    .pj-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 56px 28px;
    }

    .pj-card.d-7,
    .pj-card.d-5,
    .pj-card.d-4,
    .pj-card.d-6 {
        grid-column: span 1;
    }

    .pj-card.d-5.is-offset,
    .pj-card.d-4.is-offset {
        margin-top: 0;
    }

    .pj-card.d-12,
    .pj-card.t-2 {
        grid-column: span 2;
    }

    .pj-card.t-2:not(.d-12) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "meta  meta"
            "media text";
        gap: 18px 28px;
    }

    .pj-card.t-2:not(.d-12) .pj-card__meta  { grid-area: meta; }
    .pj-card.t-2:not(.d-12) .pj-plate       { grid-area: media; }
    .pj-card.t-2:not(.d-12) .pj-card__text  { grid-area: text; }

    .pj-card.d-12 {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 18px 28px;
    }
}

@media (max-width: 991px) {
    .pjp-hero__body {
        grid-template-columns: 1fr;
    }

    .pjf,
    .pjf--flip {
        grid-template-columns: 1fr;
    }

    .pjf--flip .pjf__media {
        order: 0;
    }

    .pj-toolbar,
    .pj-toolbar.is-stuck {
        position: static;

        background: none;
        box-shadow: none;
        clip-path: none;
    }

    .pj-toolbar {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "filters"
            "search"
            "result";
    }

    .pj-search {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .pjp-hero {
        padding-top: 128px;
        padding-bottom: 64px;
    }

    .pjp-hero__title {
        padding: 40px 0 28px;
    }

    .pjp-hero__lede {
        font-size: 16px;
    }

    .pjp-featured,
    .pjp-archive,
    .pjp-outro {
        padding-bottom: 80px;
    }

    .pjf {
        padding: 40px 0;
    }

    .pjf .pj-features {
        grid-template-columns: 1fr;
    }

    /* Filters scroll sideways on phones rather than wrapping into a wall */
    .pj-filters {
        flex-wrap: nowrap;

        width: calc(100% + 30px);
        margin: 0 -15px;
        padding: 2px 15px 6px;

        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 15px;
        scrollbar-width: none;

        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 15px, #000 calc(100% - 28px), transparent 100%);
                mask-image: linear-gradient(90deg, transparent 0, #000 15px, #000 calc(100% - 28px), transparent 100%);
    }

    .pj-filters::-webkit-scrollbar {
        display: none;
    }

    .pj-filter {
        min-height: 44px;
        scroll-snap-align: start;
    }

    .pj-grid {
        grid-template-columns: 1fr;
        gap: 56px;
    }

    .pj-card.d-12,
    .pj-card.t-2,
    .pj-card.t-2:not(.d-12) {
        display: flex;
        grid-column: auto;
    }
}


/* ---------- Scroll reveal (only when JS is running) ---------- */

.pj-js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);

    transition: opacity 0.9s var(--pj-ease), transform 0.9s var(--pj-ease);
}

.pj-js [data-reveal].is-in {
    opacity: 1;
    transform: none;
}


/* ---------- Touch & reduced motion ---------- */

/* No hover on touch screens: keep previews still and readable */
@media (hover: none) {
    .pj-hover:hover .pj-plate__frame > .pv,
    .pj-hover:hover .pj-plate__frame > img {
        transform: none;
    }

    .pj-hover:hover .pv-flow,
    .pj-hover:hover .pv-scan {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pj-plate__frame > .pv,
    .pj-plate__frame > img,
    .pj-card,
    .pj-link::after,
    .pj-arrow,
    .sw-cta__text,
    .sw-cta__arrow svg,
    .pjp-index a {
        transition: none !important;
    }

    .pj-hover:hover .pj-plate__frame > .pv,
    .pj-hover:hover .pj-plate__frame > img {
        transform: none;
    }

    .pj-hover:hover .pv-flow,
    .pj-hover:hover .pv-scan {
        animation: none;
    }

    .pj-card.is-entering,
    .pj-js [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
