/* ==========================================================================
   GRUPO PEREIRAS — v2
   Marfim sobre preto quente · serifa leve · muito espaço · movimento discreto
   Fontes alojadas localmente (sem pedidos a terceiros).
   ========================================================================== */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-latin-300-italic.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-300-normal.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0a0a09;
  --ink-2: #111110;
  --ivory: #f4f1ea;
  --ivory-dim: rgba(244, 241, 234, 0.74);
  --ivory-mute: rgba(244, 241, 234, 0.56);
  --line: rgba(244, 241, 234, 0.12);
  --line-strong: rgba(244, 241, 234, 0.3);

  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);

  --gutter: clamp(22px, 4.6vw, 88px);
  --intro: 1.9s; /* tempo da animação de entrada (0 quando já foi vista) */
}

html.no-intro {
  --intro: 0s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
picture {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
}

::selection {
  background: var(--ivory);
  color: var(--ink);
}

:focus-visible {
  outline: 1px solid var(--ivory);
  outline-offset: 4px;
}

.skip {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 2000;
  background: var(--ivory);
  color: var(--ink);
  padding: 12px 20px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: top 0.3s var(--ease);
}
.skip:focus {
  top: 16px;
}

/* ---------- Utilitários ---------- */

.wrap {
  width: 100%;
  max-width: 1560px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(96px, 13vw, 210px);
}

.label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ivory-mute);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 300;
  letter-spacing: -0.012em;
  margin: 0;
}

.sec-head {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: clamp(48px, 7vw, 110px);
}
.sec-head .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  transform-origin: left;
}
.sec-head .aside {
  color: var(--ivory-mute);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.link-arrow .bar {
  display: block;
  width: 44px;
  height: 1px;
  background: currentColor;
  transition: width 0.6s var(--ease);
}
.link-arrow:hover .bar,
a:hover > .link-arrow .bar,
a:focus-visible > .link-arrow .bar {
  width: 84px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 48px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.5s var(--ease),
    color 0.5s var(--ease),
    border-color 0.5s var(--ease);
}
.btn:hover,
.btn:focus-visible {
  background: var(--ivory);
  color: var(--ink);
  border-color: var(--ivory);
}

/* ---------- Revelação ao scroll (só ativa com JS) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 1.2s var(--ease),
    transform 1.2s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}
.js .sec-head .rule {
  transform: scaleX(0);
  transition: transform 1.6s var(--ease) 0.15s;
}
.js .sec-head.is-in .rule {
  transform: scaleX(1);
}

/* ---------- Ecrã de entrada ---------- */

.loader {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  background: var(--ink);
  animation: loader-out 1s var(--ease-io) 1.35s forwards;
}
.loader img {
  width: min(210px, 52vw);
  opacity: 0;
  animation: loader-logo 1.3s var(--ease) 0.15s forwards;
}
.loader::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 18vh;
  width: 120px;
  height: 1px;
  background: var(--line);
  transform: translateX(-50%) scaleX(0);
  transform-origin: left;
  animation: loader-line 1.1s var(--ease-io) 0.2s forwards;
}
html.no-intro .loader {
  display: none;
}
@keyframes loader-logo {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes loader-line {
  to {
    transform: translateX(-50%) scaleX(1);
  }
}
@keyframes loader-out {
  to {
    transform: translateY(-100%);
    visibility: hidden;
  }
}

/* ---------- Efeitos de ambiente ---------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  width: 100%;
  z-index: 1300;
  background: var(--ivory);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1600;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--ivory);
  mix-blend-mode: difference;
  pointer-events: none;
  opacity: 0;
  display: grid;
  place-items: center;
  transition:
    opacity 0.4s ease,
    width 0.45s var(--ease),
    height 0.45s var(--ease),
    margin 0.45s var(--ease),
    background 0.3s ease;
}
.cursor.is-on {
  opacity: 1;
}
.cursor.is-link {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
}
.cursor.is-view {
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  mix-blend-mode: normal;
  background: var(--ivory);
}
.cursor span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cursor.is-view span {
  opacity: 1;
}
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  .cursor {
    display: none;
  }
}

/* ---------- Cabeçalho ---------- */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition:
    transform 0.7s var(--ease),
    background 0.5s ease,
    border-color 0.5s ease;
}
.header.is-solid {
  background: rgba(10, 10, 9, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}
.header.is-hidden {
  transform: translateY(-105%);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand img {
  height: 30px;
  width: auto;
}
.nav {
  display: none;
  align-items: center;
  gap: clamp(28px, 3.4vw, 56px);
}
.nav a {
  position: relative;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding-block: 6px;
  color: var(--ivory-dim);
  transition: color 0.4s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.nav a:hover,
.nav a:focus-visible {
  color: var(--ivory);
}
.nav a:hover::after,
.nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}
@media (min-width: 900px) {
  .nav {
    display: flex;
  }
}

.burger {
  display: grid;
  gap: 7px;
  width: 44px;
  height: 44px;
  padding: 14px 10px;
  background: none;
  border: 0;
  cursor: pointer;
  position: relative;
  z-index: 1100;
}
.burger span {
  display: block;
  height: 1px;
  background: var(--ivory);
  transition:
    transform 0.6s var(--ease),
    opacity 0.3s ease;
}
.burger.is-open span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
.burger.is-open span:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}
@media (min-width: 900px) {
  .burger {
    display: none;
  }
}

.menu {
  position: fixed;
  inset: 0;
  z-index: 950; /* abaixo do cabeçalho, para o botão de fechar ficar visível */
  background: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px var(--gutter) 60px;
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition:
    clip-path 0.9s var(--ease-io),
    visibility 0s linear 0.9s;
}
.menu.is-open {
  visibility: visible;
  clip-path: inset(0);
  transition:
    clip-path 0.9s var(--ease-io),
    visibility 0s;
}
.menu a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(38px, 11vw, 64px);
  line-height: 1.1;
}
.menu a small {
  font-family: var(--sans);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ivory-mute);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: -5% 0;
  z-index: -2;
  transform: translate3d(0, calc(var(--py, 0) * 1px), 0);
  will-change: transform;
}
.hero-media picture,
.numbers-figure picture,
.leader-photo picture {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
  animation: hero-zoom 3.2s var(--ease) calc(var(--intro) - 0.9s) both;
}
@media (max-width: 700px) {
  .hero-media img {
    object-position: 20% 50%; /* mostra a zona iluminada da moradia em ecrãs estreitos */
  }
}
@keyframes hero-zoom {
  from {
    transform: scale(1.12);
  }
  to {
    transform: scale(1);
  }
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(10, 10, 9, 0.95) 0%, rgba(10, 10, 9, 0.35) 38%, rgba(10, 10, 9, 0.05) 70%),
    linear-gradient(to bottom, rgba(10, 10, 9, 0.55) 0%, rgba(10, 10, 9, 0) 24%);
}

