/* ============================================================
   Telleria Solutions — styles.css
   Design "matriz de pontos e dunas" (out. 2026): preto e branco,
   pílulas brancas e escuras, títulos em Geist Pixel Circle, texto em Inter.
   ============================================================ */

/* Geist Pixel Circle, da Vercel, licença OFL (fonts/OFL.txt). */
@font-face {
  font-family: "Geist Pixel Circle";
  src: url("fonts/GeistPixel-Circle.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Preto e branco do novo design. Os nomes antigos (--surface, --accent...) continuam
     cá porque as secções os usam; os valores é que passaram a ser os novos.
     O esmeralda e o latão ficam só para os estados ("Em uso real", "a entrar em uso"). */
  --bg: #000000;
  --bg-rgb: 0, 0, 0;
  --bg-alt: #060606;
  --surface: #0f0f10;
  --surface-2: #18181a;
  --border: #1d1d20;
  --border-strong: #3a3a3e;
  /* Contorno dos campos: 3,3:1 contra o preto, acima do mínimo de 3:1 da WCAG 1.4.11. */
  --border-field: #5e5e63;
  --text: #ffffff;
  --soft: #d0d0d0;
  --muted: #8e8e8e;
  --accent: #ffffff;
  --accent-rgb: 255, 255, 255;
  --accent-strong: #ffffff;
  --accent-2: #c9a227;
  --accent-2-rgb: 201, 162, 39;
  --accent-dim: rgba(255, 255, 255, 0.08);
  --accent-glow: rgba(255, 255, 255, 0.22);
  --btn-text: #000000;
  --green: #6cc79c;
  --green-rgb: 108, 199, 156;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --font-display: "Geist Pixel Circle", ui-monospace, monospace;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  /* Pílulas, sombras e brilho do novo design */
  --nav-text: #2e2e2e;
  --pill-dark: #28282a;
  --pill-dark-hover: #323234;
  --sign-in-text: #c8c8c8;
  --nav-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  --trust-bg: #28282a;
  --trust-border: rgba(255, 255, 255, 0.4);
  --trust-text: #c4c2c3;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* O pôr do sol do primeiro ecrã, levado para o resto da página: brilhos das
     secções, números grandes, barra do processo e reflexos das peças 3D. */
  --sun-1: #938cbf;
  --sun-2: #b9b0d7;
  --sun-3: #e7d5e2;
  --sun-4: #f4c2b2;
  --sun-5: #e38c7d;
  --plum: #43203b;
  --sunset: linear-gradient(100deg, var(--sun-2) 0%, var(--sun-4) 55%, var(--sun-5) 100%);
  --cta-glow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 0 22px rgba(255, 255, 255, 0.32),
    0 0 44px rgba(255, 255, 255, 0.12);
  --cta-glow-strong: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 30px rgba(255, 255, 255, 0.48),
    0 0 64px rgba(255, 255, 255, 0.2);

  /* Nav flutuante: distância ao topo e altura das pílulas */
  --nav-top: clamp(14px, 2.4vh, 28px);
  --nav-size: clamp(44px, 5.2vw, 48px);
  --nav-h: calc(var(--nav-top) + var(--nav-size) + 12px); /* scroll-margin das secções */
  --gutter: clamp(14px, 3vw, 32px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
  /* clip, onde existe: corta o que sai de lado sem criar uma caixa de scroll,
     por isso os palcos sticky (processo) continuam a colar */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }

::selection { background: var(--text); color: var(--bg); }

/* A Geist Pixel só tem um peso: os títulos grandes usam-na a 400.
   Os subtítulos (h3, h4) ficam em Inter, para a matriz de pontos não cansar. */
h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h3, h4 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

a { color: inherit; }

.container {
  width: min(1160px, 100% - 2.5rem);
  margin-inline: auto;
}
.container-narrow { width: min(820px, 100% - 2.5rem); }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--sun-4);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Nav: pílulas flutuantes ---------- */
.nav {
  position: fixed;
  top: var(--nav-top);
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding-inline: var(--gutter);
  /* só as pílulas recebem cliques; os espaços entre elas não tapam a página */
  pointer-events: none;
  animation: slideDown 0.7s var(--ease) both;
}
.nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 18px);
  width: 100%;
  max-width: 880px;
}
.nav-logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--nav-size);
  height: var(--nav-size);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--nav-shadow);
  transition: transform 0.3s var(--ease);
}
.nav-logo:hover { transform: scale(1.04); }
/* 60% e não 72%: o símbolo é quase quadrado e os cantos sairiam do círculo */
.nav-logo img { width: 60%; height: 60%; object-fit: contain; }

.nav-links {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex: 1;
  max-width: 480px;
  height: var(--nav-size);
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--nav-shadow);
}
.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 clamp(6px, 1.1vw, 12px);
  border-radius: 999px;
  color: var(--nav-text);
  font-size: clamp(13px, 1.4vw, 15px);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.5;
  transition: opacity 0.25s ease;
}
.nav-links a:hover { opacity: 0.75; }
.nav-links a.is-active { opacity: 1; }
/* três pontos por baixo da secção onde se está */
.nav-links a.is-active::after,
.mobile-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: #000;
  box-shadow: -5px 0 0 #000, 5px 0 0 #000;
}
.nav-links a:focus-visible,
.mobile-link:focus-visible {
  outline-color: var(--nav-text);
  outline-offset: -2px;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: var(--nav-size);
  padding: 0 clamp(16px, 2.2vw, 24px);
  border-radius: 999px;
  background: var(--pill-dark);
  color: var(--sign-in-text);
  font-size: clamp(13px, 1.4vw, 15px);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--nav-shadow);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease);
}
.nav-cta:hover {
  background: var(--pill-dark-hover);
  color: #fff;
  transform: translateY(-1px);
}

