/* Iteração 2: respiração, cabeçalho em scroll e interações responsivas. */
:root {
  --page-gutter: clamp(24px, 5vw, 80px);
  --content-edge: max(var(--page-gutter), calc((100vw - 1440px) / 2));
}

.shell {
  width: min(calc(100% - var(--page-gutter) - var(--page-gutter)), 1440px);
}

.site-header {
  position: fixed;
  height: 94px;
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  transition: background-color .26s ease, border-color .26s ease, box-shadow .26s ease;
}

.site-header.is-scrolled,
.site-header.menu-open {
  background: #1c2b34;
  border-bottom-color: rgba(255, 255, 255, .1);
  box-shadow: 0 9px 28px rgba(10, 25, 33, .17);
}

.brand img { width: 130px; }
.desktop-nav .nav-group { display: inline-flex; align-items: center; }
.desktop-nav .nav-parent {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 0 12px 2px;
  color: #d9e1e3;
  font-size: clamp(13px, 1.03vw, 16px);
  font-weight: 600;
  white-space: nowrap;
}
.desktop-nav .nav-parent:hover,
.desktop-nav .nav-group.current .nav-parent { color: #fff; }
.desktop-nav .nav-trigger {
  display: grid;
  place-items: center;
  width: 26px;
  min-width: 26px;
  padding: 0;
}
.desktop-nav .nav-trigger .caret { margin-left: 0; }
.desktop-nav .nav-group.current::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 3px;
  background: rgba(255,255,255,.25);
}
.mobile-menu .mobile-group { display: grid; grid-template-columns: minmax(0,1fr) 48px; align-items: center; }
.mobile-menu .mobile-group > a { grid-column: 1; grid-row: 1; }
.mobile-menu .mobile-group > button { grid-column: 2; grid-row: 1; justify-content: center; }
.mobile-menu .mobile-sub { grid-column: 1 / -1; }

/* Keep editable section labels visually attached to their headings. */
.services .section-head > div .eyebrow,
.news .section-head > div .eyebrow { margin-bottom: 14px; }
.portfolio > .shell > .eyebrow,
.team > .shell > .eyebrow { margin-bottom: 14px; }
.portfolio .portfolio-head,
.team .section-head { margin-top: 0; }
.about-signature {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 540px;
  margin: 36px 0 0;
  padding: 20px 24px;
  border-left: 4px solid var(--blue);
  background: #e8f1f3;
}
.about-signature .quote-mark { line-height: 1; }
.about-signature p { max-width: none; margin: 6px 0 0; }

/* Retrato contido: não encosta às extremidades nem reproduz o enquadramento da imagem anterior. */
.about {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(36px, 5vw, 90px);
  padding: clamp(58px, 6vw, 96px) var(--content-edge);
}
.about-copy { width: min(100%, 640px); justify-self: start; padding: 0; }
.about-copy h2 {
  font-size: clamp(34px, 3.6vw, 50px);
  margin-block: 24px;
  text-wrap: balance;
}
.about-visual {
  justify-self: center;
  width: min(86%, 520px);
  min-height: 0;
  max-height: none;
  aspect-ratio: 1 / 1.08;
  border-radius: 22px;
  box-shadow: 0 24px 65px rgba(23, 43, 53, .14);
}
.about-visual img { object-position: center 33%; }

/* As duas secções de duas colunas seguem o mesmo limite lateral da .shell. */
.specialism-copy { justify-content: stretch; }
.specialism-content {
  width: 100%;
  padding: clamp(58px, 6vw, 96px) clamp(30px, 4vw, 68px) clamp(58px, 6vw, 96px) var(--content-edge);
}
.specialism-list {
  padding-left: clamp(35px, 5vw, 80px);
  padding-right: var(--content-edge);
}
.about-visual { justify-self: end; }

/* Três grupos de serviços, com as duas áreas do último cartão acessíveis. */
.service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-card { min-height: 465px; padding-top: 32px; padding-bottom: 30px; }
.service-card h3, .service-card > p { min-height: 0; }
/* O título fica perto do descritivo; a pequena reserva do texto alinha as listas. */
.service-card h3 { margin: 12px 0 10px; }
.service-card > p { min-height: 3.4em; margin-bottom: 14px; }
.service-card ul { padding: 17px 0 18px; margin-bottom: 20px; gap: 10px; }
.service-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin-top: auto; }
.service-card .service-link { margin-top: 0; }

