/* =========================================================
   NIXHOME DESIGN — design system
   Direção: estúdio de design limpo e minimal. Fundo branco,
   cartões em cinza-creme claro, preto como único acento,
   tipografia bold contemporânea, muito espaço em branco.
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-alt: #f2f2f2;
  --bg-card: #ececec;
  --ink: #121212;
  --ink-dim: #5c5c5c;
  --ink-faint: #999999;
  --accent: #121212;
  --accent-ink: #ffffff;
  --line: rgba(17, 17, 17, 0.10);
  --line-strong: rgba(17, 17, 17, 0.20);

  --font-display: "Cabinet Grotesk", "Switzer", "Segoe UI", sans-serif;
  --font-body: "Switzer", "Segoe UI", sans-serif;

  --container: 1240px;
  --gap: clamp(1.25rem, 2vw, 2.5rem);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(17,17,17,0.04), 0 10px 24px -14px rgba(17,17,17,0.16);
  --shadow-md: 0 18px 40px -16px rgba(17,17,17,0.22);

  --header-bg: rgba(255, 255, 255, 0.86);
  /* os logos são brancos sobre transparente: no tema claro invertem-se para preto */
  --logo-filter: invert(1);
}

/* tema escuro — ativado pelo botão sol/lua do header (data-theme no <html>) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131313;
  --bg-alt: #1a1a1a;
  --bg-card: #212121;
  --ink: #f1f1f1;
  --ink-dim: #a9a9a9;
  --ink-faint: #737373;
  --accent: #f1f1f1;
  --accent-ink: #111111;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 10px 24px -14px rgba(0,0,0,0.6);
  --shadow-md: 0 18px 40px -16px rgba(0,0,0,0.7);
  --header-bg: rgba(19, 19, 19, 0.86);
  --logo-filter: none;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

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

/* ---------- helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.section { padding-block: clamp(4rem, 9vw, 8rem); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
/* para uma secção que arranca logo a seguir ao <main>, sem .page-hero antes,
   e por isso precisa de compensar o header fixo por cima (mesmo valor que
   .page-hero já usava, para ficar consistente) */
.section--header-clear { padding-top: clamp(8rem, 14vw, 11rem); }
.section--alt { background: var(--bg-alt); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.02;
}

h1 { font-size: clamp(3rem, 8.5vw, 6.6rem); font-weight: 800; letter-spacing: -0.02em; line-height: 0.98; }
h2 { font-size: clamp(1.9rem, 4.4vw, 3.2rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
h4 { font-size: 1.05rem; }

p.lede { font-size: clamp(1.05rem, 1.6vw, 1.35rem); color: var(--ink-dim); max-width: 46ch; }
.text-dim { color: var(--ink-dim); }
.text-faint { color: var(--ink-faint); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.95em 1.7em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s, background 0.3s, color 0.3s;
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.btn svg { width: 1.1em; height: 1.1em; transition: transform 0.3s; }
.btn:hover svg { transform: translate(3px, -3px); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.tag {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.4em 0.85em;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  background: var(--bg-card);
}

.cut-line {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- reveal-on-scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }
[data-reveal-delay="4"] { transition-delay: 0.32s; }

/* o conteúdo do hero só entra (fade+translateY) enquanto o loader preto sai,
   para a transição do preto para o branco ser um crossfade e não um corte seco */
.hero [data-reveal] { transition-delay: 2.1s; }
.hero [data-reveal-delay="1"] { transition-delay: 2.25s; }

/* =========================================================
   LOADER — ecrã preto de entrada (inspirado em hellomonday.com)
   ========================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #121212;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: loader-lifecycle 3.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.loader::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../assets/img/loader-bg.jpg') center / cover no-repeat;
  opacity: 0;
  animation: loader-mark-in 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.35s;
}
.loader-mark {
  position: relative;
  width: min(90%, 620px);
  height: auto;
  opacity: 0;
  transform: translateY(14px);
  animation: loader-mark-in 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.35s;
}
@keyframes loader-mark-in {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes loader-lifecycle {
  0%    { opacity: 0; }
  11.4% { opacity: 1; }
  60%   { opacity: 1; }
  100%  { opacity: 0; }
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.0);
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, padding 0.4s ease;
}
.site-header.is-scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  padding-block: 0.8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  z-index: 10;
}
/* o ficheiro enviado é branco sobre transparente (pensado para fundo escuro) — inverte-se para preto no fundo branco atual */
/* max-width/flex-shrink: sem isto o "max-width: 100%" global aperta a largura
   (a .brand só mede o que o próprio logo mede) e o logo fica esticado na vertical */
.brand-logo { height: 80px; width: auto; max-width: none; flex-shrink: 0; filter: var(--logo-filter); margin-left: -0.75rem; }
.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  mix-blend-mode: difference;
}
/* com o fundo do header transparente, a marca fica sobre o hero; "difference"
   com texto branco queima-se sozinho contra o que está por baixo (ver o véu
   escuro em .hero::before, que garante que há sempre contraste suficiente) */
.site-header.is-scrolled .brand-text { color: var(--ink); mix-blend-mode: normal; }
/* nas páginas sem .hero (tudo menos a home) o fundo por baixo do header é
   sempre claro, sem véu escuro — aí o texto fica sempre sólido e escuro,
   sem depender do "difference" (que é inconsistente em position:fixed
   nalguns browsers e podia deixar o texto ilegível sobre fundo claro) */
body:not(:has(.hero)) .brand-text { color: var(--ink); mix-blend-mode: normal; }
.brand span.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.95rem;
}

.main-nav ul { display: flex; align-items: center; gap: clamp(1.25rem, 2.2vw, 2.5rem); }
.main-nav a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  color: #fff;
  mix-blend-mode: difference;
  position: relative;
  padding-bottom: 4px;
}
.main-nav a::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; background: #fff;
  mix-blend-mode: difference;
  transition: right 0.3s ease;
}
.main-nav a:hover::after, .main-nav a.is-active::after { right: 0; }
/* enquanto o header está transparente sobre o hero, a cor fica a cargo do
   "difference" (queima/inverte-se contra o que está por baixo); só se fixa a
   cor normal depois de haver fundo sólido atrás (header scrolled, ou o
   overlay opaco do menu mobile) */
