/* Cloudkeep — folha de estilos principal. CSS puro, sem framework. */

:root {
  --ink: #14181C;
  --paper: #FAFAF8;
  --surface: #FFFFFF;
  --accent: #2451C4;
  --accent-dark: #1B3A94;
  --accent-on-dark: #7B9EEC;
  --muted: #5B6169;
  --border: #E4E2DC;
  --ink-bg: #14181C;
  --ink-fg: #F5F4F1;
  --ink-muted: #9CA3AC;

  /* Fundo alternado dos capítulos — azul Cloudkeep muito diluído.
     --muted mantém 5,57:1 sobre ele. */
  --tint: #EEF2FA;

  /* Cor de cada projecto: matiz da marca do cliente trazido à luminosidade do
     azul Cloudkeep (variante C, 2026-09-13). Todas ≥ 5:1 sobre --paper e
     --tint, por isso servem também para o número pequeno em mono. */
  --c-jfc: #516700;
  --c-crescer: #8B4A00;
  --c-cot: #006B6B;
  --c-shameless: #832836;
  --c-gec: #0060A3;
  --c-intranet: #344962;
  --c-casamento: #B3361A;

  /* Palcos escuros dos capítulos (2026-09-13): fundo = matiz do projecto a
     L 0,20 em OKLCH; cor clara = mesmo matiz a L ≈ 0,82, para texto e anéis.
     Medido: cor clara ≥ 9,3:1 sobre o fundo; #9CA3AC ≥ 7:1; #C9CED4 ≥ 11:1.
     Par vizinho mais próximo: GEC/Intranet, ΔE 8 (azul saturado vs ardósia). */
  --cl-jfc: #B4D26F;       --bg-jfc: #131906;
  --cl-crescer: #FFB572;   --bg-crescer: #221205;
  --cl-cot: #4DDCDC;       --bg-cot: #001B1B;
  --cl-shameless: #F99FB9; --bg-shameless: #240F11;
  --cl-gec: #88C3FE;       --bg-gec: #061727;
  --cl-intranet: #BBCCE1;  --bg-intranet: #12161B;
  --cl-casamento: #FFA383; --bg-casamento: #24100B;

  --focus-ring: var(--accent);

  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Public Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* Cresce com o monitor: 1220px até ~1490px de ecrã, depois 82% da largura,
     até 1680px. Os parágrafos continuam limitados por max-width em ch, por
     isso só as imagens e a grelha é que ganham espaço. A 84vw o índice lateral
     ficava a 15px do conteúdo a 1920 (medido); a 82vw fica a ~34px. */
  --wrap: clamp(1220px, 82vw, 1680px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }

html { color-scheme: light; overflow-x: clip; }
body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.on-dark {
  --focus-ring: var(--accent-on-dark);
  background: var(--ink-bg);
  color: var(--ink-fg);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Uma <table> ignora o width:1px e estica até ao conteúdo (medido: 523px a 390) */
table.visually-hidden { display: block; }

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; top: 0; }

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

/* Header — nav minimal, alinhado às margens, funde-se com o hero escuro */

.site-header {
  padding-block: 26px;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img { height: 22px; width: auto; display: block; }
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  text-decoration: none;
  font: 600 14px/1 var(--font-head);
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 11px 22px;
  white-space: nowrap;
  transition: background var(--ease-out) .22s, color var(--ease-out) .22s, border-color var(--ease-out) .22s;
}
.header-cta:hover {
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-dark);
}

/* ─────────────────────────────────────────────────────────────
   Homepage
   ───────────────────────────────────────────────────────────── */

/* Hero — o logótipo é o elemento dominante; a frase fica por baixo, menor */

.hero {
  position: relative;
  display: flex;
  min-height: min(calc(100svh - 94px), 920px);
  padding-block: clamp(40px, 7vw, 96px) 28px;
  overflow: hidden;
}
.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(56px, 9vw, 120px);
  width: 100%;
}
.hero__brand {
  position: relative;
  z-index: 1;
  width: min(52%, 660px);
  margin-block: auto;
}
.hero__logo { margin: 0; line-height: 0; }
.hero__logo img {
  width: clamp(260px, 42vw, 650px);
  height: auto;
  /* o lockup tem folga à esquerda do K; compensa para alinhar à margem */
  margin-inline-start: -1.1%;
}
.hero__descriptor {
  font: 700 clamp(12px, .5vw + 10px, 15px)/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  margin: clamp(22px, 3vw, 36px) 0 0;
}
.hero__claim {
  font: 500 clamp(1.25rem, 1.3vw + .85rem, 1.95rem)/1.3 var(--font-head);
  letter-spacing: -.01em;
  color: var(--ink-fg);
  max-width: 30ch;
  margin: clamp(14px, 2vw, 22px) 0 0;
}
.hero__sub {
  font: 400 clamp(1rem, .3vw + .9rem, 1.15rem)/1.55 var(--font-body);
  color: var(--ink-muted);
  max-width: 54ch;
  margin: clamp(12px, 1.6vw, 18px) 0 0;
}
.hero__visual {
  position: absolute;
  top: 50%;
  right: 0;
  width: min(72vw, 1120px);
  margin: 0;
  transform: translateY(-48%);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, .18) 22%, #000 42%);
          mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, .18) 22%, #000 42%);
}
.hero__visual img {
  width: 100%;
  height: auto;
}
.hero__foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 36px;
  padding-top: 22px;
  border-top: 1px solid #262B32;
}
.hero__manifesto {
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  text-decoration: none;
}
.hero__manifesto:hover { color: var(--ink-fg); }
.hero__author {
  font: 400 13px/1.3 var(--font-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0;
}
.avail {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 500 14px/1 var(--font-body);
  margin: 0;
}
.avail__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-on-dark);
  flex-shrink: 0;
}
.hero__scroll {
  margin-inline-start: auto;
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-decoration: none;
}
.hero__scroll:hover { color: var(--ink-fg); }

