﻿/* ==========================================================================
   TWILIGHT ENERGY — Folha de estilos principal
   Development. Investment. Impact.

   Estrutura:
     1.  Tokens de design (cores, tipografia, espaçamento)
     2.  Reset e base
     3.  Utilitários e componentes partilhados
     4.  Header / Navegação
     5.  Hero
     6.  Secção "A Twilight Energy"
     7.  Serviços
     8.  Timeline "Do potencial ao Ready-to-Build"
     9.  Números
     10. Porquê a Twilight Energy
     11. Call to Action
     12. Contactos
     13. Footer
     14. Animações de entrada
     15. Responsivo
   ========================================================================== */

/* ==========================================================================
   1. TOKENS DE DESIGN
   ========================================================================== */
:root {
  /* Paleta da marca */
  --navy:          #0B1A2E;   /* azul muito escuro  */
  --blue-deep:     #1E3A5F;   /* azul profundo      */
  --blue-mid:      #2F5D8A;   /* azul secundário    */
  --orange:        #FF8C42;   /* laranja energético */
  --gold:          #FFC145;   /* dourado solar      */
  --white:         #FFFFFF;
  --gray-light:    #E5E7EB;

  /* Derivados */
  --gray-bg:       #F6F8FB;
  --gray-line:     #DFE4EC;
  --ink:           #0B1A2E;
  --ink-soft:      #47576E;
  --ink-faint:     #7A8798;
  --on-dark:       #FFFFFF;
  --on-dark-soft:  #A9B8CC;
  --on-dark-faint: #74869E;

  /* Tipografia */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --max:      1240px;
  --max-text: 760px;
  --gutter:   clamp(20px, 5vw, 40px);
  --radius:   4px;
  --radius-lg: 8px;

  /* Movimento */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.2s var(--ease);
  --t-med:  0.35s var(--ease);
  --t-slow: 0.6s var(--ease);

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(11, 26, 46, 0.06), 0 2px 8px rgba(11, 26, 46, 0.04);
  --shadow-md: 0 4px 12px rgba(11, 26, 46, 0.08), 0 12px 32px rgba(11, 26, 46, 0.07);
  --shadow-lg: 0 8px 24px rgba(11, 26, 46, 0.10), 0 24px 60px rgba(11, 26, 46, 0.10);

  /* Altura do header. Tem de acompanhar o tamanho do logótipo — ver .brand img */
  --header-h: 96px;
}

/* ==========================================================================
   2. RESET E BASE
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }

img, svg { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; }

::selection {
  background: var(--gold);
  color: var(--navy);
}

/* Foco visível e acessível */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Link para saltar para o conteúdo (acessibilidade) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--navy);
  color: var(--white);
  padding: 14px 22px;
  font-weight: 600;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   3. UTILITÁRIOS E COMPONENTES PARTILHADOS
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(72px, 10vw, 132px);
  position: relative;
}

.section--tight { padding-block: clamp(56px, 7vw, 92px); }

/* Duas secções escuras seguidas leem-se como um só bloco */
.section--dark + .section--dark { padding-top: 0; }

.section--light { background: var(--white); }
.section--gray  { background: var(--gray-bg); }

.section--dark {
  background: var(--navy);
  color: var(--on-dark-soft);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--on-dark); }

/* Cabeçalho de secção */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 20px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--orange);
  flex-shrink: 0;
}

.section-title {
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  margin-bottom: 24px;
}

.section-lede {
  max-width: var(--max-text);
  font-size: clamp(1.02rem, 1.3vw, 1.15rem);
  color: var(--ink-soft);
}
.section--dark .section-lede { color: var(--on-dark-soft); }

.section-head { margin-bottom: clamp(44px, 6vw, 72px); }

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), transform var(--t-fast),
              box-shadow var(--t-fast);
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn--primary {
  background: var(--orange);
  color: var(--navy);
  border-color: var(--orange);
}
.btn--primary:hover {
  background: var(--gold);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(255, 140, 66, 0.32);
}

.btn--ghost-dark {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.42);
}
.btn--ghost-dark:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
  transform: translateY(-2px);
}

.btn--ghost-light {
  background: transparent;
  color: var(--navy);
  border-color: var(--gray-line);
}
.btn--ghost-light:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
}

.btn--solid-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn--solid-navy:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--block { width: 100%; }

