/* Portfólio — sidneyjr.com/portfolio/
   Usa os tokens do style.css do site (--bg, --panel, --text, --muted, --line, --accent, --accent-2, --font-display, --font-body). */

.pf { --pf-gap: clamp(18px, 2.2vw, 32px); --pf-surface: #131318; }

/* Abertura */
.pf-hero { padding: clamp(150px, 20vw, 210px) 0 clamp(40px, 6vw, 70px); }
.pf-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.6rem, 5.4vw, 5.6rem);
    line-height: .98;
    letter-spacing: -.055em;
    max-width: 14ch;
    margin: 0;
}
.pf-lead { color: var(--muted); font-size: clamp(1.02rem, 1.3vw, 1.2rem); max-width: 60ch; margin: 28px 0 0; }

/* As áreas em tipografia grande: abertura e filtro ao mesmo tempo */
.pf-areas {
    display: flex;
    flex-wrap: wrap;
    gap: .1em .55em;
    margin-top: clamp(48px, 7vw, 90px);
    padding-top: clamp(26px, 3vw, 36px);
    border-top: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3.6vw, 3.4rem);
    font-weight: 500;
    letter-spacing: -.045em;
    line-height: 1.12;
}
.pf-area {
    appearance: none;
    background: none;
    border: 0;
    padding: 0 .04em;
    margin: 0;
    color: #4c4c55;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    transition: color .25s var(--ease);
    border-radius: 6px;
}
.pf-area sup {
    font-family: var(--font-body);
    font-size: .32em;
    font-weight: 600;
    letter-spacing: 0;
    vertical-align: super;
    margin-left: .2em;
    color: inherit;
    opacity: .8;
}
.pf-area:hover { color: #c9c8cf; }
.pf-area.is-active { color: var(--text); }
.pf-area.is-active sup { color: var(--accent-2); opacity: 1; }
.pf-area:focus-visible,
.pf a:focus-visible,
.pf button:focus-visible,
.pf-sheet a:focus-visible,
.pf-sheet button:focus-visible,
.pf-reels-track:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; }

/* Grade */
.pf-work { padding: 0 0 clamp(90px, 10vw, 140px); }
.pf-status { color: var(--muted-2); font-size: .82rem; margin: 0 0 22px; }
.pf-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: row dense;
    gap: clamp(44px, 5vw, 70px) var(--pf-gap);
    align-items: start;
}
.pf-item { grid-column: span 4; min-width: 0; }
.pf-item.pf-wide { grid-column: span 8; }
.pf-item[hidden] { display: none; }

.pf-cover {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: var(--pf-surface);
    aspect-ratio: 4 / 5;
}
.pf-wide .pf-cover { aspect-ratio: 16 / 9.8; }
.pf-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.pf-cover:hover img:not(.pf-scroll) { transform: scale(1.025); }

/* Sites: a página inteira rola dentro da capa quando o mouse passa */
.pf-is-site .pf-cover { border: 1px solid var(--line); }
.pf-is-site .pf-cover img.pf-scroll {
    height: auto;
    object-fit: initial;
    transform: translateY(0);
    transition: transform 7s cubic-bezier(.45, .05, .35, 1);
}
.pf-is-site .pf-cover:hover img.pf-scroll,
.pf-is-site .pf-cover:focus-visible img.pf-scroll { transform: translateY(var(--pf-travel, 0px)); }

.pf-caption { margin-top: 16px; }
.pf-caption h2 {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1.5vw, 1.4rem);
    font-weight: 600;
    letter-spacing: -.025em;
    line-height: 1.2;
    margin: 0;
}
.pf-caption h2 a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.pf-caption h2 a:hover { background-size: 100% 1px; }
.pf-caption p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.pf-year { color: var(--muted-2); margin-left: 6px; white-space: nowrap; }
.pf-empty { color: var(--muted); }
.pf-empty button { background: none; border: 0; color: var(--text); text-decoration: underline; cursor: pointer; font: inherit; }

