/* Contempla Oásis
   Paleta tirada do símbolo (ardósia, sálvia, pinho) e da cal algarvia.
   A única cor quente é a "luz": a janela acesa no fim do filme do topo, usada só nas ações principais.
   Movimento: uma só família de curvas (saída rápida, chegada suave); a mola fica para peças pequenas (ilha, realces). */
:root {
  --cal: #f2f3ef;
  --pedra: #e4e7e1;
  --linha: #cdd3cd;
  --tinta: #26303a;
  --ardosia: #45505e;
  --pinho: #4c6d65;
  --salvia: #8faea5;
  --noite: #1f2830;
  --noite-2: #161e25;
  --luz: #ebcb92;
  --luz-forte: #f3dcae;
  --vidro: rgba(22, 30, 37, .86);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;

  /* escala 1.333 a partir de 17px */
  --t-sm: 0.8125rem;
  --t-base: 1.0625rem;
  --t-md: 1.3125rem;
  --t-lg: clamp(1.5rem, 1.2rem + 1vw, 1.75rem);
  --t-xl: clamp(2rem, 1.4rem + 2.2vw, 2.9rem);
  --t-display: clamp(2.6rem, 1.2rem + 3.9vw, 5rem);

  --gutter: clamp(20px, 5vw, 72px);
  --section: clamp(72px, 10vw, 144px);
  --top: clamp(124px, 13vw, 184px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  interpolate-size: allow-keywords;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --spring: linear(0, .007, .029 2.2%, .118 4.7%, .625 14.4%, .826 19%, .902, .962, 1.008 26.1%, 1.041 28.7%, 1.064 32.1%, 1.07 36%, 1.063 40.5%, 1.03 50.4%, 1.012 55.6%, .999 63.8%, .995 70.4%, 1 87.5%, 1); }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cal);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pinho); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1 { font-family: var(--serif); font-size: var(--t-display); font-weight: 300; line-height: 1.02; letter-spacing: -0.02em; font-variation-settings: "opsz" 72; }
h2 { font-family: var(--serif); font-size: var(--t-xl); line-height: 1.08; letter-spacing: -0.01em; font-variation-settings: "opsz" 60; max-width: 20ch; }
h3 { font-size: var(--t-md); line-height: 1.3; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--pinho); outline-offset: 3px; }
.section-dark :focus-visible, .hero :focus-visible, .island :focus-visible, .dock :focus-visible, .creds :focus-visible, .lightbox :focus-visible { outline-color: var(--luz); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 60; background: var(--noite); color: var(--cal); padding: 10px 16px; }
.skip:focus { top: 12px; }
.draft-bar { position: fixed; z-index: 45; left: 16px; bottom: 16px; padding: 8px 14px; border-radius: 999px; background: var(--luz); color: var(--noite); font-size: var(--t-sm); font-weight: 500; }