/* Seta que desliza no hover */
.btn .arrow { transition: transform var(--t-fast); }
.btn:hover .arrow { transform: translateX(4px); }

/* Link textual com seta */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--blue-mid);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform var(--t-fast); }
.link-arrow:hover { color: var(--orange); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ==========================================================================
   4. HEADER / NAVEGAÇÃO
   ========================================================================== */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background var(--t-med), height var(--t-med),
              box-shadow var(--t-med), border-color var(--t-med);
  border-bottom: 1px solid transparent;
}

.header.is-solid {
  height: 76px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--gray-line);
  box-shadow: 0 2px 20px rgba(11, 26, 46, 0.06);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: 100%;
}

/* Logótipo — troca entre versão branca (sobre o hero) e navy (header sólido).
   TAMANHO DO LOGÓTIPO: é a altura abaixo que manda. Se a aumentar muito,
   aumente também --header-h (secção 1) para o header não ficar apertado. */
.brand {
  display: block;
  flex-shrink: 0;
  line-height: 0;
}
.brand img {
  height: 56px;          /* logótipo sobre o hero */
  width: auto;
  transition: height var(--t-med), opacity var(--t-med);
}
.header.is-solid .brand img { height: 46px; }   /* depois do scroll */

.brand__light { display: block; }
.brand__dark  { display: none; }
.header.is-solid .brand__light { display: none; }
.header.is-solid .brand__dark  { display: block; }

/* Navegação */
.nav { display: flex; align-items: center; gap: 34px; }

/* O CTA e o seletor de idioma dentro de .nav existem só para o menu mobile */
.nav > .btn,
.nav > .lang { display: none; }

.nav__link {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.86);
  padding-block: 6px;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: var(--orange);
  transition: width var(--t-med);
}
.nav__link:hover::after,
.nav__link.is-active::after { width: 100%; }
.nav__link:hover { color: var(--white); }
.nav__link.is-active { color: var(--white); }

.header.is-solid .nav__link { color: var(--ink-soft); }
.header.is-solid .nav__link:hover,
.header.is-solid .nav__link.is-active { color: var(--navy); }

/* Zona de ações à direita */
.header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

/* Seletor de idioma (preparado para versão EN) */
.lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.lang__btn {
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.55);
  transition: color var(--t-fast);
}
.lang__btn.is-active { color: var(--white); }
.lang__sep { color: rgba(255, 255, 255, 0.3); }
.header.is-solid .lang__btn { color: var(--ink-faint); }
.header.is-solid .lang__btn.is-active { color: var(--navy); }
.header.is-solid .lang__sep { color: var(--gray-line); }

.header__cta { padding: 12px 24px; font-size: 0.88rem; }

.header.is-solid .header__cta.btn--ghost-dark {
  color: var(--navy);
  border-color: var(--navy);
}
.header.is-solid .header__cta.btn--ghost-dark:hover {
  background: var(--navy);
  color: var(--white);
}

/* Botão de menu mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.8px;
  margin-inline: auto;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--t-med), opacity var(--t-fast), background var(--t-med);
}
.header.is-solid .nav-toggle span { background: var(--navy); }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.8px) rotate(-45deg); }

/* ==========================================================================
   5. HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  padding-bottom: 90px;
  isolation: isolate;
  background: var(--navy);
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

/* Fundo: substituir por fotografia real em images/hero.jpg — ver images/LEIA-ME.md */
.hero__media img,
.hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Sobreposição escura azulada para legibilidade */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    /* escurece o lado esquerdo, onde assenta o texto */
    linear-gradient(100deg, rgba(11, 26, 46, 0.90) 0%, rgba(11, 26, 46, 0.70) 42%, rgba(11, 26, 46, 0.26) 74%, rgba(11, 26, 46, 0.40) 100%),
    /* topo (header) e base (faixa de pilares) */
    linear-gradient(180deg, rgba(11, 26, 46, 0.58) 0%, rgba(11, 26, 46, 0.06) 34%, rgba(11, 26, 46, 0.40) 72%, rgba(11, 26, 46, 0.82) 100%);
}

.hero__content {
  max-width: 780px;
  color: var(--on-dark-soft);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
}
.hero__eyebrow::before {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--gold);
}