/* Reels */
.pf-reels { padding: clamp(80px, 9vw, 120px) 0; background: #060607; border-block: 1px solid rgba(255, 255, 255, .06); }
.pf-reels-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 32ch); gap: 30px; align-items: end; margin-bottom: 42px; }
.pf-reels-head h2, .pf-index h2 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4.2vw, 4rem);
    font-weight: 600;
    letter-spacing: -.05em;
    line-height: 1;
    margin: 0;
}
.pf-reels-head p { color: var(--muted); margin: 0; font-size: .95rem; }
.pf-reels-track {
    display: flex;
    gap: var(--pf-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 0 18px;
    padding-inline: max(24px, calc((100vw - 1280px) / 2));
    scroll-padding-inline: max(24px, calc((100vw - 1280px) / 2));
    scrollbar-width: thin;
    scrollbar-color: #3a3a42 transparent;
}
.pf-reel { flex: none; margin: 0; scroll-snap-align: start; height: clamp(420px, 58vh, 600px); aspect-ratio: var(--ratio); }
.pf-reel video { width: 100%; height: calc(100% - 38px); object-fit: cover; border-radius: 14px; background: var(--pf-surface); display: block; }
.pf-reel figcaption { margin-top: 12px; font-size: .9rem; color: var(--muted); }
.pf-reel figcaption a:hover { color: var(--text); }

/* Índice */
.pf-index { padding: clamp(90px, 10vw, 140px) 0 40px; }
.pf-table { width: 100%; border-collapse: collapse; margin-top: 44px; font-size: .95rem; }
.pf-table th, .pf-table td { text-align: left; padding: 16px 18px 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pf-table thead th { color: var(--muted-2); font-weight: 500; font-size: .8rem; padding-bottom: 12px; }
.pf-table tbody th { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; letter-spacing: -.02em; }
.pf-table tbody th a:hover { color: var(--accent); }
.pf-table td { color: var(--muted); }
.pf-table tr.is-dim th, .pf-table tr.is-dim td { opacity: .3; }

/* Ficha do projeto */
.pf-sheet {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--bg);
    color: var(--text);
    overscroll-behavior: contain;
}
.pf-sheet::backdrop { background: rgba(0, 0, 0, .7); }
.pf-sheet[open] { animation: pf-in .35s var(--ease); }
@keyframes pf-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.pf-sheet-inner {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: clamp(30px, 4vw, 70px);
    width: min(1440px, calc(100vw - 48px));
    margin: 0 auto;
    padding: clamp(70px, 7vw, 96px) 0 80px;
}
.pf-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 5;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(20, 20, 25, .9);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.pf-close svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.pf-close:hover { background: #24242b; }
.pf-sheet-info { position: sticky; top: 40px; align-self: start; }
.pf-sheet-seg { color: var(--muted); font-size: .92rem; margin: 0; }
.pf-sheet-info h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.2rem, 3.6vw, 3.6rem);
    letter-spacing: -.05em;
    line-height: 1;
    margin: 12px 0 0;
}
.pf-sheet-desc { color: #d1d0d6; margin: 24px 0 0; font-size: 1.02rem; max-width: 46ch; }
.pf-sheet-meta { margin: 30px 0 0; display: grid; gap: 14px; }
.pf-sheet-meta div[hidden] { display: none; }
.pf-sheet-meta div { display: grid; grid-template-columns: 82px 1fr; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.pf-sheet-meta dt { color: var(--muted-2); font-size: .85rem; }
.pf-sheet-meta dd { margin: 0; font-size: .92rem; }
.pf-visit {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 30px;
    padding: 14px 22px;
    border-radius: 999px;
    background: #f4f3ef;
    color: #0d0d10;
    font-weight: 600;
    font-size: .92rem;
}
.pf-visit span { font-weight: 400; font-size: .78rem; color: #55555c; }
.pf-visit:hover { background: #fff; }
.pf-sheet-nav { display: flex; gap: 10px; margin-top: 40px; }
.pf-sheet-nav button {
    flex: 1;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
}
.pf-sheet-nav button:hover { color: var(--text); border-color: rgba(255, 255, 255, .3); }

.pf-sheet-media { display: grid; gap: 28px; min-width: 0; }
.pf-sheet-media figure { margin: 0; }
.pf-sheet-media figcaption { color: var(--muted-2); font-size: .84rem; margin-top: 10px; }
.pf-sheet-media img, .pf-sheet-media video { width: 100%; height: auto; border-radius: 12px; display: block; background: var(--pf-surface); }
.pf-media-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.pf-media-video video { max-height: 82vh; width: auto; max-width: 100%; margin-inline: auto; }

/* Site dentro de uma janela de navegador: rolagem feita pela pessoa */
.pf-site { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 22%); gap: 22px; align-items: start; }
.pf-browser { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--pf-surface); }
.pf-browser-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .76rem; color: var(--muted-2); }
.pf-browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #35353d; }
.pf-browser-bar span { margin-left: 10px; }
.pf-browser-view { height: min(72vh, 760px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3a3a42 transparent; }
.pf-browser-view img { border-radius: 0; }
.pf-phone { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--pf-surface); padding: 6px; }
.pf-phone img { border-radius: 16px; }
.pf-site-hint { grid-column: 1 / -1; margin: -6px 0 0; color: var(--muted-2); font-size: .84rem; }

body.pf-locked { overflow: hidden; }

/* Responsivo */
@media (max-width: 1050px) {
    .pf-item { grid-column: span 6; }
    .pf-item.pf-wide { grid-column: span 12; }
    .pf-sheet-inner { grid-template-columns: 1fr; padding-top: 80px; }
    .pf-sheet-info { position: static; }
}
@media (max-width: 720px) {
    .pf-item, .pf-item.pf-wide { grid-column: 1 / -1; }
    .pf-wide .pf-cover { aspect-ratio: 4 / 3.4; }
    .pf-areas { font-size: clamp(1.55rem, 7.4vw, 2.2rem); }
    .pf-reels-head { grid-template-columns: 1fr; }
    .pf-reel { height: min(70vh, 520px); }
    .pf-site { grid-template-columns: 1fr; }
    .pf-phone { width: min(260px, 70%); }
    .pf-browser-view { height: 62vh; }
    .pf-media-pair { grid-template-columns: 1fr; }
    .pf-sheet-inner { width: calc(100vw - 32px); }
    .pf-table thead { display: none; }
    .pf-table, .pf-table tbody, .pf-table tr { display: block; }
    .pf-table tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
    .pf-table th, .pf-table td { display: block; border: 0; padding: 2px 0; }
}
@media (prefers-reduced-motion: reduce) {
    .pf-cover img, .pf-is-site .pf-cover img.pf-scroll { transition: none !important; }
    .pf-is-site .pf-cover:hover img.pf-scroll { transform: none; }
    .pf-sheet[open] { animation: none; }
}

.pf-visit[hidden], .pf-empty[hidden] { display: none; }
.pf-media-video figcaption { text-align: center; }

/* ---- Revisão 2.1: motion premium (referências: temas GSAP do ThemeForest e Codrops) ---- */
.pf { --ease-exp: cubic-bezier(.16, 1, .3, 1); }

.pf-stats { display: flex; gap: clamp(28px, 5vw, 70px); margin: clamp(34px, 4vw, 52px) 0 0; padding: 0; }
.pf-stats div { margin: 0; }
.pf-stats dt { color: var(--muted-2); font-size: .82rem; margin-bottom: 6px; }
.pf-stats dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 3.4vw, 3.2rem); letter-spacing: -.04em; line-height: 1; }

