/* Alicerce — Construção Civil */

:root {
  --tijolo: #b4472a;
  --tijolo-escuro: #8f3519;
  --tijolo-claro: #f6e4dc;
  --betao: #2e3236;
  --betao-escuro: #212427;
  --betao-claro: #eceeef;
  --papel: #ffffff;
  --texto: #23272b;
  --texto-suave: #5b6168;
  --linha: #d5d9dc;
  --erro: #b3261e;

  --titulo: "Barlow Condensed", "Arial Narrow", sans-serif;
  --corpo: Barlow, "Helvetica Neue", Arial, sans-serif;

  --largura: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --secao: clamp(72px, 9vw, 128px);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--texto);
  font-family: var(--corpo);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  margin: 0;
  font-family: var(--titulo);
  font-weight: 800;
  line-height: 1;
  color: var(--betao-escuro);
}
h2 { font-size: clamp(2.4rem, 4.6vw, 3.8rem); }
h3 { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }

p { margin: 0 0 1em; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--tijolo); outline-offset: 3px; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; color: var(--tijolo); }

.saltar {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--tijolo);
  color: #fff;
}
.saltar:focus { top: 12px; }

.contentor {
  width: 100%;
  max-width: calc(var(--largura) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Botões */

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 2px solid var(--tijolo);
  border-radius: 0;
  background: var(--tijolo);
  color: #fff;
  font-family: var(--titulo);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.botao:hover { background: var(--tijolo-escuro); border-color: var(--tijolo-escuro); }
.botao-linha { background: transparent; color: var(--betao-escuro); border-color: var(--betao-escuro); }
.botao-linha:hover { background: var(--betao-escuro); border-color: var(--betao-escuro); color: #fff; }

/* Topo */

.topo {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.topo-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: calc(var(--largura) + var(--gutter) * 2);
  height: 84px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  transition: height 0.3s ease;
}
.topo.com-fundo {
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 1px 0 var(--linha);
}
.topo.com-fundo .topo-inner { height: 68px; }

.marca {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--betao-escuro);
  text-decoration: none;
}
.marca-simbolo { width: 40px; height: 32px; flex: none; }
.marca-simbolo rect { fill: var(--tijolo); }
.marca-simbolo .base { fill: var(--betao-escuro); }
.marca-texto { display: flex; flex-direction: column; line-height: 1; }
.marca-nome { font-family: var(--titulo); font-size: 1.75rem; font-weight: 800; letter-spacing: 0.01em; }
.marca-sub { margin-top: 3px; font-size: 0.78rem; font-weight: 500; color: var(--texto-suave); }

.menu ul {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu a:not(.botao) {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.98rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.menu a:not(.botao):hover { background: var(--tijolo); color: #fff; }
.menu a.ativo { background: var(--tijolo-claro); color: var(--tijolo-escuro); }
.menu a.ativo:hover { background: var(--tijolo); color: #fff; }
.menu .menu-tel { margin-left: 8px; font-family: var(--titulo); font-size: 1.2rem; font-weight: 700; color: var(--tijolo-escuro); }
.botao-menu { min-height: 44px; margin-left: 8px; padding: 0 20px; font-size: 1.05rem; border-radius: 8px; }

.menu-botao {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 2px solid var(--betao-escuro);
  background: transparent;
  cursor: pointer;
}
.menu-botao span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: var(--betao-escuro);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.menu-botao[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-botao[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-botao[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */

.hero { padding: 150px 0 0; overflow: hidden; }
.hero-grelha {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(48px, 7vw, 120px);
  align-items: center;
}
.hero-local {
  display: inline-block;
  margin-bottom: 24px;
  padding: 6px 12px;
  background: var(--tijolo-claro);
  color: var(--tijolo-escuro);
  font-weight: 600;
  font-size: 0.95rem;
}
.hero h1 {
  max-width: 11ch;
  font-size: clamp(3.2rem, 7vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
}
.hero-lede {
  max-width: 33em;
  margin: 28px 0 36px;
  color: var(--texto-suave);
  font-size: 1.12rem;
}
.hero-acoes { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-figura {
  position: relative;
  margin: 40px 44px 56px 0;
}
.hero-figura img {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.hero-bloco {
  position: absolute;
  z-index: 1;
  top: -26px;
  left: -26px;
  width: 52%;
  height: 42%;
  background: var(--tijolo);
}
.hero-circulo {
  position: absolute;
  z-index: 0;
  left: -110px;
  bottom: 10%;
  width: 210px;
  height: 210px;
}

/* Cotas: linhas de medida como num desenho de obra */
.cota {
  position: absolute;
  z-index: 3;
  color: var(--betao);
  font-family: var(--titulo);
  font-size: 0.95rem;
  font-weight: 600;
}
.cota::before { content: ""; position: absolute; background: currentColor; }
.cota span { position: absolute; padding: 0 6px; background: var(--papel); white-space: nowrap; }
.cota-h {
  left: 0;
  right: 0;
  bottom: -34px;
  height: 14px;
  border-left: 1.5px solid;
  border-right: 1.5px solid;
  transform-origin: left center;
  animation: cota-x 0.9s cubic-bezier(0.3, 0, 0.2, 1) 0.3s both;
}
.cota-h::before { left: 0; right: 0; top: 50%; height: 1.5px; }
.cota-h span { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.cota-v {
  top: 0;
  bottom: 0;
  right: -34px;
  width: 14px;
  border-top: 1.5px solid;
  border-bottom: 1.5px solid;
  transform-origin: center top;
  animation: cota-y 0.9s cubic-bezier(0.3, 0, 0.2, 1) 0.6s both;
}
.cota-v::before { top: 0; bottom: 0; left: 50%; width: 1.5px; }
.cota-v span { top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-90deg); }
.cota span { animation: aparecer 0.4s ease 1.3s both; }
@keyframes cota-x { from { transform: scaleX(0); } }
@keyframes cota-y { from { transform: scaleY(0); } }
@keyframes aparecer { from { opacity: 0; } }

/* Faixa de garantias */
.faixa {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(56px, 7vw, 96px);
  margin-bottom: 0;
  list-style: none;
}
.faixa li {
  padding: 26px 24px 28px 0;
  border-top: 3px solid var(--betao-escuro);
  color: var(--texto-suave);
  font-size: 0.95rem;
  line-height: 1.4;
}
.faixa li + li { padding-left: 24px; border-left: 1px solid var(--linha); }
.faixa strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--titulo);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--betao-escuro);
}

/* Cabeçalhos de secção */

.cabecalho {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 64px;
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.cabecalho p { max-width: 34em; margin: 0; color: var(--texto-suave); }

/* Serviços: legenda de materiais */

.servicos { padding: var(--secao) 0; }
.legenda {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.material {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 30px 28px 32px;
  border: 1px solid var(--linha);
  border-radius: 20px;
  background: linear-gradient(160deg, #fff 0%, #f7f8f9 100%);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
/* Faixa tijolo que cresce na base do cartão */
.material::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--tijolo);
  transform: scaleX(0.18);
  transform-origin: left center;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.material:hover {
  transform: translateY(-6px);
  border-color: rgba(180, 71, 42, 0.35);
  box-shadow: 0 22px 44px -22px rgba(143, 53, 25, 0.38), 0 2px 6px rgba(33, 36, 39, 0.06);
}
.material:hover::after { transform: scaleX(1); }

/* Ícone: trama do material dentro de um mosaico arredondado, com o desenho por cima */
.icone {
  position: relative;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--tijolo-claro);
  overflow: hidden;
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.icone-trama {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
  transition: opacity 0.3s ease;
}
.icone-linha {
  position: relative;
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--tijolo-escuro);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}
.material:hover .icone { background: var(--tijolo); transform: rotate(-4deg); }
.material:hover .icone-trama { opacity: 0; }
.material:hover .icone-linha { stroke: #fff; }

.material h3 { margin-bottom: 10px; font-size: 1.6rem; }
.material p { margin: 0; color: var(--texto-suave); font-size: 0.98rem; }

/* Obras */

.obras { padding: var(--secao) 0; background: var(--betao-claro); }
.grelha-obras {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28px;
}
.obra {
  display: flex;
  flex-direction: column;
  grid-column: span 4;
  margin: 0;
  background: var(--papel);
}
.obra img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.obra-grande { grid-column: span 8; }
.obra-alta { grid-column: span 4; }
.obra-alta img { flex: 1; min-height: 0; height: 0; aspect-ratio: auto; }
.obra figcaption { padding: 14px; }

/* Legenda da obra em forma de carimbo de desenho técnico */
.carimbo {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.3;
}
.carimbo caption {
  padding: 10px 12px;
  border: 1.5px solid var(--betao);
  border-bottom: 0;
  font-family: var(--titulo);
  font-size: 1.3rem;
  font-weight: 700;
  text-align: left;
  color: var(--betao-escuro);
}
.carimbo th,
.carimbo td {
  padding: 7px 12px;
  border: 1.5px solid var(--betao);
  text-align: left;
  vertical-align: top;
}
.carimbo th { width: 1%; white-space: nowrap; font-weight: 500; color: var(--texto-suave); background: var(--betao-claro); }
.carimbo td { font-weight: 600; }

/* Processo: régua */

.processo { padding: var(--secao) 0; background: var(--betao); color: #fff; }
.processo h2 { color: #fff; margin-bottom: clamp(48px, 6vw, 72px); }
.regua {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}
.regua li {
  position: relative;
  padding: 76px 28px 0 0;
  counter-increment: passo;
}
/* traço da régua com marcas de 1 em 1 e de 5 em 5 */
.regua li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  border-top: 2px solid rgba(255, 255, 255, 0.85);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 2px, transparent 2px 60px) top left / 100% 18px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.45) 0 1px, transparent 1px 12px) top left / 100% 9px no-repeat;
}
.regua li::after {
  content: counter(passo);
  position: absolute;
  top: 26px;
  left: 0;
  font-family: var(--titulo);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: #ef8a68;
}
.regua h3 { color: #fff; margin-bottom: 10px; }
.regua p { margin: 0; color: rgba(255, 255, 255, 0.78); }

/* Empresa */

.empresa { padding: var(--secao) 0; }
.empresa-grelha {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: center;
}
.empresa-foto { position: relative; margin: 0 0 26px 26px; }
.empresa-foto::before {
  content: "";
  position: absolute;
  inset: 26px 26px -26px -26px;
  background: var(--tijolo);
}
.empresa-foto img { position: relative; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.empresa-texto h2 { margin-bottom: 26px; }
.empresa-texto > p { max-width: 36em; color: var(--texto-suave); }
.testemunho {
  margin: 36px 0 0;
  padding: 4px 0 4px 24px;
  border-left: 4px solid var(--tijolo);
}
.testemunho p {
  margin-bottom: 12px;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--betao-escuro);
}
.testemunho footer { font-size: 0.92rem; color: var(--texto-suave); }

/* Orçamento */

.orcamento { position: relative; padding: var(--secao) 0; background: var(--betao-claro); overflow: hidden; }
.orcamento-grelha {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 48px clamp(40px, 6vw, 96px);
}
.orcamento-info h2 { margin-bottom: 18px; }
.orcamento-info > p { color: var(--texto-suave); max-width: 24em; }
.contactos { margin: 36px 0 0; }
.contactos div { padding: 14px 0; border-top: 1px solid var(--linha); }
.contactos dt { font-size: 0.85rem; color: var(--texto-suave); }
.contactos dd { margin: 2px 0 0; font-weight: 600; }
.contactos a { text-decoration-color: var(--tijolo); text-underline-offset: 4px; }

.formulario {
  padding: clamp(24px, 4vw, 44px);
  background: var(--papel);
  border-top: 6px solid var(--tijolo);
}
.campos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
.campo { margin-bottom: 20px; }
.campo-largo { grid-column: 1 / -1; }
.formulario label { display: block; margin-bottom: 6px; font-size: 0.92rem; font-weight: 600; }
.opcional { font-weight: 400; color: var(--texto-suave); }
.formulario input,
.formulario select,
.formulario textarea {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  border: 1.5px solid #b9bfc4;
  border-radius: 0;
  background: #fff;
  color: var(--texto);
  font: inherit;
  font-size: 1rem;
}
.formulario textarea { resize: vertical; min-height: 120px; }
.formulario ::placeholder { color: #8a9096; }
.formulario input:focus,
.formulario select:focus,
.formulario textarea:focus {
  outline: none;
  border-color: var(--tijolo);
  box-shadow: 0 0 0 3px rgba(180, 71, 42, 0.25);
}
.formulario [aria-invalid="true"] { border-color: var(--erro); }
.erro { margin: 6px 0 0; font-size: 0.86rem; color: var(--erro); }
.erro:empty { display: none; }
.formulario .botao { width: 100%; }
.enviado {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--tijolo-claro);
  border-left: 4px solid var(--tijolo);
  font-weight: 500;
}

/* Rodapé */

.rodape { padding: 56px 0 36px; background: var(--betao-escuro); color: rgba(255, 255, 255, 0.62); font-size: 0.9rem; }
.rodape-grelha { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 48px; }
.rodape-marca { margin-bottom: 10px; font-family: var(--titulo); font-size: 1.8rem; font-weight: 800; color: #fff; }
.rodape p { margin: 0; line-height: 1.6; }
.rodape-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 0; padding: 0; list-style: none; }
.rodape-links a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.rodape-links a:hover { color: #ef8a68; }
.rodape-nota { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.8rem; }

/* Ecrãs largos */

@media (min-width: 1700px) {
  :root { --largura: 1360px; }
  body { font-size: 18px; }
}

/* Tablet */

@media (max-width: 1080px) {
  .menu-botao { display: block; }
  .menu {
    position: fixed;
    inset: 0 0 auto;
    z-index: -1;
    padding: 100px var(--gutter) 32px;
    background: var(--papel);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
  }
  .menu.aberto { transform: none; visibility: visible; transition: transform 0.3s ease; }
  .menu ul { flex-direction: column; align-items: stretch; gap: 0; }
  .menu a:not(.botao) {
    display: flex;
    min-height: 54px;
    margin: 2px 0;
    padding: 0 14px;
    font-family: var(--titulo);
    font-size: 1.6rem;
    font-weight: 700;
  }
  .menu .menu-tel { margin-left: 0; }
  .menu .botao-menu { margin: 20px 0 0; width: 100%; min-height: 52px; }

  .legenda { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faixa { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .faixa li:nth-child(3) { padding-left: 0; border-left: 0; }
  .regua { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
  .obra-grande { grid-column: span 12; }
  .obra-alta, .obra { grid-column: span 6; }
  .obra-alta img { height: auto; flex: none; aspect-ratio: 4 / 3; }
  .cabecalho, .empresa-grelha, .orcamento-grelha { grid-template-columns: 1fr; }
  .empresa-foto { max-width: 520px; }
}

/* Telemóvel */

@media (max-width: 700px) {
  body { font-size: 16px; }
  .hero { padding-top: 112px; }
  .hero-grelha { grid-template-columns: 1fr; gap: 24px; }
  .hero-figura { margin: 44px 34px 44px 18px; }
  .hero-figura img { aspect-ratio: 1 / 1; }
  .hero-circulo { display: none; }
  .hero-bloco { top: -18px; left: -18px; }
  .legenda { grid-template-columns: 1fr; }
  .material { padding: 24px 22px 26px; gap: 18px; }
  .icone { width: 60px; height: 60px; border-radius: 16px; }
  .faixa li, .faixa li + li { padding: 20px 12px 20px 0; border-left: 0; }
  .faixa strong { font-size: 1.45rem; }
  .obra, .obra-alta { grid-column: span 12; }
  .regua { grid-template-columns: 1fr; }
  .campos { grid-template-columns: 1fr; }
  .rodape-grelha { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