/* PT / EN: pílula escura, com o idioma ativo em branco */
.lang-toggle {
  display: inline-flex;
  flex-shrink: 0;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--pill-dark);
  box-shadow: var(--nav-shadow);
}
.nav .lang-toggle { height: var(--nav-size); }
.lang-toggle button {
  min-width: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sign-in-text);
  font: 600 12px var(--font-body);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.lang-toggle button:hover { color: #fff; }
.lang-toggle button.active { background: #fff; color: #000; }

/* Burger: só no telemóvel */
.nav-burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pill-dark);
  box-shadow: var(--nav-shadow);
  cursor: pointer;
  transition: background-color 0.3s var(--ease);
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 1.5px;
  border-radius: 1px;
  background: #fff;
  transition: transform 0.35s var(--ease), opacity 0.2s ease, background-color 0.3s ease;
}
.nav-burger[aria-expanded="true"] { background: #fff; }
.nav-burger[aria-expanded="true"] span { background: #000; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Menu do telemóvel: folha branca por baixo da nav */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: overlayIn 0.28s ease backwards;
}
.mobile-menu {
  position: fixed;
  top: calc(var(--nav-top) + 48px + 12px);
  left: 0;
  right: 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  width: calc(100% - 28px);
  max-width: 420px;
  margin: 0 auto;
  padding: 22px 18px 20px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  transform-origin: top center;
  animation: menuIn 0.38s var(--ease) backwards;
}
/* [hidden] sozinho perderia para o display destas regras */
.menu-overlay[hidden],
.mobile-menu[hidden] { display: none; }
.mobile-link {
  position: relative;
  display: block;
  padding: 12px 0 20px;
  border-radius: 14px;
  color: var(--nav-text);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.25s ease;
  animation: linkIn 0.42s var(--ease) backwards;
  animation-delay: calc(0.08s + var(--i, 0) * 0.05s);
}
.mobile-link:hover { opacity: 0.75; }
.mobile-link.is-active { opacity: 1; }
.mobile-link.is-active::after { bottom: 8px; }
.mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--pill-dark);
  color: var(--sign-in-text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease;
  animation: linkIn 0.42s var(--ease) backwards;
  animation-delay: calc(0.08s + var(--i, 0) * 0.05s);
}
.mobile-cta:hover { background: var(--pill-dark-hover); color: #fff; }
.mobile-menu .lang-toggle {
  align-self: center;
  height: 40px;
  margin-top: 14px;
  animation: linkIn 0.42s var(--ease) backwards;
  animation-delay: calc(0.08s + var(--i, 0) * 0.05s);
}

/* ---------- Hero: o primeiro ecrã ---------- */
.hero {
  /* o resto do primeiro ecrã entra este tempo depois, para o logótipo abrir */
  --lead: 0.3s;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* ar mínimo entre o botão e os números quando o ecrã é baixo */
  row-gap: clamp(12px, 2vh, 20px);
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-top) + var(--nav-size) + clamp(16px, 3vh, 32px)) var(--gutter) clamp(18px, 3vh, 32px);
  text-align: center;
  /* Recurso sem canvas: o mesmo céu, horizonte e dunas, em gradiente */
  background: linear-gradient(180deg, #938cbf 0%, #e7d5e2 22%, #f4c2b2 29%, #43203b 37%, #12070f 62%, #000 82%);
}
/* O canvas do hero-bg.js: céu, caracteres e dunas */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hero-bg canvas { display: block; width: 100%; height: 100%; }

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  max-width: 900px;
}
.hero-main > * { flex-shrink: 0; }

/* Logótipo grande (SVG inline no index.html): branco, com o ponto e o ponto final
   em latão. Entra como no site antigo: a barra desliza, a haste desce, o ponto
   salta e as letras sobem. A largura também depende da altura do ecrã, para os
   números continuarem à vista nos portáteis. */
.hero-logo {
  display: block;
  width: min(clamp(220px, 32vw, 460px), 42vh);
  height: auto;
  aspect-ratio: 763 / 230;
  overflow: visible;
  margin-bottom: clamp(14px, 3vh, 30px);
  /* sombra cor de ameixa, das dunas: o branco e o latão destacam-se do céu claro */
  filter: drop-shadow(0 2px 14px rgba(40, 14, 36, 0.5)) drop-shadow(0 0 2px rgba(40, 14, 36, 0.35));
}
.hero-logo path,
.hero-logo circle { transform-box: fill-box; }
.hero-logo .bar { transform-origin: left center; animation: logoBar 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero-logo .stem { transform-origin: center top; animation: logoStem 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.28s both; }
.hero-logo .dot { transform-origin: center; animation: logoPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.62s both; }
.hero-logo .n { animation: logoRise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) calc(0.45s + var(--i) * 0.045s) both; }
.hero-logo .s { animation: logoFade 0.6s ease-out calc(0.95s + var(--i) * 0.03s) both; }
@keyframes logoBar { from { transform: scaleX(0); opacity: 0; } }
@keyframes logoStem { from { transform: scaleY(0); } }
@keyframes logoPop { from { transform: scale(0); } }
@keyframes logoRise { from { transform: translateY(18px); opacity: 0; } }
@keyframes logoFade { from { opacity: 0; } }

/* Linha de confiança: três anéis com ícones e a pílula */
.trust {
  --trust-size: clamp(36px, 4.5vw, 42px);
  display: inline-flex;
  align-items: center;
  margin-bottom: clamp(16px, 2.5vh, 26px);
}
.trust-avatar {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: var(--trust-size);
  height: var(--trust-size);
  padding: 5px;
  border: 1px solid var(--trust-border);
  border-radius: 50%;
  background: var(--trust-bg);
  transition: transform 0.35s var(--ease);
}
.trust-inner {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  color: #111;
}
.trust-inner svg { width: 58%; height: 58%; }
.trust-avatar.a1 { z-index: 1; }
.trust-avatar.a2 { z-index: 2; margin-left: calc(var(--trust-size) * -0.42); }
.trust-avatar.a3 { z-index: 4; margin-left: calc(var(--trust-size) * -0.42); }
.trust:hover .a1 { transform: translateY(-2px); }
.trust:hover .a2 { transform: translateY(-4px); }
.trust:hover .a3 { transform: translateY(-2px); }
.trust-pill {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: var(--trust-size);
  margin-left: calc(var(--trust-size) * -0.42);
  padding: 0 clamp(14px, 1.8vw, 18px) 0 calc(var(--trust-size) * 0.58);
  border: 1px solid var(--trust-border);
  border-radius: 999px;
  background: var(--trust-bg);
  color: var(--trust-text);
  font-size: clamp(12px, 1.4vw, 13.5px);
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

/* Título em duas linhas, em matriz de pontos */
.headline {
  max-width: 100%;
  margin-bottom: clamp(12px, 2vh, 20px);
  color: #fff;
  font-size: clamp(30px, 6.2vw, 80px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  /* os acentos e as hastes da Geist Pixel passam a caixa da linha: o padding evita o corte */
  padding-block: 0.08em;
  white-space: nowrap;
  overflow: hidden;
}
.headline .line {
  display: block;
  animation: headlineFade 0.85s var(--ease) backwards;
}
.headline .l1 { animation-delay: calc(0.12s + var(--lead, 0s)); }
.headline .l2 { animation-delay: calc(0.3s + var(--lead, 0s)); }

.subhead {
  /* 600 px: a frase de apresentação (22 out) fica em 3 linhas no computador e os
     quatro números continuam a caber nos portáteis baixos (1280x720, 1366x657) */
  max-width: min(600px, 92%);
  margin-bottom: clamp(20px, 3.2vh, 32px);
  color: var(--soft);
  font-size: clamp(calc(13.5px + 2pt), calc(1.55vw + 2pt), calc(16.5px + 2pt));
  line-height: 1.55;
  opacity: 0.8;
  text-wrap: pretty;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(11px, 1.6vh, 13px) clamp(22px, 3vw, 28px);
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: clamp(13.5px, 1.5vw, 14.5px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: var(--cta-glow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--cta-glow-strong);
}
.cta:focus-visible { outline-offset: 4px; }

/* Números verificados, no fundo do primeiro ecrã */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 24px);
  flex-shrink: 0;
  width: 100%;
  max-width: 920px;
  list-style: none;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 0.8vh, 8px);
  text-align: center;
}
.stat-icon {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 33px);
  line-height: 1;
}
.stat-value {
  color: #fff;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-label {
  color: var(--muted);
  font-size: clamp(11px, 1.2vw, 12.5px);
  line-height: 1.3;
  text-wrap: balance;
}

