:root {
  --verde: #6c7624;          /* verde da marca, tirado do logótipo vetorial */
  --verde-escuro: #565e1c;
  --verde-tenue: #f4f5ec;
  --escuro: #23261a;
  --texto: #23261a;
  --suave: #6a6f5c;
  --linha: #e5e7d9;
  --largura: 1080px;
  /* recuo que alinha o conteúdo de uma faixa full-bleed com o resto da página */
  --recuo: max(24px, calc((100vw - var(--largura)) / 2 + 24px));
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--texto);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--verde); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }

main > section { padding-inline: 24px; }

main > section {
  max-width: var(--largura);
  margin: 0 auto;
  padding-block: 72px;
}

/* faixas que sangram até aos limites da janela */
.hero, .solucoes, .faixa { max-width: none; padding: 0; }

/* topo */

.topo__interior {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: padding .25s ease;
}

.topo__logo img { width: 148px; transition: width .25s ease; }

/* ao rolar, a barra encolhe para não roubar ecrã */
.topo--colado .topo__interior { padding-block: 7px; }
.topo--colado .topo__logo img { width: 120px; }

/* botões */

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.btn--primario { background: var(--verde); color: #fff; }

.btn--claro { background: #fff; color: var(--verde); }

.btn--contorno-claro { border-color: rgba(255, 255, 255, .6); color: #fff; }

.btn--tel { border-color: var(--linha); color: var(--verde); padding: 10px 18px; }

/* hero */

.hero {
  background: var(--verde);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.hero__texto { padding: 76px 48px 76px var(--recuo); }

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  letter-spacing: -.02em;
  line-height: 1.08;
  font-weight: 700;
}

/* cada linha é uma janela: o texto sobe de dentro dela */
.titulo__l { display: block; overflow: hidden; padding-bottom: .04em; }
.titulo__l > span { display: block; }
.titulo__leve { font-weight: 300; color: rgba(255, 255, 255, .9); }

.js .titulo__l > span {
  transform: translateY(110%);
  transition: transform .9s cubic-bezier(.2, .8, .2, 1);
}

.js h1.visivel .titulo__l > span { transform: none; }
.js h1.visivel .titulo__l:nth-child(2) > span { transition-delay: .12s; }

.hero__sub {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, .85);
  max-width: 46ch;
  margin-bottom: 32px;
}

.hero__acoes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
}

.hero__media {
  overflow: hidden;
  height: 100%;
  min-height: 440px;
}

/* a foto é maior do que o contentor para poder deslizar sem descobrir bordas */
.hero__foto {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14) translateY(var(--desloc, 0px));
  will-change: transform;
}

/* secções */

main > section > h2, .solucoes__cabecalho > h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 36px;
}

main > section > h2::after, .solucoes__cabecalho > h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--verde);
  margin-top: 14px;
}

.grelha {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.servicos li {
  background: var(--verde-tenue);
  border-radius: 8px;
  padding: 26px;
}

.servicos__icone {
  width: 30px;
  height: 30px;
  color: var(--verde);
  margin-bottom: 16px;
}

.servicos h3 { font-size: 1.05rem; color: var(--verde); }
.servicos p { margin: 0; color: var(--suave); }

/* acabamentos */

.solucoes { background: var(--verde-tenue); }

.solucoes__interior {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 72px 24px;
}

/* cabeçalho em duas colunas: título à esquerda, frase a acompanhar à direita */
.solucoes__cabecalho {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 64px;
  align-items: end;
  margin-bottom: 40px;
}

.solucoes__cabecalho > h2 { margin: 0; }

.solucoes__sub {
  color: var(--suave);
  max-width: 54ch;
  margin: 0 0 6px;
  font-size: 1.05rem;
}

/* mosaico: a foto vertical ocupa as duas linhas à esquerda */
/* vertical à esquerda a toda a altura, painel verde por cima das duas
   horizontais, que ficam lado a lado por baixo */
.mosaico {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 14px;
  height: 640px;
}

.mosaico__item--alto { grid-column: 1; grid-row: 1 / span 2; }

.mosaico__painel {
  grid-column: 2 / span 2;
  grid-row: 1;
  background: var(--verde);
  color: #fff;
  border-radius: 10px;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 32px;
}

.mosaico__painel-titulo {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
  max-width: 12ch;
  line-height: 1.25;
}

.mosaico__painel ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.mosaico__painel li {
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .92rem;
}

.mosaico__item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #ddded2;
}