.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap-text { max-width: calc(780px + 2 * var(--gutter)); }
.section { padding-block: var(--section); }
.section-tight { padding-block: clamp(48px, 6vw, 88px); }
.section-stone { background: var(--pedra); }
.section-dark { background: var(--noite); color: var(--cal); }
.intro { margin-top: 20px; max-width: 46ch; color: var(--ardosia); font-size: var(--t-md); line-height: 1.5; }
.section-dark .intro { color: #c4ceca; }
.hint { color: var(--salvia); font-size: var(--t-sm); font-weight: 400; }
.more { margin-top: 28px; }
.more a, .section-head a { font-weight: 500; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px; margin-bottom: 40px; }

/* botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  font: 500 var(--t-base)/1 var(--sans); font-variation-settings: "wdth" 108;
  text-decoration: none; cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), scale .2s var(--ease);
}
.btn:active { scale: .97; }
.btn-glow { background: var(--luz); color: var(--noite); }
.btn-glow:hover { background: var(--luz-forte); }
.btn-ghost { background: transparent; color: var(--cal); border-color: rgba(242, 243, 239, .35); }
.btn-ghost:hover { border-color: var(--cal); background: rgba(242, 243, 239, .06); }
.btn-dark { background: var(--noite); color: var(--cal); }
.btn-dark:hover { background: var(--ardosia); }
.btn-outline { color: var(--noite); border-color: var(--noite); }
.btn-outline:hover { background: var(--noite); color: var(--cal); }

/* o símbolo */
.mark { width: 34px; height: 34px; }
.b-dark { fill: var(--mark-dark, #45505e); }
.b-sage { fill: #86a59c; }
.b-pine { fill: #5e7f77; }
.band { transform-box: fill-box; transform-origin: center; }
.wordmark { font-family: var(--serif); font-size: 1.05rem; letter-spacing: .2em; text-transform: uppercase; font-variation-settings: "opsz" 14; white-space: nowrap; }

/* ilha: o menu flutua no topo, em vidro escuro, igual sobre o filme e sobre as páginas claras */
.island {
  --h: 56px;
  position: fixed; z-index: 40;
  top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; translate: -50% 0;
  width: max-content; max-width: calc(100vw - 24px);
  color: var(--cal);
  background: var(--vidro);
  -webkit-backdrop-filter: saturate(170%) blur(22px); backdrop-filter: saturate(170%) blur(22px);
  border: 1px solid rgba(242, 243, 239, .1);
  border-radius: calc(var(--h) / 2);
  box-shadow: 0 18px 40px -18px rgba(8, 12, 16, .6), inset 0 1px 0 rgba(255, 255, 255, .06);
  view-transition-name: island;
}
.island-bar { display: flex; align-items: center; gap: 2px; height: var(--h); padding: 0 8px 0 16px; }
.island-brand { display: flex; align-items: center; gap: 10px; padding-right: 10px; color: inherit; text-decoration: none; }
.island .mark { width: 26px; height: 26px; flex: none; --mark-dark: #d7dfdb; transition: rotate .8s var(--spring); }
.island-brand:hover .mark { rotate: 72deg; }
.island .wordmark { font-size: .78rem; letter-spacing: .22em; max-width: 13em; overflow: hidden; transition: max-width .7s var(--ease), opacity .4s var(--ease); }
.island.is-compact .wordmark { max-width: 0; opacity: 0; }
.island-nav { position: relative; display: flex; align-items: center; }
.island-nav a { position: relative; z-index: 1; padding: 0 14px; line-height: 40px; border-radius: 999px; color: rgba(242, 243, 239, .72); font-size: .9rem; text-decoration: none; white-space: nowrap; transition: color .3s var(--ease); }
.island-nav a:hover, .island-nav a[aria-current="page"] { color: var(--cal); }
.island-glow { position: absolute; left: 0; top: 50%; width: 0; height: 40px; margin-top: -20px; border-radius: 999px; background: rgba(242, 243, 239, .13); opacity: 0; pointer-events: none; view-transition-name: island-glow; }
.island-cta { margin-left: 10px; display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--luz); color: var(--noite); font-size: .9rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color .3s var(--ease), scale .2s var(--ease); }
.island-cta:hover { background: var(--luz-forte); }
.island-cta:active { scale: .96; }
.island-toggle { display: none; }
.island-menu { display: none; }
/* seletor de idioma: a sigla abre uma pequena ilha por baixo */
.island-lang { position: relative; margin-left: 4px; }
.island-lang summary { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 999px; color: rgba(242, 243, 239, .72); font-size: .78rem; letter-spacing: .12em; list-style: none; cursor: pointer; transition: color .3s var(--ease), background-color .3s var(--ease); }
.island-lang summary::-webkit-details-marker { display: none; }
.island-lang summary:hover, .island-lang[open] summary { color: var(--cal); background: rgba(242, 243, 239, .13); }
.island-lang ul { position: absolute; right: 0; top: calc(100% + 14px); min-width: 168px; margin: 0; padding: 6px; list-style: none; background: var(--vidro); -webkit-backdrop-filter: saturate(170%) blur(22px); backdrop-filter: saturate(170%) blur(22px); border: 1px solid rgba(242, 243, 239, .1); border-radius: 20px; box-shadow: 0 18px 40px -18px rgba(8, 12, 16, .6); transform-origin: top right; }
.motion .island-lang[open] ul { animation: lang-in .5s var(--spring); }
@keyframes lang-in { from { opacity: 0; scale: .8; translate: 0 -6px; } }
.island-lang a { display: block; padding: 9px 14px; border-radius: 14px; color: rgba(242, 243, 239, .78); font-size: .9rem; text-decoration: none; }
.island-lang a:hover { background: rgba(242, 243, 239, .1); color: var(--cal); }
.island-lang a[aria-current] { color: var(--luz); }
/* nas páginas de artigo, a ilha mostra quanto falta ler */
.is-article .island::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--luz); transform-origin: 0 50%; scale: 0 1; animation: read-progress linear both; animation-timeline: scroll(root); }
@supports not (animation-timeline: scroll()) { .is-article .island::after { display: none; } }
@keyframes read-progress { to { scale: 1 1; } }

@media (max-width: 1180px) and (min-width: 1024px) {
  .island .wordmark { max-width: 0; opacity: 0; }
}
@media (max-width: 1023px) {
  /* ao descer, a ilha encolhe para o símbolo e o botão; abre de novo à largura toda com o menu */
  .island { left: 12px; right: 12px; translate: none; width: auto; max-width: none; border-radius: 28px; transition: left .7s var(--spring), right .7s var(--spring); }
  .island.is-compact:not(.is-open) { left: calc(50% - 60px); right: calc(50% - 60px); }
  .island.is-open .wordmark { max-width: 13em; opacity: 1; }
  .island-bar { padding-right: 6px; }
  .island-nav, .island-cta, .island-lang { display: none; }
  .island-brand { margin-right: auto; }
  .island-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(242, 243, 239, .1); color: inherit; cursor: pointer; transition: background-color .3s var(--ease); }
  .island-toggle:hover { background: rgba(242, 243, 239, .16); }
  .burger { position: relative; width: 16px; height: 10px; }
  .burger i { position: absolute; left: 0; right: 0; height: 1.5px; border-radius: 2px; background: currentColor; transition: translate .5s var(--spring), rotate .5s var(--spring); }
  .burger i:first-child { top: 1px; }
  .burger i:last-child { top: 7.5px; }
  .island.is-open .burger i:first-child { translate: 0 3.25px; rotate: 45deg; }
  .island.is-open .burger i:last-child { translate: 0 -3.25px; rotate: -45deg; }
  .island-menu { display: block; height: 0; overflow: hidden; }
  html:not(.js) .island-menu { height: auto; }
  .island-menu nav { padding: 2px 20px 20px; }
  .island-menu ul { list-style: none; margin: 0; padding: 0; }
  .island-menu li a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(242, 243, 239, .08); color: var(--cal); font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; text-decoration: none; font-variation-settings: "opsz" 36; }
  .island-menu li a[aria-current="page"] { color: var(--luz); }
  .island-menu-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
  .island-menu-actions .btn { flex: 1; min-height: 48px; padding: 0 18px; white-space: nowrap; }
  .island-menu .island-menu-langs { display: flex; gap: 4px; margin-top: 18px; }
  .island-menu .island-menu-langs a { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; font-family: inherit; font-size: .8rem; letter-spacing: .12em; color: rgba(242, 243, 239, .72); }
  .island-menu .island-menu-langs a[aria-current] { color: var(--noite); background: var(--luz); }
}

/* barra de contacto no telemóvel: outra ilha, em baixo */
.dock {
  position: fixed; z-index: 35; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: none; gap: 8px; padding: 7px;
  border-radius: 999px; background: var(--vidro);
  -webkit-backdrop-filter: saturate(170%) blur(22px); backdrop-filter: saturate(170%) blur(22px);
  border: 1px solid rgba(242, 243, 239, .1); box-shadow: 0 18px 40px -18px rgba(8, 12, 16, .6);
  translate: 0 calc(100% + 32px); transition: translate .7s var(--spring);
  view-transition-name: dock;
}
.dock.is-visible { translate: 0 0; }
.dock .btn { min-height: 46px; padding: 0 18px; font-size: .9375rem; white-space: nowrap; }
.dock .btn-glow { flex: 1; }

/* página inicial: o filme termina com a casa acesa ao anoitecer; o texto fica no céu à esquerda */
.hero { position: relative; min-height: max(640px, 100svh); background: var(--noite); color: var(--cal); display: flex; align-items: flex-end; overflow: hidden; }
.hero-media { position: absolute; inset: 0; overflow: hidden; }
.hero-video { width: 100%; height: 100%; object-fit: cover; object-position: 90% 60%; transform-origin: 70% 60%; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(31, 40, 48, .9) 0%, rgba(31, 40, 48, .55) 38%, rgba(31, 40, 48, 0) 62%); }
.hero-content { padding-block: 140px clamp(56px, 10vh, 120px); }
.hero-content > :not(.hero-media) { position: relative; z-index: 1; }
.hero-title { max-width: 13ch; }
.hero-lede { margin-top: 28px; max-width: 40ch; font-size: var(--t-md); line-height: 1.5; color: #d6ddd9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-scroll { position: absolute !important; left: 50%; bottom: 28px; width: 1px; height: 48px; overflow: hidden; background: rgba(242, 243, 239, .18); }
.hero-scroll span { position: absolute; inset: 0; background: var(--luz); translate: 0 -100%; animation: scroll-cue 2.4s var(--ease) infinite 2s; }
@keyframes scroll-cue { 60%, 100% { translate: 0 100%; } }
.motion .hero-title:not(.is-in), .motion [data-hero-in]:not(.is-in) { opacity: 0; }

/* credenciais */
.creds { background: var(--noite-2); color: var(--cal); padding-block: 40px; }
.creds-full { background: var(--noite); padding-block: var(--section); }
.creds-full h2 { color: var(--cal); }
.creds .intro { color: #c4ceca; }
.creds-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 40px; }
.creds-full .creds-list { margin-top: 48px; }
.creds-list li { display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; align-content: start; }
.creds-mark { width: 22px; height: 22px; grid-row: span 2; margin-top: 3px; --mark-dark: #d7dfdb; }
.creds-list strong { font-family: var(--serif); font-weight: 400; font-size: var(--t-md); line-height: 1.25; font-variation-settings: "opsz" 30; }
.creds-list span { font-size: var(--t-sm); color: #aab7b2; margin-top: 4px; }
.creds-verify { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--t-sm); color: #8d9a96; }
.creds-verify a { color: var(--luz); }

/* cabeçalho das páginas interiores */
.page-header { padding-block: var(--top) 0; }
.page-header h1 { max-width: 18ch; font-size: clamp(2.4rem, 1.4rem + 3vw, 4rem); }
.page-header .intro { max-width: 52ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--t-sm); margin-bottom: 28px; }
.crumbs a { color: var(--ardosia); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs a + a::before { content: "/"; margin-right: 6px; color: var(--linha); }

/* serviços */
.split { display: grid; grid-template-columns: 5fr 7fr; gap: 48px clamp(32px, 6vw, 96px); align-items: start; }
.split-head { position: sticky; top: 120px; }
.services { list-style: none; margin: 0; padding: 0; }
.service { border-top: 1px solid var(--linha); }
.service:last-child { border-bottom: 1px solid var(--linha); }
.service a { position: relative; display: grid; gap: 10px; padding-block: 32px; color: inherit; text-decoration: none; }
.service a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--pinho); scale: 0 1; transform-origin: 0 50%; transition: scale .8s var(--ease); }
.service a:hover::after { scale: 1 1; }
.service h3 { font-family: var(--serif); font-size: var(--t-lg); font-variation-settings: "opsz" 36; transition: translate .6s var(--ease); }
.service a:hover h3 { translate: 10px 0; }
.service p { max-width: 58ch; color: var(--ardosia); }
.fit { font-size: var(--t-sm); color: var(--pinho); }
.service p.fit { color: var(--pinho); }
.service-detail { display: grid; grid-template-columns: 5fr 7fr; gap: 24px clamp(32px, 6vw, 96px); padding-block: 48px; border-top: 1px solid var(--linha); scroll-margin-top: 96px; }
.service-detail:last-child { border-bottom: 1px solid var(--linha); }
.service-detail h2 { font-size: var(--t-lg); margin-bottom: 12px; }
.service-detail .lead { font-size: var(--t-md); line-height: 1.5; max-width: 52ch; }
.service-detail h3 { margin-top: 28px; font-size: var(--t-base); font-weight: 600; }
.ticks { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; color: var(--ardosia); }
.ticks li { padding-left: 22px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: var(--salvia); clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }

/* método */
.method { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.method-figure-sticky { position: sticky; top: 140px; align-self: start; }
.method-mark { width: min(100%, 420px); overflow: visible; }
.method-mark text { font: 600 5px var(--sans); fill: var(--cal); text-anchor: middle; dominant-baseline: middle; }
.method-mark.has-focus .band { transition: opacity .5s var(--ease); }
.method-mark.has-focus .band:not(.is-focus) { opacity: .28; }
.steps { list-style: none; counter-reset: step; margin: 40px 0 0; padding: 0; display: grid; gap: 22px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; }
.steps li::before { content: counter(step); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--noite); color: var(--cal); display: grid; place-items: center; font-size: var(--t-sm); font-weight: 600; transition: background-color .4s var(--ease), color .4s var(--ease); }
.steps li.is-focus::before { background: var(--luz); color: var(--noite); }
.steps h2, .steps h3 { font-family: var(--sans); font-weight: 600; font-size: var(--t-base); line-height: 1.4; letter-spacing: 0; max-width: none; }
.steps p { color: var(--ardosia); max-width: 52ch; }
.steps-large { margin-top: 0; gap: 32px; }
.steps-large li { padding-block: 8vh; }
.steps-large h2 { font-family: var(--serif); font-weight: 400; font-size: var(--t-lg); }

/* tecnologia */
.tec-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 32px; }
.tec svg { width: 44px; height: 44px; fill: none; stroke: var(--pinho); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.tec h3 { margin-top: 18px; font-weight: 600; font-size: var(--t-base); }
.tec p { margin-top: 8px; color: var(--ardosia); font-size: 0.9375rem; }

/* cartões de obras e artigos */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 28px; }
.cards-spaced { margin-top: 40px; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--pedra); border-radius: 2px; view-transition-class: media; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: scale 1.1s var(--ease); }
.card-link:hover .card-media img { scale: 1.04; }
.card-empty { width: 100%; height: 100%; display: grid; place-items: center; background: var(--noite); }
.card-empty-mark { width: 64px; height: 64px; opacity: .5; --mark-dark: #d7dfdb; }
.card h3 { margin-top: 16px; font-family: var(--serif); font-size: var(--t-lg); line-height: 1.2; font-variation-settings: "opsz" 36; }
.card-link:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.card-meta { margin-top: 6px; font-size: var(--t-sm); color: var(--ardosia); }
.card-post .card-meta { margin-top: 16px; }
.card-post h3 { margin-top: 6px; }
.card-post p:last-child { margin-top: 8px; color: var(--ardosia); font-size: 0.9375rem; }
.section-stone .card-media { background: var(--linha); }

/* filtros: a opção ativa desliza para a nova posição ao mudar de página */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.filters a { padding: 8px 16px; border: 1px solid var(--linha); border-radius: 999px; color: var(--tinta); text-decoration: none; font-size: 0.9375rem; transition: border-color .3s var(--ease); }
.filters a:hover { border-color: var(--tinta); }
.filters a[aria-current="page"] { background: var(--noite); border-color: var(--noite); color: var(--cal); view-transition-name: filter-active; }
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 56px; }
.pagination a { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--linha); border-radius: 999px; color: var(--tinta); text-decoration: none; }
.pagination a[aria-current="page"] { background: var(--noite); color: var(--cal); border-color: var(--noite); }

