/* Widney Murteira Arquitetura — estilos partilhados */
:root {
  --bg: #e3ded2;        /* o mesmo tom do fundo de estúdio do retrato */
  --ink: #26211d;
  --mute: #675b53;
  --cap: #6e655e;
  --line: rgba(38, 33, 29, .16);
  --wood: #a8642f;      /* a madeira da poltrona */
  --sans: "Inter", system-ui, sans-serif;
  --name: "Montserrat", "Inter", system-ui, sans-serif;
  --serif: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 4px; }

/* ---------- Bloco de identidade (canto superior esquerdo) ---------- */
.id { position: fixed; left: 45px; top: 14px; z-index: 5; }
.id__name {
  display: flex; align-items: center; gap: 18px; font: 500 15.5px/1 var(--name); letter-spacing: .42em;
  color: var(--ink); padding-top: 1px; white-space: nowrap;
}
.id__mark {
  width: 66px; height: 20px; flex: none; background: currentColor; margin-top: -2px;
  -webkit-mask: url(../img/logo.png) center / contain no-repeat; mask: url(../img/logo.png) center / contain no-repeat;
}
.id__links { display: flex; gap: 28px; margin-top: 15px; }
.id__links a, .id__links button {
  font: 400 15.2px/1 var(--sans); letter-spacing: -.005em; color: var(--mute);
  transition: color .3s ease;
}
.id__links a:hover, .id__links button:hover { color: var(--ink); }

/* ================= HOME ================= */
html.home, html.home body { height: 100%; overflow: hidden; }
html.home body { touch-action: none; user-select: none; -webkit-user-select: none; }

.stage { position: fixed; inset: 0; z-index: 2; overflow: hidden; }
.stage canvas { display: block; width: 100%; height: 100%; }

.portrait {
  position: fixed; left: 0; bottom: 0; z-index: 1; margin: 0;
  height: min(88vh, 64vw); aspect-ratio: 3 / 4; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 82%, transparent),
                      linear-gradient(to bottom, transparent, #000 12%);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 82%, transparent),
              linear-gradient(to bottom, transparent, #000 12%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.manifesto {
  position: fixed; z-index: 3; left: 41.5vw; top: 0; bottom: 0; width: 17.2vw; min-width: 200px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; pointer-events: none;
}
.manifesto a { pointer-events: auto; }
.manifesto__label {
  font: 500 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--mute);
  margin: 0 0 22px; white-space: nowrap;
}
.manifesto__quote {
  font: 400 italic clamp(19px, 1.82vw, 30px)/1.22 var(--serif); letter-spacing: -.005em;
  margin: 0; color: var(--ink); text-wrap: balance;
}
.manifesto__cta {
  display: inline-flex; align-items: baseline; gap: 10px; margin-top: 30px;
  font: 400 15.2px/1 var(--sans); color: var(--ink);
  padding-bottom: 7px; border-bottom: 1px solid var(--ink);
  transition: color .3s ease, border-color .3s ease, gap .4s var(--ease);
}
.manifesto__cta:hover { color: var(--wood); border-color: var(--wood); gap: 16px; }

.meter {
  position: fixed; z-index: 3; right: 45px; bottom: 20px; text-align: right;
  font: 400 12px/1.5 var(--sans); color: var(--mute); font-variant-numeric: tabular-nums;
}
.meter b { display: block; font: 400 italic 22px/1.1 var(--serif); color: var(--ink); }
.hint {
  position: fixed; z-index: 3; left: 41.5vw; bottom: 22px; margin: 0;
  font: 400 12px/1 var(--sans); color: var(--mute);
}
.credit {
  position: fixed; z-index: 3; left: 45px; bottom: 22px; margin: 0;
  font: 400 11px/1 var(--sans); color: var(--mute); opacity: .8;
}
.credit a { pointer-events: auto; }

.tag {
  position: fixed; z-index: 6; left: 0; top: 0; pointer-events: none;
  padding: 8px 12px; border-radius: 99px; background: var(--ink); color: var(--bg);
  font: 400 12px/1 var(--sans); white-space: nowrap;
  opacity: 0; transition: opacity .25s ease;
}
.tag.on { opacity: 1; }

.portal-link {
  position: fixed; z-index: 5; right: 45px; top: 14px; font: 400 15.2px/1 var(--sans); color: var(--ink);
  padding-bottom: 6px; border-bottom: 1px solid var(--ink); transition: color .3s ease, border-color .3s ease;
}
.portal-link:hover { color: var(--wood); border-color: var(--wood); }