/* Entrada do topo: título revelado linha a linha, sob máscara */
.pf-line { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.pf-line > span { display: inline-block; }
.js .pf-line > span { transform: translateY(118%); }
.js .pf-in .pf-line > span { transform: none; transition: transform 1.05s var(--ease-exp); }
.js .pf-in .pf-line:nth-child(2) > span { transition-delay: .1s; }
.js .pf-in .pf-line:nth-child(3) > span { transition-delay: .2s; }
.js .pf-lead, .js .pf-stats, .js .pf-areas { opacity: 0; transform: translateY(26px); }
.js .pf-in .pf-lead, .js .pf-in .pf-stats, .js .pf-in .pf-areas { opacity: 1; transform: none; transition: opacity .9s var(--ease-exp), transform .9s var(--ease-exp); }
.js .pf-in .pf-lead { transition-delay: .3s; }
.js .pf-in .pf-stats { transition-delay: .42s; }
.js .pf-in .pf-areas { transition-delay: .54s; }

/* Reveal ao rolar: blocos comuns sobem; projetos abrem em cortina, com escalonamento via --d */
.js [data-pf-reveal]:not(.pf-item) { opacity: 0; transform: translateY(26px); }
.js [data-pf-reveal]:not(.pf-item).is-in { opacity: 1; transform: none; transition: opacity .8s var(--ease-exp) var(--d, 0s), transform .8s var(--ease-exp) var(--d, 0s); }

.js .pf-item .pf-cover { clip-path: inset(0 0 100% 0); }
.js .pf-item .pf-cover img:not(.pf-scroll) { transform: scale(1.14); }
.js .pf-item .pf-caption { opacity: 0; transform: translateY(18px); }
.js .pf-item.is-in .pf-cover { clip-path: inset(0 0 0 0); transition: clip-path 1s var(--ease-exp) var(--d, 0s); }
.js .pf-item.is-in .pf-cover img:not(.pf-scroll) { transform: scale(1); transition: transform 1.4s var(--ease-exp) var(--d, 0s); }
.js .pf-item.is-in .pf-caption { opacity: 1; transform: none; transition: opacity .8s var(--ease-exp) calc(var(--d, 0s) + .15s), transform .8s var(--ease-exp) calc(var(--d, 0s) + .15s); }

/* Hover: zoom lento, elevação sutil */
.pf-cover { transition: box-shadow .5s var(--ease-exp), transform .5s var(--ease-exp); }
.pf-item:hover .pf-cover { transform: translateY(-4px); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.js .pf-item.is-in:hover .pf-cover img:not(.pf-scroll) { transform: scale(1.045); transition-duration: 1.1s; transition-delay: 0s; }

/* Cursor contextual sobre os projetos (desktop) */
.pf-cursor {
    position: fixed;
    z-index: 1500;
    top: 0;
    left: 0;
    width: 96px;
    height: 96px;
    margin: -48px 0 0 -48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(244, 243, 239, .92);
    color: #0d0d10;
    font-family: var(--font-display);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    pointer-events: none;
    transform: scale(0);
    transition: transform .35s var(--ease-exp);
    will-change: transform;
}
.pf-cursor.is-on { transform: scale(1); }
@media (max-width: 1050px), (pointer: coarse) { .pf-cursor { display: none; } }
.pf-cursor-hide * { cursor: none !important; }

/* Ficha: mídias entram em cascata */
.pf-sheet-media > * { opacity: 0; transform: translateY(34px); }
.pf-sheet-media > .is-live { opacity: 1; transform: none; transition: opacity .85s var(--ease-exp) var(--d, 0s), transform .85s var(--ease-exp) var(--d, 0s); }
.pf-sheet-info { transition: none; }

.pf-index-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 40ch); gap: 30px; align-items: end; }
.pf-index-head p { color: var(--muted); margin: 0; font-size: .95rem; }
.pf-table tbody th { color: var(--text); }
.pf-table tbody tr:not(:has(a)) th { font-weight: 500; color: #d6d5db; }
.pf-updated { color: var(--muted-2); font-size: .82rem; margin: 26px 0 0; }
.pf-media-video figcaption { text-align: center; }
.pf-visit[hidden], .pf-empty[hidden] { display: none; }

@media (max-width: 720px) {
    .pf-stats { gap: 26px; flex-wrap: wrap; }
    .pf-index-head { grid-template-columns: 1fr; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
    .js .pf-line > span, .js .pf-lead, .js .pf-stats, .js .pf-areas, .js [data-pf-reveal], .js .pf-item .pf-cover, .js .pf-item .pf-cover img, .js .pf-item .pf-caption, .pf-sheet-media > * { opacity: 1 !important; transform: none !important; transition: none !important; clip-path: none !important; }
    .pf-item:hover .pf-cover { transform: none; }
    .pf-cursor { display: none; }
}

/* ---- Showreel do topo ---- */
.pf-hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .5fr); gap: clamp(36px, 5vw, 80px); align-items: center; }
.pf-showreel { margin: 0; position: relative; }
.pf-showreel video {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--pf-surface);
    display: block;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.pf-showreel figcaption { color: var(--muted-2); font-size: .8rem; margin-top: 12px; text-align: center; }