@media (prefers-reduced-motion: no-preference) {
  .hero__logo,
  .hero__descriptor,
  .hero__claim,
  .hero__foot { animation: rise .9s var(--ease-out) both; }
  .hero__descriptor { animation-delay: .18s; }
  .hero__claim { animation-delay: .3s; }
  .hero__foot { animation-delay: .5s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 960px) {
  .hero { min-height: auto; }
  .hero__inner { gap: clamp(30px, 7vw, 52px); }
  .hero__brand { width: 100%; margin-block: 0; }
  .hero__logo img { width: clamp(260px, 72vw, 506px); }
  .hero__visual {
    position: relative;
    top: auto;
    right: auto;
    order: 1;
    width: calc(100% + clamp(40px, 8vw, 96px));
    aspect-ratio: 4 / 3;
    margin-inline: calc(clamp(20px, 4vw, 48px) * -1);
    overflow: hidden;
    transform: none;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .hero__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
  }
  .hero__foot { order: 2; }
}

/* Ticker */

.ticker {
  background: var(--accent);
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  padding-block: 15px;
}
.ticker__track {
  display: inline-flex;
  width: max-content;
}
.ticker__track span {
  font: 700 15px/1 var(--font-head);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-inline: 22px;
  display: inline-flex;
  align-items: center;
  gap: 22px;
  flex-shrink: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .ticker__track { animation: ticker 26s linear infinite; }
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Hook — ponte entre o ticker e o manifesto, uma só frase provocadora */

.hook { padding-block: clamp(44px, 6vw, 76px); border-bottom: 1px solid var(--border); }
.hook__quote {
  font: 500 clamp(1.4rem, 2vw + .9rem, 2.35rem)/1.28 var(--font-head);
  letter-spacing: -.015em;
  max-width: 27ch;
  margin: 0;
}

/* Citação-destaque reutilizável, dentro de blocos claros ou escuros */

.pull-quote {
  font: 500 clamp(1.15rem, 1vw + .8rem, 1.5rem)/1.4 var(--font-head);
  letter-spacing: -.01em;
  max-width: 30ch;
  margin: 10px 0 0;
}

/* Manifesto — tipográfico; mobile e desempenho em destaque */

.manifesto { padding-block: clamp(88px, 12vw, 168px) clamp(48px, 6vw, 80px); }
.manifesto__head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px clamp(32px, 6vw, 96px);
  margin-bottom: clamp(64px, 9vw, 120px);
}
.manifesto__title {
  font-size: clamp(3rem, 7.4vw + .5rem, 7.25rem);
  line-height: .9;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.manifesto__title span { display: block; }
.manifesto__title span:last-child { color: var(--accent); }
.manifesto__lede {
  font: 500 clamp(1.1rem, 1vw + .75rem, 1.45rem)/1.4 var(--font-head);
  letter-spacing: -.005em;
  max-width: 28ch;
  margin: 0;
}

.pillars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 64px) clamp(32px, 6vw, 96px);
}
.pillar { border-top: 2px solid var(--ink); padding-top: 26px; }
.pillar--cta { display: flex; flex-direction: column; }
.pillar__num {
  display: block;
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 14px;
}
.pillar__title {
  font-size: clamp(1.15rem, 1vw + .8rem, 1.5rem);
  letter-spacing: -.01em;
  margin: 0 0 14px;
}
.pillar p { color: var(--muted); max-width: 52ch; margin: 0 0 14px; }
.pillar p:last-child { margin-bottom: 0; }
.pillar .pillar__stat {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  color: var(--ink);
  margin: 6px 0 22px;
}
.pillar__stat strong {
  font: 700 clamp(3.5rem, 5vw + 1.5rem, 6rem)/.82 var(--font-head);
  letter-spacing: -.05em;
  color: var(--accent);
  flex-shrink: 0;
}
.pillar__stat span {
  font: 500 15.5px/1.35 var(--font-head);
  max-width: 26ch;
  padding-bottom: 2px;
}
.pillar .pillar__source {
  font: 400 12px/1.4 var(--font-mono);
  color: var(--muted);
  margin-top: 16px;
}
.pillar__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
  padding-top: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--border);
}
.pillar__action p {
  color: var(--ink);
  font: 600 clamp(1.15rem, 1vw + .8rem, 1.5rem)/1.3 var(--font-head);
  letter-spacing: -.01em;
  max-width: 18ch;
  margin: 0;
}
.pillar__action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 600 15px/1.2 var(--font-head);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ease-out) .22s, transform var(--ease-out) .22s;
}
.pillar__action-link:hover { background: var(--accent-dark); }
@media (prefers-reduced-motion: no-preference) {
  .pillar__action-link:hover { transform: translateY(-2px); }
}
@media (max-width: 600px) {
  .pillar__action { align-items: stretch; flex-direction: column; gap: 20px; }
  .pillar__action-link { width: 100%; white-space: normal; text-align: center; }
}

/* Tendência mobile em Portugal — série única: sem legenda (o texto nomeia-a),
   barras finas com topo arredondado assentes na base, rótulo só no primeiro e
   no último valor, texto em tinta e não na cor da série. Tabela para leitores
   de ecrã no HTML. A escala vai a 45% para as barras usarem a altura. */
.trend { margin: 26px 0 0; }
.trend__caption {
  font: 500 15.5px/1.4 var(--font-head);
  color: var(--ink);
  max-width: 40ch;
  margin: 0 0 18px;
}
.trend__plot {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(6px, 1.2vw, 14px);
  align-items: end;
  height: 132px;
  padding-top: 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--muted);
}
.trend__bar {
  position: relative;
  height: calc(var(--v) / 45 * 100%);
  background: var(--accent);
  border-radius: 4px 4px 0 0;
}
/* 2026 é média de oito meses — tracejado marca o valor provisório */
.trend__bar--partial {
  background: repeating-linear-gradient(135deg, var(--accent) 0 4px, #8FA8E6 4px 7px);
}
.trend__bar::after {
  content: attr(data-y);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  font: 400 11px/1 var(--font-mono);
  color: var(--muted);
  white-space: nowrap;
}
.trend__label,
.trend__bar:not(:has(.trend__label)):hover::before {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  font: 600 13px/1 var(--font-head);
  color: var(--ink);
  white-space: nowrap;
}
.trend__bar:not(:has(.trend__label)):hover::before { content: attr(data-v); }

@media (max-width: 820px) {
  .manifesto__head,
  .pillars { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .pillar .pillar__stat { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* Introdução ao portefólio */

.work__intro {
  background: var(--paper);
  padding-block: clamp(40px, 4vw, 56px) clamp(64px, 8vw, 112px);
}
.work__intro-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: end;
  gap: 28px clamp(32px, 6vw, 96px);
}
/* Filete como item da grelha, para acabar na margem do texto e não no padding */
.work__intro-inner::before {
  content: '';
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border);
  margin-bottom: clamp(20px, 4vw, 52px);
}
.work__title {
  font-size: clamp(2.6rem, 6vw + .5rem, 6rem);
  line-height: .92;
  letter-spacing: -.04em;
  text-transform: uppercase;
}
.work__title span { display: block; }
.work__lede {
  font: 500 clamp(1.05rem, .8vw + .8rem, 1.3rem)/1.4 var(--font-head);
  max-width: 30ch;
  margin: 0;
}
.work__count {
  display: block;
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.work__note {
  margin-top: clamp(28px, 4vw, 44px);
  max-width: 46ch;
}
.work__note p { margin: 0; color: var(--muted); }
.work__note .pull-quote { color: var(--ink); }
@media (max-width: 820px) {
  .work__intro-inner { grid-template-columns: 1fr; }
}

/* Capítulos — palco escuro na cor do projecto, um ecrã cada.
   A composição (captura desktop + telemóvel) é dimensionada pela altura do
   ecrã, para caber inteira; em monitores grandes cresce até ~1330px. */

.chapter {
  --focus-ring: var(--c-light);
  background: var(--bg);
  color: var(--ink-fg);
}
.chapter__stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding-block: clamp(56px, 9vh, 104px);
}
.chapter__frame {
  /* altura útil ≈ ecrã − cabeçalho − rodapé do capítulo; a composição mede
     1,2888 × 0,625 (desktop 8:5 + coluna do telemóvel) */
  --h: calc(100svh - 330px);
  width: min(100%, calc(max(var(--h), 320px) / .625 * 1.2888 + 16px));
}
.chapter__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
  margin-bottom: clamp(16px, 2.4vh, 28px);
}

.chapter__num {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 700 14px/1 var(--font-mono);
  letter-spacing: .06em;
  color: var(--c-light);
  margin-bottom: 12px;
}
.chapter__num::after {
  content: '';
  width: 48px;
  height: 2px;
  background: var(--c-light);
}
.chapter__name {
  font-size: clamp(2rem, 3.6vw + .6rem, 5rem);
  line-height: .94;
  letter-spacing: -.04em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--c-light);
  margin: 0;
}
.chapter__name a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat;
  transition: background-size .35s var(--ease-out);
}
.chapter__name a:hover,
.chapter__name a:focus-visible { background-size: 100% 3px; }