.hero h1 {
  font-size: clamp(2.3rem, 5.2vw, 4.05rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 28px;
  max-width: 16ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero__lede {
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
  color: rgba(255, 255, 255, 0.8);
  max-width: 60ch;
  margin-bottom: 40px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 64px;
}

/* Faixa de pilares no fundo do hero */
.hero__pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 26px;
  max-width: 900px;
}
.hero__pillar {
  padding-right: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}
.hero__pillar:last-child { border-right: none; }
.hero__pillar strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 4px;
}
.hero__pillar span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.58);
}

/* Indicador de scroll — encostado à direita para não colidir com os pilares */
.scroll-hint {
  position: absolute;
  right: var(--gutter);
  bottom: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.scroll-hint__rail {
  position: relative;
  width: 1px;
  height: 46px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.scroll-hint__rail::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 18px;
  background: var(--gold);
  animation: scrollTravel 2.2s var(--ease) infinite;
}

@keyframes scrollTravel {
  0%   { transform: translateY(-20px); opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: translateY(46px); opacity: 0; }
}

/* ==========================================================================
   6. SECÇÃO "A TWILIGHT ENERGY"
   ========================================================================== */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(40px, 6vw, 90px);
  align-items: start;
}

.about__body p { font-size: 1.06rem; }
.about__body strong { color: var(--ink); font-weight: 600; }

/* Painel de destaque com o número principal */
.figure-panel {
  border: 1px solid var(--gray-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.figure-panel__head {
  background: var(--navy);
  color: var(--white);
  padding: 38px 34px 34px;
  position: relative;
  overflow: hidden;
}
.figure-panel__head::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 193, 69, 0.22) 0%, rgba(255, 140, 66, 0) 70%);
}
.figure-panel__value {
  font-size: clamp(3rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 10px;
}
.figure-panel__label {
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.72);
  max-width: 30ch;
}

.figure-panel__list { padding: 10px 34px 30px; }
.figure-panel__list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-block: 18px;
  border-bottom: 1px solid var(--gray-line);
}
.figure-panel__list li:last-child { border-bottom: none; }

.figure-panel__list .tick {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border-radius: 50%;
  background: rgba(255, 140, 66, 0.14);
  display: grid;
  place-items: center;
}
.figure-panel__list .tick svg { width: 12px; height: 12px; stroke: var(--orange); }

.figure-panel__list strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.figure-panel__list span {
  font-size: 0.88rem;
  color: var(--ink-faint);
}

/* ==========================================================================
   6b. QUEM SOMOS — equipa
   ========================================================================== */
/* align-items: stretch iguala a altura dos cartões, para "Percurso completo"
   e o LinkedIn ficarem alinhados entre as quatro pessoas mesmo com resumos
   de comprimentos diferentes. */
.team__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.member {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
}
.member:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.member__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  /* Igual ao fundo recortado das fotografias (#E5E7EB), para não se ver
     emenda enquanto a imagem carrega. */
  background: var(--gray-light);
}
.member__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform var(--t-slow);
}
.member:hover .member__photo img { transform: scale(1.04); }

/* Risco fino a separar a fotografia do corpo do cartão */
.member__photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--gray-line);
  pointer-events: none;
}

.member__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 26px 24px 24px;
}

.member h3 {
  font-size: 1.12rem;
  letter-spacing: -0.015em;
  margin-bottom: 5px;
}

.member__role {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}

.member__bio {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

/* Percurso completo — abre/fecha sem JavaScript */
.member__cv {
  margin-top: auto;
  border-top: 1px solid var(--gray-line);
  padding-top: 14px;
}

.member__cv summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-mid);
  padding-block: 4px;
  transition: color var(--t-fast);
}
.member__cv summary::-webkit-details-marker { display: none; }
.member__cv summary:hover { color: var(--orange); }

.member__cv summary svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  transition: transform var(--t-med);
}
.member__cv[open] summary svg { transform: rotate(180deg); }

.member__cv-body {
  padding-top: 12px;
  font-size: 0.88rem;
  color: var(--ink-faint);
}
.member__cv-body p { margin-bottom: 0.9em; }
.member__cv-body p:last-child { margin-bottom: 0; }
.member__cv-body ul { margin-bottom: 0.9em; }
.member__cv-body li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 6px;
}
.member__cv-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--orange);
}

.member__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-faint);
  transition: color var(--t-fast);
}
.member__link svg { width: 15px; height: 15px; fill: currentColor; }
.member__link:hover { color: var(--blue-mid); }