.hero-inner {
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  padding-top: 160px;
  padding-bottom: clamp(104px, 13vh, 140px);
}
@media (min-width: 960px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.5fr);
    align-items: end;
    column-gap: clamp(40px, 6vw, 120px);
  }
  .hero-eyebrow {
    grid-column: 1 / -1;
  }
}

.hero-eyebrow {
  opacity: 0;
  animation: fade 1.4s var(--ease) calc(var(--intro) + 0.05s) forwards;
}
.hero-title {
  font-style: italic;
  font-weight: 300;
  font-size: clamp(56px, 10.2vw, 184px);
  line-height: 0.94;
  letter-spacing: -0.025em;
}
.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}
.hero-title .line > span {
  display: block;
  transform: translateY(112%);
  animation: rise 1.6s var(--ease) both;
}
.hero-title .line:nth-child(1) > span {
  animation-delay: calc(var(--intro) + 0.1s);
}
.hero-title .line:nth-child(2) > span {
  animation-delay: calc(var(--intro) + 0.24s);
}
@keyframes rise {
  to {
    transform: none;
  }
}
@keyframes fade {
  to {
    opacity: 1;
  }
}
.hero-foot {
  display: grid;
  gap: 32px;
  max-width: 400px;
  opacity: 0;
  transform: translateY(20px);
  animation: fade-up 1.6s var(--ease) calc(var(--intro) + 0.55s) forwards;
}
@keyframes fade-up {
  to {
    opacity: 1;
    transform: none;
  }
}
.hero-sub {
  font-size: 15px;
  color: var(--ivory-dim);
}

.hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-block: 28px;
  border-top: 1px solid var(--line);
  opacity: 0;
  animation: fade 1.6s var(--ease) calc(var(--intro) + 0.9s) forwards;
}
.hero-bar-wrap {
  position: absolute;
  inset: auto 0 0 0;
}
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}
.scroll-cue i {
  position: relative;
  display: block;
  width: 1px;
  height: 38px;
  background: var(--line-strong);
  overflow: hidden;
}
.scroll-cue i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ivory);
  transform: translateY(-100%);
  animation: cue 2.4s var(--ease-io) infinite;
}
@keyframes cue {
  0% {
    transform: translateY(-100%);
  }
  55%,
  100% {
    transform: translateY(100%);
  }
}

/* ---------- 01 · Sobre ---------- */

.statement {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(30px, 4.1vw, 68px);
  line-height: 1.16;
  letter-spacing: -0.015em;
  max-width: 22em;
}
.principles {
  list-style: none;
  margin: clamp(64px, 9vw, 140px) 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 840px) {
  .principles {
    grid-template-columns: repeat(3, 1fr);
  }
  .principles li + li {
    border-left: 1px solid var(--line);
  }
}
.principles li {
  padding: clamp(28px, 3vw, 48px) clamp(0px, 2.4vw, 40px) clamp(28px, 3vw, 48px) 0;
}
@media (min-width: 840px) {
  .principles li + li {
    padding-left: clamp(24px, 3vw, 48px);
  }
}
@media (max-width: 839px) {
  .principles li + li {
    border-top: 1px solid var(--line);
  }
}
.principles h3 {
  margin: 18px 0 14px;
  font-style: italic;
  font-size: clamp(28px, 2.6vw, 38px);
}
.principles p {
  font-size: 15px;
  color: var(--ivory-dim);
  max-width: 34ch;
}

/* ---------- 02 · Projetos ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.4vw, 40px);
  row-gap: clamp(56px, 8vw, 130px);
}
.project {
  grid-column: 1 / -1;
  min-width: 0;
}
@media (min-width: 1000px) {
  .p-a {
    grid-column: 1 / span 8;
  }
  .p-b {
    grid-column: 9 / span 4;
    margin-top: clamp(120px, 16vw, 280px);
  }
  .p-c {
    grid-column: 1 / span 7;
    align-self: end;
  }
  .p-d {
    grid-column: 8 / span 5;
    align-self: end;
  }
}

.project-media {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
}
.project-media img {
  width: 100%;
  transition: transform 1.8s var(--ease);
}
.project-link {
  display: block;
  cursor: zoom-in;
}
.project-link:hover img,
.project-link:focus-visible img {
  transform: scale(1.04);
}
.project-link:focus-visible {
  outline-offset: 6px;
}

.project-cap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 18px;
  padding-top: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}
.project-cap .idx {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ivory-mute);
}
.project-cap h3 {
  font-style: italic;
  font-size: clamp(26px, 2.5vw, 38px);
  line-height: 1.1;
}
.project-cap .cat {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory-mute);
  text-align: right;
}

/* Teaser “Brevemente” */
.p-d .project-media {
  aspect-ratio: 4 / 5;
}
.p-d .project-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
}
.teaser-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(22px, 2.6vw, 40px);
  background: linear-gradient(to top, rgba(10, 10, 9, 0.85) 0%, rgba(10, 10, 9, 0.2) 55%, rgba(10, 10, 9, 0.1) 100%);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border: 1px solid rgba(244, 241, 234, 0.38);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ivory);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.2;
  }
}
.teaser-overlay h3 {
  font-style: italic;
  font-size: clamp(34px, 3.4vw, 54px);
  line-height: 1;
}

/* Imagens com proporção fixa quando em coluna */
.p-a .project-media img,
.p-b .project-media img,
.p-c .project-media img {
  aspect-ratio: auto;
}

/* ---------- 03 · Números ---------- */

.numbers {
  border-block: 1px solid var(--line);
}
.band {
  border-top: 1px solid var(--line);
}
.numbers-grid {
  display: grid;
  gap: clamp(56px, 8vw, 120px);
  align-items: center;
}
@media (min-width: 900px) {
  .numbers-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}