.chapter__meta {
  font: 400 12.5px/1.5 var(--font-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: right;
  max-width: 32ch;
  margin: 0;
}
.chapter__foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 40px;
  margin-top: clamp(16px, 2.4vh, 26px);
}
.chapter__desc {
  font-size: 16px;
  line-height: 1.6;
  color: #C9CED4;
  max-width: 58ch;
  margin: 0;
}
.chapter__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 15px/1 var(--font-head);
  text-decoration: none;
  color: var(--ink-fg);
  border-bottom: 2px solid var(--c-light);
  padding-bottom: 5px;
  transition: gap .2s var(--ease-out);
}
.chapter__cta:hover { gap: 13px; }

/* Imagens: desktop + telemóvel. A coluna do telemóvel mede 0,2888 da desktop
   (844/390 × 10/16), por isso as duas ficam exactamente com a mesma altura.
   Cada imagem vem em duas camadas iguais (.base e .color, o mesmo ficheiro,
   um só pedido): a de cima é revelada pela onda. */

.media {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .2888fr);
  gap: clamp(10px, 1.2vw, 18px);
  align-items: start;
}
.chapter--reverse .media { grid-template-columns: minmax(0, .2888fr) minmax(0, 1fr); }
.chapter--reverse .media__phone { order: -1; }

.media__desktop,
.media__phone {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0C0F12;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
}
.media__desktop {
  aspect-ratio: 8 / 5;
  border-radius: 10px;
}
.media__desktop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}
.media__phone {
  aspect-ratio: 390 / 844;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: clamp(18px, 1.8vw, 28px);
  font: inherit;
  cursor: zoom-in;
  box-shadow:
    0 0 0 clamp(4px, .45vw, 7px) #080B0E,
    0 0 0 clamp(5px, .55vw, 8px) rgba(245, 244, 241, .22),
    0 30px 80px -30px rgba(0, 0, 0, .8);
}
.media__phone img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  transform: translate3d(0, var(--slide, 0px), 0);
  transition: transform var(--slide-time, .6s) var(--ease-in-out);
}
/* A cápsula superior e o aro transformam a captura numa moldura de
   telemóvel reconhecível, sem alterar nem recortar o conteúdo do projecto. */
.media__phone::before,
.cs-shot--phone::before {
  content: '';
  position: absolute;
  top: clamp(5px, .55vw, 9px);
  left: 50%;
  z-index: 4;
  width: clamp(26px, 4vw, 58px);
  height: clamp(4px, .45vw, 7px);
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
  background: #080B0E;
  box-shadow: none;
  opacity: 1;
  pointer-events: none;
}
/* Indicação permanente de ampliar — não depende de hover */
.media__phone::after {
  content: '';
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  z-index: 4;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F5F4F1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center / 13px no-repeat;
  box-shadow: 0 0 0 1px rgba(245, 244, 241, .35), 0 2px 8px rgba(0, 0, 0, .4);
}

@media (max-width: 760px) {
  .chapter__stage { min-height: auto; padding-block: 72px; }
  .chapter__frame { width: 100%; }
  .chapter__head,
  .chapter__foot { display: block; }
  .chapter__meta { text-align: left; margin-top: 12px; }
  .chapter__desc { margin-bottom: 16px; }
}

/* Intranet — ilustração esquemática, sem capturas nem dados reais.
   Duas cópias da ilustração, como as capturas, para a onda a acender. */