/* ==========================================================================
   7. SERVIÇOS
   --------------------------------------------------------------------------
   Lista de linhas clicáveis sobre fundo escuro. Cada linha tem três colunas:
   marcador + título | descrição | seta. Ao clicar abre a janela do serviço.
   ========================================================================== */

/* Cabeçalho: título à esquerda, descrição à direita, alinhados pela base */
.svc-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.svc-head .section-title { margin-bottom: 0; }

.svc-head__desc {
  font-size: 0.95rem;
  color: var(--on-dark-soft);
  margin-bottom: 0;
}

/* Lista de linhas */
.svc-rows { border-top: 1px solid rgba(255, 255, 255, 0.14); }

.svc-row {
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding: 26px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), padding-left var(--t-fast), border-left-color var(--t-fast);
}
.svc-row:hover,
.svc-row:focus-visible {
  background: rgba(255, 255, 255, 0.045);
  padding-left: 18px;
  border-left-color: var(--orange);
}
.svc-row:focus-visible { outline: none; }

.svc-row__head { min-width: 0; }

.svc-row__marker {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
}

.svc-row__title {
  display: block;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--white);
  line-height: 1.3;
}

.svc-row__desc {
  font-size: 0.9rem;
  color: var(--on-dark-faint);
  margin-bottom: 0;
}

.svc-row__arrow {
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
  transition: color var(--t-fast), transform var(--t-fast);
}
.svc-row__arrow svg { width: 18px; height: 18px; }
.svc-row:hover .svc-row__arrow,
.svc-row:focus-visible .svc-row__arrow {
  color: var(--gold);
  transform: translateX(5px);
}

/* ==========================================================================
   7b. JANELAS (MODAIS) DOS SERVIÇOS
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(6, 15, 28, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--t-med);
}
.modal[hidden] { display: none; }
.modal.is-open { opacity: 1; }

.modal__box {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: clamp(28px, 4vw, 48px);
  background: var(--blue-deep);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  transform: translateY(24px);
  transition: transform var(--t-med);
}
.modal.is-open .modal__box { transform: none; }

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.modal__close svg { width: 15px; height: 15px; }
.modal__close:hover {
  color: var(--white);
  border-color: var(--gold);
  background: rgba(255, 193, 69, 0.1);
}

.modal__num {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 12px;
}

.modal__box h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 14px;
  padding-right: 44px;
}

.modal__intro {
  font-size: 0.95rem;
  color: var(--on-dark-soft);
  line-height: 1.75;
  margin-bottom: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.modal__list-title {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 16px;
}

.modal__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
}
.modal__list li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--on-dark-soft);
  line-height: 1.55;
}
.modal__list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--orange);
}

.modal__footer {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Impede o scroll da página com a janela aberta */
body.modal-open { overflow: hidden; }

/* ==========================================================================
   8. TIMELINE "DO POTENCIAL AO READY-TO-BUILD"
   ========================================================================== */
.timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.tl-step { position: relative; padding-top: 58px; }

.tl-step__dot {
  position: absolute;
  top: 12px;
  left: 0;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--navy);
  border: 1.5px solid var(--blue-mid);
  transition: border-color var(--t-med), background var(--t-med), box-shadow var(--t-med);
}
.tl-step__dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: transparent;
  transition: background var(--t-med);
}
.tl-step:hover .tl-step__dot,
.tl-step.is-final .tl-step__dot {
  border-color: var(--orange);
  box-shadow: 0 0 0 5px rgba(255, 140, 66, 0.14);
}
.tl-step:hover .tl-step__dot::after,
.tl-step.is-final .tl-step__dot::after { background: var(--orange); }

.tl-step__num {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--orange);
  margin-bottom: 10px;
}

.tl-step h3 {
  font-size: 1.06rem;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.tl-step p {
  font-size: 0.88rem;
  color: var(--on-dark-faint);
}

.tl-step.is-final h3 { color: var(--gold); }

/* ==========================================================================
   9. NÚMEROS
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 60px);
}

.stat {
  padding: 34px 0 0;
  border-top: 2px solid rgba(255, 255, 255, 0.16);
  transition: border-color var(--t-med);
}
.stat:hover { border-top-color: var(--orange); }

.stat__value {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(2.6rem, 5.4vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--white);
  margin-bottom: 14px;
}
.stat__value .unit { color: var(--gold); }

.stat__label {
  font-size: 0.95rem;
  color: var(--on-dark-soft);
  max-width: 34ch;
}

/* ==========================================================================
   10. PORQUÊ A TWILIGHT ENERGY
   ========================================================================== */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2px;
  background: var(--gray-line);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pillar {
  background: var(--white);
  padding: 40px 32px 42px;
  transition: background var(--t-med);
}
.pillar:hover { background: var(--gray-bg); }

.pillar__num {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--orange);
  margin-bottom: 26px;
}

