/* Work page — portfolio grid, cards and lightbox */

.pf {
    --pf-ink: #0c1b33;
    --pf-blue: #1d4f91;
    --pf-teal: #2aa7b8;
    --pf-line: #e3e7ef;
    --pf-muted: #5d6879;
    --pf-radius: 18px;
}

.pf-section { padding-top: clamp(40px, 5vw, 64px); }

.pf-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Client logos ---------- */
.pf-brands { margin: 0 auto 36px; text-align: center; }
.pf-brands p { margin: 0 0 14px; color: var(--pf-muted); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.pf-brands ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 22px; margin: 0; padding: 0; list-style: none; }
.pf-brands li { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 84px; }
.pf-brands img { width: 64px; height: 64px; border-radius: 16px; object-fit: contain; background: #fff; border: 1px solid var(--pf-line); box-shadow: 0 4px 14px rgba(12, 27, 51, .08); transition: transform .25s ease; }
.pf-brands li:hover img { transform: translateY(-3px); }
.pf-brands span { max-width: 100%; color: var(--pf-ink); font-size: 11px; line-height: 1.3; }
@media (max-width: 720px) {
    .pf-brands ul { gap: 10px 14px; }
    .pf-brands li { width: 68px; }
    .pf-brands img { width: 52px; height: 52px; border-radius: 13px; }
}

.pf-logo,
.pf .pf-item .pf-media img.pf-logo { display: inline-block; width: 20px; height: 20px; border-radius: 5px; object-fit: contain; vertical-align: -5px; margin-right: 6px; background: #fff; transform: none; }
.pf-page-logo { position: relative; flex-shrink: 0; width: 42px; height: 42px; }
.pf-page-logo img { width: 100%; height: 100%; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--pf-line); }
.pf-page-logo .pf-page-icon { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; font-size: 10px; border: 2px solid #fff; }

/* ---------- Filter tabs ---------- */
.pf-tabs {
    position: sticky;
    top: 84px;
    z-index: 20;
    display: flex;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    margin: 0 auto clamp(28px, 4vw, 44px);
    padding: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--pf-line);
    border-radius: 999px;
    box-shadow: 0 10px 30px -18px rgba(12, 27, 51, .35);
}
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pf-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease, background .2s ease;
}
.pf-tabs a i { font-size: 13px; }
.pf-tabs a:hover { color: var(--pf-ink); background: #f1f4f9; }
.pf-tabs a.is-active { background: var(--pf-ink); color: #fff; }

/* ---------- Masonry grid ---------- */
.pf-grid {
    columns: 3 300px;
    column-gap: 24px;
}
.pf-item {
    break-inside: avoid;
    margin-bottom: 24px;
    display: block;
}
.pf-item[hidden] { display: none; }

/* ---------- Shared media ---------- */
.pf-media {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: var(--pf-radius);
    overflow: hidden;
    background: #e9edf4;
    cursor: pointer;
    color: inherit;
    text-align: left;
    isolation: isolate;
}
.pf-media img,
.pf-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.pf-shape--portrait { aspect-ratio: 9 / 16; }
.pf-shape--square { aspect-ratio: 4 / 5; }
.pf-shape--landscape { aspect-ratio: 16 / 10; }
.pf-media:hover img,
.pf-media:hover video { transform: scale(1.05); }
.pf-media:focus-visible { outline: 3px solid var(--pf-teal); outline-offset: 3px; }

.pf-count,
.pf-badge {
    position: absolute;
    z-index: 2;
    top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}
.pf-count { right: 14px; background: rgba(12, 27, 51, .72); color: #fff; backdrop-filter: blur(6px); }
.pf-badge { left: 14px; background: rgba(255, 255, 255, .92); color: var(--pf-ink); }

/* Graphic sets look like a stack of cards */
.pf-item--graphic .pf-media.is-stack { overflow: visible; margin-top: 10px; }
.pf-item--graphic .pf-media.is-stack img { border-radius: var(--pf-radius); }
.pf-item--graphic .pf-media.is-stack::before,
.pf-item--graphic .pf-media.is-stack::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 6%;
    right: 6%;
    top: -6px;
    height: 40px;
    border-radius: var(--pf-radius) var(--pf-radius) 0 0;
    background: #cfd8e6;
    transition: transform .4s ease;
}
.pf-item--graphic .pf-media.is-stack::after { left: 12%; right: 12%; top: -12px; background: #e2e8f1; z-index: -2; }
.pf-item--graphic .pf-media.is-stack:hover::before { transform: translateY(-4px); }
.pf-item--graphic .pf-media.is-stack:hover::after { transform: translateY(-8px); }
.pf-item--graphic .pf-media.is-stack:hover img { transform: none; }

.pf-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-radius: inherit;
    background: linear-gradient(180deg, transparent 45%, rgba(12, 27, 51, .85));
    color: #fff;
    opacity: 0;
    transition: opacity .35s ease;
}
.pf-overlay small { display: block; font-size: 12px; opacity: .75; margin-bottom: 2px; }
.pf-overlay strong { display: block; font-size: 16px; line-height: 1.3; }
.pf-overlay i {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--pf-ink);
    font-size: 14px;
    transform: scale(.6);
    transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
}
.pf-media:hover .pf-overlay,
.pf-media:focus-visible .pf-overlay { opacity: 1; }
.pf-media:hover .pf-overlay i { transform: scale(1); }

/* ---------- Videos ---------- */
.pf-video { background: var(--pf-ink); }
.pf-video::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(12, 27, 51, .15) 0%, transparent 30%, transparent 55%, rgba(12, 27, 51, .9) 100%);
    pointer-events: none;
}
.pf-play {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .22);
    border: 1px solid rgba(255, 255, 255, .5);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 20px;
    transition: transform .35s ease, opacity .35s ease, background .35s ease;
}
.pf-play i { margin-left: 3px; }
.pf-video:hover .pf-play { transform: scale(1.12); background: var(--pf-teal); border-color: var(--pf-teal); }
.pf-video.is-playing .pf-play { opacity: 0; transform: scale(.8); }
.pf-caption {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    color: #fff;
}
.pf-caption small { display: block; font-size: 12px; opacity: .75; }
.pf-caption strong { display: block; font-size: 17px; line-height: 1.3; margin-top: 2px; }
.pf-caption em {
    display: inline-flex;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(42, 167, 184, .9);
    font-style: normal;
    font-size: 12px;
    font-weight: 600;
}

