:root {
  --ink: #0A0908; --slate: #22333B; --sand: #EAE0D5; --tan: #C6AC8F; --umber: #5E503F;
  --display: 'Unbounded', 'Arial Black', sans-serif;
  --text: 'Hanken Grotesk', system-ui, sans-serif;
  --pad: clamp(20px, 5vw, 80px);
  --hh: 76px;
  --ease: cubic-bezier(.7, 0, .2, 1);
  --z-nav: 50; --z-menu: 60; --z-wipe: 80; --z-cursor: 90;
  /* tema (escuro por omissão, claro nos contactos) */
  --bg: var(--ink); --fg: var(--sand); --muted: color-mix(in srgb, var(--sand) 68%, transparent);
  --line: color-mix(in srgb, var(--sand) 22%, transparent); --accent: var(--tan);
}
[data-theme="light"] {
  --bg: var(--sand); --fg: var(--ink); --muted: color-mix(in srgb, var(--ink) 70%, transparent);
  --line: color-mix(in srgb, var(--ink) 22%, transparent); --accent: var(--umber);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--fg); font: 300 1.0625rem/1.6 var(--text);
  overflow-x: hidden; transition: background .5s, color .5s; min-height: 100vh; display: flex; flex-direction: column;
}
body.no-scroll { overflow: hidden; }
/* textura só no fundo preto: grão da imagem por cima da cor, sem a mudar (desligada no tema claro) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("../Imagem_textura_fundo/textura.jpg") center / cover no-repeat;
  filter: grayscale(1) brightness(.6) contrast(5);
  mix-blend-mode: screen; opacity: .07; transition: opacity .5s;
}
body[data-theme="light"]::before { opacity: 0; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--tan); color: var(--ink); padding: 10px 16px; transition: top .2s; }
.skip:focus { top: 12px; }
h1:focus { outline: none; }

/* ---------- tipografia ---------- */
h1, h2, h3, .logo { font-family: var(--display); font-weight: 300; letter-spacing: -.02em; line-height: 1.08; }
h1, h2 { font-family: "Sora", 'Arial Black', sans-serif; }
.page-title { font-size: clamp(2rem, 5.4vw, 4.8rem); max-width: 16ch; }
.page-title {
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings:
    "wdth" 100;
}
.eyebrow { font-size: .8125rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px; }
.block-title { font-size: clamp(1.4rem, 2.6vw, 2.2rem); margin: clamp(72px, 10vw, 140px) 0 28px; }

/* ---------- navegação ---------- */
.nav {
  position: fixed; inset: 0 0 auto; height: var(--hh); display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad); z-index: var(--z-nav); color: var(--fg); transition: color .5s;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 92%, transparent), transparent);
}
.logo { font-size: 1.45rem; font-weight: 400; letter-spacing: .14em; position: relative; z-index: calc(var(--z-menu) + 1); }
.menu { display: flex; gap: clamp(20px, 3vw, 44px); align-items: center; font-size: .95rem; }
.menu a { position: relative; padding: 6px 0; }
.menu a:not(.menu-cta)::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.menu a:not(.menu-cta):hover::after, .menu a[aria-current]:not(.menu-cta)::after { transform: scaleX(1); transform-origin: left; }
.menu-cta { border: 1px solid currentColor; padding: 9px 22px !important; border-radius: 99px; transition: background .3s, color .3s; }
.menu-cta:hover, .menu-cta[aria-current] { background: var(--fg); color: var(--bg); }
.lang { display: flex; align-items: center; gap: 6px; font-size: .85rem; letter-spacing: .06em; }
.lang button { padding: 6px 2px; opacity: .55; transition: opacity .3s; }
.lang button:hover, .lang button[aria-pressed="true"] { opacity: 1; }
.lang button[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 6px; }
.lang span { opacity: .35; }
.burger { display: none; width: 44px; height: 44px; position: relative; z-index: calc(var(--z-menu) + 1); color: var(--fg); }
.burger span { position: absolute; left: 10px; right: 10px; height: 1px; background: currentColor; transition: .35s var(--ease); }
.burger span:first-child { top: 18px; } .burger span:last-child { top: 26px; }
.burger[aria-expanded="true"] span:first-child { top: 22px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 22px; transform: rotate(-45deg); }
@media (max-width: 760px) {
  .burger { display: block; }
  .menu {
    position: fixed; inset: 0; z-index: var(--z-menu); background: var(--ink); color: var(--sand); flex-direction: column; justify-content: center; align-items: flex-start;
    padding: 0 var(--pad); gap: 12px; font: 300 clamp(1.8rem, 8vw, 2.6rem)/1.2 var(--display);
    clip-path: inset(0 0 100% 0); visibility: hidden; transition: clip-path .6s var(--ease), visibility 0s .6s;
  }
  .menu.open { clip-path: inset(0); visibility: visible; transition: clip-path .6s var(--ease); }
  .menu-cta { border: 0; padding: 6px 0 !important; border-radius: 0; }
  .menu-cta:hover, .menu-cta[aria-current] { background: none; color: var(--tan); }
  body.no-scroll .logo, body.no-scroll .burger { color: var(--sand); }
}