.numbers h2 {
  font-style: italic;
  font-size: clamp(38px, 5.2vw, 88px);
  line-height: 1.04;
  max-width: 11em;
  margin-bottom: clamp(48px, 6vw, 96px);
}
.stat {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) 1.2fr;
  align-items: baseline;
  gap: 24px;
  padding-block: 32px;
  border-top: 1px solid var(--line);
}
.stat .num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(64px, 8vw, 128px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
}
.stat h3 {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.stat p {
  font-size: 15px;
  color: var(--ivory-dim);
  max-width: 34ch;
}
.numbers-figure {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--ink-2);
}
.numbers-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 04 · Serviços ---------- */

.services {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.service {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: clamp(30px, 3.4vw, 54px) 0;
  border-bottom: 1px solid var(--line);
  transition:
    padding 0.8s var(--ease),
    background 0.6s ease;
}
@media (min-width: 840px) {
  .service {
    grid-template-columns: 90px 1.1fr 1fr;
    align-items: baseline;
    gap: 40px;
  }
}
.service .n {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ivory-mute);
}
.service h3 {
  font-style: italic;
  font-size: clamp(32px, 3.6vw, 58px);
  line-height: 1.05;
  transition:
    transform 0.8s var(--ease),
    color 0.5s ease;
}
.service p {
  font-size: 15px;
  color: var(--ivory-dim);
  max-width: 44ch;
}
@media (hover: hover) {
  .service:hover {
    padding-left: 18px;
    background: linear-gradient(to right, rgba(244, 241, 234, 0.035), transparent 70%);
  }
}

/* ---------- 05 · Método ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: step;
}
@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
    column-gap: clamp(20px, 2.4vw, 40px);
  }
}
.step {
  position: relative;
  padding-top: 34px;
  padding-bottom: 36px;
  border-top: 1px solid var(--line);
}
.step::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ivory);
}
.step .n {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ivory-mute);
}
.step h3 {
  margin: 20px 0 14px;
  font-style: italic;
  font-size: clamp(28px, 2.6vw, 38px);
  line-height: 1.08;
}
.step p {
  font-size: 15px;
  color: var(--ivory-dim);
  max-width: 30ch;
}
.method-head {
  display: grid;
  gap: 24px;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.method-head h2 {
  font-style: italic;
  font-size: clamp(38px, 5vw, 80px);
  line-height: 1.04;
  max-width: 12em;
}

/* ---------- 06 · Liderança ---------- */

.leader {
  display: grid;
  gap: clamp(40px, 6vw, 110px);
  align-items: center;
}
@media (min-width: 900px) {
  .leader {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
}
.leader-photo {
  margin: 0;
  width: min(100%, 580px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--ink-2);
}
.leader-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}
.leader blockquote {
  margin: 0 0 clamp(32px, 4vw, 56px);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(32px, 4.2vw, 72px);
  line-height: 1.14;
  letter-spacing: -0.015em;
  max-width: 17em;
}
.leader .name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.leader .role {
  margin-top: 4px;
}

/* ---------- 07 · Marcas ---------- */

.brands {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (min-width: 840px) {
  .brands {
    grid-template-columns: 1fr 1fr;
  }
}
.brand-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 64px;
  min-height: clamp(340px, 34vw, 480px);
  padding: clamp(28px, 4vw, 68px);
  background: var(--ink);
  transition: background 0.7s ease;
}
a.brand-card:hover,
a.brand-card:focus-visible {
  background: var(--ink-2);
}
.brand-card .logo-wrap {
  display: flex;
  align-items: center;
  min-height: 64px;
}
.brand-card .logo-wrap img {
  height: auto;
}
.brand-card .logo-pereiras {
  width: clamp(150px, 16vw, 220px);
}
.brand-card .logo-decor {
  width: clamp(200px, 22vw, 320px);
}
.brand-card p.desc {
  font-size: 15px;
  color: var(--ivory-dim);
  max-width: 36ch;
  margin-bottom: 28px;
}
.brand-card .here {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ivory-mute);
}
.brand-card .here::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ivory-mute);
}

/* ---------- 08 · Contactos ---------- */