/* página da obra */
.obra-cover { margin: 0 0 48px; overflow: hidden; border-radius: 2px; view-transition-class: media; }
.obra-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.obra-body { display: grid; grid-template-columns: 4fr 8fr; gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.facts.facts-obra { margin: 0; grid-template-columns: 1fr; position: sticky; top: 110px; }
.gallery-title { margin-top: clamp(64px, 8vw, 112px); }
.gallery { margin-top: 32px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gallery-item { display: block; padding: 0; border: 0; background: var(--pedra); border-radius: 2px; overflow: hidden; aspect-ratio: 3 / 2; cursor: zoom-in; }
.gallery-item:nth-child(3n + 1) { grid-column: span 2; aspect-ratio: 16 / 9; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: scale 1.1s var(--ease); }
.gallery-item:hover img { scale: 1.03; }
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(14, 19, 24, .94); }
.lightbox img { max-width: calc(100vw - 48px); max-height: calc(100dvh - 128px); width: auto; height: auto; object-fit: contain; border-radius: 2px; cursor: zoom-out; }
.lightbox-close { position: fixed; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(242, 243, 239, .2); background: var(--vidro); color: var(--cal); font: 500 .9375rem var(--sans); cursor: pointer; }
.post-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--linha); }
.post-nav a { display: grid; gap: 2px; max-width: 46%; color: var(--tinta); font-family: var(--serif); font-size: var(--t-md); line-height: 1.25; text-decoration: none; }
.post-nav a span { font-family: var(--sans); font-size: var(--t-sm); color: var(--pinho); }
.post-nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.post-nav-next { margin-left: auto; text-align: right; }

