/* ============================================================
   CCMF-AI — Site Institucional (homepage)
   Paleta Eclipse: Dark / Blue / Violet / Amber
   Ficheiro isolado — não partilhado com subpáginas
   ============================================================ */

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

:root {
  --primary:    #60a5fa;
  --primary-dk: #3b82f6;
  --accent:     #8b5cf6;
  --accent2:    #f59e0b;
  --text:       #f1f5f9;
  --text-muted: #94a3b8;
  --bg:         #09091a;
  --border:     rgba(96, 165, 250, 0.18);
  --mono:       'JetBrains Mono', 'Fira Code', monospace;
  --page-max:   1400px;
  --page-pad:   clamp(24px, 5vw, 80px);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
  padding: 22px var(--page-pad);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.02em;
  text-decoration: none;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14), 0 2px 8px rgba(96, 165, 250, 0.12);
}

.nav-links {
  display: flex;
  gap: clamp(16px, 2.5vw, 36px);
  flex-wrap: wrap;
}

.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: clamp(12px, 1vw, 14px);
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-links a:hover { color: #fff; }

.btn-lang {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s;
  flex-shrink: 0;
}

.btn-lang:hover { border-color: var(--primary); }

.btn-lang img {
  width: 22px;
  height: auto;
  border-radius: 2px;
  display: block;
}

.btn-lang span {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Hero ── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
  padding: clamp(60px, 7vw, 120px) var(--page-pad) clamp(80px, 8vw, 140px);
  min-height: 520px;
  position: relative;
  overflow: hidden;
}

.hero-text {
  max-width: clamp(360px, 38vw, 560px);
  z-index: 2;
}

.hero-text h1 {
  font-size: clamp(32px, 4vw, 64px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
}

.hero-text h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero-text p {
  font-size: clamp(14px, 1.1vw, 17px);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: clamp(280px, 28vw, 440px);
}

/* ── Particle orb ── */
.orb-wrap {
  position: relative;
  width: clamp(247px, 28.5vw, 475px);
  height: clamp(247px, 28.5vw, 475px);
  flex-shrink: 0;
}

.orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 45%,
    rgba(96, 165, 250, 0.18) 0%,
    rgba(139, 92, 246, 0.12) 45%,
    rgba(245, 158, 11, 0.06) 70%,
    transparent 100%);
  animation: orbPulse 4s ease-in-out infinite alternate;
}

