/* Páginas internas: listagem de projetos e página de cada projeto */

body.page { background: var(--ink); color: var(--white); }
body.page .header { color: var(--white); }
body.page .header .brand img { filter: brightness(0) invert(1); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- cabeçalho da listagem ---------- */
.pl-head { padding: clamp(8rem, 14vw, 12rem) 0 clamp(2rem, 4vw, 3.5rem); position: relative; overflow: clip; }
.pl-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(to right, var(--line-dark) 1px, transparent 1px);
  background-size: calc((min(100vw, var(--max)) - 2 * var(--gutter)) / 6) 100%;
  background-position: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))) 0;
  mask-image: linear-gradient(to bottom, #000, transparent); -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
}
.pl-head .wrap { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; align-items: end; }
.pl-head h1 { font-size: clamp(3rem, 1rem + 10vw, 11rem); line-height: .88; font-weight: 800; font-stretch: 125%; letter-spacing: -.045em; }
.pl-head p { max-width: 24ch; font-size: var(--fs-lead); font-weight: 300; font-stretch: 75%; line-height: 1.15; opacity: .9; padding-bottom: .4rem; }
.pl-head .count-badge { display: block; margin-top: .6rem; font-size: .95rem; font-stretch: 100%; font-weight: 500; opacity: .6; }

/* filtros */
.chips { position: sticky; top: 0; z-index: 50; padding-block: .9rem; background: linear-gradient(to bottom, var(--ink) 70%, transparent); }
.chips ul { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem; }
.chips ul::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: .55rem 1.1rem; border: 1px solid var(--line-dark); font-weight: 500; font-size: .95rem; transition: background-color .3s, color .3s, border-color .3s; }
.chip:hover { border-color: var(--white); }
.chip[aria-pressed="true"] { background: var(--white); color: var(--navy); border-color: var(--white); }

/* ---------- mosaico ---------- */
.mosaic {
  --u: clamp(64px, 10.4vw, 150px); --g: clamp(.5rem, 1vw, .9rem);
  display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: var(--u); gap: var(--g);
  padding-block: clamp(1rem, 2vw, 2rem) clamp(4rem, 8vw, 8rem);
}
.t1 { grid-area: 1 / 1 / span 2 / span 8; }
.t5 { grid-area: 1 / 9 / span 4 / span 4; }
.t2 { grid-area: 3 / 1 / span 2 / span 4; }
.t3 { grid-area: 3 / 5 / span 2 / span 4; }
.t4 { grid-area: 5 / 1 / span 3 / span 4; }
.t6 { grid-area: 5 / 5 / span 3 / span 8; }
.t7 { grid-area: 8 / 1 / span 3 / span 6; }
.t8 { grid-area: 8 / 7 / span 3 / span 6; }
.mc { position: relative; display: block; min-height: 0; overflow: hidden; background: var(--navy); clip-path: inset(0); }
.mc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.3s var(--ease); }
.t3 img { object-position: 60% 50%; }
.t1 img { object-position: 50% 62%; }
.mc::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 20, 43, .85), rgba(8, 20, 43, 0) 55%); opacity: .75; transition: opacity .5s; }
.mc__cap { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 1.2rem 1.3rem; display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.mc__cap b { font-size: clamp(1.1rem, .9rem + .6vw, 1.5rem); font-weight: 700; font-stretch: 112%; letter-spacing: -.02em; line-height: 1.1; }
.mc__cap em { font-style: normal; font-size: .9rem; font-weight: 600; white-space: nowrap; opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .5s var(--ease); }
.mc:hover img, .mc:focus-visible img { transform: scale(1.06); }
.mc:hover::after { opacity: 1; }
.mc:hover .mc__cap em, .mc:focus-visible .mc__cap em { opacity: 1; transform: none; }
.mc.is-out { display: none; }
.mc.is-in { animation: mcin .7s var(--ease) both; }
@keyframes mcin { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.js .rv { opacity: 0; transform: translateY(70px) scale(.97); }
.js .rv.in { opacity: 1; transform: none; transition: transform 1.1s var(--ease), opacity .7s; }
.js .rv.in img { animation: imgin 1.6s var(--ease) both; }
@keyframes imgin { from { transform: scale(1.18); } to { transform: scale(1); } }

/* ---------- página do projeto ---------- */
.ph { padding: clamp(8rem, 13vw, 11rem) 0 clamp(2.5rem, 5vw, 4rem); }
.back { display: inline-flex; align-items: center; gap: .6rem; font-weight: 500; opacity: .75; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); transition: opacity .3s, gap .4s var(--ease); }
.back::before { content: ""; width: 22px; height: 1px; background: currentColor; }
.back:hover { opacity: 1; gap: 1rem; }
.ph__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem clamp(1rem, 2vw, 2rem); align-items: end; }
.ph h1 { grid-column: 1 / span 8; font-size: clamp(2.4rem, 1rem + 6vw, 7.5rem); line-height: .92; font-weight: 800; font-stretch: 125%; letter-spacing: -.04em; }
.ph__text { grid-column: 9 / -1; font-size: var(--fs-lead); line-height: 1.25; font-weight: 300; font-stretch: 75%; padding-bottom: .5rem; }
.ph__text small { display: block; margin-top: 1.4rem; font-size: .95rem; font-weight: 500; font-stretch: 100%; opacity: .6; }