/* a ilustração não tem telemóvel: uma coluna só, mesmo nos capítulos invertidos */
.media--mock,
.chapter--reverse .media--mock { grid-template-columns: 1fr; }
.media__mock { aspect-ratio: 16 / 7; }
.mock {
  position: absolute;
  inset: 0;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (max-width: 600px) { .media__mock { aspect-ratio: 4 / 3; } }
.mock__bar {
  display: flex;
  gap: 6px;
  padding: 12px 14px;
  background: var(--c);
}
.mock__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.mock__body { flex: 1; display: grid; grid-template-columns: 18% 1fr; }
.mock__side { background: #F1F3F6; padding: 7% 12%; display: flex; flex-direction: column; gap: 12%; }
.mock__side b { height: 8px; border-radius: 4px; background: #D9DEE6; }
.mock__side b:first-child { background: var(--c); opacity: .55; }
.mock__main { padding: 4% 5%; display: flex; flex-direction: column; gap: 9%; }
.mock__title { width: 32%; height: 14px; border-radius: 4px; background: #D9DEE6; }
.mock__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4%; flex: 1; }
.mock__cards div { border-radius: 6px; border: 1px solid #E3E7ED; background: linear-gradient(var(--c), var(--c)) 12% 22% / 30% 6px no-repeat, linear-gradient(#E3E7ED, #E3E7ED) 12% 55% / 70% 6px no-repeat, linear-gradient(#E3E7ED, #E3E7ED) 12% 72% / 50% 6px no-repeat; }
.mock__cards div:nth-child(2) { --c: #7B8BA3; }
.mock__cards div:nth-child(3) { --c: #A3AFC0; }
.mock__rows { display: flex; flex-direction: column; gap: 10px; }
.mock__rows b { height: 7px; border-radius: 4px; background: #EDF0F4; }
.mock__rows b:nth-child(2) { width: 80%; }
.mock__rows b:nth-child(3) { width: 60%; }
/* O efeito — imagem apagada que acende em onda a partir do nó do logótipo.
   Só existe com .fx (JS a correr e sem movimento reduzido): sem isso as
   imagens estão a cores, o texto visível e não há nó.
   Disparo e linha do tempo em js/main.js; aqui só se lêem as variáveis:
   --r raio da onda · --x/--y origem · --ring luz da frente · --flash clarão
   --tp título a ganhar cor · --info descrição e ligação · --ns/--no nó · --ps/--po impulsos */

.node,
.pulse { display: none; }

.fx .chapter.is-armed:not(.is-lit) .base {
  filter: grayscale(1) brightness(.5) contrast(1.05) blur(1.5px);
  transform: scale(1.01);
}
.fx .chapter.is-armed:not(.is-lit) .color {
  filter: brightness(var(--flash, 1)) saturate(1.12);
  -webkit-mask-image: radial-gradient(circle at var(--x, 0) var(--y, 0), #000 calc(var(--r, 0px) - 90px), transparent var(--r, 0px));
          mask-image: radial-gradient(circle at var(--x, 0) var(--y, 0), #000 calc(var(--r, 0px) - 90px), transparent var(--r, 0px));
}
/* frente da onda: anel na cor clara do projecto + luz branca */
.fx .chapter.is-armed:not(.is-lit) .media__desktop::before,
.fx .chapter.is-armed:not(.is-lit) .media__phone::before {
  content: '';
  position: absolute;
  left: var(--x, 0);
  top: var(--y, 0);
  z-index: 3;
  width: max(0px, calc(var(--r, 0px) * 2 - 90px));
  height: max(0px, calc(var(--r, 0px) * 2 - 90px));
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 4px solid var(--c-light);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, .14), 0 0 60px 18px rgba(255, 255, 255, .22), inset 0 0 60px 10px rgba(255, 255, 255, .18);
  opacity: var(--ring, 0);
  pointer-events: none;
}
.fx .chapter__name { color: color-mix(in oklab, var(--ink-muted) calc((1 - var(--tp, 1)) * 100%), var(--c-light)); }
.fx .chapter__meta,
.fx .chapter__foot {
  opacity: var(--info, 1);
  transform: translateY(calc((1 - var(--info, 1)) * 14px));
}

.fx .is-armed .node {
  display: block;
  position: absolute;
  left: var(--nx, 30%);
  top: var(--ny, 36%);
  z-index: 5;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border-radius: 50%;
  background: var(--paper);
  border: 6px solid var(--c);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  transform: scale(var(--ns, 0));
  opacity: var(--no, 0);
  pointer-events: none;
}
.fx .node::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--c); }
.fx .is-armed .pulse {
  display: block;
  position: absolute;
  left: var(--x, 0);
  top: var(--y, 0);
  z-index: 4;
  width: 76px;
  height: 76px;
  margin: -38px 0 0 -38px;
  border-radius: 50%;
  border: 3px solid var(--c-light);
  opacity: var(--po, 0);
  transform: scale(var(--ps, 1));
  pointer-events: none;
}
/* Só com .is-armed (posto pelo main.js): se o script falhar, nada fica apagado */
.fx .is-armed .pulse--2 { opacity: var(--po2, 0); transform: scale(var(--ps2, 1)); }
.fx .chapter.is-lit .node,
.fx .chapter.is-lit .pulse { display: none; }

@media (max-width: 760px) {
  .fx .is-armed .node,
  .fx .is-armed .pulse { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .fx .is-armed .node { border-width: 4px; }
  .fx .node::before { inset: 6px; }
  .fx .is-armed .pulse { border-width: 2px; }
}

/* Índice persistente — só visível durante o portefólio */

.work { position: relative; }
.work-index,
.work-counter {
  position: fixed;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease-out), visibility 0s linear .35s;
}
.in-work .work-index,
.in-work .work-counter {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s var(--ease-out), visibility 0s;
}

.work-index { right: 14px; top: 50%; transform: translateY(-50%); display: none; }
.work-index ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.work-index a {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 5px 4px;
  font: 400 12px/1 var(--font-mono);
  letter-spacing: .03em;
  color: var(--ink-muted);
  text-decoration: none;
}
.work-index__name { order: 1; }
.work-index__num { order: 2; }
.work-index a::after {
  content: '';
  order: 3;
  width: 22px;
  height: 2px;
  background: currentColor;
  transform: scaleX(.364);
  transform-origin: right center;
  transition: transform .3s var(--ease-out);
}
/* o índice só aparece sobre os palcos escuros dos capítulos */
.work-index a:hover { color: var(--ink-fg); }
.work-index a[aria-current] { color: var(--c-light); font-weight: 700; }
.work-index a[aria-current]::after { transform: scaleX(1); }

/* Entre 1300 e 1560 só cabem os números; o nome fica para leitores de ecrã. */
@media (min-width: 1300px) {
  .work-index { display: block; }
  /* especificidade extra: a regra-base da .work-counter vem mais abaixo */
  html .work-counter { display: none; }
  .work-index .work-index__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 1560px) {
  .work-index { right: 24px; }
  .work-index .work-index__name { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

.work-counter {
  left: 16px;
  bottom: 16px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-fg);
  font: 400 12px/1 var(--font-mono);
  letter-spacing: .03em;
  box-shadow: 0 4px 16px rgba(20, 24, 28, .25);
}
.work-counter::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c, var(--accent-on-dark));
  box-shadow: 0 0 0 2px var(--ink-fg);
  transition: background .3s var(--ease-out);
}
.work-counter__n { font-weight: 700; }
.work-counter__name { color: var(--ink-muted); }

/* Visualizador da captura mobile em página inteira */

.viewer {
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--ink-bg);
  color: var(--ink-fg);
  --focus-ring: var(--accent-on-dark);
  overflow: hidden;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgba(20, 24, 28, .82); }
.viewer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 12px 12px 18px;
}
.viewer__title { margin: 0; font: 600 15px/1.3 var(--font-head); }
.viewer__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink-muted);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-fg);
  font: 600 14px/1 var(--font-head);
  cursor: pointer;
}
.viewer__close:hover { background: var(--ink-fg); color: var(--ink-bg); }
.viewer__close span { font-size: 20px; line-height: 0; }
.viewer__scroll { overflow-y: auto; overscroll-behavior: contain; background: var(--paper); }
.viewer__img { width: 100%; height: auto; }

@media (prefers-reduced-motion: no-preference) {
  .viewer[open] { animation: rise .35s var(--ease-out); }
}

/* Processo — fio com nós (o nó do logótipo) que se desenha com o scroll.
   Estado por omissão = tudo aceso; o JS só apaga o que ainda não foi alcançado
   quando consegue acompanhar o scroll (.process-js). */

.process {
  padding-block: clamp(96px, 12vw, 168px) clamp(80px, 10vw, 136px);
  border-bottom: 1px solid #262B32;
}
.process__head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  gap: 28px clamp(32px, 6vw, 96px);
}
.process__title {
  font-size: clamp(2.6rem, 5.4vw + .5rem, 5.5rem);
  line-height: .94;
  letter-spacing: -.04em;
  text-transform: uppercase;
  text-wrap: balance;
}
.process__lede-group { display: grid; gap: 14px; }
.process__lede {
  font: 500 clamp(1.05rem, .8vw + .8rem, 1.3rem)/1.45 var(--font-head);
  color: var(--ink-fg);
  max-width: 34ch;
  margin: 0;
}
.process__note {
  font: 400 15.5px/1.55 var(--font-body);
  color: var(--ink-muted);
  max-width: 38ch;
  margin: 0;
}