/* Índice de projetos (overlay) */
.indice {
  position: fixed; inset: 0; z-index: 8; background: var(--bg); display: none;
  padding: 110px 45px 40px; overflow-y: auto; touch-action: pan-y;
}
.indice.open, html.no-gl .indice { display: block; }
.indice__close { position: fixed; right: 45px; top: 14px; font: 400 15.2px/1 var(--sans); color: var(--mute); }
html.no-gl .indice__close { display: none; }
.indice ol { list-style: none; margin: 0; padding: 0; max-width: 1100px; }
.indice li { border-top: 1px solid var(--line); }
.indice li:last-child { border-bottom: 1px solid var(--line); }
.indice a {
  display: grid; grid-template-columns: 3.2em 1fr auto auto; gap: 24px; align-items: baseline;
  padding: 15px 0; transition: padding .45s var(--ease), color .3s ease;
}
.indice a:hover { padding-left: 14px; color: var(--wood); }
.indice a span { font: 400 12px/1 var(--sans); color: var(--mute); font-variant-numeric: tabular-nums; }
.indice a strong { font: 400 clamp(26px, 3.4vw, 44px)/1.05 var(--serif); }

/* entrada */
html.js.home .id__name, html.js.home .id__links > *, html.js.home .rise { opacity: 0; transform: translateY(10px); }
html.js.home.ready .id__name, html.js.home.ready .id__links > *, html.js.home.ready .rise {
  opacity: 1; transform: none; transition: opacity 1s var(--ease), transform 1s var(--ease);
}
html.js.home.ready .id__links > :nth-child(1) { transition-delay: .08s; }
html.js.home.ready .id__links > :nth-child(2) { transition-delay: .16s; }
html.js.home.ready .id__links > :nth-child(3) { transition-delay: .24s; }
html.js.home.ready .id__links > :nth-child(4) { transition-delay: .32s; }
html.js.home.ready .rise { transition-delay: .35s; }
html.js.home .portrait { opacity: 0; }
html.js.home.ready .portrait { opacity: 1; transition: opacity 1.6s ease .1s; }
html.leaving body { opacity: 0; transition: opacity .28s ease; }

/* telemóvel / tablet ao alto */
@media (max-width: 819px) and (orientation: portrait) {
  .id { left: 20px; top: 22px; }
  .id__name { font-size: 13px; letter-spacing: .34em; gap: 12px; }
  .id__mark { width: 53px; height: 16px; }
  .id__links { gap: 22px; margin-top: 16px; }
  .id__links a, .id__links button { font-size: 14px; }
  .stage { top: 92px; bottom: 64px; }
  .portrait { left: -25vw; height: 50vh; }
  .manifesto { left: 20px; top: 104px; bottom: auto; width: 42vw; min-width: 0; }
  .manifesto__label { display: none; }
  .manifesto__quote { font-size: 16.5px; }
  .manifesto__cta { margin-top: 16px; font-size: 13px; gap: 6px; white-space: nowrap; }
  .hint, .credit { display: none; }
  .portal-link { top: auto; right: auto; left: 20px; bottom: 20px; font-size: 13px; padding-bottom: 4px; }
  .meter { right: 20px; bottom: 16px; }
  .meter b { font-size: 19px; }
  .indice { padding: 100px 20px 30px; }
  .indice__close { right: 20px; top: 22px; }
  .indice a { grid-template-columns: 2.2em 1fr auto; gap: 12px; }
  .indice a span:nth-of-type(2) { display: none; }
}
@media (max-height: 520px) {
  .manifesto__label, .hint, .credit { display: none; }
  .manifesto__quote { font-size: 15px; }
  .manifesto__cta { margin-top: 12px; font-size: 13px; }
  .meter b { font-size: 17px; }
}

/* ================= PÁGINA DE PROJETO ================= */
html.proj { scroll-behavior: smooth; }
.proj .id { position: absolute; }
.back {
  position: fixed; right: 45px; top: 14px; z-index: 6; font: 400 15.2px/1 var(--sans); color: var(--mute);
  padding: 9px 14px; margin: -9px -14px; border-radius: 99px; transition: color .3s ease, background .3s ease;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(8px);
}
.back:hover { color: var(--ink); }