/* O título do portefólio mantém-se inteiro quando existe largura suficiente. */
.portfolio-head h2 { max-width: none; font-size: clamp(32px, 3.2vw, 54px); white-space: nowrap; }
.sector-icon { margin-inline: 0; }
.sector-icon img { width: 48px; height: 48px; object-fit: contain; }
.sector-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sector-card { min-height: 270px; padding: 22px; }
.team-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* O título da equipa usa a largura da secção; letras de títulos respiram melhor. */
.team .section-head { display: block; }
.team .section-head h2 { max-width: none; }
.team .section-head > p { max-width: 820px; margin-top: 20px; }
body h1, body h2 { letter-spacing: -.035em !important; }
body h3 { letter-spacing: -.015em !important; }

/* O fundo desloca-se mais devagar do que a página, sem expor as extremidades. */
.hero-image {
  inset: -84px 0;
  transform: translate3d(0, var(--hero-parallax, 0px), 0) scale(1.015);
}
.contact-banner:before {
  background-image: linear-gradient(90deg,rgba(25,40,48,.93),rgba(25,40,48,.72)), var(--contact-image, url('./assets/df0f52c7fc457749.jpg'));
}

/* Ícones vetoriais centrados nos controlos, sem depender da linha de base da fonte. */
.team-plus {
  top: auto;
  left: auto;
  right: 16px;
  bottom: 16px;
  pointer-events: none;
  transition: transform .24s ease, background-color .24s ease;
}

.team-plus svg {
  display: block;
  width: 25px;
  height: 25px;
  stroke-width: 2.6;
}

.team-photo-button:hover .team-plus,
.team-photo-button:focus-visible .team-plus {
  transform: scale(1.08);
  background: #8bd9f4;
}

.dialog-close { display: grid; place-items: center; padding: 0; }
.dialog-close svg { display: block; width: 20px; height: 20px; stroke-width: 2.8; }

.arrow-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke-width: 2.5;
  overflow: visible;
}

.pill-button > span,
.header-contact .round-arrow {
  flex: 0 0 42px;
  min-width: 42px;
  min-height: 42px;
}

.service-card .service-link span {
  flex: 0 0 34px;
  min-width: 34px;
  min-height: 34px;
  color: var(--navy);
}

.service-card .service-link .arrow-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

