/* ══ Sobre · "Um bocadinho do que faço" — os sites de verdade ═══════════
   Cada trabalho aparece como o site que é: moldura de browser com o
   domínio real, a captura de ecrã real do computador, o telemóvel por cima
   com a captura real do telemóvel e, a correr por cima da captura, a
   gravação real do site (muda, só quando o cartão está à vista ou debaixo
   do rato). Capturas e gravações tiradas dos sites ao vivo a 2026-09-21.

   Estrutura de um cartão:
     <article class="obra obra--destaque|obra--compacta" data-nome="…">
       <div class="obra-palco">
         <div class="obra-browser">
           <div class="obra-barra"> pontos · .obra-url · .obra-play </div>
           <a class="obra-ecra"> <img> <video class="obra-video"> </a>
         </div>
         <div class="obra-telemovel"><img></div>
       </div>
       <div class="obra-texto"> .obra-meta · h3/h4 · .obra-desc · .obra-acoes </div>
     </article>

   Rótulos de origem, três famílias com a mesma geometria:
     verde  = trabalho de cliente   (foi pedido)
     azul   = projeto da casa       (do próprio Jaime)
     âmbar  = maqueta não encomendada (a ressalva, como já era na página)
   Comportamento (tocar/pausar, modal "Espreitar aqui"): dadiva-obras.js. */

.obras {
  --obra-sombra: 0 18px 40px rgba(16, 41, 79, 0.14), 0 0 0 1px rgba(16, 41, 79, 0.09);
  --obra-barra: #f3efe3;
}