/* Entrada do primeiro ecrã. O preenchimento "backwards" aplica o estado inicial
   durante o atraso; no fim cada elemento fica no seu estilo normal, por isso os
   hovers e a opacidade de 0.8 do subtítulo funcionam sem mais nada. */
.anim { animation: reveal 0.85s var(--ease) calc(var(--d, 0s) + var(--lead, 0s)) backwards; }
.cta.anim { animation: revealPulse 1.4s var(--ease) calc(var(--d, 0s) + var(--lead, 0s)) backwards; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(22px) scale(0.98); filter: blur(6px); }
}
@keyframes revealPulse {
  0% { opacity: 0; transform: translateY(22px) scale(0.98); filter: blur(6px); }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 0 22px rgba(255, 255, 255, 0.32),
      0 0 44px rgba(255, 255, 255, 0.12);
  }
  80% {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 34px rgba(255, 255, 255, 0.55),
      0 0 72px rgba(255, 255, 255, 0.24);
  }
}
@keyframes headlineFade { from { opacity: 0; transform: translateY(14px); } }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes overlayIn { from { opacity: 0; } }
@keyframes menuIn { from { opacity: 0; transform: translateY(-10px) scale(0.97); } }
@keyframes linkIn { from { opacity: 0; transform: translateY(8px); } }

/* Logótipo completo (rodapé). Os SVGs vivem em assets/brand/; o conjunto-mestre está
   fora desta pasta, em "Telleria logos (mestre)", para não ser publicado. */
.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  border-radius: 6px;
  flex-shrink: 0;
}
.brand img { height: 30px; width: auto; display: block; }
.brand-footer img { height: 34px; }

/* Rótulo pequeno por cima dos títulos das secções */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sun-4);
  margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font: 600 0.95rem var(--font-body);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.85rem 1.7rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, color 0.2s;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.98); }