/* ---------- Social pages ---------- */
.pf-page,
.pf-site,
.pf-case {
    background: #fff;
    border: 1px solid var(--pf-line);
    border-radius: calc(var(--pf-radius) + 4px);
    overflow: hidden;
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.pf-page:hover,
.pf-site:hover,
.pf-case:hover {
    transform: translateY(-6px);
    border-color: #d3dbe8;
    box-shadow: 0 26px 50px -28px rgba(12, 27, 51, .45);
}
.pf-page .pf-media,
.pf-case .pf-media { border-radius: 0; }

.pf-page-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}
.pf-page-head > div { flex: 1; min-width: 0; }
.pf-page-head strong { display: block; color: var(--pf-ink); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-page-head small { display: block; color: var(--pf-muted); font-size: 12px; }
.pf-page-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 18px;
    background: var(--pf-ink);
}
.pf-page--instagram .pf-page-icon { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.pf-page--facebook .pf-page-icon { background: #1877f2; }
.pf-page--tiktok .pf-page-icon { background: #010101; box-shadow: -2px -2px 0 #25f4ee inset, 2px 2px 0 #fe2c55 inset; }
.pf-page-follow {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--pf-ink);
    color: #fff !important;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s ease;
}
.pf-page--instagram .pf-page-follow:hover { background: #d6249f; }
.pf-page--facebook .pf-page-follow:hover { background: #1877f2; }
.pf-page--tiktok .pf-page-follow:hover { background: #fe2c55; }

.pf-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    margin: 0;
    border-bottom: 1px solid var(--pf-line);
}
.pf-stats div { padding: 14px 10px; text-align: center; }
.pf-stats div + div { border-left: 1px solid var(--pf-line); }
.pf-stats dt { font-size: 22px; font-weight: 700; color: var(--pf-ink); line-height: 1.1; letter-spacing: -.01em; }
.pf-stats dd { margin: 4px 0 0; font-size: 12px; color: var(--pf-muted); }
.pf-stats--inline { border: 1px solid var(--pf-line); border-radius: 12px; margin-top: 16px; }

.pf-body { padding: 18px 20px 22px; }
.pf-body h3 { margin: 0; font-size: 18px; line-height: 1.35; color: var(--pf-ink); }
.pf-body p { margin: 8px 0 0; font-size: 14.5px; color: var(--pf-muted); line-height: 1.6; }
.pf-client { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--pf-teal); margin-bottom: 6px; }
.pf-result {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 7px 12px;
    border-radius: 10px;
    background: #e8f6f8;
    color: #137986;
    font-size: 13.5px;
    font-weight: 600;
}
.pf-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--pf-blue);
    text-decoration: none;
}
.pf-link i { font-size: 11px; transition: transform .2s ease; }
.pf-link:hover i { transform: translate(2px, -2px); }

/* ---------- Websites ---------- */
.pf-browser { background: #f1f4f9; padding: 12px 12px 0; }
.pf-browser-bar { display: flex; align-items: center; gap: 6px; padding: 0 4px 10px; }
.pf-browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.pf-browser-bar span:nth-child(2) { background: #febc2e; }
.pf-browser-bar span:nth-child(3) { background: #28c840; }
.pf-browser-bar em {
    flex: 1;
    margin-left: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fff;
    font-style: normal;
    font-size: 12px;
    color: var(--pf-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pf-browser-shot {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    background: #fff;
    cursor: pointer;
}
/* Long screenshots scroll slowly on hover, like browsing the site */
.pf-browser-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: object-position 5s ease-in-out;
}
.pf-site:hover .pf-browser-shot img { object-position: bottom; }

/* ---------- Bottom prompt ---------- */
.pf-more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px 20px;
    margin-top: clamp(20px, 3vw, 36px);
    text-align: center;
}
.pf-more p { margin: 0; font-weight: 600; color: var(--pf-ink); }

/* ---------- Lightbox ---------- */
.pf-lb {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    grid-template-rows: 1fr auto;
    background: rgba(7, 14, 28, .94);
    backdrop-filter: blur(6px);
    animation: pf-fade .25s ease;
}
.pf-lb[hidden] { display: none; }
@keyframes pf-fade { from { opacity: 0; } }
.pf-lb-stage {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 64px 80px 12px;
    touch-action: pan-y;
}
.pf-lb-stage > * {
    max-width: 100%;
    max-height: calc(100vh - 160px);
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
    animation: pf-zoom .3s cubic-bezier(.2, .7, .2, 1);
}
.pf-lb-stage img { object-fit: contain; }
.pf-lb-stage video { background: #000; }
.pf-lb-stage iframe { width: min(1000px, 100%); aspect-ratio: 16 / 9; height: auto; border: 0; }
.pf-lb-stage iframe.is-short { width: auto; height: calc(100vh - 160px); aspect-ratio: 9 / 16; }
@keyframes pf-zoom { from { opacity: 0; transform: scale(.96); } }
.pf-lb-close,
.pf-lb-nav {
    position: absolute;
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.pf-lb-close:hover,
.pf-lb-nav:hover { background: rgba(255, 255, 255, .2); transform: scale(1.06); }
.pf-lb-close { top: 16px; right: 16px; }
.pf-lb-nav { top: 50%; margin-top: -40px; }
.pf-lb-prev { left: 18px; }
.pf-lb-next { right: 18px; }
.pf-lb-nav[hidden] { display: none; }
.pf-lb-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 14px 24px 22px;
    color: #fff;
}
.pf-lb-bar > div { flex: 1; min-width: 0; }
.pf-lb-bar small { display: block; font-size: 12px; opacity: .6; }
.pf-lb-bar strong { display: block; font-size: 16px; }
.pf-lb-counter { font-size: 13px; opacity: .7; font-variant-numeric: tabular-nums; }
.pf-lb-link {
    padding: 9px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--pf-ink, #0c1b33);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
body.pf-lb-open { overflow: hidden; }

@media (max-width: 720px) {
    .pf-tabs { top: 72px; justify-content: flex-start; }
    .pf-tabs a { padding: 9px 14px; font-size: 13px; }
    .pf-grid { columns: 2 160px; column-gap: 12px; }
    .pf-item { margin-bottom: 12px; }
    .pf-overlay { opacity: 1; padding: 12px; }
    .pf-overlay strong { font-size: 13px; }
    .pf-overlay i { display: none; }
    .pf-caption { padding: 12px; }
    .pf-caption strong { font-size: 14px; }
    .pf-play { width: 48px; height: 48px; margin: -24px 0 0 -24px; font-size: 16px; }
    .pf-item--instagram, .pf-item--facebook, .pf-item--tiktok, .pf-item--website, .pf-item--case { column-span: all; }
    .pf-lb-stage { padding: 60px 8px 8px; }
    .pf-lb-nav { display: none; }
    .pf-lb-stage > * { max-height: calc(100vh - 150px); }
}

@media (prefers-reduced-motion: reduce) {
    .pf-lb, .pf-lb-stage > * { animation: none; }
    .pf-browser-shot img { transition: none; }
}