.mosaico__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mosaico__item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 52px 22px 18px;
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .01em;
  background: linear-gradient(rgba(20, 22, 14, 0) 12%, rgba(20, 22, 14, .88));
}

/* faixa escura */

.faixa {
  background:
    linear-gradient(rgba(28, 30, 20, .68), rgba(28, 30, 20, .68)),
    url("img/portoes-industriais.jpg") center / cover no-repeat;
}

.faixa__conteudo {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
  color: #fff;
}

.faixa__logo { width: 230px; margin: 0 auto 24px; }

.faixa p {
  font-size: 1.15rem;
  max-width: 42ch;
  margin: 0 auto 28px;
}

/* contactos */

.contactos__grelha {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 48px;
  align-items: start;
}

/* o selo vive aqui, logo por cima do rodapé, onde se vê melhor */
.contactos__lre { display: block; justify-self: end; }
.contactos__lre img { width: 190px; transition: transform .2s ease; }

.contactos dl {
  margin: 0;
  display: grid;
  grid-template-columns: 130px auto;
  gap: 2px 16px;
  align-items: baseline;
}

.contactos dt {
  font-weight: 600;
  color: var(--suave);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.contactos dt + dd { grid-column: 2; }
.contactos dd { margin: 0; grid-column: 2; }
.contactos dt:not(:first-of-type) { margin-top: 14px; }

.contactos__nota {
  margin: 0;
  color: var(--suave);
  border-left: 3px solid var(--linha);
  padding-left: 20px;
  max-width: 34ch;
}

/* como trabalhamos */

.passos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
  counter-reset: passo;
}

.passos li { position: relative; }

/* uma barra única por cima dos quatro passos. O --progresso é escrito pelo JS
   a partir da posição de scroll, por isso ela enche e esvazia com a página. */
.passos__envolvente { position: relative; padding-top: 25px; }

.passos__trilho {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--linha);
  overflow: hidden;
}

.passos__barra {
  display: block;
  height: 100%;
  background: var(--verde-escuro);
  transform: scaleX(var(--progresso, 0));
  transform-origin: left;
}

.passos__n {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--verde);
  margin: 0 0 10px;
}

.passos h3 { font-size: 1.05rem; }
.passos p { margin: 0; color: var(--suave); }

/* rodapé */

.rodape {
  border-top: 1px solid var(--linha);
  color: var(--suave);
  font-size: .85rem;
}

.rodape__interior {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 22px 24px 26px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 32px;
  flex-wrap: wrap;
}

.rodape__interior p { margin: 0; }
.rodape__interior a { color: var(--verde); text-decoration: none; }



@media (max-width: 860px) {
  .solucoes__cabecalho { grid-template-columns: 1fr; gap: 14px; }

  .mosaico {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .mosaico__item { aspect-ratio: 4 / 3; }

  .mosaico__item--alto {
    grid-column: 1 / span 2;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }

  .mosaico__painel { grid-column: 1 / span 2; grid-row: auto; grid-template-columns: 1fr; }
  .mosaico__painel-titulo { max-width: none; }

  .hero { grid-template-columns: 1fr; }
  .hero__texto { padding: 56px 24px; order: 1; }
  .hero__media { min-height: 260px; max-height: 340px; }
  .contactos__grelha { grid-template-columns: 1fr; gap: 32px; }
  .contactos__lre { justify-self: start; }
}

@media (max-width: 620px) {
  .mosaico { grid-template-columns: 1fr; }
  .mosaico__item--alto { grid-column: 1; aspect-ratio: 3 / 4; }
  .mosaico__painel { grid-column: 1; }

  .hero__acoes { gap: 10px; }
  .hero__acoes .btn { flex: 1; text-align: center; padding: 13px 10px; }
  .btn__extra { display: none; }

  .passos { gap: 26px; }
  .passos__envolvente { padding: 0 0 0 22px; }

  .passos__trilho {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 3px;
    height: auto;
  }

  .passos__barra {
    width: 100%;
    transform: scaleY(var(--progresso, 0));
    transform-origin: top;
  }
}

@media (max-width: 420px) {
  .contactos dl { grid-template-columns: 1fr; }
  .contactos dt + dd, .contactos dd { grid-column: 1; }
}

/* ---------------------------------------------------------------
   Movimento. Tudo isto depende da classe .js no <html>, posta por
   um script inline no <head>: sem JS nada fica escondido.
   --------------------------------------------------------------- */

html { scroll-behavior: smooth; }

.topo {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  transition: box-shadow .25s ease;
}

.topo--colado { box-shadow: 0 1px 0 var(--linha), 0 6px 20px rgba(35, 38, 26, .06); }

.btn { transition: background-color .2s ease, border-color .2s ease, transform .2s ease; }
.btn:active { transform: translateY(1px); }

.servicos li {
  transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease;
}


.servicos__icone { transition: color .3s ease, transform .35s cubic-bezier(.2, .8, .3, 1); }

.servicos h3, .servicos p, .servicos strong { transition: color .3s ease; }

.mosaico__item img { transition: transform .7s cubic-bezier(.2, .7, .3, 1); }

.mosaico__item figcaption { transition: background .35s ease, padding-bottom .35s ease; }

.topo__logo img, .faixa__logo { transition: opacity .2s ease; }

/* estado inicial dos elementos que aparecem ao entrar no ecrã */
.js :where(.hero__texto > *,
           .hero__media,
           .servicos > h2,
           .servicos li,
           .solucoes__cabecalho > h2,
           .solucoes__sub,
           .mosaico__item,
           .processo > h2,
           .passos li,
           .faixa__conteudo > *,
           .contactos > h2,
           .contactos__grelha > *) {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .3, 1);
}