.pg { display: grid; gap: clamp(.75rem, 1.6vw, 1.5rem); padding-bottom: clamp(3rem, 6vw, 6rem); }
.pg figure { position: relative; overflow: hidden; background: var(--navy); }
.pg figure.tall { width: min(100%, 680px); justify-self: center; }
.pg button { display: block; width: 100%; cursor: zoom-in; }
.pg img { width: 100%; height: auto; transition: transform 1.4s var(--ease); }
.pg button:hover img { transform: scale(1.03); }

.next { position: relative; display: block; min-height: clamp(320px, 62vh, 640px); overflow: hidden; isolation: isolate; background: var(--navy); }
.next img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.6s var(--ease); }
.next::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 20, 43, .9), rgba(8, 20, 43, .3)); }
.next .wrap { min-height: inherit; display: flex; flex-direction: column; justify-content: flex-end; padding-block: clamp(2rem, 4vw, 3.5rem); gap: .6rem; }
.next small { font-size: 1rem; font-weight: 500; opacity: .8; }
.next b { font-size: clamp(2rem, 1rem + 5vw, 6rem); font-weight: 800; font-stretch: 125%; letter-spacing: -.04em; line-height: .95; }
.next:hover img { transform: scale(1.06); }
.cta-end { padding-block: clamp(3rem, 6vw, 6rem); background: var(--navy); }
.cta-end .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem; }
.cta-end p { font-size: clamp(1.4rem, 1rem + 1.6vw, 2.6rem); font-weight: 700; font-stretch: 112%; letter-spacing: -.025em; }

/* ---------- visualizador ---------- */
.zoom { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(8, 20, 43, .97); color: var(--white); }
.zoom[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; animation: zin .5s var(--ease); }
.zoom::backdrop { background: rgba(8, 20, 43, .85); }
@keyframes zin { from { opacity: 0; clip-path: inset(6%); } to { opacity: 1; clip-path: inset(0); } }
.zoom__stage { min-height: 0; display: grid; place-items: center; padding: 4.5rem var(--gutter) 1rem; }
.zoom__stage img { max-width: 100%; max-height: calc(100dvh - 9.5rem); width: auto; height: auto; object-fit: contain; }
.zoom__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem var(--gutter) 1.4rem; }
.zoom__bar span { font-weight: 600; font-stretch: 112%; }
.zoom button { min-width: 46px; height: 46px; border: 1px solid var(--line-dark); padding-inline: 1rem; font-size: 1.4rem; line-height: 1; transition: background-color .3s, color .3s; }
.zoom button:hover { background: var(--white); color: var(--ink); }
.zoom__close { position: absolute; top: 1rem; right: 1.2rem; z-index: 3; }
.zoom__nav { display: flex; gap: .6rem; }

@media (max-width: 1000px) {
  .mosaic { --u: 34vw; grid-template-columns: repeat(2, 1fr); }
  .t1 { grid-area: 1 / 1 / span 1 / span 2; }
  .t5 { grid-area: 2 / 1 / span 2 / span 1; }
  .t2 { grid-area: 2 / 2 / span 1 / span 1; }
  .t3 { grid-area: 3 / 2 / span 1 / span 1; }
  .t4 { grid-area: 4 / 1 / span 1 / span 1; }
  .t6 { grid-area: 4 / 2 / span 1 / span 1; }
  .t7 { grid-area: 5 / 1 / span 1 / span 1; }
  .t8 { grid-area: 5 / 2 / span 1 / span 1; }
  .ph h1 { grid-column: 1 / -1; }
  .ph__text { grid-column: 1 / span 9; }
  .pl-head .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .mosaic { --u: 62vw; grid-template-columns: 1fr; }
  .t1, .t2, .t3, .t4, .t5, .t6, .t7, .t8 { grid-area: auto; }
  .t5 { grid-row: span 1; }
  .ph__text { grid-column: 1 / -1; }
  .mc__cap em { opacity: 1; transform: none; }
}
@media (hover: none) { .mc__cap em { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js .rv { opacity: 1; transform: none; } .js .rv.in img { animation: none; } .mc.is-in { animation: none; } }