.process__flow { position: relative; margin-top: clamp(64px, 8vw, 112px); }
.process__track {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 2px;
  background: #2E353E;
}
.process__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent-on-dark);
  transform-origin: left center;
  transform: scaleX(var(--p, 1));
}
.process__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
}
.step { position: relative; padding-top: 48px; }
.step__node {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-bg);
  border: 2px solid var(--accent-on-dark);
  transition: border-color .4s var(--ease-out);
}
.step__node::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--accent-on-dark);
  transition: transform .45s var(--ease-out);
}
.step__num {
  display: block;
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .06em;
  color: var(--accent-on-dark);
  margin-bottom: 12px;
}
.step__title {
  font-size: clamp(1.25rem, .9vw + .95rem, 1.6rem);
  letter-spacing: -.015em;
  margin: 0 0 12px;
  transition: color .4s var(--ease-out);
}
.step__lead {
  font: 500 16px/1.45 var(--font-head);
  color: var(--ink-fg);
  margin: 0 0 10px;
}
.step p:not(.step__lead) {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0;
}
.process-js .step:not(.is-reached) .step__node { border-color: #3A424C; }
.process-js .step:not(.is-reached) .step__node::after { transform: scale(0); }
.process-js .step:not(.is-reached) .step__title { color: var(--ink-muted); }

.process__quotes {
  display: grid;
  gap: clamp(14px, 2vw, 20px);
  max-width: 50ch;
  margin: clamp(64px, 8vw, 104px) 0 0;
}
.process__quotes p {
  font: 500 clamp(1.1rem, 1vw + .75rem, 1.4rem)/1.4 var(--font-head);
  color: var(--ink-fg);
  margin: 0;
}
.process__quotes-big {
  font: 500 clamp(1.5rem, 2vw + 1rem, 2.5rem)/1.25 var(--font-head) !important;
  letter-spacing: -.015em;
  color: var(--accent-on-dark) !important;
  margin-top: 10px !important;
}

.process__close {
  font: 700 clamp(2rem, 3.6vw + 1rem, 4rem)/1 var(--font-head);
  letter-spacing: -.035em;
  margin: clamp(56px, 7vw, 96px) 0 0;
}

@media (max-width: 900px) {
  .process__head { grid-template-columns: 1fr; }
  .process__steps { grid-template-columns: 1fr; gap: 44px; }
  .process__track { top: 0; bottom: 0; left: 10px; right: auto; width: 2px; height: auto; }
  .process__fill { transform-origin: center top; transform: scaleY(var(--p, 1)); }
  .step { padding-top: 0; padding-left: 48px; }
  .step__node { top: 0; }
}

/* Footer — frase de fecho grande */

.site-footer { padding-block: clamp(72px, 9vw, 120px) 44px; }
.site-footer__quote {
  font: 500 clamp(1.05rem, .8vw + .8rem, 1.3rem)/1.4 var(--font-head);
  color: var(--ink-muted);
  max-width: 34ch;
  margin: 0 0 clamp(18px, 2.4vw, 28px);
}
.site-footer__statement {
  font-size: clamp(2rem, 4vw + 1rem, 3.6rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  max-width: 16ch;
  margin: 0 0 32px;
}
.site-footer__statement a {
  text-decoration: none;
  border-bottom: 3px solid var(--accent-on-dark);
}
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px clamp(28px, 4vw, 56px);
}
.contact-list a {
  font: 500 clamp(1.2rem, 1.4vw + .75rem, 1.85rem)/1.2 var(--font-head);
  letter-spacing: -.01em;
  color: var(--ink-fg);
  text-decoration: none;
  border-bottom: 2px solid var(--accent-on-dark);
  padding-bottom: 3px;
  transition: color .2s var(--ease-out), border-color .2s var(--ease-out);
}
.contact-list a:hover { color: var(--accent-on-dark); }

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  padding-top: 32px;
  border-top: 1px solid #262B32;
  margin-top: clamp(48px, 6vw, 80px);
}
.site-footer__logo { height: 20px; width: auto; }
.site-footer__contact a {
  color: var(--ink-fg);
  text-decoration: underline;
  text-decoration-color: var(--accent-dark);
  text-underline-offset: 3px;
}
.site-footer__legal {
  display: flex;
  gap: 20px;
  font-size: 14px;
  margin-inline-start: auto;
}
.site-footer__legal a { color: var(--ink-muted); text-decoration: none; }
.site-footer__legal a:hover { color: var(--ink-fg); }
.site-footer__credit {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 18px 0 0;
}

/* WhatsApp flutuante — padrão do Centro Óptico da Torre, com os mesmos valores
   medidos: texto em tinta e não em branco (branco sobre #25D366 dá 1,98:1) e
   bordo #0C6B33 para o controlo ter 3:1 contra a página (WCAG 1.4.11).
   - até 1299px: pastilha com etiqueta no canto inferior direito;
   - a partir de 1300px: só o ícone, a meio da altura, logo abaixo do índice
     dos projectos (que vive no mesmo bordo, centrado a 50%). 178px é a altura
     medida do índice com 7 linhas (22px cada + 4px de gap); 40px de folga
     chega ao topo do botão sem tocar no último número.
     A etiqueta abre em hover e em foco. O foco leva anel branco + tinta para
     se ver no papel e nas bandas escuras. */
.wa-float {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 54px;
  padding: 0 20px 0 16px;
  border: 2px solid #0C6B33;
  border-radius: 999px;
  background: #25D366;
  color: var(--ink);
  font: 700 16px/1 var(--font-head);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22), 0 2px 6px rgba(0, 0, 0, .14);
  transition: background .2s var(--ease-out), transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.wa-float__icon { flex: none; width: 24px; height: 24px; }
.wa-float:hover,
.wa-float:focus-visible {
  background: #1FBF5B;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .26), 0 3px 8px rgba(0, 0, 0, .16);
}
.wa-float:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 7px var(--ink);
}
@media (prefers-reduced-motion: no-preference) {
  .wa-float:hover,
  .wa-float:focus-visible { transform: translateY(-2px); }
}
@media (min-width: 769px) and (max-width: 1299.98px) {
  .wa-float { right: 22px; bottom: 22px; height: 50px; font-size: 15px; }
  .wa-float__icon { width: 22px; height: 22px; }
}
@media (min-width: 1300px) {
  .wa-float {
    right: 14px;
    bottom: auto;
    top: calc(50% + 89px + 40px);
    padding: 0 14px;
    gap: 0;
  }
  .wa-float__label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
  }
  .wa-float:hover .wa-float__label,
  .wa-float:focus-visible .wa-float__label {
    max-width: 110px;
    margin-left: 9px;
    opacity: 1;
    transform: none;
  }
}
@media (min-width: 1560px) {
  .wa-float { right: 24px; }
}
/* No telemóvel e tablet a pastilha taparia o crédito do rodapé */
@media (max-width: 1299.98px) {
  .site-footer { padding-bottom: 104px; }
}

/* ─────────────────────────────────────────────────────────────
   Páginas de documento — manifesto, privacidade, acessibilidade
   ───────────────────────────────────────────────────────────── */

.doc-hero { padding-block: clamp(64px, 9vw, 120px) clamp(48px, 6vw, 80px); }
.doc-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(20px, 3vw, 36px);
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  text-decoration: none;
}
.doc-back:hover { color: var(--ink-fg); }
.doc-hero__label {
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  margin: 0 0 16px;
}
.doc-hero__title {
  font-size: clamp(2.4rem, 5vw + .5rem, 5rem);
  line-height: .95;
  letter-spacing: -.04em;
  text-transform: uppercase;
  max-width: 16ch;
  margin: 0 0 clamp(20px, 3vw, 32px);
}
.doc-hero__lede {
  font: 500 clamp(1.05rem, .8vw + .8rem, 1.35rem)/1.45 var(--font-head);
  color: var(--ink-fg);
  max-width: 46ch;
  margin: 0;
}