.site-header.is-scrolled .main-nav a {
  color: var(--ink-dim);
  mix-blend-mode: normal;
}
.site-header.is-scrolled .main-nav a:hover,
.site-header.is-scrolled .main-nav a.is-active { color: var(--ink); }
.site-header.is-scrolled .main-nav a::after { background: var(--ink); mix-blend-mode: normal; }
body:not(:has(.hero)) .main-nav a { color: var(--ink-dim); mix-blend-mode: normal; }
body:not(:has(.hero)) .main-nav a:hover,
body:not(:has(.hero)) .main-nav a.is-active { color: var(--ink); }
body:not(:has(.hero)) .main-nav a::after { background: var(--ink); mix-blend-mode: normal; }

.main-nav { margin-left: auto; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: clamp(1rem, 2.2vw, 2.5rem);
  position: relative;
  z-index: 600;
}
.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  color: #fff;
  mix-blend-mode: difference;
  transition: background 0.3s ease, transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.theme-toggle:hover { transform: rotate(-18deg); }
.theme-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
/* mesma lógica das ligações do menu: "difference" por cima do hero, cor sólida no resto */
.site-header.is-scrolled .theme-toggle,
body:not(:has(.hero)) .theme-toggle { color: var(--ink); mix-blend-mode: normal; }
.site-header.is-scrolled .theme-toggle:hover,
body:not(:has(.hero)) .theme-toggle:hover { background: var(--line); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 30px;
  z-index: 600;
  position: relative;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); transition: transform 0.3s ease, opacity 0.3s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .main-nav ul { flex-direction: column; gap: 2rem; text-align: center; }
  .main-nav a { font-size: 1.4rem; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 7rem;
  overflow: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 55% 45% at 85% 10%, var(--bg-alt), transparent 65%);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  /* véu escuro só na faixa do header: garante que o "mix-blend-mode: difference"
     do menu tem sempre contraste para queimar contra, mesmo nas zonas de
     meio-tom da imagem onde preto-sobre-preto/branco-sobre-branco falhava */
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 170px),
    url('../assets/img/hero-bg.jpg') center / cover no-repeat;
}

