/* =========================================================================
   MARCUTZ — Seção Portfólio  ·  ABC.DESIGN_
   Palco em "unidades de design" (1672 x 941 = pixels do cenário master).
   O JS escala o palco para cobrir a seção (desktop) ou ajusta à largura (celular).
   ========================================================================= */

/* integração: as fontes do pacote (Cinzel e Saira Condensed) deram lugar à tipografia da
   marca do site (Gang of Three, css/base.css), decisão nº 10 do CLAUDE.md */

.pf {
  /* integração: tipografia da marca (tokens globais, com reserva se a seção for usada sozinha) */
  --pf-font-ui: var(--f-display, "Gang of Three", sans-serif);
  --pf-font-serif: var(--f-display, "Gang of Three", sans-serif);
  --pf-red: #e3202a;
  --pf-red-hot: #ff3a2e;
  --pf-cream: #efe4d2;
  --pf-ink: #060203;

  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--pf-ink);
  color: var(--pf-cream);
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.pf.is-narrow { min-height: 0; }
.pf *, .pf *::before, .pf *::after { box-sizing: border-box; }
.pf img { display: block; max-width: none; user-select: none; -webkit-user-drag: none; }
.pf :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.pf-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pf-fill { position: absolute; inset: 0; }

/* fundo de segurança (telas ultra-largas / celular) */
.pf-backdrop {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 70% at 50% 30%, rgba(120, 14, 18, .35), transparent 70%),
    linear-gradient(#0d0405, #050102 70%);
}

/* integração: emenda com a seção de cima (Sobre), que termina em preto. O cenário começa
   em céu e dragão vermelhos, e sem isso fica uma linha dura. Fica fora do palco (que é
   escalado e pode ter o topo cortado), então a altura não pode alcançar o título: no
   desktop ele começa a ~70px do topo em 1366×768. */
.pf::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  height: clamp(32px, 7%, 64px);
  background: linear-gradient(var(--pf-ink), rgba(6, 2, 3, .86) 30%, rgba(6, 2, 3, .4) 65%, transparent);
  pointer-events: none;
}
.pf.is-narrow::before { height: 12%; }   /* celular: o título fica no meio, longe do topo */

/* integração: emenda com a seção de baixo (Depoimentos), que começa em preto. Os reflexos
   vermelhos da água vão até a última linha e paravam numa linha dura. No desktop os pontos
   ficam a ~70px da base em 1366×768; no celular o 龍 fica a ~5px, por isso lá é só um fio. */
.pf::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  height: clamp(24px, 5%, 48px);
  background: linear-gradient(transparent, rgba(6, 2, 3, .4) 35%, rgba(6, 2, 3, .86) 70%, var(--pf-ink));
  pointer-events: none;
}
.pf.is-narrow::after { height: 4px; }

/* ---------------------------------------------------------------- palco */
.pf-stage {
  position: absolute; left: 0; top: 0;
  width: 1672px; height: 941px;
  transform-origin: 0 0;
  z-index: 1;
}

/* ---------------------------------------------------------------- mundo (cenário + efeitos) */
.pf-world, .pf-world-front {
  position: absolute; left: 0; top: 0; width: 1672px; height: 941px;
  transform-origin: 0 0;

  pointer-events: none;
}
.pf-world { z-index: 1; }
.pf-world-front { z-index: 4; }
.pf-bg { position: absolute; left: -2%; top: -2%; width: 104%; height: 104%; object-fit: cover; }
.pf-world picture, .pf-body picture, .pf-body-refl picture { display: contents; }
.pf-bgfx { position: absolute; inset: 0; }

.pf-moon {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 70, 50, .32) 0%, rgba(255, 30, 30, .12) 38%, transparent 66%);
  animation: pf-moon 7s ease-in-out infinite;
}
.pf-moon { will-change: opacity, transform; }
.pf-bgfx.is-moon .pf-moon { animation-duration: 2.2s; }
@keyframes pf-moon { 0%, 100% { opacity: .45; transform: scale(1); } 50% { opacity: .85; transform: scale(1.04); } }

