:root {
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --text: #101828;
  --muted: #5b6678;
  --line: #d8e0ea;
  --dark: #07111f;
  --dark-2: #0b1728;
  --dark-3: #111f34;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-line: rgba(255, 255, 255, 0.14);
  --accent: #2dd4bf;
  --accent-2: #60a5fa;
  --accent-3: #a7f3d0;
  --accent-ink: #08766f;
  --shadow: 0 24px 70px rgba(7, 17, 31, 0.15);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
.wrap { width: min(1180px, calc(100% - 44px)); margin-inline: auto; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 10px;
  background: #fff;
  color: var(--dark);
  padding: 10px 14px;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible {
  outline: 3px solid var(--accent-ink);
  outline-offset: 4px;
}
.site-header :focus-visible,
.section-dark :focus-visible,
.about-card :focus-visible,
.contact-box :focus-visible,
.footer :focus-visible {
  outline-color: var(--accent-3);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 17, 31, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.nav {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.brand { display: flex; min-height: 44px; align-items: center; font-weight: 900; letter-spacing: -0.03em; }
.brand-logo { display: block; width: 186px; height: 44px; object-fit: contain; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #fff !important;
  font-weight: 900;
  letter-spacing: .06em;
}

.nav-links { display: flex; align-items: center; gap: 18px; color: rgba(255, 255, 255, .78); font-size: .92rem; font-weight: 700; }
.nav-links a { transition: color .2s ease; }
.nav-links a:hover { color: #fff; }
.nav-cta { border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; padding: 10px 17px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; }
.nav-toggle { cursor: pointer; }
.nav-toggle span { display: block; width: 25px; height: 2px; background: #fff; margin: 7px auto; border-radius: 999px; transition: transform .18s ease, opacity .18s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

.section { padding: 94px 0; }
.section-dark { background: var(--dark); color: #fff; }
.section-muted { background: var(--surface-2); }

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-ink);
  font-size: .76rem;
  line-height: 1.2;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 900;
}
.section-dark .eyebrow { color: var(--accent); }

h1, h2, h3 { margin: 0; line-height: 1.06; color: inherit; }
h1 {
  font-size: clamp(3.72rem, 5.08vw, 5.32rem);
  line-height: .92;
  letter-spacing: -0.064em;
  max-width: 1050px;
  text-wrap: balance;
}
.hero-title span { display: block; white-space: nowrap; }
h2 { font-size: clamp(2rem, 4.1vw, 4.25rem); letter-spacing: -0.07em; }
h3 { font-size: 1.18rem; letter-spacing: -0.035em; }
p { margin-top: 0; }

.hero { position: relative; min-height: calc(100svh - 60px); display: flex; align-items: center; padding: 26px 0 34px; }
.hero-bg { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(130deg, #07111f 0%, #0b1728 47%, #162948 100%); }
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 26%, rgba(45, 212, 191, .22), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(96, 165, 250, .20), transparent 34%),
    linear-gradient(rgba(255,255,255,.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.038) 1px, transparent 1px);
  background-size: auto, auto, 64px 64px, 64px 64px;
  opacity: .95;
}
.hero-bg::after {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  right: -210px;
  bottom: -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, .12), transparent 68%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.18fr) 390px; gap: 72px; align-items: center; transform: translateY(-8px); }
.hero-content { max-width: 1050px; }
.hero-lead { color: rgba(255,255,255,.86); font-size: clamp(1.06rem, 1.18vw, 1.22rem); line-height: 1.42; max-width: 820px; margin: 18px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 21px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.button.primary { color: #06111e; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.button.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(45, 212, 191, .22); }
.button.secondary { color: #fff; border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.06); }
.button.secondary:hover { border-color: rgba(255,255,255,.5); }

.hero-panel {
  position: relative;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
  border-radius: 30px;
  padding: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-topline { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.panel-label { color: var(--accent); font-size: .77rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 900; margin-bottom: 16px; }
.hero-panel h2 { font-size: 1.25rem; letter-spacing: -0.045em; margin-bottom: 16px; }
.hero-panel ol { list-style: none; padding: 0; margin: 0; }
.hero-panel li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.84); }
.hero-panel li span { color: var(--accent); font-weight: 900; font-size: .77rem; letter-spacing: .08em; }

.proof-strip { background: #fff; border-bottom: 1px solid var(--line); }
.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.proof-grid article { padding: 42px 34px; border-left: 1px solid var(--line); }
.proof-grid article:first-child { border-left: 0; }
.mini-icon { display: inline-block; width: 12px; height: 12px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin: 0 12px 0 0; vertical-align: middle; }
.proof-grid h3 { display: inline-block; vertical-align: middle; }
.proof-grid p { margin: 12px 0 0; color: var(--muted); }

.intro-grid, .split-grid, .about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 72px; align-items: start; }
.intro-grid { align-items: center; }
.about-grid { align-items: center; }
.intro-copy p, .about-copy p, .sticky-copy p:not(.eyebrow) { color: var(--muted); font-size: 1.07rem; }
.intro-copy p:last-child, .about-copy p:last-child { margin-bottom: 0; }

.section-heading { max-width: 860px; margin-bottom: 48px; }
.section-heading.compact { max-width: 720px; }
.section-heading p:not(.eyebrow) { color: var(--muted); }

.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 30px; overflow: hidden; background: #fff; box-shadow: 0 16px 50px rgba(16, 24, 40, .07); }
.service-card { min-height: 330px; padding: 30px; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: flex-start; }
.service-card:first-child { border-left: 0; }
.service-card p { color: var(--muted); margin: 18px 0 0; }
.service-number { font-size: .8rem; letter-spacing: .12em; font-weight: 900; color: var(--accent-ink); margin-bottom: 16px; }
.featured-card { background: linear-gradient(150deg, #07111f, #10213a); color: #fff; border-left: 0; }
.featured-card p { color: rgba(255,255,255,.72); }
.featured-card .service-number { color: var(--accent); }

.split-section { background: #fff; }
.sticky-copy { position: sticky; top: 105px; }
.split-section .sticky-copy h2 { margin-bottom: 24px; font-size: clamp(2rem, 4.1vw, 4.25rem); color: var(--ink); }
.signal-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.signal { display: grid; grid-template-columns: 24px 1fr; gap: 18px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.signal span { width: 11px; height: 11px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin-top: 9px; }
.signal p { margin: 0; color: #344054; font-size: 1.08rem; }

.statement { padding: 92px 0; }
.statement-inner {
  max-width: 1120px;
  border-left: 4px solid var(--accent);
  padding-left: clamp(28px, 4vw, 58px);
}
.statement blockquote {
  margin: 0;
  max-width: 980px;
  font-size: clamp(1.55rem, 2.15vw, 2.6rem);
  line-height: 1.38;
  letter-spacing: -0.022em;
  word-spacing: .045em;
  font-weight: 800;
  text-wrap: balance;
}
.statement blockquote span { color: var(--accent); }
.statement blockquote strong { color: #fff; font-weight: 900; }

.about-card { min-height: 430px; background: linear-gradient(150deg, #07111f, #15243c); color: #fff; border-radius: 34px; padding: 36px 36px 48px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow); }
.about-card .eyebrow, .contact-box .eyebrow { color: var(--accent); }
.about-copy { padding-top: 0; }
.about-copy p { font-size: 1.09rem; }

.process-section { background: #fff; }
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; list-style: none; padding: 0; margin: 0; }
.process-grid li { border: 1px solid var(--line); background: #fff; border-radius: 24px; padding: 26px; }
.process-grid span { display: inline-block; color: var(--accent-ink); font-size: .8rem; font-weight: 900; letter-spacing: .12em; margin-bottom: 18px; }
.process-grid h3 { margin-bottom: 10px; }
.process-grid p { color: var(--muted); margin-bottom: 0; }

.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill-group { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 28px; min-height: 220px; }
.skill-group p { color: var(--muted); margin: 16px 0 0; }
.skill-list { list-style: none; padding: 0; margin: 16px 0 0; }
.skill-list li { display: grid; grid-template-columns: 8px 1fr; gap: 9px; color: var(--muted); line-height: 1.42; }
.skill-list li + li { margin-top: 8px; }
.skill-list li::before { content: ""; width: 5px; height: 5px; margin-top: .52em; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.skill-group.emphasis { background: linear-gradient(150deg, #07111f, #14243d); color: #fff; }
.skill-group.emphasis p { color: rgba(255,255,255,.72); }

.contact { background: var(--surface-2); }
.contact-box { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; background: linear-gradient(135deg, #07111f, #14233c); color: #fff; border-radius: 34px; padding: 52px; box-shadow: var(--shadow); }
.contact-box h2 { margin-bottom: 24px; font-size: clamp(2rem, 3.7vw, 4rem); }
.contact-box p:not(.eyebrow) { color: rgba(255,255,255,.74); max-width: 770px; }
.contact-action-group { display: grid; justify-items: center; gap: 10px; }
.contact-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.contact-email { position: relative; font-size: .86rem; }
.copy-email { appearance: none; border: 0; padding: 0; background: transparent; color: rgba(255,255,255,.66); font: inherit; font-weight: 700; cursor: pointer; }
.copy-email:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.copy-email:focus-visible { outline: 2px solid var(--accent-3); outline-offset: 4px; }
.copy-status { position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); color: var(--accent); font-size: .84rem; white-space: nowrap; }

.footer { background: #050c16; color: rgba(255,255,255,.66); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.footer p { margin: 0; }
.footer a { color: #fff; font-weight: 800; }

@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .service-card:nth-child(4) { border-top: 1px solid var(--line); }
  .skills-grid, .process-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; inset: 60px 0 auto 0; max-height: calc(100dvh - 60px); overflow-y: auto; background: rgba(7, 17, 31, .98); padding: 24px 22px; flex-direction: column; align-items: flex-start; border-bottom: 1px solid rgba(255,255,255,.09); box-shadow: 0 24px 50px rgba(0,0,0,.25); }
  .nav-links.open { display: flex; }
  html:not(.js) .nav { flex-wrap: wrap; }
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .nav-links { display: flex; position: static; width: 100%; max-height: none; overflow: visible; padding: 14px 0 20px; box-shadow: none; }
  body.menu-open { overflow: hidden; }
  .hero { min-height: auto; padding: 70px 0; }
  .hero-grid, .intro-grid, .split-grid, .about-grid, .contact-box { grid-template-columns: 1fr; gap: 38px; }
  .hero-title span { white-space: normal; }
  .hero-panel { max-width: 520px; }
  .proof-grid { grid-template-columns: 1fr; }
  .proof-grid article, .proof-grid article:first-child { border-left: 0; border-top: 1px solid var(--line); }
  .proof-grid article:first-child { border-top: 0; }
  .sticky-copy { position: static; }
  .contact-actions { justify-content: flex-start; }
  .section { padding: 76px 0; }
}

@media (max-width: 620px) {
  .wrap { width: min(100% - 30px, 1180px); }
  .brand-logo { width: 176px; height: 42px; object-fit: contain; }
  .hero { padding: 48px 0; }
  .hero-grid { gap: 28px; }
  .hero-actions, .contact-actions { display: grid; }
  .hero-actions { gap: 10px; margin-top: 16px; }
  .button { width: 100%; }
  .services-grid, .skills-grid, .process-grid { grid-template-columns: 1fr; }
  .service-card, .service-card:nth-child(3), .service-card:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); min-height: 260px; }
  .service-card:first-child { border-top: 0; }
  .about-card, .contact-box { padding: 28px; }
  .hero-panel { padding: 20px; }
  .statement { padding: 74px 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* Small desktops / laptops: keep hero content inside first screen without making it look empty */
@media (min-width: 961px) and (max-height: 820px) {
  .nav { min-height: 58px; }
  h1 { font-size: clamp(3.45rem, 4.65vw, 4.75rem); max-width: 1040px; }
  .hero { min-height: calc(100svh - 58px); padding: clamp(62px, 8vh, 92px) 0 24px; }
  .hero-grid { transform: none; grid-template-columns: minmax(0, 1.18fr) 360px; gap: 52px; }
  .eyebrow { margin-bottom: 10px; }
  .hero-lead { margin-top: 14px; font-size: 1rem; max-width: 740px; }
  .hero-actions { margin-top: 15px; }
  .button { min-height: 43px; padding: 0 18px; }
  .hero-panel { padding: 19px; }
  .hero-panel h2 { font-size: 1.12rem; margin-bottom: 13px; }
  .hero-panel li { padding: 8px 0; }
}

@media (min-width: 1000px) and (max-height: 1000px) {
  h1 { font-size: clamp(3.65rem, 4.85vw, 5.05rem); max-width: 1060px; }
  .hero { padding: clamp(70px, 9vh, 108px) 0 28px; }
  .hero-grid { transform: none; }
  .hero-lead { margin-top: 18px; }
  .hero-actions { margin-top: 18px; }
}

/* v11: ajuste fino da versão portuguesa no hero.
   Mantém as três linhas, mas reduz ligeiramente a versão PT para evitar que o ponto final toque no painel lateral. */
html[lang="pt-PT"] h1 {
  font-size: clamp(3.45rem, 4.78vw, 5rem);
}

html[lang="pt-PT"] .hero-content {
  max-width: 980px;
}

/* Em ecrãs grandes, mantém o bloco visualmente centrado e com espaço entre título e cartão. */
@media (min-width: 1200px) {
  html[lang="pt-PT"] .hero-grid {
    grid-template-columns: minmax(0, 1.08fr) 390px;
    gap: 78px;
  }
}

/* v12: texto de apoio da versão PT ligeiramente menor para ficar em 2 linhas no hero. */
html[lang="pt-PT"] .hero-lead {
  font-size: clamp(.94rem, 1.02vw, 1.08rem);
  line-height: 1.36;
  max-width: 840px;
}

@media (min-width: 961px) and (max-height: 820px) {
  html[lang="pt-PT"] .hero-lead {
    font-size: .94rem;
    line-height: 1.34;
    max-width: 835px;
  }
}

/* Responsive overrides live after the PT desktop contract so the cascade cannot undo them. */
@media (max-width: 960px) {
  h1, html[lang="pt-PT"] h1 {
    font-size: clamp(2.8rem, 7.2vw, 3.6rem);
  }
}

@media (max-width: 620px) {
  h1, html[lang="pt-PT"] h1 {
    max-width: 100%;
    font-size: clamp(1.95rem, 9vw, 2.5rem);
    line-height: .98;
    letter-spacing: -0.05em;
  }
  .hero-lead, html[lang="pt-PT"] .hero-lead {
    margin-top: 14px;
    font-size: 1rem;
    line-height: 1.48;
  }
  .hero-panel h2 { margin-bottom: 12px; }
  .hero-panel li { padding-block: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