.doc-body { padding-block: clamp(64px, 8vw, 112px); }
.doc-body__grid {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.doc-nav { position: sticky; top: 32px; }
.doc-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.doc-nav a {
  font: 400 13.5px/1.4 var(--font-body);
  color: var(--muted);
  text-decoration: none;
}
.doc-nav a:hover { color: var(--ink); }
.doc-content { max-width: 68ch; }
.doc-content h2 {
  font-size: clamp(1.35rem, 1.3vw + .85rem, 1.85rem);
  letter-spacing: -.015em;
  margin: clamp(48px, 6vw, 72px) 0 16px;
}
.doc-content h3 {
  font: 700 1.05rem/1.3 var(--font-head);
  margin: 28px 0 10px;
}
.doc-content p { color: var(--ink); font-size: 16.5px; line-height: 1.65; margin: 0 0 16px; }
.doc-content li { color: var(--ink); font-size: 16.5px; line-height: 1.65; margin-bottom: 8px; }
.doc-content ul, .doc-content ol { margin: 0 0 16px; padding-left: 22px; }
.doc-content li:last-child { margin-bottom: 0; }
.doc-content a { color: var(--accent); }
.doc-content strong { color: var(--ink); }
.doc-meta {
  font: 400 13px/1.4 var(--font-mono);
  color: var(--muted);
  margin: 0 0 clamp(40px, 5vw, 64px);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.doc-declaration:first-child h2 { margin-top: 0; }
.doc-declaration + .doc-declaration {
  margin-top: clamp(48px, 6vw, 80px);
  padding-top: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--border);
}
.doc-declaration__title {
  font-size: clamp(1.3rem, 1.4vw + .8rem, 1.75rem);
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 16px;
}
.doc-declaration p { max-width: 62ch; }

@media (max-width: 820px) {
  .doc-body__grid { grid-template-columns: 1fr; }
  .doc-nav { position: static; }
  .doc-nav ol { display: flex; flex-wrap: wrap; gap: 8px 20px; }
}

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

/* Revelação genérica ao scroll — só esconde se o JS estiver disponível */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* ─────────────────────────────────────────────────────────────
   Case studies (fase 2, piloto JF Carnide)
   Hero = palco dos capítulos da homepage; o resto alterna papel e escuro.
   ───────────────────────────────────────────────────────────── */

.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(16px, 3vh, 32px);
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-light);
  text-decoration: none;
}
.cs-back:hover { color: var(--ink-fg); }
.cs-hero .chapter__name { font-size: clamp(2.2rem, 4.4vw + .6rem, 5.6rem); }

.cs-label {
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c);
  margin: 0 0 16px;
}
.cs-label--dark { color: var(--c-light); }
.cs-title {
  font-size: clamp(2.4rem, 4.6vw + .5rem, 5rem);
  line-height: .94;
  letter-spacing: -.04em;
  text-transform: uppercase;
  margin: 0 0 clamp(28px, 4vw, 48px);
}
.cs-title--small { font-size: clamp(1.6rem, 2vw + .8rem, 2.4rem); }
.cs-lede {
  font: 500 clamp(1.05rem, .8vw + .8rem, 1.3rem)/1.4 var(--font-head);
  max-width: 34ch;
  margin: 0;
}

/* Contexto */
.cs-intro { padding-block: clamp(80px, 10vw, 140px); }
.cs-intro__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px clamp(32px, 6vw, 96px);
}
.cs-intro p {
  font-size: clamp(17px, .4vw + 15px, 19px);
  line-height: 1.65;
  color: var(--ink);
  max-width: 52ch;
  margin: 0;
}
.cs-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px clamp(24px, 4vw, 64px);
  margin: clamp(56px, 7vw, 96px) 0 0;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}
.cs-facts div { display: flex; flex-direction: column-reverse; gap: 10px; }
.cs-facts dt { font: 400 13px/1.4 var(--font-mono); color: var(--muted); max-width: 26ch; }
.cs-facts dd {
  margin: 0;
  font: 700 clamp(2.6rem, 4vw + 1rem, 4.4rem)/.9 var(--font-head);
  letter-spacing: -.04em;
  color: var(--c);
}
/* especificidade extra: .cs-intro p (17–19px) ganhava à nota */
.cs-intro .cs-facts__note { font: 400 12px/1.4 var(--font-mono); color: var(--muted); margin: 18px 0 0; }

/* Pormenores */
.cs-details {
  background: var(--tint);
  padding-block: clamp(88px, 11vw, 160px);
}
.cs-details__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 48px;
  flex-wrap: wrap;
  margin-bottom: clamp(56px, 7vw, 104px);
}
.cs-details__head .cs-title { margin: 0; }

.cs-item { display: grid; gap: clamp(24px, 3vw, 48px); }
.cs-item + .cs-item {
  margin-top: clamp(88px, 11vw, 160px);
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid #D3DAE8;
}
.cs-item__num {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 700 14px/1 var(--font-mono);
  letter-spacing: .06em;
  color: var(--c);
  margin-bottom: 14px;
}
.cs-item__num::after { content: ''; width: 40px; height: 2px; background: var(--c); }
.cs-item__title {
  font-size: clamp(1.6rem, 1.8vw + 1rem, 2.6rem);
  line-height: 1.02;
  letter-spacing: -.03em;
  margin: 0 0 16px;
  text-wrap: balance;
}
.cs-item__text p {
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  max-width: 54ch;
  margin: 0 0 12px;
}
.cs-item__text p:last-child { margin-bottom: 0; }
.cs-note {
  background: var(--surface);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 15px !important;
  color: var(--muted) !important;
}

.cs-shot {
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: var(--border);
  box-shadow: 0 2px 4px rgba(20, 24, 28, .05), 0 24px 56px -24px rgba(20, 24, 28, .35);
}
.cs-shot img { width: 100%; height: auto; }
.cs-shot--phone {
  position: relative;
  border-radius: clamp(18px, 2vw, 28px);
  box-shadow:
    0 0 0 clamp(4px, .45vw, 7px) #080B0E,
    0 0 0 clamp(5px, .55vw, 8px) rgba(20, 24, 28, .16),
    0 24px 56px -24px rgba(20, 24, 28, .48);
}
.cs-item__shots { display: grid; gap: clamp(16px, 2vw, 28px); align-items: start; }

/* larga: texto em duas colunas por cima, imagens a toda a largura */
.cs-item--wide .cs-item__text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 0 clamp(32px, 6vw, 96px);
  align-items: start;
}
.cs-item--wide .cs-item__title { margin-bottom: 0; }
.cs-item--wide .cs-item__body { padding-top: 28px; }
.cs-item--narrow .cs-item__shots { max-width: 1100px; }