.pf-lantern {
  position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 150, 80, .55), rgba(255, 50, 30, .16) 45%, transparent);
  animation: pf-flicker var(--d, 2.6s) steps(1, end) infinite;
  animation-delay: var(--dl, 0s);
  will-change: opacity;
}
.pf-bgfx.is-flare .pf-lantern { animation-duration: .9s; }
@keyframes pf-flicker {
  0% { opacity: .75; } 12% { opacity: .95; } 22% { opacity: .7; } 37% { opacity: 1; } 51% { opacity: .82; }
  63% { opacity: .96; } 78% { opacity: .72; } 88% { opacity: .9; } 100% { opacity: .78; }
}

.pf-mist { position: absolute; left: 0; width: 1672px; height: 290px; overflow: hidden; }
.pf-mist-strip {
  position: absolute; left: 0; top: 0; width: 3686px; height: 290px;
  background-repeat: repeat-x;
  background-size: 1843px 290px;
  will-change: transform;
}
/* integração (v4.0.1): a névoa só baixa com .imgs-ok (liberada pelo hero.js na abertura) */
.imgs-ok .pf-mist-strip { background-image: url("../assets/portfolio/nevoa.webp"); }
.pf-mist.is-back { top: 560px; opacity: .55; }
.pf-mist.is-front { top: 610px; opacity: .45; }
.pf-mist.is-back .pf-mist-strip { animation: pf-mist 110s linear infinite; }
.pf-mist.is-front .pf-mist-strip { animation: pf-mist 80s linear infinite reverse; }
@keyframes pf-mist { from { transform: translateX(0); } to { transform: translateX(-1843px); } }

/* ---------------------------------------------------------------- dragão: corpo */
.pf-body, .pf-body-refl { position: absolute; pointer-events: none; }
.pf-body { z-index: 3; }
.pf-body-refl { z-index: 2; opacity: .9; }
.pf-body img, .pf-body-refl img { width: 100%; height: 100%; }
.pf-breathe { animation: pf-body-breathe 7s ease-in-out infinite; }
@keyframes pf-body-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(2px); } }

/* ---------------------------------------------------------------- dragão: cabeça */
.pf-head { position: absolute; z-index: 8; pointer-events: none; }
.pf-head-breathe { animation: pf-head-breathe 6s ease-in-out infinite; }
@keyframes pf-head-breathe {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(4px) rotate(-.7deg); }
}
.pf-head-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pf-whiskers { position: absolute; animation: pf-whisk 5.2s ease-in-out infinite; }
.pf-whiskers img { width: 100%; height: 100%; }
@keyframes pf-whisk { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(2.2deg); } }
.pf-eye {
  position: absolute; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 235, 200, .8), rgba(255, 60, 40, .5) 28%, rgba(255, 20, 20, .14) 60%, transparent);
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
}
.pf.is-in .pf-eye { opacity: .7; animation: pf-eye 3.4s ease-in-out infinite; }
.pf.is-in .pf-head.is-flare .pf-eye { opacity: 1; transform: scale(1.5); animation: none; }
@keyframes pf-eye { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }

/* ---------------------------------------------------------------- carrossel */
.pf-cards { position: absolute; inset: 0; touch-action: pan-y; outline: none; }
.pf-card {
  position: absolute;
  transform-origin: 50% 50%;
  transition: transform .78s cubic-bezier(.22, .8, .18, 1), opacity .5s ease;
  will-change: transform;
}
/* integração (desempenho): o transform 3D de cada card sempre cria uma camada na GPU, mesmo
   para os cards fora do leque (opacidade 0). Eles ficam `visibility: hidden` depois do fade
   (.5s), e o navegador não mantém a camada. Só os visíveis (.is-vis, marcado pelo JS) têm
   will-change no flutuante, que o JS move a cada quadro. */
.pf-card:not(.is-vis) { visibility: hidden; }
.pf-card:not(.is-vis):not(.no-anim) { transition: transform .78s cubic-bezier(.22, .8, .18, 1), opacity .5s ease, visibility 0s linear .5s; }
.pf-card.no-anim { transition: none; }
.pf-card.is-off { visibility: hidden; }
.pf-card-float { position: absolute; inset: 0; }
.pf-card.is-vis .pf-card-float { will-change: transform; }
.pf-card-art { position: absolute; inset: 0; }
.pf-card-shade {
  position: absolute; left: -7px; top: -7px; width: calc(100% + 14px); height: calc(100% + 14px);
  background: #050102; pointer-events: none;
  opacity: var(--shade, 0); transition: opacity .6s ease;
}