.pillar h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}

.pillar p {
  font-size: 0.92rem;
  color: var(--ink-faint);
}

/* Nota de edição (usada na secção Quem Somos) */
.edit-note {
  margin-top: 34px;
  padding: 20px 24px;
  background: var(--white);
  border: 1px dashed var(--gray-line);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--ink-faint);
}

/* ==========================================================================
   11. CALL TO ACTION
   ========================================================================== */
.cta {
  position: relative;
  isolation: isolate;
  padding-block: clamp(80px, 10vw, 140px);
  background: var(--navy);
  text-align: center;
  overflow: hidden;
}
.cta__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.cta__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cta__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(11, 26, 46, 0.86) 0%, rgba(11, 26, 46, 0.72) 50%, rgba(11, 26, 46, 0.9) 100%);
}

.cta h2 {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  color: var(--white);
  margin-bottom: 18px;
  max-width: 22ch;
  margin-inline: auto;
}
.cta p {
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 38px;
}

/* ==========================================================================
   12. CONTACTOS
   ========================================================================== */
.contact__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(40px, 6vw, 84px);
  align-items: start;
}

.contact__aside h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
  margin-bottom: 20px;
}

.contact__details { margin-top: 40px; }

.contact-item {
  display: flex;
  gap: 16px;
  padding-block: 20px;
  border-top: 1px solid var(--gray-line);
}
.contact-item:last-child { border-bottom: 1px solid var(--gray-line); }

.contact-item__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--gray-bg);
  display: grid;
  place-items: center;
}
.contact-item__icon svg {
  width: 17px; height: 17px;
  stroke: var(--blue-mid);
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-item dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3px;
}
.contact-item dd {
  margin: 0;
  font-size: 0.99rem;
  font-weight: 500;
  color: var(--ink);
}
.contact-item dd a:hover { color: var(--orange); }

/* Formulário */
.form {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px);
  box-shadow: var(--shadow-sm);
}

.form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.field .opt {
  font-weight: 400;
  color: var(--ink-faint);
  letter-spacing: 0;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 0.96rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input::placeholder,
.field textarea::placeholder { color: #A9B3C1; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #C3CBD8; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(47, 93, 138, 0.12);
}

.field textarea { resize: vertical; min-height: 130px; }

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2347576E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px;
  padding-right: 40px;
}

.form__foot {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* Apanha-robôs do Netlify — invisível para pessoas */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Mensagem de estado do formulário */
.form__status {
  margin-top: 16px;
  padding: 13px 16px;
  font-size: 0.9rem;
  border-radius: var(--radius);
  background: rgba(47, 93, 138, 0.08);
  color: var(--blue-deep);
  border: 1px solid rgba(47, 93, 138, 0.2);
}
.form__status[hidden] { display: none; }

/* ==========================================================================
   13. FOOTER
   ========================================================================== */
.footer {
  background: var(--navy);
  color: var(--on-dark-faint);
  padding-top: clamp(56px, 7vw, 80px);
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 5vw, 70px);
  padding-bottom: 52px;
}

/* Logótipo do rodapé — independente do header */
.footer__brand img { height: 58px; width: auto; margin-bottom: 22px; }

