/* ===== G2B — portfólio: listagem e detalhe de projeto ===== */

/* ---------- capa do projeto ---------- */
.proj-hero {
  position: relative; min-height: 78svh; display: flex; align-items: flex-end;
  padding: 160px 0 70px; overflow: hidden;
}
.proj-hero-bg { position: absolute; inset: 0; z-index: -1; }
.proj-hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.proj-hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(21, 23, 23, 0.82) 0%, rgba(21, 23, 23, 0.35) 42%, var(--bg) 100%);
}
.proj-crumb {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 26px;
}
.proj-crumb a { color: inherit; text-decoration: none; transition: color 0.3s ease; }
.proj-crumb a:hover { color: var(--acc); }
.proj-crumb span { color: var(--acc); }
.proj-hero h1 {
  font-size: clamp(38px, 6.5vw, 96px); font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.04em; line-height: 0.98; max-width: 18ch;
}
.proj-hero h1 .outline { color: transparent; -webkit-text-stroke: 2px var(--ink); }
.proj-sub { margin-top: 24px; font-size: clamp(17px, 2vw, 22px); color: var(--muted); max-width: 56ch; line-height: 1.5; }
.proj-sub strong { color: var(--ink); font-weight: 600; }

/* ---------- ficha técnica ---------- */
.proj-specs { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 40px 0; }
.proj-specs dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 32px; }
.proj-specs dt {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 9px;
}
.proj-specs dd { font-size: 17px; font-weight: 600; line-height: 1.4; }

/* ---------- textos ---------- */
.proj-text { padding: 110px 0 90px; }
.proj-text-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.proj-text .lead {
  font-size: clamp(22px, 2.6vw, 30px); line-height: 1.4; font-weight: 500;
  letter-spacing: -0.015em; color: var(--ink);
}
.proj-body p { color: var(--muted); font-size: 17.5px; margin-bottom: 20px; }
.proj-body p:last-child { margin-bottom: 0; }
.proj-body strong { color: var(--ink); font-weight: 600; }
.proj-body a { color: var(--acc); }

/* ---------- galeria ---------- */
.proj-gallery { padding: 20px 0 120px; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pgrid-item { min-width: 0; }
.pgrid-item.is-wide { grid-column: span 2; }
.pgrid-btn {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  background: var(--bg2); border-radius: 14px; overflow: hidden;
  position: relative; aspect-ratio: 4 / 3;
}
.pgrid-btn img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.pgrid-btn:hover img { transform: scale(1.06); }
.pgrid-btn .zoom {
  position: absolute; right: 16px; bottom: 16px;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; font-weight: 300;
  background: var(--ink); color: #151717;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.pgrid-btn:hover .zoom { opacity: 1; transform: none; }
.pgrid-item figcaption { padding: 12px 4px 0; font-size: 13.5px; color: rgba(244, 244, 242, 0.45); }

/* ---------- desafio / solução / resultado ---------- */
.proj-blocks { background: var(--bg2); }
.proj-blocks .wrap { padding-top: 110px; padding-bottom: 70px; }
.proj-block {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 40px;
  padding: 44px 0; border-top: 1px solid var(--line);
}
.proj-block:last-child { border-bottom: 1px solid var(--line); }
.proj-block .ph-tag {
  display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--acc); margin-bottom: 18px;
}
.proj-block-text p { color: var(--muted); font-size: 18px; max-width: 62ch; margin-bottom: 16px; }
.proj-block-text p:last-child { margin-bottom: 0; }
.proj-block-text strong { color: var(--ink); font-weight: 600; }
.proj-block .ph-num {
  font-size: clamp(56px, 9vw, 130px); font-weight: 800; line-height: 0.8; flex: none;
  color: transparent; -webkit-text-stroke: 2px rgba(244, 244, 242, 0.16);
}

/* ---------- navegação entre projetos ---------- */
.proj-nav { border-top: 1px solid var(--line); }
.proj-nav .wrap { display: flex; justify-content: space-between; gap: 24px; padding-top: 34px; padding-bottom: 34px; }
.proj-nav-item { text-decoration: none; color: var(--ink); display: grid; gap: 6px; min-width: 0; max-width: 46%; }
.proj-nav-item.next { text-align: right; margin-left: auto; }
.proj-nav-item .dir { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); transition: color 0.3s ease; }
.proj-nav-item strong {
  font-size: clamp(17px, 2.2vw, 26px); font-weight: 800; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
  transition: color 0.3s ease;
}
.proj-nav-item:hover .dir, .proj-nav-item:hover strong { color: var(--acc); }