/* foto sangrando até o filete */
.pf-card-photo { position: absolute; inset: 0; overflow: hidden; background: #0a0506; }
.pf-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.pf-card-photo::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 46px 14px rgba(0, 0, 0, .8), inset 0 0 22px 2px rgba(120, 0, 8, .45);
}

/* filete de neon + cantoneiras (SVG gerado pelo JS) */
.pf-card-frame {
  position: absolute; left: -6px; top: -6px; width: calc(100% + 12px); height: calc(100% + 12px);
  overflow: visible; pointer-events: none;
}
.pf-card-frame .ln { fill: none; stroke: #ff3030; stroke-linecap: square; }
.pf-card-frame .ln-outer { stroke-width: 2.2; }
.pf-card-frame .ln-glow1 { stroke-width: 5; opacity: .32; }
.pf-card-frame .ln-glow2 { stroke-width: 12; opacity: .12; }
.pf-card-frame .ln-orn { stroke-width: 1.8; }
.pf-card-frame .ln-inner { stroke-width: 1; opacity: .5; }
.pf-card-frame .ln-orn { stroke-width: 1.6; stroke: #ff4a3a; }
.pf-card-frame .dot { fill: #ff4a3a; }
.pf-card-frame .ln { stroke-dasharray: 1; stroke-dashoffset: 0; }
.pf-card.is-draw .pf-card-frame .ln { animation: pf-draw .95s cubic-bezier(.6, .1, .2, 1) both; }
.pf-card.is-draw .pf-card-frame .ln-orn { animation-delay: .35s; }
.pf-card.is-draw .pf-card-frame .dot { animation: pf-pop .5s ease .7s both; }
@keyframes pf-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pf-pop { from { opacity: 0; } to { opacity: 1; } }

.pf-card-glow {
  position: absolute; inset: 4% 3%; z-index: -1;
  box-shadow: 0 0 60px 10px rgba(255, 30, 30, .32), 0 0 150px 26px rgba(160, 10, 14, .3);
  opacity: 0; transition: opacity .6s ease;
}
.pf-card.is-center .pf-card-glow { opacity: 1; }
/* integração (memória): a sombra de 150px do brilho faz a camada de cada card ficar ~2,6× maior.
   Só o card central mostra o brilho; nos outros a sombra sai depois do fade (.6s). */
.pf-card:not(.is-center) .pf-card-glow { box-shadow: none; transition: opacity .6s ease, box-shadow 0s linear .6s; }
.pf-card-refl {
  position: absolute; left: 0; top: calc(100% + 14px); width: 100%; height: 100%;
  transform: scaleY(-1);
  -webkit-mask-image: linear-gradient(transparent 62%, rgba(0, 0, 0, .2));
  mask-image: linear-gradient(transparent 62%, rgba(0, 0, 0, .2));
  pointer-events: none;
}
.pf-card-hit { position: absolute; left: 0; top: 0; width: 100%; height: 100%; outline-offset: 6px; }
.pf-card-hit:focus-visible { outline: 2px solid var(--pf-red-hot); }
.pf-card.is-center .pf-card-hit { cursor: zoom-in; }


/* ---------------------------------------------------------------- título */
.pf-top { position: absolute; left: 0; top: 0; width: 1672px; z-index: 12; pointer-events: none; }
.pf-title {
  position: absolute; left: 836px; top: 84px; width: 560px; height: 187px;  /* ratio 3.0 da arte nova (titulo.webp, 1300×434; era 2000×667 e foi reduzida na v4.0) */
  margin: 0 0 0 -280px; font-size: 0;
}
.pf-title img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pf-title-art { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .85)); }
.pf-seal { position: absolute; left: 1112px; top: 146px; width: 26px; opacity: .95; filter: drop-shadow(0 0 6px rgba(255, 30, 30, .45)); }
/* integração: o subtítulo do pacote ("Um breve resumo sobre os meus trabalhos", .pf-sub) saiu a
   pedido do Victor (2026-10-13), junto com as regras dele */

/* ---------------------------------------------------------------- setas laterais */
.pf-side {
  position: absolute; z-index: 30; top: var(--arrow-y, 60%);
  height: var(--arrow-h, 120px); width: calc(var(--arrow-h, 120px) * .85);
  margin-top: calc(var(--arrow-h, 120px) * -.5);
  display: flex; align-items: center; justify-content: center;
}
.pf-side.is-prev { left: var(--arrow-x, 24px); }
.pf-side.is-next { right: var(--arrow-x, 24px); }
.pf-side img {
  height: var(--arrow-h, 120px); width: auto; flex: none;
  transition: transform .35s cubic-bezier(.2, .9, .2, 1), filter .35s ease;
  animation: pf-nudge 3.6s ease-in-out infinite;
}
.pf-side.is-prev img { transform: scaleX(-1); animation-name: pf-nudge-l; }
@keyframes pf-nudge { 0%, 70%, 100% { translate: 0 0; } 80% { translate: 7px 0; } 88% { translate: 0 0; } 93% { translate: 4px 0; } }
@keyframes pf-nudge-l { 0%, 70%, 100% { translate: 0 0; } 80% { translate: -7px 0; } 88% { translate: 0 0; } 93% { translate: -4px 0; } }
.pf-side:hover img { filter: drop-shadow(0 0 12px rgba(255, 30, 30, .8)); animation-play-state: paused; }
.pf-side.is-next:hover img { transform: translateX(8px) scale(1.06); }
.pf-side.is-prev:hover img { transform: scaleX(-1) translateX(8px) scale(1.06); }
.pf-side:active img { transition-duration: .08s; }
.pf-side.is-next:active img { transform: translateX(14px) scale(.96); }
.pf-side.is-prev:active img { transform: scaleX(-1) translateX(14px) scale(.96); }
.pf-side:focus-visible { outline: 2px solid var(--pf-red-hot); outline-offset: 6px; border-radius: 8px; }

/* ---------------------------------------------------------------- paginação + legenda */
.pf-nav { position: absolute; left: 0; width: 1672px; top: 838px; z-index: 12; display: flex; justify-content: center; }
.pf-dots { display: flex; align-items: center; gap: 12px; }
.pf-dot { width: 16px; height: 16px; display: grid; place-items: center; }
.pf-dot::before { content: ""; width: 6px; height: 6px; transform: rotate(45deg); background: rgba(227, 32, 42, .5); transition: all .3s ease; }
.pf-dot:hover::before { background: var(--pf-red); }
.pf-dot.is-active::before { width: 11px; height: 11px; background: transparent; box-shadow: inset 0 0 0 2px var(--pf-red-hot), 0 0 10px rgba(255, 40, 40, .8); }
.pf-dot:focus-visible { outline: 2px solid var(--pf-red-hot); outline-offset: 2px; }
.pf-caption {
  position: absolute; left: 0; width: 1672px; top: 878px; z-index: 12;
  text-align: center; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.pf:not(.is-ready) .pf-caption { opacity: 0; }
.pf-caption.is-swap { opacity: 0; transform: translateY(4px); }
.pf-cap-num { font-family: var(--pf-font-ui); font-weight: 600; font-size: 11px; letter-spacing: .3em; color: var(--pf-red-hot); margin-right: 12px; }
.pf-cap-title { font-family: var(--pf-font-serif); font-weight: 600; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--pf-cream); text-shadow: 0 2px 8px #000; }
.pf-cap-style { font-family: var(--pf-font-ui); font-weight: 500; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: rgba(239, 228, 210, .55); margin-left: 12px; }

/* ---------------------------------------------------------------- partículas e arranhões */
.pf-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; }

/* ---------------------------------------------------------------- entrada */
.pf.is-pre .pf-title-art { opacity: 0; transform: scale(.9); }
.pf.is-pre .pf-seal { opacity: 0; }
.pf-title-art { transition: opacity .7s ease, transform .95s cubic-bezier(.2, .9, .2, 1); }
.pf-seal { transition: opacity .5s ease 1.35s; }

@keyframes pf-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- celular / retrato */
/* palco vertical: 1024 x 1536 (cenário mobile) */
.is-narrow .pf-stage, .is-narrow .pf-world, .is-narrow .pf-world-front { width: 1024px; height: 1536px; }
.is-narrow .pf-bg { left: 0; top: 0; width: 100%; height: 100%; }
.is-narrow .pf-mist { width: 1024px; }
.is-narrow .pf-mist.is-back { top: 900px; }
.is-narrow .pf-mist.is-front { top: 1190px; opacity: .38; }
.is-narrow .pf-top, .is-narrow .pf-nav, .is-narrow .pf-caption { width: 1024px; }
.is-narrow .pf-title { left: 512px; top: 572px; width: 720px; height: 226px; margin-left: -360px; }
.is-narrow .pf-seal { display: none; }
.is-narrow .pf-card-refl, .is-narrow .pf-body-refl { display: none; }
.is-narrow .pf-nav { top: 1414px; }
.is-narrow .pf-dots { gap: 6px; }
.is-narrow .pf-dot { width: 32px; height: 36px; }
.is-narrow .pf-dot::before { width: 12px; height: 12px; }
.is-narrow .pf-dot.is-active::before { width: 20px; height: 20px; box-shadow: inset 0 0 0 3px var(--pf-red-hot), 0 0 14px rgba(255, 40, 40, .8); }
.is-narrow .pf-caption { top: 1470px; }
/* divisor com 龍 (só no mobile) */
.pf-divider { display: none; }
.is-narrow .pf-divider {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  position: absolute; left: 0; top: 1458px; width: 1024px; height: 64px; z-index: 12; pointer-events: none;
}
.is-narrow .pf-divider::before, .is-narrow .pf-divider::after {
  content: ""; width: 300px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(227, 32, 42, .85) 30%, rgba(227, 32, 42, .85));
}
.is-narrow .pf-divider::after { transform: scaleX(-1); }
.is-narrow .pf-divider img { height: 60px; width: auto; }

