/* Portfólio (portfolio.html). Cabeçalho, rodapé, tokens e seções vêm do servico.css;
   aqui ficam só a pilha de prévias do topo, os filtros e os cartões dos projetos. */

/* Topo: texto à esquerda, os três projetos mais recentes empilhados à direita */
.pf-hero .sv-hero-inner { padding-bottom: clamp(24px, 4vw, 56px); }
.sv-kicker svg { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--orange-soft); color: var(--orange); flex: none; }
.pf-numeros { display: grid; grid-template-columns: repeat(3, max-content); gap: 14px clamp(20px, 3vw, 36px); margin: 34px 0 0; padding: 0; list-style: none; }
.pf-numeros li { max-width: 15ch; }
.pf-numeros b { display: block; font: 600 clamp(1.8rem, 3vw, 2.3rem)/1 var(--font-head); letter-spacing: -.03em; color: var(--text); }
.pf-numeros span { display: block; margin-top: 6px; color: var(--muted); font-size: .9rem; }

.pf-pilha { position: relative; aspect-ratio: 1 / .86; }
.pf-pilha .janela { position: absolute; width: 70%; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9); }
.pf-pilha .janela:nth-child(1) { right: 0; top: 0; rotate: 4deg; }
.pf-pilha .janela:nth-child(2) { left: 0; top: 18%; rotate: -5deg; }
.pf-pilha .janela:nth-child(3) { left: 17%; bottom: 0; z-index: 2; box-shadow: 0 50px 100px -40px rgba(249, 109, 0, .45), 0 30px 60px -20px rgba(0, 0, 0, .9); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pf-pilha .janela { transition: rotate .5s cubic-bezier(.2, .7, .2, 1), translate .5s cubic-bezier(.2, .7, .2, 1); }
  .pf-pilha:hover .janela:nth-child(1) { rotate: 7deg; translate: 14px -6px; }
  .pf-pilha:hover .janela:nth-child(2) { rotate: -8deg; translate: -14px 0; }
  .pf-pilha:hover .janela:nth-child(3) { translate: 0 6px; }
}