.hero { padding: 150px 45px 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 60px; align-items: end; }
.hero__kicker { font: 500 10.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); margin: 0 0 26px; }
.hero h1 { font: 400 clamp(52px, 7.4vw, 128px)/.92 var(--serif); letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.hero h1 em { font-style: italic; color: var(--wood); }
.facts { margin: 44px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; max-width: 460px; }
.facts div { border-top: 1px solid var(--line); padding: 12px 0 16px; }
.facts dt { font: 500 10px/1.35 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
.facts dd { margin: 0; font: 400 15.2px/1.3 var(--sans); }
.hero__img { margin: 0; overflow: hidden; background: #cfc7ba; }
.hero__img img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: cover; }

.gallery { padding: 60px 45px 0; display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 14px; }
.shot { position: relative; display: block; min-width: 0; overflow: hidden; background: #cfc7ba; cursor: zoom-in; scroll-margin-top: 80px; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .8s ease; }
.shot:hover img { transform: scale(1.025); }
.shot i { position: absolute; left: 12px; bottom: 10px; font: 400 11px/1 var(--sans); font-style: normal; color: #fff; mix-blend-mode: difference; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .3s ease; }
.shot:hover i { opacity: .9; }
html.js .reveal { opacity: 0; transform: translateY(26px); }
html.js .reveal.in { opacity: 1; transform: none; transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.note { padding: 28px 45px 0; font: 400 14px/1.5 var(--sans); color: var(--mute); }
.note a { color: var(--ink); border-bottom: 1px solid var(--ink); }

.next { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: end; margin: 120px 45px 0; padding: 34px 0 0; border-top: 1px solid var(--ink); }
.next small { display: block; font: 500 10.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); margin-bottom: 18px; }
.next strong { font: 400 italic clamp(40px, 6vw, 96px)/.95 var(--serif); letter-spacing: -.015em; transition: color .3s ease; }
.next:hover strong { color: var(--wood); }
.next img { width: clamp(120px, 16vw, 230px); aspect-ratio: 1; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.next:hover img { transform: translateY(-8px); }

.foot { margin: 120px 45px 0; padding: 26px 0 30px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: space-between; font: 400 13px/1.4 var(--sans); color: var(--mute); }
.foot a:hover { color: var(--ink); }
.foot__cta { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 3px; }

.lb { position: fixed; inset: 0; z-index: 20; background: rgba(24, 21, 18, .96); display: none; align-items: center; justify-content: center; }
.lb.open { display: flex; }
.lb img { max-width: calc(100vw - 140px); max-height: calc(100vh - 90px); object-fit: contain; display: block; }
.lb button { position: absolute; color: #e3ded2; font: 400 14px/1 var(--sans); padding: 18px; opacity: .75; transition: opacity .2s; }
.lb button:hover { opacity: 1; }
.lb__x { right: 22px; top: 12px; } .lb__p { left: 14px; top: 50%; translate: 0 -50%; font-size: 24px !important; }
.lb__n { right: 14px; top: 50%; translate: 0 -50%; font-size: 24px !important; }
.lb__c { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: #e3ded2; opacity: .6; font: 400 12px/1 var(--sans); font-variant-numeric: tabular-nums; }

@media (max-width: 819px) {
  .proj .id { left: 20px; top: 22px; }
  .proj .id__name { font-size: 13px; letter-spacing: .34em; gap: 12px; }
  .proj .id__mark { width: 53px; height: 16px; }
  .proj .id__links { display: none; }
  .back { right: 20px; top: 62px; position: absolute; margin: 0; padding: 0; background: none; backdrop-filter: none; }
  .hero { grid-template-columns: 1fr; padding: 120px 20px 0; gap: 36px; }
  .gallery { padding: 14px 20px 0; gap: 10px; }
  .row { gap: 10px; flex-wrap: wrap; }
  .row--3 .shot { flex-basis: calc(50% - 5px) !important; flex-grow: 1 !important; }
  .note { padding: 20px 20px 0; }
  .next { margin: 80px 20px 0; gap: 18px; }
  .foot { margin: 80px 20px 0; }
  .lb img { max-width: 100vw; max-height: calc(100vh - 120px); }
  .lb__p, .lb__n { top: auto !important; bottom: 0; translate: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  html.proj { scroll-behavior: auto; }
  html.js.home .id__name, html.js.home .id__links > *, html.js.home .rise, html.js.home .portrait, html.js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .shot img, .next img { transition: none; }
}