@media (max-width: 1250px) {
  .portfolio-head { display: block; }
  .portfolio-head > p { margin-top: 18px; }
  .sector-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .team-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Igualar o diâmetro e o eixo do botão flutuante WiseMind. */
.back-top { display: grid; place-items: center; right: 14px; bottom: 92px; width: 52px; height: 52px; }
.back-top .arrow-icon { width: 23px; height: 23px; flex-basis: 23px; }
@media (max-width: 700px) {
  .back-top { right: 14px; bottom: 88px; width: 52px; height: 52px; }
}

/* O menu móvel fica montado no DOM para deslizar, mas não é navegável fechado. */
.mobile-menu { display: none; }

@media (max-width: 1024px) {
  .site-header { height: 78px; }
  .specialism-content {
    width: 100%;
  }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sector-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portfolio-head { display: block; }
  .portfolio-head > p { margin-top: 18px; }

  .mobile-menu {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    padding: calc(78px + env(safe-area-inset-top) + 25px) var(--page-gutter) max(34px, env(safe-area-inset-bottom));
    background: var(--navy);
    border: 0;
    box-shadow: -20px 0 50px rgba(5, 20, 28, .25);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    transform: translate3d(102%, 0, 0);
    transition: transform .43s cubic-bezier(.22, 1, .36, 1), visibility .43s;
    pointer-events: none;
  }

  .site-header.menu-open .mobile-menu {
    visibility: visible;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
  }

  .header-inner { position: relative; z-index: 2; }
  .menu-toggle span { transition: transform .25s ease, opacity .2s ease; }
  .site-header.menu-open .menu-toggle span:first-child { transform: translateY(7px) rotate(45deg); }
  .site-header.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .site-header.menu-open .menu-toggle span:last-child { transform: translateY(-7px) rotate(-45deg); }
  html.menu-open,
  body.menu-open { overflow: hidden; }
}

@media (max-width: 900px) {
  .about { display: block; }
  .about-copy { width: min(100%, 720px); margin-inline: 0; }
  .about-visual { width: min(100%, 460px); margin: 38px auto 0; }
}

@media (max-width: 700px) {
  .site-header { height: 72px; }
  .brand img { width: 110px; }
  .mobile-menu {
    padding-top: calc(72px + env(safe-area-inset-top) + 25px);
  }
  .specialism-content {
    width: 100%;
    padding-inline: var(--page-gutter);
  }
  .about { padding: 70px var(--page-gutter); }
  .about-copy { width: 100%; padding: 0; }
  .specialism-list { padding-inline: var(--page-gutter); }
  .about-visual { width: 100%; height: auto; aspect-ratio: 1 / 1; margin-top: 30px; }
  .service-grid { grid-template-columns: 1fr; }
  .service-card { min-height: 0; }
  .service-card h3 { min-height: 0; }
  .service-card > p { min-height: 0; }
  .sector-grid, .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portfolio-head h2 { white-space: normal; font-size: clamp(34px, 9vw, 48px); }
  .sector-icon img { width: 40px; height: 40px; }
}

@media (max-width: 430px) {
  .sector-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(49px, 13vw, 56px); }
}

@media (prefers-reduced-motion: no-preference) {
  .motion-enabled .motion-reveal {
    opacity: 0;
    transform: translate3d(0, 34px, 0);
    transition: opacity .72s ease, transform .72s cubic-bezier(.22, 1, .36, 1), box-shadow .2s ease;
    transition-delay: var(--motion-delay, 0ms);
  }
  .motion-enabled .motion-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  .motion-enabled .sector-card.motion-reveal.is-visible:hover {
    transform: translateY(-5px);
  }
}

