/* ==========================================================================
   Cases em cartões + modal (assets/js/portfolio/portfolio.js)
   Mesmo formato do portfólio da Rokeu Dev: cartão e modal com dois cantos chanfrados (superior
   esquerdo e inferior direito), borda do cartão na cor da marca do projeto (--cor) e a borda do
   modal desenhada por fibras. Cores da US Digital: navy, verde de crescimento e ciano.
   ========================================================================== */

/* ---------- grupos ---------- */
.pf-grupo + .pf-grupo { margin-top: 56px; }
.pf-grupo-titulo {
    font-family: 'Unbounded', 'Inter', system-ui, sans-serif;
    font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.01em;
    margin-bottom: 22px;
}
@media (min-width: 768px) { .pf-grupo-titulo { font-size: 24px; } }
.pf-grade { display: grid; gap: 24px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .pf-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .pf-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; } }

/* ---------- cartão ----------
   A borda é o ::before (cor do projeto) e o fundo é o ::after, os dois com o mesmo chanfro; a capa
   é recortada por dentro da borda. Assim o chanfro mantém a borda e o foco do teclado não é cortado. */
.pf-card {
    --cut: 28px;
    --edge-w: 2px;
    --inner: calc(var(--cut) - var(--edge-w) * 0.414);
    position: relative; isolation: isolate; display: block; width: 100%; height: 100%;
    padding: var(--edge-w); text-align: left; background: transparent; border: 0; cursor: pointer;
    color: inherit; font: inherit;
    transition: transform .25s ease;
}
.pf-card::before, .pf-card::after {
    content: ''; position: absolute; z-index: -1; pointer-events: none;
}
.pf-card::before {
    inset: 0;
    background: var(--cor, #1E293B);
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    transition: filter .25s ease;
}
.pf-card::after {
    inset: var(--edge-w);
    background: linear-gradient(180deg, #111a2b, #0d1420);
    clip-path: polygon(var(--inner) 0, 100% 0, 100% calc(100% - var(--inner)), calc(100% - var(--inner)) 100%, 0 100%, 0 var(--inner));
}
.pf-card:hover { transform: translateY(-4px); }
.pf-card:hover::before { filter: drop-shadow(0 0 14px var(--cor)); }
.pf-card:focus-visible { outline: 2px solid #00FF66; outline-offset: 4px; }

.pf-capa {
    display: block; aspect-ratio: 3 / 2; overflow: hidden; background: #111827;
    clip-path: polygon(var(--inner) 0, 100% 0, 100% 100%, 0 100%, 0 var(--inner));
}
.pf-capa img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.pf-card:hover .pf-capa img { transform: scale(1.03); }

.pf-corpo { display: block; padding: 20px 24px 30px; }
.pf-categoria {
    display: block; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    letter-spacing: 0.08em; color: #00FF66;
}
.pf-nome { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 19px; font-weight: 800; color: #fff; line-height: 1.25; }
/* logo do cliente no canto direito da linha do nome, monocromático; no hover ganha a cor do projeto */
.pf-logo {
    flex-shrink: 0; background: rgba(255, 255, 255, 0.5);
    transition: background-color .18s ease-out;
}
.pf-card:hover .pf-logo { background: var(--cor, #fff); }
.pf-resumo { display: block; margin-top: 8px; font-size: 14.5px; line-height: 1.6; color: rgba(226, 232, 240, 0.72); }

/* selo "abre": canto superior direito; no hover mostra "Ver projeto" */
.pf-abrir {
    position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 8px;
    height: 34px; padding: 0 10px; color: #fff;
    background: rgba(10, 14, 23, 0.82); border: 1px solid rgba(255, 255, 255, 0.16);
    clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.pf-abrir-texto {
    max-width: 0; overflow: hidden; white-space: nowrap; font-size: 13px; font-weight: 700;
    transition: max-width .22s ease-out;
}
.pf-card:hover .pf-abrir, .pf-card:focus-visible .pf-abrir { background: #00FF66; border-color: #00FF66; color: #0A0E17; }
.pf-card:hover .pf-abrir-texto, .pf-card:focus-visible .pf-abrir-texto { max-width: 7rem; }

/* ---------- modal ---------- */
.pf-modal {
    padding: 0; border: 0; background: transparent; overflow: visible; max-width: none; max-height: none;
    width: calc(100vw - 24px); height: calc(100dvh - 24px); color: #E2E8F0;
}
.pf-modal::backdrop { background: rgba(5, 8, 14, 0.78); backdrop-filter: blur(4px); }
.pf-shell { position: relative; width: 100%; height: 100%; --pf-cut: 26px; }
.pf-painel {
    position: absolute; inset: 0; display: flex; flex-direction: column; background: #0D1420;
    clip-path: polygon(var(--pf-cut) 0, 100% 0, 100% calc(100% - var(--pf-cut)), calc(100% - var(--pf-cut)) 100%, 0 100%, 0 var(--pf-cut));
}
.pf-foto { position: relative; height: 42%; flex-shrink: 0; overflow: hidden; background: #0A0E17; touch-action: pan-y; }
.pf-slides { position: absolute; inset: 0; }
.pf-slide { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity .3s ease; }
.pf-slide.is-ativo { opacity: 1; }
.pf-slide-fundo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); filter: blur(40px); opacity: 0.55; }
.pf-slide-img { position: relative; width: 100%; height: 100%; object-fit: contain; padding: 16px 16px 48px; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5)); }
.pf-rodape-foto {
    position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 40px 20px 16px; background: linear-gradient(to top, rgba(5, 8, 14, 0.8), transparent);
}
.pf-pontos { display: flex; gap: 6px; }
.pf-rodape-foto { flex-wrap: wrap; }
.pf-legenda { flex-basis: 100%; margin: 0 0 4px; font-size: 15px; font-weight: 700; line-height: 1.35; color: #fff; }
.pf-legenda[hidden] { display: none; }
.pf-slide-img--legenda { padding-bottom: 84px; }
.pf-ponto { width: 8px; height: 8px; padding: 0; border: 0; transform: rotate(45deg); background: rgba(255, 255, 255, 0.45); cursor: pointer; transition: background .15s, transform .15s; }
.pf-ponto[aria-current='true'] { background: #00FF66; transform: rotate(45deg) scale(1.3); }
.pf-ponto:focus-visible { outline: 2px solid #00E5FF; outline-offset: 3px; }
.pf-contador { margin: 0; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: #fff; }

.pf-seta, .pf-fechar {
    position: absolute; display: flex; align-items: center; justify-content: center; border: 0; cursor: pointer;
    color: #fff; background: rgba(10, 14, 23, 0.85);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    transition: background .15s ease, color .15s ease;
}
.pf-seta { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; }
.pf-seta--esq { left: 12px; }
.pf-seta--dir { right: 12px; }
.pf-seta[hidden] { display: none; }
.pf-fechar { top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; }
.pf-seta:hover, .pf-fechar:hover { background: #00FF66; color: #0A0E17; }
.pf-seta:focus-visible, .pf-fechar:focus-visible { outline: 2px solid #00FF66; outline-offset: 2px; }

.pf-texto { flex: 1; overflow-y: auto; padding: 24px 24px 44px; overscroll-behavior: contain; }
.pf-modal-titulo { margin: 6px 0 0; font-family: 'Unbounded', 'Inter', system-ui, sans-serif; font-size: 26px; font-weight: 800; line-height: 1.15; color: #fff; }
.pf-paragrafo { margin: 16px 0 0; font-size: 15px; line-height: 1.7; color: rgba(226, 232, 240, 0.78); }
.pf-subtitulo { margin: 28px 0 0; font-size: 14px; font-weight: 800; color: #fff; }
.pf-entregas { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 9px; }
.pf-entregas li { display: flex; gap: 12px; font-size: 14.5px; line-height: 1.45; color: rgba(226, 232, 240, 0.8); }
.pf-entregas li span { flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; transform: rotate(45deg); background: #00FF66; }
.pf-tecnologias { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pf-tecnologias li {
    padding: 5px 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; color: #00E5FF;
    background: rgba(0, 229, 255, 0.08);
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.pf-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; font-weight: 800; color: #00FF66; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(0, 255, 102, 0.4); }
.pf-link:hover { text-decoration-color: #00FF66; }
.pf-link i { font-size: 11px; }

.pf-linhas { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); pointer-events: none; overflow: visible; }
.pf-brilho { filter: drop-shadow(0 0 4px rgba(0, 255, 102, 0.9)); }

@media (min-width: 768px) {
    .pf-modal { width: min(1120px, 100vw - 64px); height: min(620px, 100dvh - 64px); }
    .pf-shell { --pf-cut: 40px; }
    .pf-painel { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
    .pf-foto { height: auto; }
    .pf-slide-img { padding: 24px 24px 56px; }
    .pf-slide-img--legenda { padding-bottom: 96px; }
    .pf-texto { padding: 48px 44px 48px 40px; }
    .pf-modal-titulo { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    .pf-card, .pf-card:hover { transition: none; transform: none; }
    .pf-capa img, .pf-abrir-texto, .pf-slide { transition: none; }
}