.contact-grid {
  display: grid;
  gap: clamp(56px, 7vw, 120px);
}
@media (min-width: 960px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.contact h2 {
  font-style: italic;
  font-size: clamp(46px, 7.6vw, 136px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin-bottom: clamp(36px, 5vw, 72px);
}
.contact-list {
  display: grid;
  gap: 28px;
}
.contact-item .label {
  display: block;
  margin-bottom: 8px;
}
.contact-item a,
.contact-item span.v {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.2;
  border-bottom: 1px solid transparent;
  transition: border-color 0.5s ease;
}
.contact-item a:hover {
  border-color: var(--ivory);
}

.form {
  display: grid;
  gap: 30px;
  align-content: start;
}
.form-row {
  display: grid;
  gap: 30px;
}
@media (min-width: 640px) {
  .form-row.two {
    grid-template-columns: 1fr 1fr;
  }
}
.field label {
  display: block;
  margin-bottom: 4px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 0 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  outline: none;
  transition: border-color 0.5s ease;
  appearance: none;
  -webkit-appearance: none;
}
.field select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ivory-mute) 50%),
    linear-gradient(135deg, var(--ivory-mute) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 8px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.field select option {
  background: var(--ink);
  color: var(--ivory);
}
.field textarea {
  resize: vertical;
  min-height: 110px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-bottom-color: var(--ivory);
}
.field ::placeholder {
  color: rgba(244, 241, 234, 0.3);
}
.form .btn {
  justify-self: start;
  margin-top: 8px;
}
.form-note {
  min-height: 22px;
  font-size: 13px;
  color: var(--ivory-mute);
}

/* ---------- Rodapé ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(48px, 6vw, 88px) 36px;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.footer-brands {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.footer-brands .sep {
  width: 1px;
  height: 26px;
  background: var(--line-strong);
}
.footer-brands a {
  display: inline-flex;
  opacity: 0.78;
  transition: opacity 0.4s ease;
}
.footer-brands a:hover,
.footer-brands a:focus-visible {
  opacity: 1;
}
.footer-brands .f-pereiras {
  height: 30px;
  width: auto;
}
.footer-brands .f-decor {
  height: 20px;
  width: auto;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
}
.footer-nav a {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ivory-mute);
  transition: color 0.4s ease;
}
.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--ivory);
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px 40px;
  margin-top: clamp(40px, 5vw, 72px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ivory-mute);
}
.footer-bottom a:hover {
  color: var(--ivory);
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(8, 8, 7, 0.97);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.6s var(--ease),
    visibility 0s linear 0.6s;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.6s var(--ease),
    visibility 0s;
}
.lb-top,
.lb-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter);
}
.lb-count {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ivory-mute);
}
.lb-btn {
  background: none;
  border: 0;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 12px 0;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.lb-btn:hover,
.lb-btn:focus-visible {
  opacity: 1;
}
.lb-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 var(--gutter);
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.45s ease;
}
.lb-stage img.is-swap {
  opacity: 0;
}
.lb-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.1;
}
.lb-nav {
  display: flex;
  gap: 32px;
}

/* ---------- Movimento reduzido ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .loader {
    display: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .hero-eyebrow,
  .hero-foot,
  .hero-bar {
    opacity: 1;
    transform: none;
  }
  .hero-title .line > span {
    transform: none;
  }
}

/* ---------- Pequenos ajustes de ecrã ---------- */

@media (max-width: 639px) {
  .project-cap {
    grid-template-columns: auto 1fr;
  }
  .project-cap .cat {
    grid-column: 2;
    text-align: left;
  }
  .stat {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .btn {
    width: 100%;
  }
  .form .btn {
    justify-self: stretch;
  }
}


/* ==========================================================================
   v3 — idiomas, formulário, cookies, páginas legais, 404
   ========================================================================== */

/* ---------- Seletor de idioma ---------- */
.lang {
  display: none;
  align-items: center;
  gap: 4px;
}
@media (min-width: 900px) {
  .lang {
    display: flex;
  }
}
.lang a {
  padding: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ivory-mute);
  transition: color 0.4s ease;
}
.lang a:hover,
.lang a:focus-visible,
.lang a.is-current {
  color: var(--ivory);
}
.lang a.is-current {
  text-decoration: underline;
  text-underline-offset: 7px;
  text-decoration-thickness: 1px;
}
.menu-lang {
  display: flex;
  gap: 6px;
  margin-top: 36px;
}
.menu .menu-lang a {
  display: block;
  padding: 12px 18px 12px 0;
  border: 0;
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.24em;
  color: var(--ivory-mute);
}
.menu .menu-lang a.is-current {
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 8px;
}

/* ---------- Formulário: armadilha anti-spam e consentimento ---------- */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.field.check {
  margin-top: 2px;
}
.field.check .check-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ivory-dim);
  letter-spacing: 0;
  text-transform: none;
}
.field.check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.field.check .box {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border: 1px solid var(--line-strong);
  transition:
    background 0.4s ease,
    border-color 0.4s ease;
}
.field.check input:checked + .box {
  background: var(--ivory);
  border-color: var(--ivory);
}
.field.check input:checked + .box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid var(--ink);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.field.check input:focus-visible + .box {
  outline: 1px solid var(--ivory);
  outline-offset: 3px;
}
.check-text a {
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ---------- Rodapé: ligações legais ---------- */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}
.linklike {
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.4s ease;
}
.linklike:hover,
.footer-legal a:hover {
  color: var(--ivory);
}