.smile-doodle {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(0.25rem, 1.5vw, 1rem);
  width: 42px;
  z-index: 400;
  pointer-events: auto;
  cursor: default;
}
.smile-doodle svg {
  width: 100%;
  height: auto;
  overflow: visible;
  transform: scale(1);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.smile-doodle:hover svg { transform: scale(1.14); }

.smile-eye {
  fill: var(--ink);
  transform-box: fill-box;
  animation: smile-eye-wipe 2.8s infinite;
}
/* olho direito arranca um instante depois do esquerdo — a leve
   assincronia é o que faz o traço parecer desenhado à mão, não gerado */
.smile-eye:nth-of-type(2) { animation-delay: 70ms; }

.smile-mouth {
  fill: none;
  stroke: var(--ink);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 105;
  animation: smile-draw 2.8s infinite;
}

@keyframes smile-eye-wipe {
  0%        { clip-path: inset(0 -30% 100% -30%); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
  14%       { clip-path: inset(0 -30% 0% -30%); animation-timing-function: linear; }
  82%       { clip-path: inset(0 -30% 0% -30%); animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  92%,100%  { clip-path: inset(0 -30% 100% -30%); }
}
@keyframes smile-draw {
  0%        { stroke-dashoffset: 105; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  38%       { stroke-dashoffset: 0; animation-timing-function: linear; }
  58%       { stroke-dashoffset: 0; animation-timing-function: cubic-bezier(0.55, 0, 1, 0.45); }
  100%      { stroke-dashoffset: -105; }
}

@media (prefers-reduced-motion: reduce) {
  .smile-eye, .smile-mouth { animation: none; }
  .smile-eye { clip-path: none; }
  .smile-mouth { stroke-dashoffset: 0; }
}

:root[data-theme="dark"] .hero::before {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 170px),
    url('../assets/img/hero-bg-dark.jpg') center / cover no-repeat;
}

.hero .container { position: relative; padding-bottom: clamp(3rem, 6vw, 5rem); text-align: center; }

.hero-kicker {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin-bottom: 1.4rem;
}

.hero h1 { max-width: 15ch; margin-inline: auto; }
.hero h1 .accent { color: var(--ink-faint); }
.hero-title { max-width: none; }
.hero-title-logo { display: block; width: min(90%, 620px); height: auto; filter: var(--logo-filter); margin-inline: auto; }
/* linha de texto por baixo do logo: dá ao Google (e a quem lê) o que o
   site é e onde, sem mexer no logo */
.hero-tagline {
  display: block;
  margin-top: 1.1rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--ink-dim);
}

.hero-foot {
  margin-top: clamp(2rem, 4vw, 3.2rem);
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
}

.hero-stats { display: flex; gap: clamp(1.5rem, 3vw, 3rem); }
.hero-stats div strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}
.hero-stats div span { font-family: var(--font-body); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }

/* =========================================================
   MARQUEE
   ========================================================= */
.marquee {
  border-block: 1px solid var(--line);
  background: var(--bg-alt);
  overflow: hidden;
  white-space: nowrap;
  padding-block: 1.1rem;
}
.marquee__track { display: inline-flex; animation: marquee 32s linear infinite; }
.marquee__track span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  color: var(--ink-faint);
  padding-inline: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 1.2rem;
  opacity: 0.45;
  transition: opacity 0.3s ease;
}
.marquee__track span:hover { opacity: 1; }
.marquee__track span::after { content: "\00B7"; color: var(--ink-faint); font-size: 1.4em; line-height: 0; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =========================================================
   CARDS / SERVICES
   ========================================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
/* 5 cartões: 5 colunas no desktop, 3+2 no tablet (em 2 colunas sobrava um sozinho) */
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 980px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .grid-5 { grid-template-columns: 1fr; } }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.2rem, 4vw, 3.6rem);
}

.card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.card .num {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}
.card .icon {
  width: 42px; height: 42px;
  margin-block: 1.1rem;
  color: var(--ink);
}
.card .icon svg { width: 100%; height: 100%; }
.card h3 { margin-bottom: 0.6rem; }
.card p { color: var(--ink-dim); font-size: 0.95rem; }

/* cartões de "O que faço" — cada um fica pronto para receber uma foto (ex:
   o pai a trabalhar nesse serviço). Sem imagem ficam como estão hoje; assim
   que existir um ficheiro assets/img/servico-<slug>.jpg, o main.js aplica-o
   e o cartão passa a full-photo com o ícone/título em branco por cima */
/* secção "O que faço": container mais largo e gap mais apertado do que o
   resto do site, só para dar mais espaço a cada cartão (mantendo os 4 na
   mesma linha) sem alargar tudo o resto */
#servicos .container { max-width: 1440px; }
#servicos .grid-4 { gap: clamp(1rem, 1.8vw, 1.75rem); }