/* ---------- transição entre separadores ---------- */
.wipe { position: fixed; inset: 0; z-index: var(--z-wipe); background: var(--slate); transform: translateY(100%); pointer-events: none; }
.wipe::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--tan); }

/* ---------- cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: var(--z-cursor); pointer-events: none; opacity: 0; transition: opacity .3s; }
.cursor.on { opacity: 1; }
.cursor::before {
  content: ''; position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 1px solid var(--tan); border-radius: 50%;
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), background .3s;
}
.cursor.link::before { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: color-mix(in srgb, var(--tan) 18%, transparent); }
.cursor.label::before { width: 78px; height: 78px; margin: -39px 0 0 -39px; background: color-mix(in srgb, var(--ink) 55%, transparent); }
.cursor-label { position: absolute; transform: translate(-50%, -50%); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--sand); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.cursor.label .cursor-label { opacity: 1; }
@media (hover: none) { .cursor { display: none; } }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; border-radius: 99px; white-space: nowrap;
  background: var(--tan); color: var(--ink); font-weight: 500; font-size: .95rem; border: 1px solid var(--tan);
  transition: background .3s, color .3s, border-color .3s, transform .25s ease-out;
}
.btn:hover { background: transparent; color: var(--tan); }
.btn-ghost { background: transparent; color: var(--sand); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--tan); color: var(--tan); }
.btn-solid { background: var(--ink); color: var(--sand); border-color: var(--ink); }
.btn-solid:hover { background: var(--slate); color: var(--sand); border-color: var(--slate); }
.btn:disabled { opacity: .55; cursor: progress; }

/* ---------- revelar ---------- */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* ---------- páginas ---------- */
.view { animation: none; }
.page { padding: calc(var(--hh) + clamp(40px, 8vw, 110px)) var(--pad) clamp(72px, 10vw, 140px); }
.page-slate { background: var(--slate); margin: 0; }
.wrap { max-width: 1280px; margin: 0 auto; }