/* ---------- Aviso de cookies ---------- */
.cookie {
  position: fixed;
  z-index: 1550;
  left: var(--gutter);
  bottom: 24px;
  width: min(460px, calc(100vw - 24px));
  padding: 26px 28px;
  background: rgba(10, 10, 9, 0.96);
  border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}
.cookie.is-in {
  opacity: 1;
  transform: none;
}
.cookie p {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ivory-dim);
}
.cookie p a {
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-actions {
  display: flex;
  gap: 12px;
}
.cookie-actions button {
  flex: 1;
  padding: 15px 18px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ivory);
  font: 500 11px/1 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease;
}
.cookie-actions button:hover,
.cookie-actions button:focus-visible {
  background: var(--ivory);
  color: var(--ink);
  border-color: var(--ivory);
}
@media (max-width: 560px) {
  .cookie {
    left: 12px;
    bottom: 12px;
    padding: 22px;
  }
}

/* ---------- Política de privacidade ---------- */
.legal {
  max-width: 900px;
  padding-top: clamp(130px, 16vw, 200px);
  padding-bottom: clamp(80px, 10vw, 140px);
}
.legal-back {
  display: inline-block;
  margin-bottom: 40px;
  transition: color 0.4s ease;
}
.legal-back:hover {
  color: var(--ivory);
}
.legal h1 {
  margin-bottom: 20px;
  font-style: italic;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 1;
}
.legal-updated {
  margin-bottom: clamp(48px, 6vw, 88px);
}
.legal h2 {
  margin: 56px 0 16px;
  font-weight: 400;
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.2;
}
.legal p,
.legal li {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ivory-dim);
}
.legal p {
  margin: 0 0 16px;
}
.legal ul {
  margin: 0 0 16px;
  padding-left: 20px;
}
.legal li {
  margin-bottom: 12px;
}
.legal a {
  color: var(--ivory);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal .legal-back {
  text-decoration: none;
  color: var(--ivory-mute);
}
.legal strong {
  font-weight: 500;
  color: var(--ivory);
}
.table-wrap {
  margin: 20px 0 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
}
.legal table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13.5px;
}
.legal th,
.legal td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  color: var(--ivory-dim);
}
.legal th {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory-mute);
}
.legal tr:last-child td {
  border-bottom: 0;
}
.legal code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--ivory);
}

/* ---------- Página 404 ---------- */
.e404 {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 32px var(--gutter) 56px;
}
.e404-brand img {
  height: 30px;
  width: auto;
}
.e404-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1100px;
}
.e404-code {
  margin: 0 0 -0.12em;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(130px, 28vw, 440px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: rgba(244, 241, 234, 0.09);
}
.e404-h {
  margin-bottom: 20px;
  font-style: italic;
  font-size: clamp(38px, 5.6vw, 88px);
  line-height: 1.04;
}
.e404-p {
  max-width: 46ch;
  margin: 0 0 40px;
  color: var(--ivory-dim);
}

/* ---------- Aviso de cookies: barra fina no fundo (não tapa o conteúdo) ---------- */
.cookie {
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  padding: 18px var(--gutter);
  border-width: 1px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.cookie p {
  margin: 0;
  max-width: 84ch;
}
.cookie-actions {
  flex: none;
}
.cookie-actions button {
  flex: none;
  width: 150px;
  padding: 14px 10px;
}
@media (max-width: 760px) {
  .cookie {
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .cookie-actions button {
    flex: 1;
    width: auto;
  }
}