.js .pf-showreel { opacity: 0; transform: translateY(30px) rotate(.6deg); }
.js .pf-in .pf-showreel { opacity: 1; transform: none; transition: opacity 1.1s var(--ease-exp) .45s, transform 1.1s var(--ease-exp) .45s; }
@media (max-width: 900px) {
    .pf-hero-grid { grid-template-columns: 1fr; }
    .pf-showreel { width: min(300px, 72%); }
}
@media (prefers-reduced-motion: reduce) {
    .js .pf-showreel { opacity: 1 !important; transform: none !important; }
}

/* ---- Fundo em vídeo no topo: mosaico dos trabalhos, fundindo na cor da seção seguinte ---- */
.pf-hero { position: relative; overflow: hidden; }
.pf-hero > .container { position: relative; z-index: 1; }
.pf-hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.pf-hero-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.4) saturate(.8);
}
.pf-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(9, 9, 11, .94) 0%, rgba(9, 9, 11, .78) 46%, rgba(9, 9, 11, .42) 100%),
        linear-gradient(180deg, rgba(9, 9, 11, .9) 0%, rgba(9, 9, 11, .52) 26%, rgba(9, 9, 11, .6) 52%, var(--bg) 80%);
}
.js .pf-hero-bg { opacity: 0; }
.js .pf-in .pf-hero-bg { opacity: 1; transition: opacity 1.6s var(--ease-exp) .15s; }
@media (prefers-reduced-motion: reduce) {
    .js .pf-hero-bg { opacity: 1 !important; transition: none !important; }
}

/* ---- Fechamento: o mesmo fundo do topo dentro do cartão do CTA ---- */
.pf-cta { position: relative; overflow: hidden; }
.pf-cta > * { position: relative; z-index: 1; }
.pf-cta .pf-cta-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.pf-cta-bg video { width: 100%; height: 100%; object-fit: cover; filter: brightness(.38) saturate(.8); }
.pf-cta-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(14, 14, 18, .92) 0%, rgba(14, 14, 18, .66) 55%, rgba(14, 14, 18, .4) 100%),
        radial-gradient(circle at 80% 0, rgba(136, 109, 255, .18), transparent 40%);
}
@media (prefers-reduced-motion: reduce) { .pf-cta-bg video { display: none; } }

/* Projeto com site cuja capa é outra peça: no filtro "Sites" troca a capa pelo site */
.pf-cover img.pf-alt { display: none; }
.pf-alt-on .pf-cover img.pf-alt { display: block; }
.pf-alt-on .pf-cover img.pf-main { display: none; }
