/* ============================================================
   Portfólio — cards estilo App Store + modal de detalhes
   Temas: padrão claro (área do aluno); .pf--dark (site público)
   ============================================================ */
:root {
  --pf-bg: #eceef1;
  --pf-surface: #ffffff;
  --pf-surface-2: #f4f5f7;
  --pf-line: #d7dbe0;
  --pf-text: #1c2128;
  --pf-muted: #5b6673;
  --pf-accent: #c8ff4d;
  --pf-accent-ink: #10130a;
  --pf-ink: #14181f;
  --pf-radius: 14px;
  --pf-shadow: 0 18px 40px -24px rgba(20, 24, 31, .35);
}
.pf--dark {
  --pf-bg: #060709;
  --pf-surface: #0e1116;
  --pf-surface-2: #141821;
  --pf-line: rgba(255, 255, 255, .09);
  --pf-text: #f2f3f5;
  --pf-muted: #9aa0aa;
  --pf-ink: #f2f3f5;
  --pf-shadow: 0 30px 60px -24px rgba(0, 0, 0, .8);
}

/* ---------- CTA "Publique seu portfólio" ---------- */
.pf-cta {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
  background: linear-gradient(135deg, #14181f 0%, #1c2230 60%, #10130a 100%);
  color: #f2f3f5; border-radius: var(--pf-radius); padding: 26px 28px; margin-bottom: 26px;
  border: 1px solid rgba(200, 255, 77, .18);
}
.pf-cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 40% 80% at 90% 50%, rgba(200, 255, 77, .18), transparent 70%);
}
.pf-cta__txt { position: relative; max-width: 560px; }
.pf-cta__kicker { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--pf-accent); margin-bottom: 6px; }
.pf-cta__title { font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.pf-cta__sub { color: #aab1bb; font-size: 14.5px; margin-top: 6px; }
.pf-cta__btn {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px;
  background: var(--pf-accent); color: var(--pf-accent-ink); font-weight: 800; font-size: 14.5px;
  padding: 13px 22px; border-radius: 100px; border: none; cursor: pointer; text-decoration: none;
  box-shadow: 0 10px 30px -10px rgba(200, 255, 77, .6); transition: transform .15s, box-shadow .15s;
}
.pf-cta__btn:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -10px rgba(200, 255, 77, .75); }

/* ---------- cabeçalho da seção ---------- */
.pf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pf-head h2 { font-size: 20px; font-weight: 800; color: var(--pf-text); }
.pf-head p { color: var(--pf-muted); font-size: 14px; margin-top: 2px; }
.pf-head__count { font-size: 13px; color: var(--pf-muted); }

/* ---------- grade e cards ---------- */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.pf-card {
  display: flex; flex-direction: column; cursor: pointer; overflow: hidden;
  background: var(--pf-surface); border: 1px solid var(--pf-line); border-radius: var(--pf-radius);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.pf-card:hover, .pf-card:focus-visible { transform: translateY(-3px); box-shadow: var(--pf-shadow); border-color: rgba(200, 255, 77, .5); outline: none; }
.pf-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--pf-surface-2); overflow: hidden; }
.pf-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.pf-card:hover .pf-card__media img { transform: scale(1.04); }
.pf-card__nocover { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #1b212b, #0c0f14); }
.pf-card__nocover span { font-size: 44px; font-weight: 900; color: var(--pf-accent); opacity: .9; }
.pf-card__count { position: absolute; right: 10px; bottom: 10px; font-size: 11px; font-weight: 700; background: rgba(6, 7, 9, .75); color: #fff; padding: 4px 9px; border-radius: 100px; backdrop-filter: blur(4px); }
.pf-card__body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pf-card__head { display: flex; align-items: center; gap: 11px; }
.pf-card__titles { min-width: 0; }
.pf-card__title { font-size: 16px; font-weight: 800; color: var(--pf-text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-card__by { display: block; font-size: 12.5px; color: var(--pf-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-card__desc { font-size: 13.5px; color: var(--pf-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pf-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.pf-card__cta { font-size: 13px; font-weight: 800; color: var(--pf-accent-ink); background: var(--pf-accent); padding: 6px 16px; border-radius: 100px; }
.pf--dark .pf-card__cta { color: #0a0c04; }
.pf-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 100px; border: 1px solid var(--pf-line); color: var(--pf-muted); }
.pf-tag--open { color: #1b7a43; background: #e7f4ec; border-color: #bfe3cc; }
.pf--dark .pf-tag--open { color: #7ee2a1; background: rgba(47, 174, 98, .14); border-color: rgba(47, 174, 98, .4); }

.pf-avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: #d7dce2 no-repeat center/cover; color: var(--pf-ink); font-weight: 700; overflow: hidden; }
.pf-avatar--txt { background: #14181f; color: var(--pf-accent); }
.pf-empty { text-align: center; color: var(--pf-muted); padding: 40px 16px; border: 1px dashed var(--pf-line); border-radius: var(--pf-radius); }

/* ---------- modal ---------- */
.pf-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 18px; }
.pf-modal[hidden] { display: none; }
.pf-modal__backdrop { position: absolute; inset: 0; background: rgba(6, 7, 9, .72); backdrop-filter: blur(6px); animation: pfFade .18s ease; }
.pf-modal__dialog {
  position: relative; width: min(860px, 100%); max-height: calc(100vh - 36px); overflow: hidden auto;
  background: var(--pf-surface); color: var(--pf-text); border-radius: 20px; border: 1px solid var(--pf-line);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7); animation: pfPop .22s cubic-bezier(.2, 1.2, .3, 1);
  -webkit-overflow-scrolling: touch;
}
.pf-modal__close {
  position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer; font-size: 15px;
  background: rgba(6, 7, 9, .7); color: #fff; backdrop-filter: blur(4px);
}
.pf-modal__close:hover { background: rgba(6, 7, 9, .9); }
.pf-modal__gallery {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 0 6px;
  background: #0b0d11; scrollbar-width: thin;
}
.pf-modal__gallery img { flex: 0 0 auto; width: 100%; max-width: 100%; max-height: 440px; object-fit: contain; scroll-snap-align: center; background: #0b0d11; }
.pf-modal__gallery img:only-child { max-height: 480px; }
.pf-modal__body { padding: 22px 26px 28px; }
.pf-modal__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.pf-modal__titles { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pf-modal__title { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.pf-modal__by { font-size: 13.5px; color: var(--pf-muted); }
.pf-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; padding: 11px 20px; border-radius: 100px; text-decoration: none; white-space: nowrap; }
.pf-btn--primary { background: var(--pf-accent); color: var(--pf-accent-ink); }
.pf-btn--primary:hover { filter: brightness(.96); }
.pf-sec { border-top: 1px solid var(--pf-line); padding: 16px 0 2px; margin-top: 14px; }
.pf-sec h4 { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--pf-muted); margin-bottom: 8px; }
.pf-sec p { font-size: 15px; line-height: 1.6; white-space: pre-line; }
.pf-sec--hl { background: var(--pf-surface-2); border: 1px solid var(--pf-line); border-radius: 12px; padding: 16px 18px; }
.pf-sec--hl h4 { color: #7a8d00; }
.pf--dark .pf-sec--hl h4 { color: var(--pf-accent); }
.pf-sec--dev { border-left: 3px solid var(--pf-accent); padding-left: 16px; }
.pf-contato { margin-top: 8px; font-weight: 600; }
.pf-contato span { color: var(--pf-muted); font-weight: 600; margin-right: 4px; }
.pf-contato a { color: #1b7a43; text-decoration: underline; }
.pf--dark .pf-contato a { color: var(--pf-accent); }
body.pf-lock { overflow: hidden; }

@keyframes pfFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pfPop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .pf-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
  .pf-modal { padding: 0; align-items: flex-end; }
  .pf-modal__dialog { max-height: 94vh; border-radius: 20px 20px 0 0; }
  .pf-modal__body { padding: 18px 18px 26px; }
  .pf-cta { padding: 22px 20px; }
  .pf-cta__btn { width: 100%; justify-content: center; }
}
@media (max-width: 440px) {
  .pf-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-card, .pf-card__media img, .pf-modal__backdrop, .pf-modal__dialog { transition: none; animation: none; }
}