/* par: texto numa coluna, captura desktop + telemóvel */
.cs-item--pair { grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); align-items: start; }
.cs-item--pair .cs-item__shots { grid-template-columns: minmax(0, 1fr) minmax(0, .32fr); }
.cs-item--pair .cs-item__text { position: sticky; top: 32px; }
.cs-item--reverse { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); }
.cs-item--reverse .cs-item__text { order: 2; }

/* dois desktop lado a lado, texto por cima */
.cs-item--pair2 .cs-item__text { max-width: 760px; }
.cs-item--pair2 .cs-item__shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cs-item__shots--mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-shot--span { grid-column: 1 / -1; }

/* antes e depois: desktop antigo + dois telemóveis, cada um com etiqueta */
.cs-item__shots--compare { grid-template-columns: minmax(0, 1fr) minmax(0, .3fr) minmax(0, .3fr); }
.cs-shot--tagged { position: relative; }
.cs-shot__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ink-fg);
  font: 400 12px/1 var(--font-mono);
  letter-spacing: .04em;
}
.cs-shot__tag--new { background: var(--c); }

/* esquema de percursos (Intranet): origem → estado → destino, sem nomes nem endereços */
.cs-routes {
  margin: 0;
  padding: clamp(20px, 3vw, 36px);
  list-style: none;
  display: grid;
  gap: 14px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(20, 24, 28, .05), 0 24px 56px -24px rgba(20, 24, 28, .35);
}
.cs-routes li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.3fr);
  align-items: center;
  gap: 12px 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.cs-routes li:first-child { border-top: 0; }
.cs-routes__from { font: 600 17px/1.3 var(--font-head); color: var(--ink); }
.cs-routes__state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font: 700 13px/1 var(--font-body);
  color: #fff;
  background: #3D6B28;
}
.cs-routes__state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cs-routes__state--out { background: #6B4E00; }
.cs-routes__to { font-size: 15px; line-height: 1.45; color: var(--muted); }
@media (max-width: 600px) {
  .cs-routes li { grid-template-columns: 1fr; justify-items: start; }
}

@media (max-width: 1000px) {
  .cs-intro__grid,
  .cs-item--wide .cs-item__text,
  .cs-item--pair,
  .cs-item--reverse { grid-template-columns: 1fr; }
  .cs-item--wide .cs-item__title { margin-bottom: 16px; }
  .cs-item--wide .cs-item__body { padding-top: 0; }
  .cs-item--pair .cs-item__text { position: static; }
  .cs-item--reverse .cs-item__text { order: 0; }
  .cs-facts { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cs-item--pair .cs-item__shots { grid-template-columns: minmax(0, 1fr) minmax(0, .5fr); }
  .cs-item--pair2 .cs-item__shots,
  .cs-item__shots--mosaic { grid-template-columns: 1fr; }
  .cs-item__shots--compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-item__shots--compare .cs-shot:first-child { grid-column: 1 / -1; }
}

/* Pontos fortes + implementação */
.cs-strengths { padding-block: clamp(88px, 11vw, 160px); }
.cs-strengths__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 56px clamp(40px, 7vw, 120px);
  align-items: start;
}
.cs-list { list-style: none; margin: 0; padding: 0; counter-reset: cs; }
.cs-list li {
  counter-increment: cs;
  position: relative;
  padding: 22px 0 22px 64px;
  border-top: 1px solid var(--border);
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}
.cs-list li::before {
  content: counter(cs, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 25px;
  font: 700 14px/1 var(--font-mono);
  color: var(--c);
}
.cs-list strong { color: var(--ink); font-weight: 600; }
.cs-tech { margin: 0; }
.cs-tech div { padding: 16px 0; border-top: 1px solid var(--border); }
.cs-tech dt { font: 700 12px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c); margin-bottom: 8px; }
.cs-tech dd { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink); }
@media (max-width: 900px) { .cs-strengths__grid { grid-template-columns: 1fr; } }

/* Resultado */
.cs-result {
  background: var(--bg);
  color: var(--ink-fg);
  --focus-ring: var(--c-light);
  padding-block: clamp(96px, 12vw, 176px);
}
.cs-result__statement {
  font: 700 clamp(2rem, 3.6vw + 1rem, 4.4rem)/1.02 var(--font-head);
  letter-spacing: -.035em;
  max-width: 22ch;
  margin: 0 0 clamp(36px, 5vw, 56px);
  text-wrap: balance;
}
.cs-visit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 17px/1 var(--font-head);
  color: var(--ink-fg);
  text-decoration: none;
  border: 2px solid var(--c-light);
  border-radius: 999px;
  padding: 16px 28px;
  transition: background .22s var(--ease-out), color .22s var(--ease-out);
}
.cs-visit:hover { background: var(--c-light); color: var(--bg); }