.js .visivel { opacity: 1; transform: none; }

/* escalonamento: os irmãos entram a seguir uns aos outros */
.js .hero__texto > *:nth-child(2) { transition-delay: .10s; }
.js .hero__texto > *:nth-child(3) { transition-delay: .20s; }
.js .hero__media { transition-delay: .15s; transition-duration: .9s; }
.js .servicos li:nth-child(2),
.js .mosaico__item:nth-child(2) { transition-delay: .09s; }
.js .servicos li:nth-child(3),
.js .mosaico__item:nth-child(3) { transition-delay: .18s; }
.js .servicos li:nth-child(4) { transition-delay: .27s; }
.js .faixa__conteudo > *:nth-child(2) { transition-delay: .12s; }
.js .faixa__conteudo > *:nth-child(3) { transition-delay: .24s; }

/* quem pediu menos movimento não leva nenhum */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js :where(.hero__texto > *,
             .hero__media,
             .servicos > h2,
             .servicos li,
             .solucoes__cabecalho > h2,
             .solucoes__sub,
             .mosaico__item,
             .processo > h2,
           .passos li,
           .faixa__conteudo > *,
             .contactos > h2,
             .contactos__grelha > *) {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:active { transform: none; }
  .hero__foto { transform: scale(1.14); }
  .js .titulo__l > span { transform: none; transition: none; }
  .passos__barra { transform: none; }
  .topo__interior, .topo__logo img { transition: none; }
}

/* paralaxe na faixa escura, só onde não faz mal: o iOS não suporta
   background-attachment fixed com cover e o resultado é um salto */
@media (min-width: 861px) and (pointer: fine) {
  .faixa { background-attachment: fixed; }
}

/* ---------------------------------------------------------------
   Hover só onde existe um rato. Num ecrã táctil o :hover fica
   colado depois do toque e o cartão ficava verde até se tocar
   noutro sítio.
   --------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .btn--primario:hover { background: var(--verde-escuro); }
  .btn--claro:hover { background: var(--verde-tenue); }
  .btn--contorno-claro:hover { border-color: #fff; background: rgba(255, 255, 255, .12); }
  .btn--tel:hover { border-color: var(--verde); }

  .topo__logo:hover img { opacity: .75; }
  .contactos__lre:hover img { transform: translateY(-2px); }
  .rodape__interior a:hover { text-decoration: underline; }

  .servicos li:hover {
    background: var(--verde);
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(35, 38, 26, .18);
  }

  .servicos li:hover h3,
  .servicos li:hover strong { color: #fff; }
  .servicos li:hover p { color: rgba(255, 255, 255, .88); }
  .servicos li:hover .servicos__icone { color: #fff; transform: scale(1.08) rotate(-3deg); }

  .mosaico__item:hover img { transform: scale(1.07); }
  .mosaico__item:hover figcaption {
    background: linear-gradient(rgba(20, 22, 14, 0) 12%, rgba(108, 118, 36, .92));
    padding-bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .servicos li:hover, .mosaico__item:hover img, .contactos__lre:hover img { transform: none; }
  .servicos li:hover .servicos__icone { transform: none; }
}