.particles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 210px 180px, rgba(96,165,250,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 260px 140px, rgba(139,92,246,0.8) 0%, transparent 100%),
    radial-gradient(2px 2px at 190px 230px, rgba(96,165,250,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 300px 200px, rgba(245,158,11,0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 170px 160px, rgba(96,165,250,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 240px 270px, rgba(139,92,246,0.7) 0%, transparent 100%),
    radial-gradient(2px 2px at 320px 160px, rgba(96,165,250,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 150px 200px, rgba(245,158,11,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 280px 240px, rgba(96,165,250,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 220px 300px, rgba(139,92,246,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 350px 220px, rgba(96,165,250,0.3) 0%, transparent 100%),
    radial-gradient(2px 2px at 200px 130px, rgba(245,158,11,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 130px 250px, rgba(96,165,250,0.6) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 370px 180px, rgba(139,92,246,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 270px 310px, rgba(96,165,250,0.4) 0%, transparent 100%);
}

@keyframes orbPulse {
  from { transform: scale(0.91); opacity: 0.78; }
  to   { transform: scale(1.08); opacity: 1; }
}

/* ── Binary digits overlay ── */
.orb-binary {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}

.binary-digit {
  position: absolute;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0;
  animation: binaryFloat 3s ease-in-out infinite;
  user-select: none;
  line-height: 1;
}

.bin-blue   { color: rgba(96,  165, 250, 0.90); }
.bin-purple { color: rgba(139,  92, 246, 0.80); }
.bin-amber  { color: rgba(245, 158,  11, 0.75); }

@keyframes binaryFloat {
  0%   { opacity: 0;    transform: translateY(5px) scale(1); }
  20%  { opacity: 0.85; }
  75%  { opacity: 0.50; }
  100% { opacity: 0;    transform: translateY(-14px) scale(0.85); }
}

/* ── Hero background glow ── */
.hero-glow {
  position: absolute;
  right: 5%;
  top: 10%;
  width: clamp(300px, 40vw, 600px);
  height: clamp(300px, 40vw, 600px);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(96, 165, 250, 0.07) 0%,
    rgba(139, 92, 246, 0.05) 50%,
    transparent 75%);
  pointer-events: none;
}

/* ── Feature sections ── */
.feature-section {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
}

/* Imagem à direita por omissão (índice par: 0, 2, 4) */
.feature-section .feature-img  { order: 2; }
.feature-section .feature-text { order: 1; }

/* Imagem à esquerda (índice ímpar: 1, 3) */
.feature-section.reverse .feature-img  { order: 1; }
.feature-section.reverse .feature-text { order: 2; }

.feature-img {
  flex: 0 0 45%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* Imagem real */
.feature-img-real {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  object-fit: cover;
  display: block;
}

/* Placeholder visual enquanto não há imagem real */
.feature-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg,
    rgba(96, 165, 250, 0.06) 0%,
    rgba(139, 92, 246, 0.10) 50%,
    rgba(9, 9, 26, 0.95) 100%);
  position: relative;
}

.feature-img-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20%  30%, rgba(96,165,250,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 40%  60%, rgba(139,92,246,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 60% 25%, rgba(96,165,250,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 75%  70%, rgba(245,158,11,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85%  40%, rgba(96,165,250,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 30% 80%, rgba(139,92,246,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 55%  50%, rgba(96,165,250,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 15%  65%, rgba(245,158,11,0.4) 0%, transparent 100%);
}

.feature-img-placeholder .placeholder-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: rgba(96, 165, 250, 0.4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 1;
  border: 1px dashed rgba(96, 165, 250, 0.2);
  padding: 8px 16px;
  border-radius: 4px;
}

.feature-text {
  flex: 0 0 55%;
  padding: clamp(40px, 5vw, 80px) clamp(40px, 5.5vw, 96px);
}

.feature-text h2 {
  font-size: clamp(1.375rem, 2.2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.feature-text p {
  font-size: clamp(0.9375rem, 1vw, 1.0625rem);
  color: var(--text-muted);
  line-height: 1.8;
  max-width: clamp(380px, 32vw, 560px);
}

.section-highlight {
  font-style: normal;
  color: var(--blue);
  font-weight: 500;
}

.section-cta {
  display: inline-block;
  margin-top: 28px;
  padding: 12px 28px;
  background: var(--primary);
  color: #09091a;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 7px;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 2px 10px rgba(96, 165, 250, 0.3);
}

.section-cta:hover {
  background: var(--primary-dk);
  box-shadow: 0 4px 18px rgba(96, 165, 250, 0.4);
  transform: translateY(-1px);
}

.section-cta:active {
  transform: translateY(0);
}

.section-cta + .section-cta {
  margin-left: 12px;
}

/* Links inline no texto das secções */
.section-link {
  color: #60a5fa;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.section-link:hover {
  color: #93c5fd;
}

/* Separador subtil entre secções */
.feature-section + .feature-section {
  border-top: 1px solid rgba(96, 165, 250, 0.07);
}

/* Fundo ligeiramente alternado para respiração visual */
.feature-section:nth-child(even) {
  background: rgba(96, 165, 250, 0.02);
}

/* ── Footer ── */
.site-footer {
  padding: 24px var(--page-pad) 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.contact-link:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.contact-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.privacy-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  cursor: pointer;
}

.privacy-link:hover {
  color: var(--primary);
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
  letter-spacing: 0.02em;
  text-align: center;
}

/* ── Back to top ── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.12);
  border: 1.5px solid rgba(96, 165, 250, 0.25);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s, transform 0.2s;
  backdrop-filter: blur(8px);
  z-index: 200;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: rgba(96, 165, 250, 0.25);
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: translateY(0);
}

.back-to-top::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-45deg) translateY(2px);
}

/* ── Responsivo: tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  .nav-links {
    gap: 14px;
  }

  .hero {
    gap: 40px;
  }

  .orb-wrap {
    width: clamp(190px, 34.2vw, 323px);
    height: clamp(190px, 34.2vw, 323px);
  }
}

/* ── Responsivo: mobile (≤ 768px) ── */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    padding: 60px 24px 80px;
    min-height: auto;
    gap: 48px;
  }

  .hero-text {
    max-width: 100%;
  }

  .hero-text p {
    max-width: 100%;
    margin: 0 auto;
  }

  .orb-wrap {
    width: 228px;
    height: 228px;
  }

  .feature-section {
    flex-direction: column;
    min-height: auto;
  }

  .feature-section .feature-img,
  .feature-section.reverse .feature-img  { order: 1; }
  .feature-section .feature-text,
  .feature-section.reverse .feature-text { order: 2; }

  .feature-img {
    flex: none;
    width: 100%;
    min-height: 240px;
  }

  .feature-img-real,
  .feature-img-placeholder {
    min-height: 240px;
  }

  .feature-text {
    flex: none;
    width: 100%;
    padding: 40px 24px;
  }

  .feature-text p {
    max-width: 100%;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}