/* Moldura de navegador em volta de cada print */
.janela { margin: 0; overflow: hidden; border-radius: 12px; background: var(--surface-2); border: 1px solid rgba(255, 255, 255, .1); }
.janela-barra { display: flex; align-items: center; gap: 12px; height: 30px; padding: 0 12px; background: #151515; border-bottom: 1px solid var(--line); }
.janela-barra i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2C2C2C; box-shadow: 13px 0 0 #2C2C2C, 26px 0 0 #2C2C2C; margin-right: 26px; }
.janela-barra span { flex: 1; min-width: 0; max-width: 260px; margin-inline: auto; padding: 3px 10px; border-radius: 6px; background: #0E0E0E; color: #8A8A8A; font-size: .72rem; line-height: 1.3; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.janela img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }

/* Filtros por segmento (aparecem só com JavaScript) */
.pf-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.pf-filtros button {
  min-height: 44px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: none; color: var(--muted); font: 500 .92rem/1 var(--font-body);
  transition: color .2s, border-color .2s, background-color .2s;
}
.pf-filtros button:hover { color: var(--text); border-color: rgba(255, 255, 255, .3); }
.pf-filtros button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.pf-filtros button span { margin-left: 6px; opacity: .6; font-size: .82rem; }

/* Lista de projetos: o mais recente abre a lista em destaque, os outros em grade */
.projetos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 28px; }
.projetos > li[hidden] { display: none; }
.projeto { display: flex; flex-direction: column; height: 100%; }
.projeto .janela { transition: border-color .3s, transform .4s cubic-bezier(.2, .7, .2, 1); }
.projeto .janela img { transition: transform .6s ease; }
.projeto:hover .janela { border-color: rgba(249, 109, 0, .5); }
.projeto:hover .janela img { transform: scale(1.02); }
.projeto-capa { display: block; text-decoration: none; border-radius: 12px; }
.projeto-selos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.projeto-selos .ui-badge { white-space: nowrap; }
.projeto-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.projeto-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3DDC84; }
.projeto-status.is-previa::before { background: #F5B942; }
.projeto h3 { margin-top: 14px; font-size: 1.3rem; }
.projeto h3 a { text-decoration: none; }
.projeto h3 a:hover { color: var(--orange); }
.projeto-data { margin-top: 4px; color: #7C7C7C; font-size: .85rem; }
.projeto-resumo { margin-top: 10px; color: var(--muted); font-size: .98rem; }
.projeto-feito { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.projeto-feito li { padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: #C9C9C9; font-size: .8rem; line-height: 1.2; }
.projeto-link {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 44px; margin-top: auto; padding-top: 14px;
  color: var(--orange); font-size: .95rem; font-weight: 500; text-decoration: none;
}
.projeto-link svg { width: 16px; height: 16px; transition: transform .25s ease; }
.projeto-link:hover svg { transform: translate(2px, -2px); }

.projetos:not(.filtrado) > li:first-child { grid-column: 1 / -1; padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.projetos:not(.filtrado) > li:first-child .projeto {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: repeat(6, auto) 1fr;
  column-gap: clamp(28px, 4.5vw, 64px); align-items: start;
}
.projetos:not(.filtrado) > li:first-child .projeto-capa { grid-row: 1 / -1; }
.projetos:not(.filtrado) > li:first-child .projeto-selos { margin-top: clamp(0px, 2vw, 24px); }
.projetos:not(.filtrado) > li:first-child h3 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.08; letter-spacing: -.03em; }
.projetos:not(.filtrado) > li:first-child .projeto-resumo { font-size: 1.1rem; }
.projetos:not(.filtrado) > li:first-child .projeto-link { margin-top: 10px; }
.pf-destaque-rotulo { display: none; }
.projetos:not(.filtrado) > li:first-child .pf-destaque-rotulo {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--orange-soft); border: 1px solid rgba(249, 109, 0, .35); color: var(--orange);
  font: 500 .75rem/1.2 var(--font-head); letter-spacing: .08em; text-transform: uppercase;
}

.pf-vazio { margin-top: 8px; color: var(--muted); }

/* Como cada projeto nasce */
.pf-processo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: pf; }
.pf-processo li { padding: 26px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.pf-processo li::before { counter-increment: pf; content: "0" counter(pf); display: block; margin-bottom: 18px; font: 600 .85rem/1 var(--font-head); color: var(--orange); }
.pf-processo h3 { font-size: 1.1rem; margin-bottom: 8px; }
.pf-processo p { color: var(--muted); font-size: .96rem; }

@media (prefers-reduced-motion: reduce) {
  .projeto .janela, .projeto .janela img, .projeto-link svg { transition: none; }
  .projeto:hover .janela img { transform: none; }
}

@media (max-width: 1080px) {
  .projetos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-processo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .pf-pilha { max-width: 560px; margin-bottom: 8px; }
  .projetos:not(.filtrado) > li:first-child .projeto { display: flex; }
  .projetos:not(.filtrado) > li:first-child .projeto-selos { margin-top: 20px; }
}
@media (max-width: 640px) {
  .projetos { grid-template-columns: 1fr; gap: 44px; }
  .projetos:not(.filtrado) > li:first-child { padding-bottom: 44px; }
  .pf-processo { grid-template-columns: 1fr; }
  .pf-numeros { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
  .pf-numeros span { font-size: .8rem; line-height: 1.35; }
  .pf-pilha .janela { width: 76%; }
  .pf-pilha .janela-barra { height: 22px; padding: 0 8px; }
  .pf-pilha .janela-barra i { width: 6px; height: 6px; box-shadow: 10px 0 0 #2C2C2C, 20px 0 0 #2C2C2C; margin-right: 20px; }
  .pf-pilha .janela-barra span { font-size: .6rem; padding: 2px 6px; }
  .pf-filtros { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .pf-filtros::-webkit-scrollbar { display: none; }
  .pf-filtros button { flex: none; }
}