/* Botão principal: a pílula branca com brilho do primeiro ecrã */
.btn-primary {
  background: #fff;
  color: #000;
  box-shadow: var(--cta-glow);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--cta-glow-strong);
}
.btn-primary:active { transform: scale(0.98); }
/* Botão secundário: pílula escura */
.btn-outline {
  background: var(--pill-dark);
  color: var(--sign-in-text);
  border-color: rgba(255, 255, 255, 0.14);
}
.btn-outline:hover { background: var(--pill-dark-hover); color: #fff; }
.btn-whatsapp {
  background: #1faa55;
  color: #fff;
}
.btn-whatsapp:hover { background: #24c261; }

/* ---------- Sections ---------- */
.section {
  position: relative;
  isolation: isolate;
  padding: clamp(4rem, 10vh, 7.5rem) 0;
  scroll-margin-top: var(--nav-h);
}
/* Atmosfera: um brilho suave numa cor do pôr do sol e uma trama de pontos que
   se desvanece à volta dele. Cada secção escolhe a cor e o sítio, alternando
   lilás, pêssego e rosa, para a página deixar de ser preta e lisa. */
.section::before,
.section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
/* os brilhos desvanecem-se nos 160 px de cima e de baixo: sem isto, cada secção
   cortava o seu brilho a direito na fronteira com a seguinte */
.section {
  --fade-v: linear-gradient(to bottom, transparent, #000 160px, #000 calc(100% - 160px), transparent);
}
.section::before {
  background: radial-gradient(var(--glow-w, 1000px) var(--glow-h, 680px) at var(--glow-x, 85%) var(--glow-y, 0%),
    rgb(var(--glow, 132 118 214) / var(--glow-a, 0.22)), transparent 72%);
  -webkit-mask-image: var(--fade-v);
  mask-image: var(--fade-v);
}
.section::after {
  background: radial-gradient(circle, rgb(255 255 255 / 0.09) 0 1px, transparent 1.4px) 0 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(var(--glow-w, 1000px) var(--glow-h, 680px) at var(--glow-x, 85%) var(--glow-y, 0%), #000, transparent 68%), var(--fade-v);
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(var(--glow-w, 1000px) var(--glow-h, 680px) at var(--glow-x, 85%) var(--glow-y, 0%), #000, transparent 68%), var(--fade-v);
  mask-composite: intersect;
  opacity: 0.65;
}
/* lilás 132 118 214 · pêssego 241 150 116 · rosa 222 98 122 · malva 150 82 125 */
#orbita      { --glow: 132 118 214; --glow-x: 50%; --glow-y: 0%; --glow-a: 0.3; }
#trabalhos   { --glow: 241 150 116; --glow-x: 6%; --glow-y: 0%; --glow-a: 0.2; }
#servicos    { --glow: 132 118 214; --glow-x: 94%; --glow-y: 0%; --glow-a: 0.26; }
#calculadora { --glow: 222 98 122; --glow-x: 10%; --glow-y: 100%; --glow-a: 0.24; }
#processo    { --glow: 150 82 125; --glow-x: 90%; --glow-y: 12%; --glow-a: 0.32; }
#formas      { --glow: 241 150 116; --glow-x: 50%; --glow-y: 0%; --glow-a: 0.22; }
#sobre       { --glow: 222 98 122; --glow-x: 0%; --glow-y: 50%; --glow-a: 0.22; }
#contacto    { --glow: 241 150 116; --glow-x: 100%; --glow-y: 100%; --glow-a: 0.26; }
#faq         { --glow: 132 118 214; --glow-x: 50%; --glow-y: 0%; --glow-a: 0.2; }

.section-title {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  margin-bottom: 1.1rem;
  /* o ponto final fica fora do <span> traduzido: sai em latão, como o do logótipo */
  color: var(--accent-2);
}
.section-title > span { color: var(--text); }
.section-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 62ch;
  margin-bottom: clamp(2.2rem, 5vh, 3.5rem);
}

/* ---------- Projects ---------- */
/* Trabalhos em layout editorial: sem moldura de cartão, colunas desiguais e
   lados alternados. Três cartões idênticos empilhados era metade do que fazia
   a página parecer gerada automaticamente. */
.project {
  border: 0;
  background: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: clamp(2rem, 5vw, 3.4rem) 0 0;
  margin-bottom: clamp(3rem, 8vw, 6rem);
}
.project:last-of-type { margin-bottom: 0; }

.project-head {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(1.8rem, 5vw, 4.5rem);
  align-items: center;
}
/* o segundo projeto troca de lado — o olhar deixa de cair sempre no mesmo sítio */
.project:nth-of-type(even) .project-meta { order: 2; }
.project:nth-of-type(even) .project-visual { order: 1; }
.project:nth-of-type(even) .project-head {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

.project-num {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  font-weight: 400;
  line-height: 1;
  /* pontos cheios com o gradiente do pôr do sol; fit-content para o gradiente
     ocupar só o número e não a largura toda da coluna */
  color: transparent;
  background: var(--sunset);
  -webkit-background-clip: text;
  background-clip: text;
  display: block;
  width: fit-content;
  margin-bottom: 1.1rem;
}
.built-for {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.1rem;
}
.project h3 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 0.9rem;
}
.one-liner { color: var(--muted); margin-bottom: 1.2rem; max-width: 52ch; }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
}
.chips li {
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  color: var(--text);
}
.chips li.chip-wip {
  border-color: rgba(var(--accent-rgb), 0.5);
  color: var(--accent-strong);
}

.project-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.case-toggle .when-open { display: none; }
.project.open .case-toggle .when-open { display: inline; }
.project.open .case-toggle .when-closed { display: none; }

/* Abstract app illustrations */
.project-visual { position: relative; }
.browser-frame {
  background: #111;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.frame-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #161616;
}
.frame-bar i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #2e2e2e;
}
.frame-body { display: flex; min-height: 210px; }
/* Capturas reais das apps. width/height no HTML reservam o espaço e evitam saltos. */
.shot { display: block; width: 100%; height: auto; }
.shot-phone { border-radius: 14px; }

/* Dois ecrãs do mesmo trabalho: a loja à frente, o painel atrás e recuado.
   Lê-se como camadas — a montra e os bastidores. */
.visual-duo { display: grid; }
.visual-duo .duo-front { position: relative; z-index: 2; }
.visual-duo .duo-back {
  position: relative;
  z-index: 1;
  width: 82%;
  margin: -14% 0 0 auto;
  opacity: 0.94;
}
@media (max-width: 720px) {
  /* empilhadas a direito: sobrepostas em ecrã estreito ficam ilegíveis */
  .visual-duo { gap: 0.9rem; }
  .visual-duo .duo-back { width: 100%; margin: 0; }
}
.sk-side { width: 26%; background: #141414; border-right: 1px solid var(--border); }
.sk-main { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.sk-row { height: 12px; border-radius: 6px; background: #222; }
.sk-row.w60 { width: 60%; } .sk-row.w70 { width: 70%; } .sk-row.w80 { width: 80%; }
.sk-row.center { margin-inline: auto; }
.sk-cards { display: flex; gap: 8px; }
.sk-cards b { flex: 1; height: 42px; border-radius: 8px; background: #1d1d1d; }
.sk-bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; }
.sk-bars b { flex: 1; border-radius: 4px 4px 0 0; background: #222; }

.visual-sou .sk-bars b:nth-child(4), .visual-sou .sk-bars b:nth-child(6) { background: var(--accent-dim); border-top: 2px solid var(--accent); }
.visual-sou .sk-cards b:nth-child(2) { background: rgba(var(--accent-rgb), 0.18); }

.demo-float {
  position: absolute;
  bottom: -12px;
  right: 14px;
  background: var(--accent);
  color: var(--btn-text);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.35);
}

.phone-frame {
  width: min(220px, 70%);
  margin-inline: auto;
  background: #111;
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  padding: 14px 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.phone-notch {
  width: 60px; height: 5px;
  border-radius: 999px;
  background: #2a2a2a;
  margin: 0 auto 12px;
}
.phone-frame .sk-main { padding: 0; }

/* O bilhete no site, ao fundo, e a app da porta no telemóvel, pousado à
   frente, no canto: o mesmo bilhete dos dois lados da entrada. */
.visual-echoo { padding: 0 0 9% 0; }
.visual-echoo .phone-frame {
  position: absolute;
  right: -3%;
  bottom: 0;
  width: min(150px, 30%);
  margin: 0;
  padding: 9px 8px;
  border-radius: 20px;
  z-index: 2;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.visual-echoo .phone-notch { width: 40px; height: 4px; margin-bottom: 8px; }
.visual-echoo .shot-phone { border-radius: 11px; }
@media (max-width: 960px) {
  /* numa só coluna a caixa encosta à margem: o telemóvel não pode sair 3% para fora */
  .visual-echoo .phone-frame { right: 0; }
}
@media (max-width: 720px) {
  /* em ecrã estreito o telemóvel tapava o site; fica só o computador */
  .visual-echoo { padding-bottom: 0; }
  .visual-echoo .phone-frame { display: none; }
}
.sk-field { height: 30px; border-radius: 8px; background: #1d1d1d; border: 1px solid #262626; }
.sk-field.half { width: 55%; }
.sk-btn { height: 34px; border-radius: 999px; background: rgba(var(--accent-rgb), 0.65); margin-top: 4px; }

/* Case study panel */
.case-panel {
  border-top: 1px solid var(--border);
  margin-top: clamp(1.4rem, 3vw, 2.2rem);
  padding-top: clamp(1.4rem, 3vw, 2.2rem);
}
.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  margin-bottom: 1.8rem;
}
.case-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  margin-bottom: 0.6rem;
}
.case-panel p { color: var(--muted); }

.features {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1.6rem;
  margin: 0.4rem 0 1.8rem;
}
.features li {
  color: var(--muted);
  font-size: 0.94rem;
  padding-left: 1.3rem;
  position: relative;
}
.features li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.case-result {
  background: var(--accent-dim);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: var(--radius-s);
  padding: 0.9rem 1.1rem;
  color: var(--text) !important;
  font-weight: 500;
  margin-bottom: 1rem;
}
.case-who { font-size: 0.92rem; font-style: italic; margin-bottom: 1.2rem; }

/* ---------- Dois trabalhos dentro do mesmo caso (SOU) ----------
   A SOU foram duas encomendas separadas: a loja online e o painel de operações.
   Empilham-se em vez de ficarem lado a lado porque têm tamanhos muito diferentes
   (4 pontos contra 9) e duas colunas desiguais leem-se mal. */
.case-grid-solo { grid-template-columns: 1fr; }

.case-jobs {
  list-style: none;
  counter-reset: casejob;
  display: grid;
  gap: 1.6rem;
  margin: 0 0 1.4rem;
}
.case-job {
  counter-increment: casejob;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}
.case-job-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
/* O número vem do contador, não do texto: assim a numeração nunca fica
   dessincronizada da ordem real dos blocos, nem precisa de tradução. */
.case-job-title::before {
  content: counter(casejob, decimal-leading-zero);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  flex: none;
}
.case-job-sum { margin-bottom: 0.9rem; }
.case-job .features { margin-bottom: 0; }

/* Estado real de cada parte (03 Creative): verde = em uso todos os dias,
   latão = construído e a entrar em uso. Fica à vista de propósito, para não
   se apresentar como provado o que ainda está a arrancar. */
.case-job-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
  border: 1px solid rgba(var(--green-rgb), 0.45);
  background: rgba(var(--green-rgb), 0.08);
  color: var(--green);
}
.case-job-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.case-job-status.is-new {
  border-color: rgba(var(--accent-2-rgb), 0.5);
  background: rgba(var(--accent-2-rgb), 0.08);
  color: var(--accent-2);
}
.case-job-status::before {
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.15), 0 0 10px currentColor;
  animation: pulso-estado 2.6s ease-in-out infinite;
}
.case-job-status.is-new::before { box-shadow: 0 0 0 3px rgba(var(--accent-2-rgb), 0.15), 0 0 10px currentColor; }
@keyframes pulso-estado { 50% { opacity: 0.5; } }
@keyframes painel-abrir { from { opacity: 0; translate: 0 -10px; } }
.case-panel:not([hidden]) { animation: painel-abrir 0.55s var(--ease); }

.tech summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.tech summary::-webkit-details-marker { display: none; }
.tech summary::before { content: "+"; color: var(--accent); font-weight: 700; }
.tech[open] summary::before { content: "–"; }
.tech p { font-size: 0.88rem; margin-top: 0.6rem; }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.service-card {
  border: 1px solid rgb(var(--glow, 132 118 214) / 0.16);
  border-radius: var(--radius-m);
  background: linear-gradient(160deg, rgb(var(--glow, 132 118 214) / 0.09), transparent 55%), var(--surface);
  padding: 1.7rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color 0.25s;
}
.service-card:hover { border-color: rgb(var(--glow, 132 118 214) / 0.42); }
.service-card h3 { font-size: 1.18rem; }
.service-card p { color: var(--muted); font-size: 0.94rem; }
/* números 01 a 08 em matriz de pontos (contador do CSS: o HTML fica igual) */
.services-grid { counter-reset: servico; }
.service-card { counter-increment: servico; }
.service-card::before {
  content: counter(servico, decimal-leading-zero);
  width: fit-content;
  font: 400 1.6rem/1 var(--font-display);
  color: transparent;
  background: var(--sunset);
  -webkit-background-clip: text;
  background-clip: text;
}
@media (min-width: 1200px) {
  /* oito cartões em duas filas de quatro, em vez de 3 + 3 + 2 */
  .services-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.service-card .fit {
  margin-top: auto;
  color: var(--text);
  font-size: 0.88rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border-strong);
}

/* ---------- Process ---------- */
/* Processo: deixou de ser uma grelha de 4 cartões iguais. Agora é um percurso —
   trilho fixo à esquerda que acompanha o passo, conteúdo a passar à direita.
   Em telemóvel e com prefers-reduced-motion volta a ser uma lista simples. */
/* À esquerda, fixo: o cubo 3D (3d/cubo.js) e, por baixo, os nomes dos passos com a barra. */
.proc {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  margin-top: 2.5rem;
}
.proc-rail {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.proc-palco {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.86;
  max-height: calc(100vh - var(--nav-h) - 14rem);
}
.proc-palco.sem-3d { display: none; }
.proc-trilho {
  display: grid;
  grid-template-columns: 3px 1fr;
  gap: 0 1.2rem;
}
.proc-progress {
  grid-row: 1;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  min-height: 100%;
}
/* --p vai de 0 a 1. Cresce com scaleY e não com height: não obriga a refazer o layout. */
.proc-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--sun-2), var(--sun-4), var(--sun-5));
  transform: scaleY(var(--p, 0));
  transform-origin: top;
  transition: transform 0.25s ease-out;
}
.proc-rail ol { list-style: none; display: grid; gap: 1.6rem; }
.proc-rail-item {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  color: var(--muted);
  opacity: 0.45;
  transition: opacity 0.3s, color 0.3s;
}
.proc-rail-item b {
  font: 700 0.8rem var(--font-display);
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 0.3s;
}
.proc-rail-item span { font: 600 1rem var(--font-display); }
.proc-rail-item.is-active { opacity: 1; color: var(--text); }
.proc-rail-item.is-active b { color: var(--accent); }
.proc-rail-item.is-done { opacity: 0.75; }

.process-list {
  list-style: none;
  display: grid;
  gap: clamp(1.2rem, 3vw, 2rem);
  counter-reset: step;
}
.process-step {
  border: 1px solid rgb(var(--glow, 132 118 214) / 0.16);
  border-radius: var(--radius-m);
  background: linear-gradient(160deg, rgb(var(--glow, 132 118 214) / 0.08), transparent 55%), var(--surface);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  position: relative;
  transition: border-color 0.3s, background 0.3s;
}
.process-step.is-active {
  border-color: rgb(var(--glow, 132 118 214) / 0.45);
  background: linear-gradient(160deg, rgb(var(--glow, 132 118 214) / 0.18), transparent 60%), var(--surface-2);
}

/* Sem espaço para o trilho, ou com movimento reduzido, volta a ser uma lista normal. */
/* No telemóvel o cubo fica numa faixa colada ao cimo enquanto os passos passam por baixo. */
@media (max-width: 899px) {
  .proc { grid-template-columns: 1fr; gap: 1.2rem; }
  .proc-rail {
    top: calc(var(--nav-h) - 2.2rem);
    z-index: 3;
    margin-inline: -1.25rem;
    padding: 2rem 0 1.4rem;
    /* desvanece em cima (por trás do menu) e em baixo: sem cortes a direito */
    background: linear-gradient(to bottom, rgb(0 0 0 / 0) 0, #000 2.4rem, #000 74%, rgb(0 0 0 / 0) 100%);
  }
  .proc-palco { aspect-ratio: auto; height: 30vh; height: 30svh; max-height: none; }
  .proc-trilho { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .proc-rail { position: static; }
  .proc-progress i { transition: none; }
  .process-step { transition: none; }
}
.step-num {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 400;
  line-height: 1;
  color: transparent;
  background: var(--sunset);
  -webkit-background-clip: text;
  background-clip: text;
  display: block;
  width: fit-content;
  margin-bottom: 0.8rem;
}
.process-step h3 { font-size: 1.15rem; margin-bottom: 0.7rem; }
.process-step p { color: var(--muted); font-size: 0.92rem; }
.step-get {
  margin-top: 0.9rem;
  padding: 0.7rem 0.9rem;
  border-left: 2px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--text) !important;
}

/* ---------- Formas de trabalho ---------- */
.ways-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.way-card {
  border: 1px solid rgb(var(--glow, 132 118 214) / 0.16);
  border-radius: var(--radius-l);
  background: linear-gradient(160deg, rgb(var(--glow, 132 118 214) / 0.09), transparent 55%), var(--surface);
  padding: clamp(1.6rem, 3vw, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: border-color 0.25s;
}
.way-card:hover { border-color: rgb(var(--glow, 132 118 214) / 0.42); }
/* A parte que mantém o sistema vivo leva o contorno do pôr do sol */
.way-card-accent,
.way-card-accent:hover {
  border-color: transparent;
  background:
    linear-gradient(160deg, rgb(var(--glow, 132 118 214) / 0.12), transparent 55%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--sunset) border-box;
}
.way-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}
.way-card h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
.way-card p { color: var(--muted); }

/* As duas cartas são as duas partes do mesmo acordo, não alternativas:
   um "+" entre elas diz isso sem mais uma frase. */
.ways-two-parts { position: relative; }
.ways-two-parts::after {
  content: "+";
  position: absolute;
  left: 50%;
  top: 50%;
  /* translate (e não transform) para a rotação abaixo girar à volta do próprio centro */
  translate: -50% -50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid rgb(244 194 178 / 0.45);
  color: var(--sun-4);
  box-shadow: 0 0 22px rgb(241 150 116 / 0.28);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
  animation: girar-mais 16s linear infinite;
}
@keyframes girar-mais { to { rotate: 360deg; } }
@media (max-width: 960px) {
  /* empilhadas (a partir de 960 px), o centro da grelha já não cai no espaço entre as cartas */
  .ways-two-parts::after { display: none; }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.about-body { font-size: clamp(1.05rem, 1.8vw, 1.3rem); line-height: 1.75; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 0.8rem; }
.faq-item {
  border: 1px solid rgb(var(--glow, 132 118 214) / 0.16);
  border-radius: var(--radius-m);
  background: linear-gradient(160deg, rgb(var(--glow, 132 118 214) / 0.08), transparent 55%), var(--surface);
  padding: 1.1rem 1.4rem;
}
.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--sun-4);
  flex-shrink: 0;
  transition: transform 0.35s var(--ease);
}
.faq-item summary:hover { color: var(--sun-3); }
/* abrir e fechar a deslizar, onde o browser deixa (::details-content); nos
   outros abre de uma vez, como antes */
.faq-item { interpolate-size: allow-keywords; }
.faq-item::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.45s var(--ease), content-visibility 0.45s allow-discrete;
}
.faq-item[open]::details-content { block-size: auto; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--muted); margin-top: 0.8rem; max-width: 68ch; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.reassurance {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}
.direct-label { font-weight: 600; margin-bottom: 0.9rem; }
.direct-buttons { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 1rem; }
.contact-details { color: var(--muted); font-size: 0.9rem; }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: clamp(1.4rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.86rem; font-weight: 600; }
.field input,
.field textarea,
.field select {
  background: var(--bg);
  border: 1px solid var(--border-field);
  border-radius: var(--radius-s);
  color: var(--text);
  font: 400 0.95rem var(--font-body);
  padding: 0.75rem 0.9rem;
  width: 100%;
  transition: border-color 0.2s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent-strong);
}
/* Sem isto não se vê onde se está a escrever ao navegar por teclado: o contorno
   estava desligado e só mudava a cor da borda, que é uma diferença demasiado ténue. */
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.btn-submit { margin-top: 0.3rem; }
.form-msg { font-size: 0.9rem; min-height: 1.4em; }
.form-msg.ok { color: var(--green); }
.form-msg.err { color: #ff6b6b; }
/* Nem sucesso nem erro: instrução. Usado quando abrimos o email do visitante
   e falta ele carregar em Enviar. */
.form-msg.info { color: var(--sun-4); }

/* ---------- Footer ---------- */
.footer { padding: 0 0 2.8rem; }
/* o fim da página ao pôr do sol: as dunas do primeiro ecrã em silhueta */
.footer-dunas {
  display: block;
  width: 100%;
  height: clamp(56px, 8vw, 110px);
  margin-bottom: 1.8rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.footer p { color: var(--muted); font-size: 0.9rem; }
.footer .copyright { font-size: 0.8rem; }
.footer-legal { color: inherit; text-underline-offset: 3px; }
.footer-legal:hover { color: var(--accent-strong); }
.footer-social {
  display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start;
  color: var(--text); font-size: 0.9rem; text-decoration: none;
}
.footer-social:hover { color: var(--accent-strong); }
.contact-details a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.contact-details a:hover { color: var(--accent-strong); }

/* ---------- Entradas ao scroll ----------
   Animação (e não transição) com as propriedades soltas translate/scale/rotate:
   assim não pisa o transform nem as transições dos próprios cartões (hover,
   inclinação). O --rd é o atraso escalonado que o script.js dá a cada lote. */
.reveal:not(.in) { opacity: 0; }
.reveal.in { animation: entrar 0.9s var(--ease) var(--rd, 0ms) backwards; }
/* versão que vira para a frente; o pai precisa de perspective */
.reveal-flip.in { animation-name: entrar-virar; }
.services-grid,
.ways-grid { perspective: 1400px; }
@keyframes entrar {
  from { opacity: 0; translate: 0 32px; scale: 0.97; filter: blur(8px); }
}
@keyframes entrar-virar {
  from { opacity: 0; translate: 0 26px; rotate: x 16deg; filter: blur(6px); }
}

/* ---------- Inclinação dos cartões ----------
   O script.js põe .tilt nos cartões e .is-tilting enquanto o rato está por cima
   (só com rato e sem "reduzir movimento"). --rx/--ry inclinam até 5 graus e
   --mx/--my levam um brilho do pôr do sol atrás do cursor. */
.tilt {
  position: relative;
  isolation: isolate;
  transition: transform 0.6s var(--ease), border-color 0.25s, background-color 0.3s;
}
.tilt.is-tilting {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-3px);
  transition: transform 0.15s ease-out, border-color 0.25s, background-color 0.3s;
}
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%),
    rgb(244 194 178 / 0.14), rgb(185 176 215 / 0.07) 45%, transparent 70%);
  opacity: 0;
  transition: opacity 0.35s;
}
.tilt.is-tilting::after { opacity: 1; }