.is-narrow .pf-cap-num, .is-narrow .pf-cap-style { display: block; margin: 8px 0 0; font-size: 16px; }
.is-narrow .pf-cap-num { margin: 0 0 8px; }
.is-narrow .pf-cap-title { font-size: 24px; }

/* ---------------------------------------------------------------- lightbox */
.pf-lb {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: rgba(5, 1, 2, .93);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s;
  color: #efe4d2;
}
.pf-lb.is-open { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.pf-lb figure { margin: 0; display: grid; justify-items: center; gap: 14px; max-width: 92vw; }
.pf-lb figure img {
  max-width: 92vw; max-height: 80vh; max-height: 80svh; width: auto; height: auto;
  box-shadow: 0 0 0 1px rgba(255, 48, 48, .8), 0 0 18px rgba(255, 30, 30, .45), 0 20px 80px rgba(0, 0, 0, .8);
  transform: scale(.97); transition: transform .4s cubic-bezier(.2, .9, .2, 1), opacity .25s ease;
}
.pf-lb.is-open figure img { transform: scale(1); }
.pf-lb figure img.is-swap { opacity: 0; }
.pf-lb figcaption { text-align: center; font-family: var(--f-display, "Gang of Three", sans-serif); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 16px; }
.pf-lb figcaption small { display: block; margin-top: 6px; font-family: var(--f-display, "Gang of Three", sans-serif); font-weight: 500; font-size: 12px; letter-spacing: .28em; color: rgba(239, 228, 210, .6); }
.pf-lb button { position: absolute; border: 0; cursor: pointer; background: none; display: grid; place-items: center; }
.pf-lb button:focus-visible { outline: 2px solid #ff3a2e; outline-offset: 3px; }
.pf-lb-close { top: 18px; right: 18px; width: 48px; height: 48px; color: #ff3a2e; }
.pf-lb-close svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2.4; fill: none; }
.pf-lb-prev, .pf-lb-next { top: 50%; width: auto; height: 96px; margin-top: -48px; }
.pf-lb-prev { left: 14px; }
.pf-lb-next { right: 14px; }
.pf-lb-prev img, .pf-lb-next img { height: 96px; width: auto; filter: drop-shadow(0 0 10px rgba(255, 30, 30, .5)); }
.pf-lb-prev img { transform: scaleX(-1); }
@media (max-width: 640px) {
  .pf-lb-prev, .pf-lb-next { top: auto; bottom: 14px; margin: 0; height: 70px; width: auto; }
  .pf-lb-prev img, .pf-lb-next img { height: 70px; }
}

/* ---------------------------------------------------------------- movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  .pf *, .pf *::before, .pf *::after { animation: none !important; transition-duration: .01s !important; transition-delay: 0s !important; }
}