/* texto escrito no painel (obras, artigos, privacidade) */
.prose { font-size: 1.125rem; line-height: 1.7; max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.8em; font-size: var(--t-lg); max-width: none; }
.prose h3 { margin-top: 1.5em; font-weight: 600; font-size: var(--t-md); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 2px solid var(--salvia); font-family: var(--serif); font-size: var(--t-md); }
.prose figure { margin-inline: 0; overflow: hidden; }
.prose figure img { width: 100%; border-radius: 2px; }
.prose figcaption { margin-top: 8px; font-size: var(--t-sm); color: var(--ardosia); }

/* artigo */
.article .page-header h1 { font-size: var(--t-xl); max-width: 24ch; }
.article-meta { margin-top: 20px; font-size: var(--t-sm); color: var(--ardosia); }
.article-cover { margin-block: 48px 0; }
.article-cover > div { overflow: hidden; border-radius: 2px; view-transition-class: media; }
.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-cta { margin-top: 64px; padding: 32px; background: var(--pedra); border-radius: 4px; }
.article-cta h2 { font-size: var(--t-lg); }
.article-cta p { margin: 10px 0 20px; color: var(--ardosia); }

/* sobre e contactos */
.about-lead { font-family: var(--serif); font-size: var(--t-lg); line-height: 1.35; font-variation-settings: "opsz" 36; max-width: 34ch; }
.about > p + p { margin-top: 20px; color: var(--ardosia); max-width: 58ch; }
.facts { margin: 40px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px; }
.facts dt { font-size: var(--t-sm); color: var(--pinho); }
.facts dd { margin: 4px 0 0; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.contact-item h2 { font-size: var(--t-lg); margin-bottom: 16px; }
.contact-item p + p { margin-top: 16px; }
.contact-item address { font-style: normal; color: var(--ardosia); }
.contact-big { font-family: var(--serif); font-size: var(--t-xl); text-decoration: none; color: var(--tinta); }

/* perguntas: a resposta abre a deslizar onde o navegador o permite */
.faq details { border-top: 1px solid var(--linha); }
.faq details:last-child { border-bottom: 1px solid var(--linha); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative; font-weight: 500; font-size: var(--t-md); line-height: 1.35; transition: color .3s var(--ease); }
.faq summary:hover { color: var(--pinho); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border-right: 1.5px solid var(--pinho); border-bottom: 1.5px solid var(--pinho); rotate: 45deg; transition: rotate .5s var(--spring), margin .5s var(--ease); }
.faq details[open] summary::after { rotate: -135deg; margin-top: -2px; }
.faq details p { padding: 0 40px 24px 0; color: var(--ardosia); max-width: 62ch; }
@supports selector(::details-content) {
  .faq details::details-content { block-size: 0; overflow: clip; transition: block-size .55s var(--ease), content-visibility .55s allow-discrete; }
  .faq details[open]::details-content { block-size: auto; }
}

/* triagem */
.triage { padding-top: var(--top); }
.triage h1 { font-size: var(--t-xl); line-height: 1.08; max-width: 14ch; }
.triage-grid { display: grid; grid-template-columns: 4fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.triage-aside { position: sticky; top: 120px; }
.progress-mark { width: 150px; margin-top: 48px; overflow: visible; }
.progress-mark polygon { fill: var(--salvia); fill-opacity: .1; stroke: var(--salvia); stroke-width: .8; stroke-opacity: .5; transform-origin: 50px 50px; transition: fill-opacity .5s var(--ease), stroke-opacity .5s var(--ease); }
.progress-mark polygon.is-done { fill-opacity: 1; stroke-opacity: 0; }
.progress-mark polygon.is-current { stroke: var(--luz); stroke-opacity: 1; }
.progress-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--t-sm); color: #8d9a96; }
.progress-list li { transition: color .4s var(--ease), translate .5s var(--ease); }
.progress-list li.is-current { color: var(--cal); translate: 6px 0; }
.progress-list li.is-done { color: var(--salvia); }

.triage-form { background: rgba(255, 255, 255, .03); border: 1px solid rgba(143, 174, 165, .2); border-radius: 6px; padding: clamp(24px, 4vw, 48px); }
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step-title { padding: 0; font-family: var(--serif); font-size: var(--t-lg); line-height: 1.2; font-variation-settings: "opsz" 36; margin-bottom: 24px; outline: none; }
.q { margin: 32px 0 14px; font-weight: 500; }
.options { display: grid; gap: 10px; }
.options-inline { display: flex; flex-wrap: wrap; gap: 10px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; min-height: 50px; padding: 12px 18px 12px 46px; border: 1px solid rgba(143, 174, 165, .35); border-radius: 4px; transition: border-color .25s var(--ease), background-color .25s var(--ease); position: relative; }
.opt span::before { content: ""; position: absolute; left: 16px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 1px solid var(--salvia); border-radius: 50%; transition: background-color .25s var(--ease), box-shadow .35s var(--spring); }
.opt input[type="checkbox"] + span::before { border-radius: 3px; }
.opt:hover span { border-color: var(--salvia); }
.opt input:checked + span { border-color: var(--luz); background: rgba(235, 203, 146, .08); }
.opt input:checked + span::before { background: var(--luz); border-color: var(--luz); box-shadow: inset 0 0 0 3px var(--noite); }
.opt input:focus-visible + span { outline: 2px solid var(--luz); outline-offset: 2px; }
.opt input:disabled + span { opacity: .4; cursor: not-allowed; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; font-size: var(--t-sm); }
.field-wide { margin-top: 24px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; font: inherit; font-size: var(--t-base); color: var(--cal);
  background: rgba(0, 0, 0, .18); border: 1px solid rgba(143, 174, 165, .35); border-radius: 4px; transition: border-color .25s var(--ease);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--salvia) 50%), linear-gradient(135deg, var(--salvia) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { color: var(--tinta); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--luz); outline: none; }