.proj-related { padding-top: 110px; }

/* ---------- listagem ---------- */
.proj-index-head { padding: 170px 0 60px; }
.proj-index-head h1 {
  font-size: clamp(38px, 6vw, 88px); font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.04em; line-height: 0.98; max-width: 16ch;
}
.proj-index-head h1 .pink { color: var(--acc); }
.proj-index-head > .wrap > p { margin-top: 24px; color: var(--muted); font-size: 18px; max-width: 56ch; }
.proj-index { padding-top: 20px; }

.proj-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 42px; }
.proj-filters a {
  font-size: 13.5px; font-weight: 600; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 20px;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.proj-filters a sup { font-size: 10px; opacity: 0.7; margin-left: 3px; }
.proj-filters a:hover { color: var(--ink); border-color: var(--muted); }
.proj-filters a.active { background: var(--acc); border-color: var(--acc); color: #fff; }

.case-grid-3 { grid-template-columns: repeat(3, 1fr); gap: 32px 28px; }
.case-grid-3 .case-card:nth-child(even) { margin-top: 0; }
.case-card .ph .flag {
  position: absolute; left: 16px; top: 16px; z-index: 1;
  font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--acc); color: #fff; border-radius: 999px; padding: 6px 14px;
}
.case-card .excerpt { display: block; padding: 10px 4px 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

.proj-empty { text-align: center; padding: 70px 20px 90px; color: var(--muted); }
.proj-empty b { display: block; font-size: 22px; color: var(--ink); margin-bottom: 12px; font-weight: 700; }
.proj-empty a { color: var(--acc); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 5000; background: rgba(8, 9, 9, 0.96);
  display: grid; grid-template-columns: 90px 1fr 90px; align-items: center;
  animation: lbIn 0.28s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lbIn { from { opacity: 0; } }
.lb-stage { display: grid; place-items: center; gap: 16px; padding: 5vh 0; max-height: 100svh; min-width: 0; }
.lb-stage img {
  max-width: 100%; max-height: 78svh; object-fit: contain;
  border-radius: 10px; animation: lbImg 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes lbImg { from { opacity: 0; transform: scale(0.97); } }
.lb-stage figcaption { color: var(--muted); font-size: 14.5px; text-align: center; max-width: 62ch; padding: 0 20px; }
.lb-stage figcaption:empty { display: none; }
.lb-arrow {
  width: 58px; height: 58px; border-radius: 50%; justify-self: center;
  border: 1px solid rgba(244, 244, 242, 0.25); background: transparent; color: var(--ink);
  font-size: 30px; line-height: 1; cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.lb-arrow:hover { background: var(--acc); border-color: var(--acc); color: #fff; }
.lb-close {
  position: absolute; right: 22px; top: 22px; z-index: 2;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(244, 244, 242, 0.25); background: transparent; color: var(--ink);
  font-size: 28px; line-height: 1; cursor: pointer; transition: background 0.25s, border-color 0.25s;
}
.lb-close:hover { background: var(--acc); border-color: var(--acc); color: #fff; }
.lb-count {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  font-size: 13px; letter-spacing: 0.16em; color: var(--muted);
}

@media (max-width: 980px) {
  .proj-text-grid { grid-template-columns: 1fr; gap: 32px; }
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .case-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .proj-hero { min-height: 68svh; padding: 130px 0 50px; }
  .proj-text { padding: 70px 0 60px; }
  .proj-specs { padding: 30px 0; }
  .proj-specs dl { grid-template-columns: 1fr 1fr; gap: 22px; }
  .proj-gallery { padding-bottom: 80px; }
  .pgrid { grid-template-columns: 1fr; }
  .pgrid-item.is-wide { grid-column: span 1; }
  .proj-blocks .wrap { padding-top: 70px; padding-bottom: 40px; }
  .proj-block { flex-direction: column-reverse; align-items: flex-start; gap: 16px; padding: 34px 0; }
  .proj-nav .wrap { flex-direction: column; }
  .proj-nav-item, .proj-nav-item.next { max-width: 100%; text-align: left; margin-left: 0; }
  .proj-index-head { padding: 130px 0 40px; }
  .case-grid-3 { grid-template-columns: 1fr; }
  .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lb-stage { grid-row: 1; }
  .lb-arrow { position: absolute; bottom: 26px; }
  .lb-arrow.prev { left: 22%; }
  .lb-arrow.next { right: 22%; }
  .lb-count { bottom: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .pgrid-btn img, .pgrid-btn .zoom, .lightbox, .lb-stage img { transition: none; animation: none; }
}