/* ── Grelhas ───────────────────────────────────────────────────────────── */
.obras-destaques {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 5vw, 72px) clamp(28px, 3.4vw, 48px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.obras-mais {
  margin-top: clamp(64px, 7vw, 104px);
  padding-top: clamp(36px, 4vw, 52px);
  border-top: 1px solid var(--line, #d9e4ee);
}
.obras-mais__cabeca {
  max-width: 640px;
  margin-bottom: clamp(26px, 3vw, 36px);
}
.inner-page .obras-mais__cabeca h3 {
  font-size: clamp(22px, 2.2vw, 28px);
  margin-bottom: 8px;
}
.obras-mais__cabeca p {
  margin: 0;
  font-size: 15.5px;
  color: var(--muted, #3c5470);
}
.obras-grelha {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 3.6vw, 48px) clamp(22px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.obras-grelha > li,
.obras-destaques > li {
  min-width: 0;
}

/* ── Cartão ────────────────────────────────────────────────────────────── */
.obra {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* O palco guarda espaço à direita e em baixo para o telemóvel poisar sobre
   o canto do browser sem sair do cartão (zero overflow horizontal). */
.obra-palco {
  position: relative;
  padding: 0 9% 7% 0;
}
.obra--compacta .obra-palco {
  padding: 0 8% 6% 0;
}

/* ── Moldura de browser ────────────────────────────────────────────────── */
.obra-browser {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--obra-sombra);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s;
}
.obra:hover .obra-browser {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px rgba(16, 41, 79, 0.18), 0 0 0 1px rgba(16, 41, 79, 0.1);
}
.obra-barra {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 6px 0 12px;
  background: var(--obra-barra);
  border-bottom: 1px solid rgba(16, 41, 79, 0.08);
}
.obra-pontos {
  display: flex;
  gap: 6px;
  flex: none;
}
/* Os três pontos nos tons tinta-e-papel da /mylo (terminal "A ligar o
   Telegram", page-mylo.css), não nos semáforos saturados do macOS. */
.obra-pontos i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e08a72;
}
.obra-pontos i:nth-child(2) { background: #dfbe62; }
.obra-pontos i:nth-child(3) { background: #79bd8e; }
.obra-url {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(16, 41, 79, 0.09);
  font: 600 12.5px/1 var(--sans, system-ui, sans-serif);
  color: #3c5470;
  white-space: nowrap;
  overflow: hidden;
}
.obra-url svg {
  flex: none;
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}
.obra-url span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botão da gravação: vive na barra, como um ícone da própria janela. */
.obra-play {
  position: relative;
  z-index: 1; /* o alvo alargado passa por cima do topo da captura */
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #10294f;
  cursor: pointer;
  transition: background 0.2s;
}
.obra-play[hidden] { display: none; }
/* 44x44 de alvo sem mudar o desenho: 14px para baixo (por cima do topo da
   captura, onde tocar também quer dizer "pausar/ver") e 7px de cada lado,
   porque a moldura (overflow:hidden) corta tudo o que passe do topo da barra. */
.obra-play::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -14px;
  left: -8px;
  right: -6px;
}
.obra-play:hover { background: rgba(16, 41, 79, 0.08); }
.obra-play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.obra-play .ico-pausa { display: none; }
.obra.is-playing .obra-play .ico-pausa { display: block; }
.obra.is-playing .obra-play .ico-tocar { display: none; }

/* ── Ecrã: captura real + gravação real por cima ───────────────────────── */
.obra-ecra {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0e1a2e;
}
/* Clicar na captura abre o site (atalho de rato; no teclado e no leitor
   de ecrã o caminho é o botão "Abrir o site", sem ligações repetidas). */
.obra-ecra[data-abre] { cursor: pointer; }
.obra-ecra img,
.obra-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.obra-video {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.obra.is-playing .obra-video { opacity: 1; }

/* ── Telemóvel ─────────────────────────────────────────────────────────── */
.obra-telemovel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22%;
  padding: 4px;
  border-radius: 18px;
  background: #13233d;
  box-shadow: 0 18px 36px rgba(16, 41, 79, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.obra:hover .obra-telemovel { transform: translateY(-6px) rotate(-1deg); }
.obra-telemovel::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 9px;
  left: 50%;
  width: 26%;
  height: 5px;
  margin-left: -13%;
  border-radius: 999px;
  background: #13233d;
}
.obra-telemovel img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 390 / 844;
  object-fit: cover;
  object-position: top center;
  border-radius: 14px;
  background: #0e1a2e;
}
.obra--compacta .obra-telemovel {
  width: 19%;
  padding: 3px;
  border-radius: 12px;
}
.obra--compacta .obra-telemovel img { border-radius: 9px; }
.obra--compacta .obra-telemovel::before { top: 6px; height: 3px; }

/* ── Texto ─────────────────────────────────────────────────────────────── */
.obra-texto {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-top: 18px;
}
/* No HTML o título vem primeiro (quem ouve o leitor de ecrã ouve o nome e
   depois o rótulo); à vista, o rótulo sobe para cima do título. */
.obra-meta {
  order: -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 10px;
}
.obra-rotulo {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font: 700 12.5px/1.4 var(--sans, system-ui, sans-serif);
  letter-spacing: 0.02em;
}
.obra-rotulo--cliente { color: #1f4d33; background: #eaf3e8; box-shadow: inset 0 0 0 1.5px #7da888; }
.obra-rotulo--casa    { color: #173a66; background: #e8f0fb; box-shadow: inset 0 0 0 1.5px #8eaedb; }
.obra-rotulo--maqueta { color: #5a4413; background: #fdf1c9; box-shadow: inset 0 0 0 1.5px #c9a53a; }
.obra-tipo {
  font: 800 11.5px/1 var(--sans, system-ui, sans-serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted, #3c5470);
}
.inner-page .obra h3,
.inner-page .obra h4 {
  margin: 0 0 8px;
  font-family: var(--sans, system-ui, sans-serif);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--green, #06482f);
  text-wrap: balance;
}
.inner-page .obra h3 { font-size: clamp(22px, 2vw, 26px); line-height: 1.2; }
.inner-page .obra h4 { font-size: 19px; line-height: 1.25; }
.inner-page .obra-desc {
  margin: 0 0 18px;
  max-width: 58ch;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted, #3c5470);
}
.inner-page .obra--compacta .obra-desc {
  font-size: 14.5px;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.obra-acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}
/* Ações por cartão a TINTA, como as fichas da /ferramentas: o azul cheio
   fica para um CTA por página. "Abrir o site ↗" é um link de texto (a ação
   que sai da página); "Espreitar aqui" uma pílula de contorno a tinta. */
.obra-acoes { align-items: center; gap: 6px 18px; }
.obra-abrir,
.obra-espreitar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font: 800 15px/1.2 var(--sans, system-ui, sans-serif);
  color: var(--navy, #10294f);
  text-decoration: none;
  cursor: pointer;
}
.obra-abrir {
  padding: 0 2px;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(16, 41, 79, 0.28);
  text-underline-offset: 5px;
  transition: text-decoration-color 0.2s;
}
.obra-abrir:hover { text-decoration-color: currentColor; }
.obra-abrir span[aria-hidden] { font-weight: 800; }
.obra-espreitar {
  padding: 0 18px;
  border: 1.5px solid rgba(16, 41, 79, 0.32);
  border-radius: 999px;
  background: transparent;
  transition: border-color 0.2s, background 0.2s;
}
.obra-espreitar:hover { border-color: var(--navy, #10294f); background: rgba(16, 41, 79, 0.05); }
.obra--compacta .obra-abrir,
.obra--compacta .obra-espreitar { font-size: 14px; }
.obra--compacta .obra-espreitar { min-height: 40px; padding: 0 14px; }
.obra--compacta .obra-espreitar::before { content: ""; position: absolute; inset: -2px 0; }
.obra--compacta .obra-espreitar { position: relative; }

/* ── Fecho da secção ───────────────────────────────────────────────────── */
.obras-todos {
  margin-top: clamp(44px, 5vw, 64px);
  text-align: center;
}

/* ── Modal "Espreitar aqui" ────────────────────────────────────────────── */
.obras-espreita {
  width: min(1280px, 94vw);
  height: min(860px, 90vh);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  color: #10294f;
  box-shadow: 0 30px 90px rgba(6, 18, 38, 0.45);
}
.obras-espreita[open] {
  display: flex;
  flex-direction: column;
}
.obras-espreita::backdrop {
  background: rgba(16, 41, 79, 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.espreita-barra {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  background: var(--obra-barra, #f3efe3);
  border-bottom: 1px solid rgba(16, 41, 79, 0.1);
}
.espreita-barra .obra-pontos { margin-right: 4px; }
.espreita-titulo {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(16, 41, 79, 0.1);
  font: 600 14px/1 var(--sans, system-ui, sans-serif);
  white-space: nowrap;
  overflow: hidden;
}
.espreita-titulo strong { font-weight: 800; color: var(--green, #06482f); }
.espreita-titulo .obra-rotulo {
  flex: none;
  padding: 3px 9px;
  font-size: 11.5px;
}
.espreita-titulo .obra-rotulo[hidden] { display: none; }
.espreita-titulo .espreita-dominio {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #3c5470;
}
.espreita-abrir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1.5px solid rgba(16, 41, 79, 0.32);
  border-radius: 999px;
  color: #10294f;
  font: 800 14px/1 var(--sans, system-ui, sans-serif);
  text-decoration: none;
  white-space: nowrap;
}
.espreita-abrir:hover { border-color: #10294f; background: rgba(16, 41, 79, 0.05); }
/* Faixa só do telemóvel: o rótulo de origem e o domínio, por baixo da barra. */
.espreita-origem { display: none; }
.espreita-fechar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #10294f;
  color: #fff;
  font: 700 14px/1 var(--sans, system-ui, sans-serif);
  cursor: pointer;
}
.espreita-fechar:hover { background: #1b3a69; }
.espreita-fechar svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.espreita-moldura {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #fffdf5;
}
.espreita-moldura iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  opacity: 0;
  transition: opacity 0.3s;
}
.espreita-moldura.is-pronto iframe { opacity: 1; }
.espreita-carregar {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font: 700 15px/1.4 var(--sans, system-ui, sans-serif);
  color: #3c5470;
}
.espreita-moldura.is-pronto .espreita-carregar { display: none; }
.espreita-sentinela {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}
html.obras-modal-aberto,
html.obras-modal-aberto body { overflow: hidden; }
/* Com a janela aberta a página fica sem barra de scroll mas guarda a goteira
   (scrollbar-gutter, mylo-companion.css). O ::backdrop não chega lá e ficava
   uma faixa de marfim à direita: pinta-se a goteira com a cor do véu. */
html.obras-modal-aberto { background: #6b7a8e; }
.espreita-curto { display: none; }

/* ── Tablet: destaques em linha (captura à esquerda, texto à direita) ──── */
@media (max-width: 1023px) {
  .obras-destaques {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .obra--destaque {
    display: grid;
    grid-template-columns: minmax(0, 56%) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
  }
  .obra--destaque .obra-texto { padding-top: 0; }
  .obras-grelha { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Telemóvel ─────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .obras-destaques { gap: 44px; }
  .obra--destaque {
    display: flex;
    gap: 0;
    /* o align-items:center do tablet centrava o palco e deixava-o crescer
       até à largura do domínio na barra (saía 10px do ecrã a 320px) */
    align-items: stretch;
  }
  .obra--destaque .obra-texto { padding-top: 16px; }
  .obra--destaque .obra-palco { padding: 0 10% 9% 0; }
  .obra--destaque .obra-telemovel { width: 25%; padding: 3px; border-radius: 13px; }
  .obra--destaque .obra-telemovel img { border-radius: 10px; }
  .obra--destaque .obra-telemovel::before { top: 6px; height: 3px; }
  .obra-barra { height: 30px; gap: 8px; padding-left: 10px; }
  .obra-pontos i { width: 8px; height: 8px; }
  .obra-pontos { gap: 5px; }
  .obra-url { height: 21px; font-size: 11.5px; padding: 0 8px; }
  .obra--destaque .obra-acoes { gap: 4px 16px; }

  /* Os restantes passam a lista: o rótulo de origem por cima, a toda a
     largura (numa coluna estreita "maqueta não encomendada" partia em duas
     linhas), e por baixo a miniatura à esquerda com o nome e as ações à
     direita. Sem telemóvel desenhado (ficava do tamanho de uma unha) e sem
     gravação — no telemóvel só toca a do destaque que estiver ao centro. */
  .obras-grelha {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .obra--compacta {
    display: grid;
    grid-template-columns: minmax(0, 45%) minmax(0, 1fr);
    grid-template-areas: "meta meta" "palco nome" "palco acoes";
    grid-template-rows: auto auto 1fr;
    gap: 0 14px;
    align-items: start;
  }
  .obra--compacta .obra-texto { display: contents; }
  .obra--compacta .obra-palco { grid-area: palco; }
  .obra--compacta .obra-meta { grid-area: meta; margin: 0 0 10px; }
  .inner-page .obra--compacta h4 { grid-area: nome; }
  .obra--compacta .obra-acoes { grid-area: acoes; margin-top: 0; }
  .obra--compacta .obra-palco { padding: 0; }
  .obra--compacta .obra-telemovel,
  .obra--compacta .obra-play,
  .obra--compacta .obra-url,
  .obra--compacta .obra-video,
  .inner-page .obra--compacta .obra-desc { display: none; }
  .obra--compacta .obra-browser { border-radius: 8px; }
  .obra--compacta .obra-barra { height: 16px; padding: 0 6px; }
  .obra--compacta .obra-pontos { gap: 3px; }
  .obra--compacta .obra-pontos i { width: 5px; height: 5px; }
  .obra--compacta .obra-meta { gap: 4px 10px; }
  .obra--compacta .obra-rotulo { font-size: 11.5px; padding: 3px 9px; }
  .obra--compacta .obra-tipo { font-size: 10.5px; }
  .inner-page .obra h4 { font-size: 17px; margin-bottom: 8px; }
  .obra--compacta .obra-acoes { flex-direction: column; align-items: flex-start; gap: 2px; }
  .obra--compacta .obra-abrir { min-height: 40px; font-size: 14px; }
  .obra--compacta .obra-espreitar { min-height: 40px; padding: 0 14px; font-size: 13.5px; }

  .obras-espreita {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
  .espreita-barra { gap: 8px; padding: 6px; }
  .espreita-barra .obra-pontos,
  .espreita-longo { display: none; }
  .espreita-curto { display: inline; }
  .espreita-titulo { height: 36px; padding: 0 10px; font-size: 13px; }
  /* Na barra só cabe o nome; o rótulo e o domínio descem para a faixa de
     baixo. O rótulo NUNCA se esconde: numa maqueta não encomendada é ele que
     diz que a empresa não pediu o site. */
  .espreita-titulo .espreita-dominio,
  .espreita-titulo .obra-rotulo { display: none; }
  .espreita-origem {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 6px 10px 7px;
    background: var(--obra-barra, #f3efe3);
    border-bottom: 1px solid rgba(16, 41, 79, 0.1);
    font: 600 12.5px/1.2 var(--sans, system-ui, sans-serif);
    color: #3c5470;
    white-space: nowrap;
  }
  .espreita-origem .obra-rotulo { flex: none; padding: 3px 9px; font-size: 11.5px; }
  .espreita-origem .obra-rotulo[hidden] { display: none; }
  .espreita-origem .espreita-dominio { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .espreita-abrir,
  .espreita-fechar { min-height: 44px; padding: 8px 12px; }
}

@media (max-width: 360px) {
  .obra--compacta { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); column-gap: 12px; }
  .obra--compacta .obra-rotulo { font-size: 11px; }
}

/* Sem animação para quem pediu menos movimento: a gravação não arranca
   sozinha (dadiva-obras.js) e os cartões não saltam. */
@media (prefers-reduced-motion: reduce) {
  .obra-browser,
  .obra-telemovel,
  .obra-video { transition: none; }
  .obra:hover .obra-browser,
  .obra:hover .obra-telemovel { transform: none; }
}