.footer__tagline {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.footer__about {
  font-size: 0.92rem;
  color: var(--on-dark-faint);
  max-width: 42ch;
}

.footer__col h4 {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 20px;
}
.footer__col li { margin-bottom: 11px; }
.footer__col a,
.footer__col span {
  font-size: 0.92rem;
  color: var(--on-dark-faint);
}
.footer__col a:hover { color: var(--gold); }

.footer__social {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.footer__social a {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.footer__social svg { width: 17px; height: 17px; fill: currentColor; }
.footer__social a:hover {
  border-color: var(--gold);
  background: rgba(255, 193, 69, 0.1);
  color: var(--gold);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-block: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.84rem;
}

/* ==========================================================================
   14. ANIMAÇÕES DE ENTRADA
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Escalonamento em grelhas */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: none;
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.00s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.07s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.14s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.21s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.28s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.35s; }

/* Respeitar preferências de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal,
  .reveal-stagger > * { opacity: 1; transform: none; }
}

/* ==========================================================================
   15. RESPONSIVO
   ========================================================================== */

/* Tablet largo */
/* Faixa estreita antes do menu mobile: aperta a navegação para os 7 itens
   caberem sem colidir com o logótipo e o botão de contacto. */
@media (max-width: 1180px) {
  .nav { gap: 20px; }
  .nav__link { font-size: 0.87rem; }
  .header__actions { gap: 12px; }
  .header__cta { padding: 11px 18px; font-size: 0.84rem; }
}

@media (max-width: 1100px) {
  .team__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc-row    { grid-template-columns: 220px 1fr auto; }
  .timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 42px; }
  .timeline::before { display: none; }
}

/* Tablet */
@media (max-width: 980px) {
  :root { --header-h: 80px; }

  /* Logótipo um pouco menor em ecrãs pequenos */
  .brand img,
  .header.is-solid .brand img { height: 46px; }

  .nav,
  .header__actions .lang,
  .header__cta { display: none; }

  .nav-toggle { display: flex; }

  /* Menu mobile em painel deslizante */
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 28px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-line);
    box-shadow: var(--shadow-md);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--t-med), opacity var(--t-med), visibility var(--t-med);
  }
  .nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .nav__link {
    color: var(--ink);
    font-size: 1.02rem;
    font-weight: 500;
    padding-block: 15px;
    border-bottom: 1px solid var(--gray-line);
  }
  .nav__link::after { display: none; }
  .nav__link.is-active { color: var(--orange); }

  .nav > .btn,
  .nav > .lang {
    display: flex;
    margin-top: 20px;
  }
  .nav .lang { justify-content: center; }
  .nav .lang__btn { color: var(--ink-faint); }
  .nav .lang__btn.is-active { color: var(--navy); }
  .nav .lang__sep { color: var(--gray-line); }

  /* Header fica sempre sólido quando o menu está aberto */
  .header.is-menu-open {
    background: var(--white);
    border-bottom-color: var(--gray-line);
  }
  .header.is-menu-open .brand__light { display: none; }
  .header.is-menu-open .brand__dark  { display: block; }
  .header.is-menu-open .nav-toggle span { background: var(--navy); }

  .about__grid,
  .svc-head,
  .contact__grid { grid-template-columns: minmax(0, 1fr); }

  /* Linhas dos serviços: a descrição sai, ficando marcador/título e seta */
  .svc-row { grid-template-columns: 1fr auto; gap: 16px; }
  .svc-row__desc { display: none; }

  .footer__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer__brand { grid-column: 1 / -1; }

  .hero__pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .hero__pillar:nth-child(2) { border-right: none; }
}

/* Telemóvel */
@media (max-width: 680px) {
  body { font-size: 16px; }

  .team__grid,
  .timeline,
  .stats { grid-template-columns: minmax(0, 1fr); }

  .svc-head__desc { margin-top: 18px; }

  /* A janela do serviço ocupa a base do ecrã */
  .modal { align-items: flex-end; padding: 0; }
  .modal__box {
    max-height: 88vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
  }
  .modal__list { grid-template-columns: minmax(0, 1fr); }

  /* Em telemóvel o retrato fica mais baixo para não empurrar o texto */
  .member__photo { aspect-ratio: 3 / 2; }
  .member__photo img { object-position: center 28%; }

  .timeline { row-gap: 34px; }

  .stats { gap: 32px; }
  .stat { padding-top: 26px; }

  .form__row { grid-template-columns: minmax(0, 1fr); gap: 0; }

  /* Em ecrãs pequenos o hero cresce com o conteúdo em vez de o centrar,
     para o texto nunca passar por baixo do header fixo. */
  .hero {
    min-height: auto;
    align-items: flex-start;
    padding-top: calc(var(--header-h) + 44px);
    padding-bottom: 72px;
  }
  .hero__actions { gap: 12px; }
  .hero__actions .btn { width: 100%; }
  .hero__pillars { grid-template-columns: minmax(0, 1fr); }
  .hero__pillar { border-right: none; padding-right: 0; }

  .scroll-hint { display: none; }

  .footer__top { grid-template-columns: minmax(0, 1fr); }
}

/* Impressão */
@media print {
  .header, .scroll-hint, .cta, .form { display: none; }
  body { color: #000; background: #fff; }
}