/* ---------- início ---------- */
.hero { position: relative; height: 100svh; min-height: 620px; display: flex; align-items: flex-end; padding: 0 var(--pad) clamp(28px, 6vh, 64px); overflow: hidden; touch-action: pan-y; }
.hero.is-drag { cursor: grabbing; }
/* esbatido em cima (sobre a maquete) e em baixo (por trás dos textos e botões) */
.hero::before, .hero::after { content: ''; position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; }
.hero::before { top: 0; height: 28%; background: linear-gradient(180deg, var(--bg) 0%, transparent 100%); }
.hero::after { bottom: 0; height: 45%; background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 45%, transparent 100%); }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 2; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; pointer-events: none; }
.hero-inner a, .hero-inner button { pointer-events: auto; }
.hero h1 { font-size: clamp(1.8rem, 4.6vw, 4.2rem); max-width: 13ch; }
.hero-sub { margin: 24px 0 32px; max-width: 34ch; color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.2rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-models { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.model-btn { padding: 8px 0; font-size: .9rem; color: var(--muted); display: flex; align-items: center; gap: 14px; transition: color .3s; }
.model-btn::after { content: ''; width: 24px; height: 1px; background: currentColor; transition: width .5s var(--ease); }
.model-btn:hover, .model-btn.is-on { color: var(--sand); }
.model-btn.is-on { color: var(--tan); }
.model-btn.is-on::after { width: 64px; }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-models { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 22px; }
  .model-btn::after { display: none; }
  .model-btn.is-on { text-decoration: underline; text-underline-offset: 6px; }
}

/* ---------- sobre ---------- */
.lead { font: 300 clamp(1.35rem, 2.6vw, 2.3rem)/1.4 var(--text); max-width: 34em; margin-top: clamp(40px, 6vw, 80px); }
.lead .w { opacity: .22; transition: opacity .5s; }
.lead .w.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .lead .w { opacity: 1; } }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 5vw, 72px); margin-top: clamp(72px, 10vw, 140px); }
.principles article { border-top: 1px solid var(--line); padding-top: 24px; }
.principles h2 { font-size: 1.25rem; margin-bottom: 14px; }
.principles p, .steps span { color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); }
.steps li { border-top: 1px solid var(--line); padding-top: 20px; position: relative; transition: border-color .4s; }
.steps li:hover { border-color: var(--tan); }
.steps strong { display: block; font: 300 clamp(1.3rem, 2.2vw, 1.9rem)/1.2 "Sora", 'Arial Black', sans-serif; margin-bottom: 12px; letter-spacing: -.02em; }
.steps li:nth-child(2) { margin-top: 28px; } .steps li:nth-child(3) { margin-top: 56px; } .steps li:nth-child(4) { margin-top: 84px; }
/* ao chegar ao bloco, os degraus sobem da esquerda para a direita */
.rv-stairs.rv { opacity: 1; transform: none; transition: none; }
.rv-stairs.rv > * { opacity: 0; transform: translateY(70px); transition: opacity .7s var(--ease), transform .9s var(--ease), border-color .4s; }
.rv-stairs.rv.in > * { opacity: 1; transform: none; }
.rv-stairs.rv.in > :nth-child(1) { transition-delay: 0s, 0s, 0s; }
.rv-stairs.rv.in > :nth-child(2) { transition-delay: .18s, .18s, 0s; }
.rv-stairs.rv.in > :nth-child(3) { transition-delay: .36s, .36s, 0s; }
.rv-stairs.rv.in > :nth-child(4) { transition-delay: .54s, .54s, 0s; }
/* itens soltos (grelha de projetos): mesma subida, com atraso por coluna definido em JS */
.rv.stair { transform: translateY(70px); transition: opacity .7s var(--ease), transform .9s var(--ease); }
.rv.stair.in { transform: none; }
@media (prefers-reduced-motion: reduce) { .rv-stairs.rv > *, .rv.stair { opacity: 1; transform: none; transition: none; } }
@media (max-width: 900px) {
  .principles { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(n) { margin-top: 0; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- projetos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: clamp(32px, 5vw, 56px) 0; }
.chip { padding: 9px 20px; border: 1px solid var(--line); border-radius: 99px; font-size: .9rem; transition: background .3s, color .3s, border-color .3s; }
.chip:hover { border-color: var(--tan); }
.chip.is-on { background: var(--sand); color: var(--ink); border-color: var(--sand); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(28px, 4vw, 56px) clamp(16px, 2.4vw, 32px); align-items: start; }
.proj { grid-column: span 4; cursor: default; }
.proj:nth-child(3n + 1) { grid-column: span 5; }
.proj:nth-child(3n + 2) { grid-column: span 4; margin-top: clamp(24px, 6vw, 80px); }
.proj:nth-child(3n) { grid-column: span 3; }
.proj-art { aspect-ratio: 4 / 5; background: var(--slate); position: relative; overflow: hidden; transition: background .5s; }
.proj:nth-child(3n + 2) .proj-art { aspect-ratio: 1; }
.proj:nth-child(3n) .proj-art { aspect-ratio: 3 / 4; }
.proj:hover .proj-art, .proj:focus .proj-art { background: color-mix(in srgb, var(--slate) 70%, var(--ink)); }
.proj-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.proj-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }/* ao passar o rato: a imagem escurece e aparece um resumo da descrição, centrado */
.proj-desc {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 28px; overflow: hidden;
  color: var(--sand); font-size: clamp(.95rem, 1.2vw, 1.1rem); line-height: 1.55;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  opacity: 0; transition: opacity .45s; pointer-events: none;
}
.proj:hover .proj-desc, .proj:focus-visible .proj-desc { opacity: 1; }
@media (hover: none) { .proj-desc { display: none; } }
.proj figcaption { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; }
.proj strong { font-weight: 400; }
.proj span { color: var(--muted); font-size: .9rem; }
.note { margin-top: clamp(48px, 7vw, 90px); color: var(--muted); font-size: .9rem; max-width: 52ch; }
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .proj:nth-child(n) { grid-column: span 1; margin-top: 0; }
  .proj:nth-child(n) .proj-art { aspect-ratio: 4 / 5; }
}
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }

/* ---------- serviços ---------- */
.svc-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); margin-top: clamp(40px, 7vw, 90px); align-items: start; }
.svc { border-top: 1px solid var(--line); }
.svc:last-child { border-bottom: 1px solid var(--line); }
.svc-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 20px; text-align: left; padding: 26px 0; font: 300 clamp(1.4rem, 2.8vw, 2.4rem)/1.15 "Sora", 'Arial Black', sans-serif; letter-spacing: -.02em; color: var(--muted); transition: color .3s; }
.svc-head:hover, .svc.is-open .svc-head { color: var(--sand); }
.svc-head i { width: 20px; height: 20px; position: relative; flex: none; }
.svc-head i::before, .svc-head i::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--tan); transition: transform .45s var(--ease); }
.svc-head i::after { transform: rotate(90deg); }
.svc.is-open .svc-head i::after { transform: rotate(0); }
.svc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.svc.is-open .svc-body { grid-template-rows: 1fr; }
.svc-body > div { overflow: hidden; }
.svc-body p { color: var(--muted); max-width: 40ch; margin-bottom: 20px; }
.svc-body ul { padding-bottom: 32px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.svc-body li { padding: 8px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.svc-view { position: sticky; top: calc(var(--hh) + 20px); aspect-ratio: 1; background: color-mix(in srgb, var(--ink) 55%, var(--slate)); touch-action: pan-y; }
.svc-view.is-drag { cursor: grabbing; }
.svc-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.closing { margin-top: clamp(72px, 10vw, 140px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding-top: 40px; }
.closing p { font: 300 clamp(1.4rem, 3vw, 2.6rem)/1.15 "Sora", 'Arial Black', sans-serif; letter-spacing: -.02em; }
@media (max-width: 900px) {
  .svc-layout { grid-template-columns: 1fr; }
  .svc-view { position: relative; top: 0; order: -1; aspect-ratio: 4 / 3; }
}
@media (max-width: 520px) { .svc-body ul { grid-template-columns: 1fr; } }

/* ---------- contactos ---------- */
.contact { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.contact-info .page-title { font-family: "Sora", 'Arial Black', sans-serif; font-size: clamp(1.7rem, 4.2vw, 3.7rem); }
.contact-info { position: sticky; top: calc(var(--hh) + 20px); }
.details { margin-top: clamp(32px, 5vw, 64px); }
.details div { display: flex; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.details dt { width: 6.5rem; color: var(--muted); font-size: .9rem; padding-top: 2px; }
.details dd[data-todo] { color: var(--muted); font-style: italic; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 99px; padding: 4px; margin-bottom: 36px; --i: 0; }
.seg button { position: relative; z-index: 1; padding: 12px 10px; border-radius: 99px; font-weight: 500; font-size: .95rem; color: var(--muted); transition: color .35s; }
.seg button[aria-selected="true"] { color: var(--sand); }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: var(--ink); border-radius: 99px; transform: translateX(calc(var(--i) * 100%)); transition: transform .5s var(--ease); }
.form-intro { margin-bottom: 28px; color: var(--muted); }
.field { margin-bottom: 26px; border: 0; min-width: 0; }
.field > label, .field > legend, .label { display: block; font-size: .85rem; letter-spacing: .04em; margin-bottom: 8px; font-weight: 500; }
.hint { font-weight: 300; color: var(--muted); }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=number], .field select, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; border-radius: 0; transition: border-color .3s; appearance: none;
}
/* prazo: lista própria, de pontas redondas */
.dd { position: relative; }
.dd-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dd-btn { width: 100%; text-align: left; padding: 10px 28px 10px 0; border-bottom: 1px solid var(--line); position: relative; transition: border-color .3s; }
.dd-btn::after { content: ''; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); transition: transform .35s var(--ease); }
.dd.open .dd-btn::after { transform: translateY(5px) rotate(225deg); }
.dd-btn:hover { border-color: var(--fg); }
.dd-btn:focus, .dd-btn:focus-visible { outline: none; }
.dd-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 8px); list-style: none; padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--ink) 35%, transparent); animation: dd-in .3s var(--ease); }
.dd-list li { padding: 10px 14px; border-radius: 12px; cursor: pointer; font-size: .95rem; outline: none; transition: background .2s; }
.dd-list li:hover, .dd-list li:focus { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.dd-list li[aria-selected="true"] { background: var(--fg); color: var(--bg); }
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .dd-list { animation: none; } .dd-btn::after { transition: none; } }
/* área: sem os botões do browser; − e + redondos, no estilo do site */
.num { position: relative; }
.num input { padding-right: 76px !important; -moz-appearance: textfield; appearance: textfield; }
.num input::-webkit-outer-spin-button, .num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-btn { position: absolute; top: 50%; width: 28px; height: 28px; margin-top: -14px; border: 1px solid var(--line); border-radius: 99px; display: grid; place-items: center; font-size: 1rem; line-height: 1; transition: background .3s, color .3s, border-color .3s; }
.num-btn[data-step="-5"] { right: 34px; }
.num-btn[data-step="5"] { right: 0; }
.num-btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.field select { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235E503F'/%3E%3C/svg%3E") right 4px center no-repeat; padding-right: 24px; }
.field textarea { resize: vertical; min-height: 110px; border: 1px solid var(--line); padding: 12px; }
/* campo selecionado: sem contorno nem mudança de borda */
.field input:focus, .field select:focus, .field textarea:focus,
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; box-shadow: none; }
::placeholder { color: var(--muted); opacity: 1; }
.opt span { min-height: 44px; display: flex; align-items: center; }
.logo { padding: 10px 0; }
[aria-invalid="true"] { border-color: #8a2b1d !important; }
/* o aviso fica por cima do campo, fora do fluxo, na folga entre campos: os campos não se mexem */
.field, .check, [data-only] { position: relative; }
.field-err { position: absolute; left: 0; bottom: calc(100% + 4px); margin: 0; color: #8a2b1d; font-size: .85rem; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; }
.opt span { display: block; padding: 9px 18px; border: 1px solid var(--line); border-radius: 99px; font-size: .9rem; transition: background .25s, color .25s, border-color .25s; }
.opt:hover span { border-color: var(--ink); }
.opt input:checked + span { background: var(--ink); color: var(--sand); border-color: var(--ink); }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 28px; border: 1px dashed var(--umber); cursor: pointer;
  transition: background .3s, border-color .3s;
}
.drop:hover, .drop.over, .drop:focus-within { background: color-mix(in srgb, var(--ink) 6%, transparent); border-color: var(--ink); border-style: solid; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop-title { font-weight: 500; }
.drop-hint { color: var(--muted); font-size: .875rem; }
.up-msg { min-height: 1.4em; font-size: .875rem; color: #8a2b1d; margin-top: 8px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-top: 8px; }
.thumbs li { position: relative; font-size: .75rem; color: var(--muted); }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--slate); margin-bottom: 4px; }
.thumbs span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumbs button { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--sand); font-size: 1.1rem; line-height: 1; }
.thumbs button:hover { background: var(--slate); }
.check { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 20px; font-size: .9rem; cursor: pointer; }
/* caixa de seleção própria: redonda, linha fina, preenche com a cor do texto ao marcar */
.check input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin-top: 1px; flex: none; position: relative; border: 1px solid var(--fg); border-radius: 99px; background: transparent; cursor: pointer; outline: none; transition: background .3s var(--ease), border-color .3s; }
.check input::after { content: ''; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid var(--bg); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) scale(0); transition: transform .3s var(--ease); }
.check input:checked { background: var(--fg); }
.check input:checked::after { transform: rotate(45deg) scale(1); }
.check:hover input:not(:disabled) { border-color: var(--accent); }
.check input:disabled { opacity: .5; cursor: default; }
.check input[aria-invalid="true"] { border-color: #8a2b1d !important; }
@media (prefers-reduced-motion: reduce) { .check input, .check input::after { transition: none; } }
.form-msg.ok { color: #2f6b3a; }
.form-msg { min-height: 1.5em; margin-bottom: 14px; color: #8a2b1d; font-size: .9rem; font-weight: 500; }
.sent { padding: 40px 0; }
.sent:focus { outline: none; }
.sent h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 14px; }
.sent p { color: var(--muted); margin-bottom: 28px; max-width: 40ch; }
.sent .btn { background: var(--ink); color: var(--sand); border-color: var(--ink); }
@media (max-width: 900px) {
  .contact { grid-template-columns: 1fr; }
  .contact-info { position: static; }
}
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

/* ---------- rodapé ---------- */
.foot { display: grid; grid-template-columns: auto 1fr auto; gap: 16px 40px; align-items: center; padding: 36px var(--pad); border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); background: var(--bg); /* cor sólida, tapa a textura */ }
.foot .logo { font-size: 1.2rem; color: var(--fg); }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links { display: grid; gap: 14px; }
.foot-contact { font-style: normal; display: grid; gap: 2px; font-size: .85rem; }
.foot-contact b { font-weight: 500; color: var(--fg); margin-right: 6px; }
.foot-contact [data-todo] { font-style: italic; }
.foot nav a:hover { color: var(--fg); }
.foot small { grid-column: 1 / -1; font-size: .8rem; }
.foot-legal { grid-column: 1 / -1; display: flex; gap: 22px; flex-wrap: wrap; font-size: .8rem; }
.foot-legal a:hover { color: var(--fg); }
@media (max-width: 760px) { .foot { grid-template-columns: 1fr; } }

/* ---------- legal ---------- */
.legal-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: clamp(28px, 4vw, 48px); }
.legal-tabs a { padding: 10px 18px; border: 1px solid var(--line); border-radius: 99px; font-size: .9rem; color: var(--muted); transition: color .3s, border-color .3s, background .3s; }
.legal-tabs a:hover { color: var(--accent); border-color: var(--accent); }
.legal-tabs a[aria-current] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.legal { max-width: 68ch; margin-top: clamp(40px, 6vw, 72px); color: var(--muted); }
.legal h2 { font-size: 1.25rem; color: var(--fg); margin: 40px 0 12px; border-top: 1px solid var(--line); padding-top: 24px; }
.legal p + p { margin-top: 12px; }
.legal [data-todo] { font-style: italic; color: var(--accent); }
.legal-date { font-size: .85rem; letter-spacing: .04em; margin-bottom: 20px; }