.service-card {
  overflow: hidden;
  background-size: cover;
  background-position: center;
  aspect-ratio: 1080 / 1350;
}
#servicos .service-card { padding: 2.4rem; }
#servicos .service-card .icon { width: 52px; height: 52px; margin-block: 1.3rem; }
#servicos .service-card h3 { font-size: clamp(1.3rem, 1.8vw, 1.7rem); }
/* com 5 colunas os cartões ficam mais estreitos: menos padding e título mais pequeno */
#servicos .grid-5 .service-card { padding: clamp(1.4rem, 2vw, 2rem); }
#servicos .grid-5 .service-card h3 { font-size: clamp(1.15rem, 1.5vw, 1.45rem); }

/* "Tudo o que faço": lista completa dos serviços, por categoria */
.services-list {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem var(--gap);
}
.services-list > [id] { scroll-margin-top: 9rem; }
.services-list-head { grid-column: 1 / -1; display: grid; gap: 0.6rem; max-width: 62ch; }
.services-list-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.services-list-head p { color: var(--ink-dim); }
.services-list h3 { font-size: 1rem; margin-bottom: 0.8rem; }
.services-list ul { display: grid; gap: 0.35rem; }
.services-list li { font-size: 0.9rem; color: var(--ink-dim); line-height: 1.4; }
@media (max-width: 980px) { .services-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .services-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .services-list { grid-template-columns: 1fr; } }
.service-card.has-photo {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.service-card.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 42%, rgba(0,0,0,0.66) 100%);
  transition: background 0.35s ease;
}
.service-card.has-photo .icon,
.service-card.has-photo h3 { position: relative; z-index: 2; }
.service-card.has-photo .icon { color: #fff; margin-block: 0 0.6rem; }
.service-card.has-photo h3 { color: #fff; margin-bottom: 0; }

/* variante com mockup de produto (fundo branco, foto sem cortar) — igual ao
   tratamento do cartão "Chapéus" no portfolio, para quando o serviço já tem
   uma foto de produto própria em vez de foto do pai a trabalhar */
.service-card.has-mockup {
  background: #ffffff;
  display: flex;
  flex-direction: column;
}
.service-card.has-mockup .mockup {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-block: 0.5rem;
}
.service-card.has-mockup .mockup img {
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.5s ease;
}
.service-card.has-mockup:hover .mockup img { transform: scale(1.03); }
.service-card.has-mockup h3 { margin-top: 1rem; }

/* =========================================================
   PORTFOLIO
   ========================================================= */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.filters button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6em 1.2em;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  transition: all 0.25s ease;
}
.filters button:hover { color: var(--ink); border-color: var(--ink); }
.filters button.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 980px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .work-grid { grid-template-columns: 1fr; } }

/* teaser da home: sempre os 4 cartões numa única linha, nunca a passar para
   a linha de baixo (grelha própria, não mexe no .work-grid do portfolio) */