/* ---------- Títulos que se escrevem (script.js) ----------
   As letras estão todas no sítio desde o início, só escondidas: o título não
   muda de tamanho enquanto se escreve. O cursor é um bloco de pontos, como a
   letra, e vive no body (o script dá-lhe o tamanho da letra do título). */
.teclar .tecla { visibility: hidden; }
.teclar .tecla.vista { visibility: visible; }
.headline.teclar .line { animation: none; }
.cursor-tecla {
  position: absolute;
  z-index: 5;
  width: 0.5em;
  height: 0.84em;
  background: radial-gradient(circle, var(--sun-4) 0 40%, transparent 46%) 0 0 / 0.105em 0.105em;
  filter: drop-shadow(0 0 0.12em rgb(241 150 116 / 0.75));
  pointer-events: none;
  animation: piscar-cursor 1.05s steps(1) infinite;
}
.cursor-tecla.a-escrever { animation: none; }
.cursor-tecla.sair { opacity: 0; transition: opacity 0.4s; }
@keyframes piscar-cursor { 50% { opacity: 0; } }
@media print {
  .teclar .tecla { visibility: visible; }
  .cursor-tecla { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal:not(.in) { opacity: 1; }
  .tilt.is-tilting { transform: none; }
  * { animation: none !important; }
}
@media print {
  .reveal:not(.in) { opacity: 1; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .project-head,
  /* a regra de alternância tem especificidade maior — sem isto ganhava aqui */
  .project:nth-of-type(even) .project-head { grid-template-columns: 1fr; }
  .project-visual { order: -1; }
  .demo-float { bottom: -10px; right: 8px; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .ways-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* A nav completa precisa de cerca de 860px; abaixo disso fica o logótipo e o burger. */
@media (max-width: 900px) {
  .nav-inner { justify-content: space-between; max-width: none; }
  .nav-links,
  .nav .nav-cta,
  .nav .lang-toggle { display: none; }
  .nav-logo { width: 48px; height: 48px; }
  .nav-burger { display: flex; }
}

@media (max-width: 720px) {
  .trust-pill { font-size: 12px; }
  .headline { line-height: 1.08; }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: clamp(14px, 2.4vh, 22px);
  }
  .brand img { height: 26px; }

  .case-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .features { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .process-list { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .hero-ctas .btn { width: 100%; }
  .project-actions .btn { width: 100%; }
  .direct-buttons .btn { width: 100%; }
}

@media (max-width: 480px) {
  /* a pílula de confiança só passa a duas linhas, equilibradas, se não couber no ecrã */
  .trust { --trust-size: 34px; }
  .trust-pill {
    padding-block: 5px;
    border-radius: 20px;
    text-align: left;
    white-space: normal;
    text-wrap: balance;
  }
}

/* Portáteis (ecrã baixo): menos ar por cima, logótipo e título um pouco mais
   pequenos, para os quatro números continuarem dentro do primeiro ecrã. */
@media (max-height: 820px) {
  .hero { padding-top: calc(var(--nav-top) + var(--nav-size) + clamp(8px, 1.6vh, 16px)); }
  .hero-logo { width: min(clamp(200px, 32vw, 460px), 34vh); margin-bottom: clamp(8px, 1.6vh, 14px); }
  .headline { font-size: min(clamp(30px, 6.2vw, 80px), 10.4vh); }
}
/* Telemóvel deitado: não há altura para o logótipo grande, fica o da nav */
@media (max-height: 440px) {
  .hero-logo { display: none; }
}

/* Ecrãs baixos (portáteis pequenos, telemóvel deitado): menos ar entre os blocos */
@media (max-height: 700px) {
  .trust { margin-bottom: 12px; }
  .headline { margin-bottom: 10px; }
  .subhead { margin-bottom: 16px; line-height: 1.45; }
  .stat { gap: 4px; }
}
@media (max-height: 440px) {
  .headline { font-size: min(clamp(30px, 6.2vw, 80px), 11vh); }
}

/* ============================================================
   BOTÃO DE CONTACTO FLUTUANTE
   ============================================================ */
.contact-fab {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--btn-text);
  font: 600 0.92rem var(--font-body);
  text-decoration: none;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(var(--accent-rgb), 0.35);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s, background 0.2s;
}
.contact-fab svg { width: 18px; height: 18px; flex: 0 0 auto; }
.contact-fab:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.75), 0 0 0 4px rgb(244 194 178 / 0.3), 0 0 26px rgb(241 150 116 / 0.45);
}
.contact-fab:active { transform: translateY(0) scale(0.98); }
.contact-fab:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
/* [hidden] sozinho perderia para o display:inline-flex acima */
.contact-fab[hidden] { display: none; }
/* estado de entrada/saída suave, controlado pelo script */
.contact-fab.is-out { opacity: 0; transform: translateY(12px); pointer-events: none; }

@media (max-width: 560px) {
  /* em ecrãs estreitos fica só o ícone, para não tapar o conteúdo */
  .contact-fab { padding: 0.85rem; }
  .contact-fab span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .contact-fab { transition: opacity 0.2s; }
  .contact-fab:hover { transform: none; }
}

/* ============================================================
   CALCULADORA — quanto custa fazer à mão
   ============================================================ */
.calc {
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3.2rem);
  align-items: start;
}
.calc-controls { display: grid; gap: 1.7rem; }
.calc-field { display: grid; gap: 0.55rem; }
.calc-label { font-size: 0.92rem; color: var(--muted); }
.calc-value {
  font: 700 1.5rem var(--font-display);
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}
.calc input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(to right, var(--sun-2), var(--sun-4), var(--sun-5)) 0 0 / var(--fill, 30%) 100% no-repeat,
    var(--border-strong);
  cursor: pointer;
}
.calc input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-alt);
  box-shadow: 0 0 0 4px rgb(244 194 178 / 0.16), 0 2px 14px -2px rgb(241 150 116 / 0.65);
  cursor: grab;
}
.calc input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-alt);
  cursor: grab;
}
.calc input[type="range"]:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 6px; }