/* ---------- início: resumos ---------- */
.hx { padding: clamp(72px, 10vw, 140px) var(--pad); border-top: 1px solid var(--line); }
#home-extra .sobre-bg { background: var(--bg); border-top: 0; } /* sem textura: cor sólida */
/* "Sobre nós" (início): a imagem desliza da esquerda e aparece quando a secção entra no ecrã */
.rv-bg.rv { opacity: 1; transform: none; transition: none; }
.rv-bg:not(.in)::before { visibility: hidden; }
.rv-bg.in::before { animation: bg-in 1.4s var(--ease) both; }
@keyframes bg-in { from { opacity: 0; transform: translateX(-70px); } }
@media (prefers-reduced-motion: reduce) { .rv-bg.in::before { animation: none; } }
.hx-slate { background: var(--slate); border-top: 0; }
/* projetos (início): esbatido no topo, a suavizar a passagem da secção anterior */
section[aria-labelledby="hx-projetos"] { position: relative; border-top: 0; }
section[aria-labelledby="hx-projetos"]::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: clamp(120px, 22vh, 220px); background: linear-gradient(180deg, var(--bg) 0%, transparent 100%); pointer-events: none; }
section[aria-labelledby="hx-projetos"] > * { position: relative; }
.hx-title { font-size: clamp(1.6rem, 3.4vw, 3rem); max-width: 18ch; }
.hx-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.hx-text { font: 300 clamp(1.1rem, 1.7vw, 1.5rem)/1.5 var(--text); max-width: 34em; }
.hx-points { margin-top: 36px; }
.hx-points li { border-top: 1px solid var(--line); padding: 18px 0; display: grid; grid-template-columns: minmax(0, 12em) 1fr; gap: 8px 24px; }
.hx-points span, .hx-cols p { color: var(--muted); }
.hx-link { display: inline-block; margin-top: 28px; padding-bottom: 4px; border-bottom: 1px solid var(--accent); color: var(--accent); transition: color .3s; }
.hx-link:hover { color: var(--fg); }
.hx-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(32px, 5vw, 56px); }
.hx-head .hx-link { margin-top: 0; }
/* mesmas proporções e disposição da grelha da página de projetos (5 / 4 / 3 colunas, 2.º cartão descido) */
.hx-cards { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(28px, 4vw, 56px) clamp(16px, 2.4vw, 32px); align-items: start; }
.hx-card { grid-column: span 4; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 14px 12px; }
.hx-card:nth-child(1) { grid-column: span 5; }
.hx-card:nth-child(2) { grid-column: span 4; margin-top: clamp(24px, 6vw, 80px); }
.hx-card:nth-child(3) { grid-column: span 3; }
.hx-card img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--slate); transition: opacity .4s; }
.hx-card:nth-child(2) img { aspect-ratio: 1; }
.hx-card:nth-child(3) img { aspect-ratio: 3 / 4; }
.hx-card:hover img { opacity: .85; }
.hx-card span { display: block; font-weight: 400; }
.hx-card small { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.hx-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 5vw, 72px); }
.hx-cols article { border-top: 1px solid var(--line); padding-top: 24px; }
.hx-cols h3 { font-size: 1.25rem; margin-bottom: 14px; }
/* ao passar o rato (início e "Sobre nós"): o título desliza um pouco para a direita, ganha a cor de destaque e a linha acende */
.principles h2, .hx-cols h3, .hx-points strong, .steps strong { transition: transform .45s var(--ease), color .3s; }
.principles article:hover h2, .hx-cols article:hover h3, .hx-points li:hover strong, .steps li:hover strong { transform: translateX(10px); color: var(--accent); }
.principles article, .hx-cols article { transition: border-color .4s; }
.principles article:hover, .hx-cols article:hover, .hx-points li:hover { border-color: var(--accent); }
.hx-card:hover > span { color: var(--accent); }
.hx-card > span { transition: color .3s; }
@media (prefers-reduced-motion: reduce) { .principles h2, .hx-cols h3, .hx-points strong, .steps strong { transition: none; } .principles article:hover h2, .hx-cols article:hover h3, .hx-points li:hover strong, .steps li:hover strong { transform: none; } }
@media (hover: none) { .principles article:hover h2, .hx-cols article:hover h3, .hx-points li:hover strong, .steps li:hover strong { transform: none; } }
@media (max-width: 900px) {
  .hx-split, .hx-cards, .hx-cols { grid-template-columns: 1fr; }
  .hx-points li { grid-template-columns: 1fr; }
  .hx-card:nth-child(n) { grid-column: auto; margin-top: 0; }
  .hx-card:nth-child(n) img { aspect-ratio: 4 / 5; }
}