/* Próximo projecto */
.cs-next { background: var(--ink-bg); }
.cs-next__prev {
  display: block;
  padding: 18px clamp(20px, 4vw, 48px);
  font: 400 13px/1 var(--font-mono);
  letter-spacing: .04em;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid #262B32;
  --focus-ring: var(--accent-on-dark);
}
.cs-next__prev:hover { color: var(--ink-fg); }
.cs-next__link {
  display: grid;
  gap: 10px;
  padding: clamp(64px, 9vw, 128px) clamp(20px, 4vw, 48px);
  background: var(--bg);
  color: var(--c-light);
  text-decoration: none;
  --focus-ring: var(--c-light);
}
.cs-next__label { font: 700 13px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.cs-next__num { font: 700 14px/1 var(--font-mono); letter-spacing: .06em; }
.cs-next__name {
  font: 700 clamp(2.4rem, 6vw + .5rem, 7rem)/.92 var(--font-head);
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.cs-next__name span { display: inline-block; transition: transform .35s var(--ease-out); }
.cs-next__link:hover .cs-next__name span { transform: translateX(14px); }

/* ─────────────────────────────────────────────────────────────
   Páginas de projecto
   ───────────────────────────────────────────────────────────── */

.project-hero { padding-block: clamp(56px, 8vw, 104px) clamp(56px, 7vw, 88px); }
.project-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 13px/1 var(--font-mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent-on-dark);
  text-decoration: none;
  margin-bottom: 36px;
}
.project-hero__back:hover { color: var(--ink-fg); }
.project-hero__type {
  display: block;
  font: 600 13px/1 var(--font-head);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-muted);
  margin-bottom: 18px;
}
.project-hero h1 {
  font-size: clamp(2.25rem, 4.5vw + 1rem, 4.75rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  max-width: 16ch;
  margin: 0;
}

.project-body { padding-block: clamp(56px, 8vw, 96px); }
.project-body__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.project-body h2 {
  font-size: clamp(1.1rem, 1.4vw + .6rem, 1.5rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  margin: 0 0 14px;
}
.project-body p {
  color: var(--muted);
  max-width: 60ch;
  margin: 0 0 18px;
}
.project-body p:last-child { margin-bottom: 0; }

.project-meta {
  list-style: none;
  margin: clamp(40px, 5vw, 64px) 0 0;
  padding: 28px 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px 32px;
}
.project-meta dt,
.project-meta__label {
  font: 700 12px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 8px;
}
.project-meta__value { font-size: 15.5px; color: var(--ink); margin: 0; }

.shots { padding-block: 0 clamp(56px, 8vw, 96px); }
.shots__item { margin-bottom: clamp(40px, 6vw, 72px); }
.shots__item:last-child { margin-bottom: 0; }
.shots__frame {
  overflow: hidden;
  border-radius: 6px;
  background: var(--border);
}
.shots__frame img { width: 100%; height: auto; display: block; }
.shots__caption {
  font-size: 14.5px;
  color: var(--muted);
  margin: 14px 0 0;
  max-width: 60ch;
}
.shots__pair {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.project-visit { padding-block: 0 clamp(56px, 8vw, 96px); }
.visit-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 16px/1 var(--font-head);
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 16px 28px;
  transition: background var(--ease-out) .22s, color var(--ease-out) .22s;
}
.visit-link:hover { background: var(--ink); color: var(--paper); }
.project-visit__note {
  font-size: 15px;
  color: var(--muted);
  max-width: 52ch;
  margin: 0;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding-block: clamp(40px, 5vw, 64px);
  border-top: 1px solid #262B32;
}
.pager a { text-decoration: none; max-width: 45%; }
.pager__dir {
  display: block;
  font: 700 12px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent-on-dark);
  margin-bottom: 10px;
}
.pager__name {
  font: 600 clamp(1.1rem, 1.6vw + .5rem, 1.6rem)/1.15 var(--font-head);
  letter-spacing: -.01em;
}
.pager__next { text-align: right; margin-inline-start: auto; }

@media (max-width: 780px) {
  .project-body__grid { grid-template-columns: 1fr; }
  .shots__pair { grid-template-columns: 1fr; }
  .pager a { max-width: 100%; }
  .pager__next { text-align: left; margin-inline-start: 0; }
}

/* A captura mobile é muito mais alta do que a desktop — recorta-se pelo topo
   para as duas colunas ficarem equilibradas. */
.shots__pair > *:last-child .shots__frame { aspect-ratio: 390 / 560; }
.shots__pair > *:last-child .shots__frame img {
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
@media (max-width: 780px) {
  .shots__pair > *:last-child .shots__frame { aspect-ratio: auto; }
  .shots__pair > *:last-child .shots__frame img { height: auto; object-fit: fill; }
}

/* ─────────────────────────────────────────────────────────────
   Infraestrutura — banda da homepage e página própria (2026-09-16)

   Reaproveita o vocabulário que já existe: .pillars/.pillar para os blocos,
   .cs-label/.cs-title/.cs-lede para os cabeçalhos, .cs-list para a prosa
   numerada e .cs-tech para a lista de serviços. Só entram aqui as peças que
   não existiam: a banda da homepage, a variante de três colunas e os ajustes
   da página. Sem cores novas.
   ───────────────────────────────────────────────────────────── */

/* Ligação de texto no cabeçalho, ao lado do CTA */
.site-header__nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); }
.header-link {
  font: 600 14px/1 var(--font-head);
  color: var(--ink-muted);
  text-decoration: none;
}
.header-link:hover { color: var(--ink-fg); }
.header-link[aria-current='page'] { color: var(--ink-fg); }
@media (max-width: 620px) { .header-link { display: none; } }

/* Banda da homepage: fica entre duas bandas escuras (processo e rodapé), por
   isso usa --tint e não --paper, para não parecer um corte a meio. */
.infra {
  background: var(--tint);
  padding-block: clamp(88px, 12vw, 168px);
}
.infra__head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px clamp(32px, 6vw, 96px);
  margin-bottom: clamp(56px, 8vw, 104px);
}
.infra__title {
  font-size: clamp(2.2rem, 4.2vw + .5rem, 4.5rem);
  line-height: .96;
  letter-spacing: -.04em;
  text-transform: uppercase;
  margin: 0;
}
.infra__lede {
  font: 500 clamp(1.05rem, .8vw + .8rem, 1.3rem)/1.4 var(--font-head);
  color: var(--muted);
  max-width: 34ch;
  margin: 0;
}
.infra__more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(48px, 6vw, 72px);
  font: 600 17px/1 var(--font-head);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
  transition: gap .22s var(--ease-out), border-color .22s var(--ease-out);
}
.infra__more:hover { gap: 15px; border-bottom-color: var(--accent); }
@media (max-width: 820px) { .infra__head { grid-template-columns: 1fr; } }

/* Três blocos a três colunas; abaixo de 1000px vai a duas e, com a regra dos
   820px que já existe, a uma. */
.pillars--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .pillars--three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* a regra dos 820px de .pillars tem a mesma especificidade e vem antes neste
   ficheiro, por isso perdia para a de cima — repete-se aqui, depois dela */
@media (max-width: 820px) { .pillars--three { grid-template-columns: 1fr; } }

/* Página infraestrutura.html — a cor de acento faz de cor de projecto */
.infra-page {
  --c: var(--accent);
  --c-light: var(--accent-on-dark);
  --bg: var(--ink-bg);
}
.infra-page .project-hero h1 { max-width: 12ch; }
.project-hero__lede {
  font: 500 clamp(1.05rem, .8vw + .8rem, 1.35rem)/1.45 var(--font-head);
  color: var(--ink-muted);
  max-width: 46ch;
  margin: 26px 0 0;
}
/* Secções de texto da página: mesmo ritmo dos case studies, sem imagens */
.ip-section { padding-block: clamp(80px, 10vw, 140px); }
.ip-section--tint { background: var(--tint); }
.ip-section__head { margin-bottom: clamp(48px, 6vw, 80px); max-width: 62ch; }
.ip-section__head .cs-title { margin-bottom: clamp(20px, 3vw, 28px); }
.ip-section p {
  font-size: clamp(16.5px, .4vw + 15px, 18px);
  line-height: 1.65;
  color: var(--ink);
  max-width: 62ch;
  margin: 0 0 18px;
}
.ip-section p:last-child { margin-bottom: 0; }
.ip-section .cs-lede { color: var(--muted); max-width: 40ch; }
.ip-note {
  margin-top: clamp(32px, 4vw, 48px);
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}
/* Lista de serviços: o .cs-tech da ficha técnica, a duas colunas */
.ip-services {
  margin-top: clamp(40px, 5vw, 64px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(32px, 5vw, 80px);
}
.ip-services dd { color: var(--muted); max-width: 46ch; }
@media (max-width: 760px) { .ip-services { grid-template-columns: 1fr; } }
.ip-close {
  background: var(--tint);
  padding-block: clamp(88px, 11vw, 150px);
  border-top: 2px solid var(--ink);
}
.ip-close__statement {
  font: 700 clamp(1.9rem, 3.4vw + 1rem, 4rem)/1.02 var(--font-head);
  letter-spacing: -.035em;
  max-width: 24ch;
  margin: 0 0 clamp(32px, 4vw, 48px);
  text-wrap: balance;
}
.ip-close__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 17px/1 var(--font-head);
  color: var(--accent);
  text-decoration: none;
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 16px 28px;
  transition: background .22s var(--ease-out), color .22s var(--ease-out);
}
.ip-close__link:hover { background: var(--accent); color: #fff; }