.calc-results {
  background: linear-gradient(160deg, rgb(var(--glow, 132 118 214) / 0.12), transparent 60%), var(--surface);
  border: 1px solid rgb(var(--glow, 132 118 214) / 0.3);
  border-radius: var(--radius-m);
  padding: clamp(1.3rem, 3vw, 2rem);
  display: grid;
  gap: 1.2rem;
}
.calc-result { display: grid; gap: 0.15rem; }
.calc-num {
  font: 400 clamp(2rem, 5vw, 3.1rem)/1 var(--font-display);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.calc-result-strong .calc-num {
  width: fit-content;
  color: transparent;
  background: var(--sunset);
  -webkit-background-clip: text;
  background-clip: text;
}
.calc-unit { font-size: 0.92rem; color: var(--muted); }
.calc-assumption {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 66ch;
  border-left: 2px solid var(--border-strong);
  padding-left: 0.9rem;
}
.calc-cta { grid-column: 1 / -1; justify-self: start; }

@media (max-width: 767px) {
  .calc { grid-template-columns: 1fr; }
}

/* ============================================================
   DEMO A CORRER DENTRO DA PÁGINA (dentro do caso de estudo)
   ============================================================ */
.live-demo { margin-top: 2rem; }
.live-demo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.live-demo-open {
  font: 600 0.85rem var(--font-body);
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.live-demo-open:hover { border-bottom-color: var(--accent-strong); }
.live-demo-note { color: var(--muted); font-size: 0.9rem; margin: 0.2rem 0 0.9rem; max-width: 62ch; }
.live-demo-frame {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  height: clamp(420px, 62vh, 660px);
}
.live-demo-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ============================================================
   ÓRBITA: ferramentas e clientes, em 3D (3d/planeta.js)
   O palco ocupa a largura toda do ecrã, para os anéis de fora caberem, e as
   margens do canvas desvanecem-se. Sem 3D (ou enquanto ele não chega), a
   lista aparece em pílulas no mesmo espaço, por isso nada salta.
   ============================================================ */
.section-orbit { padding-bottom: clamp(1rem, 4vh, 3rem); }
.orbit-stage {
  position: relative;
  width: 100%;
  height: clamp(360px, 46vw, 600px);
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
}
.orbit-lista {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 0.7rem;
  width: min(820px, 100% - 2.5rem);
  height: 100%;
  margin-inline: auto;
}
.orbit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  border: 1px solid rgb(var(--glow, 132 118 214) / 0.28);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}
.orbit-chip img { display: block; width: auto; height: auto; max-height: 22px; max-width: 160px; }
.orbit-chip.icon img { width: 20px; height: 20px; }
.orbit-chip img.invert { filter: invert(1) brightness(1.9); }
.orbit-chip .wordmark { font: 400 0.95rem var(--font-display); white-space: nowrap; }
/* as margens do canvas desvanecem: sem cortes a direito no brilho do planeta */
.orbit-stage > .stage-canvas {
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent),
    linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}