/* ---------- sobre nós: imagem de fundo com gradiente e corte diagonal ---------- */
.sobre-bg { position: relative; overflow: hidden; isolation: isolate; }
.sobre-bg::before {
  content: ''; position: absolute; z-index: -1; top: 0; left: 0; bottom: 0; width: min(68%, 960px);
  background: linear-gradient(270deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 35%, color-mix(in srgb, var(--bg) 45%, transparent) 100%),
    url("../Imagens_site/pexels-ivan-s-4458200.jpg") center / cover no-repeat;
  clip-path: polygon(0 0, 45% 0, 70% 100%, 0 100%);
  pointer-events: none;
}
@media (max-width: 760px) { .sobre-bg::before { width: 100%; opacity: .45; clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%); } }
#v-sobre.sobre-bg::before {
  left: auto; right: 0;
  background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 80%, transparent) 35%, color-mix(in srgb, var(--bg) 45%, transparent) 100%),
    url("../Imagens_site/pexels-ivan-s-4458200.jpg") center / cover no-repeat;
  clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%);
}
@media (max-width: 760px) { #v-sobre.sobre-bg::before { clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%); } }
#v-sobre.sobre-bg::before { bottom: auto; height: clamp(380px, 52vh, 480px); }
#v-sobre.sobre-bg::before { -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }

/* ---------- ficha de projeto (botões nos cartões) ---------- */
.proj { cursor: pointer; }
.proj:focus-visible, .hx-card:focus-visible { outline: 1px solid var(--tan); outline-offset: 6px; }
.hx-card { width: 100%; text-align: left; color: inherit; font: inherit; }
.pdlg { border: 1px solid var(--line); background: var(--ink); color: var(--sand); padding: 0; width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: hidden; margin: auto; border-radius: 22px; }
html:has(.pdlg[open]), body:has(.pdlg[open]) { overflow: hidden; } /* página parada com a ficha aberta */
.pdlg::backdrop { background: color-mix(in srgb, var(--ink) 80%, transparent); }
.pdlg[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
/* só a imagem faz scroll (se for mais alta que a ficha); o texto fica parado */
.pdlg-img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; display: block; background: var(--slate); }
.pdlg-body { padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; gap: 16px; align-items: flex-start; }
.pdlg-body h2 { font-size: clamp(1.5rem, 2.8vw, 2.4rem); }
.pdlg-body p:not(.eyebrow) { color: var(--muted); }
.pdlg-close { position: absolute; top: 10px; right: 14px; z-index: 2; font-size: 2rem; line-height: 1; padding: 4px 10px; color: var(--sand); }
.pdlg-close:hover { color: var(--tan); }
@media (max-width: 760px) { .pdlg[open] { grid-template-columns: 1fr; } .pdlg-img { min-height: 220px; max-height: 40vh; } }

/* ---------- aviso de cookies ---------- */
.cnotice { position: fixed; z-index: 85; left: var(--pad); right: var(--pad); bottom: 20px; margin: 0 auto; max-width: 1080px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 20px 32px; padding: 20px 28px; background: var(--ink); color: var(--sand); border: 1px solid var(--line); border-radius: 22px; font-size: .9rem; }
.cnotice[hidden] { display: none; }
/* o aviso é sempre escuro: no tema claro (contactos) as cores do tema ficavam escuras sobre fundo escuro */
.cnotice { --bg: var(--ink); --fg: var(--sand); --muted: color-mix(in srgb, var(--sand) 68%, transparent); --line: color-mix(in srgb, var(--sand) 22%, transparent); --accent: var(--tan); }
.cnotice, .cnotice p, .cnotice h4, .cnotice label, .cnotice legend { color: var(--sand); }
.cnotice p { color: color-mix(in srgb, var(--sand) 80%, transparent); }
.cnotice a { color: var(--tan); border-bottom: 1px solid currentColor; }
.cnotice .btn { padding: 10px 22px; }
.cnotice-text { flex: 1; min-width: 0; }
.cnotice-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: none; }
.cnotice-prefs { border: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 14px; }
.cnotice-prefs .check { margin: 0; }
.cnotice .btn-ghost { color: var(--sand); }
.cnotice .btn-ghost:hover { color: var(--tan); }
@media (max-width: 760px) { .cnotice { flex-direction: column; align-items: stretch; right: 16px; left: 16px; } .cnotice-actions .btn { flex: 1; justify-content: center; padding-inline: 12px; } }