@media (max-width: 700px) {
  .team-plus { right: 11px; bottom: 11px; }
  .team-plus svg { width: 20px; height: 20px; }
  .motion-enabled .motion-reveal { transform: translate3d(0, 22px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-image { transform: none; }
  .motion-enabled .motion-reveal { opacity: 1; transform: none; }
  .mobile-menu { transition: none; }
}

/* Isola a orientação da seta do texto vertical do indicador de scroll. */
@media (min-width: 1025px) {
  .scroll-cue {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    writing-mode: horizontal-tb;
  }
  .scroll-cue .scroll-cue-label {
    writing-mode: vertical-rl;
    margin: 0;
    color: #d9e2e6;
    font-size: 12px;
    line-height: 1;
    letter-spacing: .2em;
  }
  .scroll-cue svg {
    display: block;
    width: 24px;
    height: 24px;
    flex: none;
    color: var(--blue);
  }
}

/* Sem etiqueta introdutória, o nome inicia o conteúdo do popup. */
.bio-dialog h2 { margin-top: 0; }

/* Formulário Brevo aprovado junto à chamada final da homepage e no rodapé. */
.home-newsletter-promo{background:#e4f1f4;padding:clamp(36px,5vw,68px) 0;}
.home-newsletter-promo>.shell{align-items:start;}
.home-newsletter-promo h2{font-size:clamp(28px,3.2vw,48px);line-height:1.15;margin:14px 0 10px;}
.home-newsletter-promo p{color:#536a75;margin:0;max-width:600px;line-height:1.65;}
.home-newsletter-promo .newsletter-form{width:100%;}
.footer .newsletter-section{margin-bottom:56px;color:var(--ink);}
.footer .newsletter-section h2{color:var(--ink);}
.footer:has(.newsletter-section){padding-top:0;}
.footer:has(.newsletter-section)>.shell{padding-top:56px;}
.footer .newsletter-copy p{max-width:560px;color:#52636b;}
.footer .newsletter-form a{color:#245e77;}
.newsletter-form iframe[src*="/newsletter-demo/"]{height:345px;}
@media(max-width:800px){.newsletter-form iframe[src*="/newsletter-demo/"]{height:390px;}}
@media(max-width:480px){.newsletter-form iframe[src*="/newsletter-demo/"]{height:440px;}}
@media(max-width:360px){.newsletter-form iframe[src*="/newsletter-demo/"]{height:470px;}}
@media(max-width:700px){.home-newsletter-promo>.shell{display:grid;}}

/* Rodapé: marca, parceria e subscrição no topo; apoios numa faixa inferior. */
.hero-overline::before{content:none;display:none}
.footer{padding-top:clamp(42px,4.2vw,68px)}
.footer-top{grid-template-columns:minmax(0,1fr) minmax(0,1.35fr) minmax(0,1.12fr);gap:clamp(24px,3vw,50px);align-items:start}
.footer-top--no-newsletter,.footer-top--no-partnership{grid-template-columns:repeat(2,minmax(0,1fr))}
.footer-top--no-newsletter.footer-top--no-partnership{grid-template-columns:minmax(0,1fr)}
.footer-brand,.footer-partnership,.footer-newsletter{min-width:0}
.footer-brand .footer-logo{width:clamp(125px,11vw,160px);margin-bottom:9px}
.footer-brand-overline{display:block;margin:0 0 12px;color:#e3edf1;font-size:10px;font-weight:800;letter-spacing:.22em;text-transform:uppercase}
.footer .footer-brand>p{margin:0 0 23px;max-width:320px}
.footer-brand .footer-social h3{margin-bottom:13px}
.footer-funding-block{min-width:0;margin-top:clamp(38px,4vw,60px);padding:0;text-align:center}
.footer-funding{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:clamp(22px,3vw,48px)}
.footer-funding img{display:block;max-width:min(20%,170px);max-height:44px;width:auto;height:auto;object-fit:contain}
.footer-funding img+img{border:0;padding:0}
.footer-funding-block--combined{max-width:none}
.footer-funding--combined{display:flex;width:100%}
.footer-funding--combined img{display:block;width:auto;max-width:min(100%,610px);max-height:64px;height:auto;object-fit:contain;object-position:center}
.footer .footer-funding-caption{max-width:none;margin:12px 0 0;color:#d5e4e9;font-size:13px;line-height:1.5}
.footer-partnership{padding:0;border:0;color:#d5e4e9}
.footer-partnership-eyebrow{display:block;margin-bottom:13px;color:var(--blue);font-size:11px;font-weight:800;letter-spacing:.2em;text-transform:uppercase}
.footer-partnership-brands{display:flex;align-items:center;justify-content:flex-start;gap:clamp(15px,1.8vw,24px);margin:0}
.footer-partnership-brands>img{display:block;width:auto;max-width:34%;height:auto;max-height:47px;object-fit:contain}
.footer-partnership-brands .footer-partnership-partner-logo{max-width:59%;max-height:55px}
.footer-logo-filter{position:absolute;width:0;height:0;overflow:hidden}
.footer-partnership-partner-logo--official{filter:url(#footer-partner-alpha)}
.footer-partnership-divider{width:1px;height:42px;flex:none;background:rgba(222,241,246,.5)}
.footer-partnership-partner-wordmark{color:#fff;font-size:clamp(19px,2.2vw,28px);font-weight:800;line-height:.92;letter-spacing:.02em;text-align:left}
.footer-partnership-partner-wordmark small{display:block;margin-top:5px;font-size:.46em;font-weight:500;letter-spacing:.33em}
.footer-partnership>p{margin:14px 0 0;font-size:14px;line-height:1.5;max-width:none}
.footer-funding-block+.footer-bottom{margin-top:clamp(38px,4vw,60px);border-top:0}
.footer-bottom{margin-top:clamp(38px,4vw,60px);border-top:0;padding-top:0}
.footer-newsletter{min-width:0}
.footer-newsletter h3{font-size:16px;font-weight:700;line-height:normal;margin:0 0 20px}
.footer-newsletter .tbmb-newsletter-form{margin-top:0}
.tbmb-newsletter-form{display:grid;gap:12px;min-width:0}
.tbmb-newsletter-form label,.tbmb-newsletter-form .entry__label{font-size:13px;font-weight:700;color:#e7f3f6}
.tbmb-newsletter-form .entry__field{margin-top:0}
.tbmb-newsletter-form input[type=email]{display:block;width:100%;min-width:0;box-sizing:border-box;padding:13px 16px;border:1px solid #8cb9ca;border-radius:100px;background:#fff;color:#20323b;font:inherit;font-size:14px}
.tbmb-newsletter-form input[type=email]:focus-visible{outline:3px solid #8ed7f1;outline-offset:2px}
.tbmb-newsletter-form>button{display:inline-flex;align-items:center;justify-content:center;min-height:48px;width:100%;padding:12px 20px;border:0;border-radius:100px;background:var(--blue);color:var(--navy);font:inherit;font-size:14px;font-weight:800;cursor:pointer;transition:background .2s ease,transform .2s ease}
.tbmb-newsletter-form>button:hover:not(:disabled),.tbmb-newsletter-form>button:focus-visible:not(:disabled){background:var(--blue-hover);transform:translateY(-2px)}
.tbmb-newsletter-form>button:disabled{opacity:.75;cursor:not-allowed}
.tbmb-newsletter-form .newsletter-consent{display:flex;align-items:flex-start;gap:9px;margin-top:2px;font-size:12px;font-weight:500;line-height:1.45}
.newsletter-consent input{flex:none;margin:2px 0 0;accent-color:var(--blue)}
.newsletter-consent a{color:#a5e5fb;text-decoration:underline}
.tbmb-newsletter-form .input--hidden{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
.tbmb-newsletter-form .entry__error{display:block;min-height:0;color:#ffd7d7;font-size:12px}
.tbmb-newsletter-form .newsletter-status{margin:0;color:#bed0d7;font-size:11px;line-height:1.45}
.tbmb-newsletter-form .newsletter-status.is-error,.tbmb-newsletter-form .newsletter-validation{margin:0;color:#ffd7d7;font-size:12px;font-weight:700;line-height:1.45}
.tbmb-newsletter-form .newsletter-validation[hidden]{display:none}
.tbmb-newsletter-form .newsletter-consent input[aria-invalid=true]{outline:2px solid #ffd7d7;outline-offset:3px}
.tbmb-brevo-form .sib-form-message-panel{margin:0 0 12px;padding:12px 14px;border-radius:8px;background:#d9f1e5;color:#173d2d;font-size:14px;line-height:1.5}
.tbmb-brevo-form #success-message:has(.sib-form-message-panel__inner-text:not(:empty)){display:block!important}
.tbmb-brevo-form #error-message{background:#ffe5e5;color:#733333}
.tbmb-brevo-form .sib-form-block__button{margin-top:4px}
.footer-legal-links{display:flex;flex-wrap:wrap;align-items:center;gap:5px 18px;justify-content:flex-end}
.footer-legal-links a{white-space:nowrap}
@media(max-width:1100px){.footer-top{grid-template-columns:repeat(2,minmax(0,1fr))}.footer-top>.footer-newsletter{grid-column:1/-1;max-width:520px}.footer-top--no-newsletter.footer-top--no-partnership{grid-template-columns:1fr}}
@media(max-width:700px){.footer-top,.footer-top--no-newsletter,.footer-top--no-partnership{grid-template-columns:1fr;gap:34px}.footer-top>.footer-newsletter{grid-column:auto;max-width:none}.footer-partnership{padding:0;border:0}.footer-legal-links{justify-content:flex-start}.footer-bottom{display:grid;gap:12px}.footer-funding-block{margin-top:38px}.footer-funding img{max-width:30%;max-height:38px}.footer-funding--combined img{max-width:100%;max-height:58px}}
@media(max-width:700px){.footer-legal-links small{flex-basis:100%;white-space:normal;overflow-wrap:anywhere}}
@media(max-width:430px){.footer-funding{gap:12px}.footer-funding img{max-width:29%;max-height:30px}.footer-funding--combined img{max-width:100%;max-height:49px}}