.work-grid.work-grid--teaser { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .work-grid.work-grid--teaser { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .work-grid.work-grid--teaser { grid-template-columns: 1fr; } }

/* secção "Trabalhos" (teaser da home e página de portfolio): mesmo truque do
   #servicos — container mais largo e gap mais apertado só aqui, para os
   cartões ficarem maiores sem alterar o número de colunas */
#trabalhos .container { max-width: 1440px; }
#trabalhos .work-grid { gap: clamp(1rem, 1.8vw, 1.75rem); }
#trabalhos .work-item { padding: 1.7rem; }
#trabalhos .work-item .icon { width: 52px; height: 52px; }

.work-item {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.work-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.work-item .icon { width: 44px; height: 44px; color: var(--ink-faint); transition: color 0.3s ease; }
.work-item:hover .icon { color: var(--ink); }
.work-item .icon svg { width: 100%; height: 100%; }
.work-item .meta { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; margin-top: auto; width: 100%; text-align: center; }
.work-item .soon {
  position: absolute; top: 1.2rem; right: 1.2rem;
  font-family: var(--font-body); font-weight: 600; font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  background: var(--bg);
  border-radius: var(--radius-full);
  padding: 0.35em 0.7em;
}

/* cartões de portfolio com foto real (full-bleed, tipo fotografia de ambiente) */
.work-item-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform 0.5s ease;
}
.work-item:hover .work-item-photo { transform: scale(1.04); }
/* a carrinha da Andamento e o troféu CTTN ficam bem enquadrados tal como estão; sem zoom no hover */
.work-item:hover .work-item-photo[src*="portfolio-vinil-andamento"],
.work-item:hover .work-item-photo[src*="portfolio-madeira-trofeu-cttn"] { transform: none; }
/* foto do troféu CTTN: o objeto (raquete + jogador + disco) já tem bastante
   espaço vazio à volta dentro da própria fotografia quadrada, por isso
   nenhum recorte "cover" o deixa realmente centrado — mostra-se a foto
   inteira, sem cortar, como no mockup da Andamento */
.work-item-photo[src*="portfolio-madeira-trofeu-cttn"] { object-fit: contain; background: #fff; }
/* mockup da carrinha Andamento: cover cortava demasiado a carrinha; contain
   mostra a imagem inteira (mais "zoom out"), com fundo branco a preencher
   a margem porque o PNG já vem com fundo branco sólido, não transparente */
.work-item-photo[src*="portfolio-vinil-andamento"] { object-fit: contain; background: #fff; }
/* troféu da Brigada Mecanizada: foto quadrada já vem cortada rente ao objeto
   (quase sem margem própria), por isso qualquer "cover" corta para dentro do
   troféu — contain mostra-o inteiro, mais "zoom out" */
.work-item-photo[src*="portfolio-madeira-trofeu-brigada"] { object-fit: contain; background: #fff; }
.work-item:hover .work-item-photo[src*="portfolio-madeira-trofeu-brigada"] { transform: none; }
.work-item.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.6) 100%);
}
.work-item.has-photo .meta { position: relative; z-index: 2; }
.work-item.has-photo .meta h4 { color: #fff; }

/* variante sem camada escura, para fotos já claras (ex: fundo branco) */
.work-item.photo-light::after { content: none; }
.work-item.photo-light .meta h4,
.work-item.has-mockup .meta h4 { color: #121212; }

/* cartão com várias fotos em crossfade contínuo (mix). Cada foto entra e sai
   em fade (não só sai) — como a seguinte já está por cima na ordem do DOM,
   sem fade de entrada ela aparecia de repente a tapar a que ainda estava a
   desvanecer, e a transição parecia um corte em vez de um crossfade */
.work-item.photo-mix .work-item-photo { animation: photo-mix-slot 35s ease-in-out infinite; }
.work-item.photo-mix .work-item-photo.mix-1 { animation-delay: 0s; }
.work-item.photo-mix .work-item-photo.mix-2 { animation-delay: -3.5s; }
.work-item.photo-mix .work-item-photo.mix-3 { animation-delay: -7s; }
.work-item.photo-mix .work-item-photo.mix-4 { animation-delay: -10.5s; }
.work-item.photo-mix .work-item-photo.mix-5 { animation-delay: -14s; }
.work-item.photo-mix .work-item-photo.mix-6 { animation-delay: -17.5s; }
.work-item.photo-mix .work-item-photo.mix-7 { animation-delay: -21s; }
.work-item.photo-mix .work-item-photo.mix-8 { animation-delay: -24.5s; }
.work-item.photo-mix .work-item-photo.mix-9 { animation-delay: -28s; }
.work-item.photo-mix .work-item-photo.mix-10 { animation-delay: -31.5s; }
@keyframes photo-mix-slot {
  0%   { opacity: 0; }
  3%   { opacity: 1; }
  10%  { opacity: 1; }
  13%  { opacity: 0; }
  100% { opacity: 0; }
}

/* variante para cartões com só 2 fotos em crossfade (ex: viaturas) — mesmo
   padrão do cartão de Carpintaria, CNC e laser (fade-in + hold + fade-out),
   só reescalado para 2 fotos em vez de 5 */
.work-item.photo-mix-pair .work-item-photo { animation: photo-mix-pair-slot 8s ease-in-out infinite; }
.work-item.photo-mix-pair .work-item-photo.mix-1 { animation-delay: 0s; }
.work-item.photo-mix-pair .work-item-photo.mix-2 { animation-delay: -4s; }
@keyframes photo-mix-pair-slot {
  0%    { opacity: 0; }
  15%   { opacity: 1; }
  50%   { opacity: 1; }
  65%   { opacity: 0; }
  100%  { opacity: 0; }
}

/* variante para cartões com 3 fotos em crossfade (ex: viaturas com 3 wraps) */
.work-item.photo-mix-trio .work-item-photo { animation: photo-mix-trio-slot 12s ease-in-out infinite; }
.work-item.photo-mix-trio .work-item-photo.mix-1 { animation-delay: 0s; }
.work-item.photo-mix-trio .work-item-photo.mix-2 { animation-delay: -4s; }
.work-item.photo-mix-trio .work-item-photo.mix-3 { animation-delay: -8s; }
@keyframes photo-mix-trio-slot {
  0%      { opacity: 0; }
  10%     { opacity: 1; }
  33.3%   { opacity: 1; }
  43.3%   { opacity: 0; }
  100%    { opacity: 0; }
}

/* cartões de portfolio com mockup em fundo branco (sem cortar a imagem) */
.work-item.has-mockup { background: #ffffff; }
.work-item.has-mockup .mockup {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-block: 0.5rem;
}
.work-item.has-mockup .mockup img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.5s ease;
}
.work-item.has-mockup:hover .mockup img { transform: scale(1.03); }

/* variante do mockup com 3 fotos em crossfade (ex: cartão de Chapéus) — mesma
   ideia dos outros mosaicos, mas sem cortar (object-fit:contain herdado da
   regra ".mockup img" acima), porque são fotos de produto isoladas */
.work-item.has-mockup .mockup--mix { position: relative; }
.work-item.has-mockup .mockup .mockup-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 1.4rem;
  box-sizing: border-box;
  animation: photo-mix-trio-slot 12s ease-in-out infinite;
}
.work-item.has-mockup .mockup .mockup-photo.mix-1 { animation-delay: 0s; }
.work-item.has-mockup .mockup .mockup-photo.mix-2 { animation-delay: -4s; }
.work-item.has-mockup .mockup .mockup-photo.mix-3 { animation-delay: -8s; }

/* =========================================================
   ABOUT / SPLIT
   ========================================================= */
.split {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.portrait {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  box-shadow: var(--shadow-md);
}
.portrait .icon { width: 28%; color: var(--bg); }
.portrait .icon svg { width: 100%; height: 100%; }

.stat-row { display: flex; gap: clamp(1.5rem, 4vw, 3.5rem); flex-wrap: wrap; margin-top: 2rem; }
.stat-row div strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.8rem); }
.stat-row div span { font-family: var(--font-body); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-card {
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 3vw, 2.6rem);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.contact-link, .spec-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
}
.contact-link:first-of-type, .spec-row:first-of-type { border-top: none; }
.contact-link .icon, .spec-row .icon { width: 22px; height: 22px; color: var(--ink); flex-shrink: 0; }
.contact-link .icon svg, .spec-row .icon svg { width: 100%; height: 100%; }
.contact-link strong, .spec-row strong { display: block; font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; margin-bottom: 0.2rem; }
.contact-link:hover span.value { color: var(--ink-dim); }
.spec-row span.value { font-family: var(--font-body); color: var(--ink); }

.map-frame { position: relative; border-radius: var(--radius-lg); aspect-ratio: 4/3; overflow: hidden; box-shadow: var(--shadow-sm); filter: grayscale(0.15) contrast(1.02); }
.map-frame iframe { width: 100%; height: 100%; border: 0; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(1.5rem, 3vw, 2rem); }
.footer-seo {
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 95ch;
  margin: 0 0 1rem;
}
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-faint);
}
.footer-social { display: flex; gap: 1rem; }
.footer-social a { color: var(--ink-dim); }
.footer-social a:hover { color: var(--ink); }

.portfolio-title { display: block; margin-bottom: 1.4rem; line-height: 1.5; }

/* =========================================================
   PAGE HEADER (interior pages)
   ========================================================= */
.page-hero {
  padding-top: clamp(8rem, 14vw, 11rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  position: relative;
  background: radial-gradient(ellipse 50% 40% at 90% 0%, var(--bg-alt), transparent 60%), var(--bg);
}
.page-hero .crumbs { font-family: var(--font-body); font-weight: 600; font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 1rem; }
.page-hero .crumbs .accent { color: var(--ink); }

/* CTA band — bloco invertido a preto, eco do acento sólido do moodboard */
.cta-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 2rem;
  padding: clamp(2.5rem, 5vw, 4rem);
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: var(--bg);
}
.cta-band .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.cta-band .btn:hover { box-shadow: 0 18px 40px -16px rgba(0,0,0,0.5); }