/* ============================================================
   PALCOS 3D (3d/stage.js)
   O canvas aparece por cima da versão em HTML quando a cena está pronta
   (.is-3d). A versão em HTML fica escondida só à vista: os leitores de ecrã
   continuam a lê-la, e volta a aparecer se o 3D falhar (.sem-3d).
   ============================================================ */
.stage-3d > .stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.stage-3d.is-3d > .stage-canvas { opacity: 1; }
.stage-3d.is-3d > .stage-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Trabalhos (3d/ecras.js): os ecrãs 3D ficam onde estavam as molduras. O canvas
   transborda um pouco da caixa para os ecrãs poderem rodar sem ser cortados; as
   molduras ficam invisíveis mas no sítio (guardam o tamanho e o texto alternativo). */
/* (um canvas não estica entre left e right como uma caixa normal: precisa de largura e altura)
   Para os lados transborda 10% da caixa, mas nunca para lá da margem do ecrã: quando a
   coluna encosta à margem (ecrãs até ~1300 px), fica pela margem. */
.project-visual > .stage-canvas {
  --sx: min(10%, max(1.25rem, calc((100vw - 1160px) / 2 - 12px)));
  inset: auto;
  left: calc(-1 * var(--sx));
  top: -14%;
  width: calc(100% + 2 * var(--sx));
  height: 128%;
  z-index: 1;
}
.project-visual > .stage-canvas {
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent),
    linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent),
    linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-composite: intersect;
}
.project-visual.is-3d > .browser-frame,
.project-visual.is-3d > .phone-frame { opacity: 0; }
.project-visual .demo-float { z-index: 3; }
@media (max-width: 720px) {
  .project-visual > .stage-canvas { top: -10%; height: 120%; }
}
/* Contacto (3d/marca.js): o símbolo em relevo por cima do título; sem 3D, o símbolo plano */
.contacto-palco {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(170px, 22vw, 250px);
  margin-bottom: 1.2rem;
}
.contacto-palco > img { width: auto; height: 46%; transition: opacity 0.6s; }
.contacto-palco.is-3d > img { opacity: 0; }
.contacto-palco > .stage-canvas {
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent),
    linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent),
    linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
  mask-composite: intersect;
}
@media print {
  .stage-3d > .stage-canvas { display: none; }
  .stage-3d.is-3d > .stage-fallback { position: static; width: auto; height: auto; clip-path: none; }
}