.field input[aria-invalid="true"] { border-color: #e69a8a; }
.consent { display: flex; gap: 12px; margin-top: 24px; font-size: var(--t-sm); color: #c4ceca; align-items: flex-start; }
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--luz); flex: none; }
.consent a { color: var(--luz); }
.hp { position: absolute; left: -9999px; }
.form-error { margin-top: 20px; color: #f0b5a8; font-size: var(--t-sm); }
.form-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; }
.form-nav [data-next], .form-nav [data-submit] { margin-left: auto; }

.result h2 { font-size: var(--t-xl); line-height: 1.1; max-width: 20ch; }
.result > p { margin-top: 18px; max-width: 52ch; color: #d6ddd9; font-size: var(--t-md); line-height: 1.5; }
.result:focus { outline: none; }
.summary { margin: 32px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; font-size: var(--t-sm); }
.summary dt { color: #8d9a96; }
.summary dd { margin: 0; }

/* fecho e rodapé */
.closing { position: relative; overflow: hidden; background: var(--pedra); }
.closing-inner { position: relative; }
.closing-inner > :not(.closing-mark) { position: relative; }
.closing-inner h2 { max-width: 22ch; }
.closing-mark { position: absolute; right: calc(-1 * var(--gutter)); top: 50%; width: clamp(240px, 34vw, 480px); height: auto; margin-top: calc(clamp(240px, 34vw, 480px) / -2); opacity: .1; --mark-dark: #45505e; animation: turn linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
@keyframes turn { from { rotate: -36deg; } to { rotate: 36deg; } }
.site-footer { background: var(--noite-2); color: #aab7b2; padding-block: 64px calc(40px + env(safe-area-inset-bottom, 0px)); font-size: var(--t-sm); }
.footer-grid { display: grid; grid-template-columns: 4fr 3fr 4fr; gap: 40px; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--cal); margin-bottom: 16px; }
.footer-brand .mark { width: 28px; height: 28px; --mark-dark: #d7dfdb; }
.site-footer address { font-style: normal; line-height: 1.7; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #cfd8d4; }
.copy { margin-top: 48px; color: #77857f; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer-langs { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.footer-langs a[aria-current] { color: var(--luz); text-decoration: none; }

/* revelações ao entrar no ecrã: o JS só começa depois de preparar o estado inicial.
   Se o script não correr, tudo aparece ao fim de 2,5 s. */
.motion [data-reveal]:not(.is-in) { opacity: 0; }
.motion:not(.ready) [data-reveal], .motion:not(.ready) .hero-title, .motion:not(.ready) [data-hero-in] { animation: reveal-fallback 0s 2.5s forwards; }
@keyframes reveal-fallback { to { opacity: 1; } }
.w { display: inline-block; overflow: clip; overflow-clip-margin: .1em; vertical-align: top; padding-bottom: .06em; margin-bottom: -.06em; }
.w > span { display: inline-block; }

/* a ilha acorda na primeira página da visita */
.motion.wake .island { clip-path: inset(0 calc(50% - 28px) round 28px); }
.motion.wake .island-bar > * { opacity: 0; }
.motion.wake:not(.ready) .island, .motion.wake:not(.ready) .island-bar > * { animation: wake-fallback 0s 2.5s forwards; }
@keyframes wake-fallback { to { clip-path: inset(0 round 28px); opacity: 1; } }

/* transições entre páginas (Chrome, Edge e Safari recentes; nos restantes a navegação é normal) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease-in) both; }
::view-transition-new(root) { animation: vt-in .7s var(--ease) .1s both; }
@keyframes vt-out { to { opacity: 0; translate: 0 -14px; } }
@keyframes vt-in { from { opacity: 0; translate: 0 32px; } }
::view-transition-group(island-glow), ::view-transition-group(filter-active) { animation-duration: .6s; animation-timing-function: var(--spring); }
::view-transition-group(*.media) { animation-duration: .8s; animation-timing-function: var(--ease); }
::view-transition-old(*.media), ::view-transition-new(*.media) { height: 100%; object-fit: cover; }
::view-transition-group(lightbox) { animation-duration: .55s; animation-timing-function: var(--ease); }

@media (max-width: 1080px) {
  .tec-grid, .creds-list { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .split, .method, .triage-grid, .service-detail, .obra-body, .contact-grid, .footer-grid { grid-template-columns: 1fr; }
  .split-head, .triage-aside, .facts-obra, .method-figure-sticky { position: static; }
  .method-figure { max-width: 180px; }
  .steps-large li { padding-block: 0; }
  .cards { grid-template-columns: 1fr; }
  .fields, .facts { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gallery-item:nth-child(3n + 1) { grid-column: auto; aspect-ratio: 3 / 2; }
  .triage-aside { display: grid; grid-template-columns: 1fr auto; gap: 0 20px; align-items: start; }
  .triage-aside .intro { grid-column: 1 / -1; }
  .progress-mark { width: 64px; margin-top: 6px; grid-column: 2; grid-row: 1; }
  .progress-list { display: none; }
  .post-nav a { max-width: none; }

  /* no telemóvel o filme passa para baixo do título, enquadrado na casa */
  .hero { min-height: 0; }
  .hero-media { position: relative; aspect-ratio: 4 / 3; margin: 24px calc(-1 * var(--gutter)) 0; }
  .hero-media::after { background: linear-gradient(180deg, var(--noite) 0%, rgba(31, 40, 48, 0) 25%); }
  /* a casa está em x 1109–1876 e y 489–917 do filme de 1920×1080: ocupa ~92% da largura da caixa */
  .hero-video { position: absolute; width: 231%; height: auto; max-width: none; left: -130%; top: -62%; }
  .hero-content { padding-block: 104px 40px; }
  .hero-scroll { display: none; }

  .dock { display: flex; }
  .site-footer { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
  .draft-bar { bottom: auto; top: calc(80px + env(safe-area-inset-top, 0px)); }
}

@media (max-width: 560px) {
  .tec-grid, .creds-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  .closing-mark, .hero-scroll span { animation: none; }
}
