/* ============================================================
   FROID — Design System (paleta reaproveitada de froid-engine.ts HEX_PALETTE)
   BRANCO #f8fafc / AZUL #3b82f6 / VERDE #22c55e / AMARELO #eab308
   VERMELHO #ef4444 / PRETO #0f172a / CINZA #6b7280
   ============================================================ */

:root {
  --froid-branco: #f8fafc;
  --froid-azul: #3b82f6;
  --froid-verde: #22c55e;
  --froid-amarelo: #eab308;
  --froid-vermelho: #ef4444;
  --froid-preto: #0f172a;
  --froid-cinza: #94a3b8;
  --ink: #e2e8f0;
  --paper: #020617;
  --paper-soft: #0f172a;
  --border: #1e2a44;
  --radius: 14px;
  --maxw: 1120px;
  --font: "Inter", "Segoe UI", Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: #93c5fd; text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / Nav ---------- */
header.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(2, 6, 23, 0.97);
  color: var(--froid-branco);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(6px);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: var(--maxw); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; letter-spacing: 0.02em; color: var(--froid-branco); }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--froid-azul); box-shadow: 0 0 12px var(--froid-azul); }
/* Logo removido do header a pedido — para repor, troque display:none por display:block */
.brand-logo { height: 28px; width: auto; display: none; }
.nav-links { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.nav-links a { color: rgba(248,250,252,0.85); font-weight: 500; font-size: 0.84rem; white-space: nowrap; }
.nav-links a:hover { color: var(--froid-branco); text-decoration: none; }
/* Sem caixa de foco em volta dos links; a página atual é destacada por itálico + sublinhado */
.nav-links a:focus, .nav-links a:focus-visible { outline: none; }
.nav-links a.ativo {
  font-style: italic; font-weight: 600; color: var(--froid-branco);
  text-decoration: underline; text-underline-offset: 5px;
  text-decoration-color: #7dd3fc;
}
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-actions .btn { padding: 8px 14px; font-size: 0.82rem; }
/* Seletor de idioma no header — grupo de pills PT/EN/FR/... antes dos botões de acesso */
.lang-group { display: flex; align-items: center; gap: 4px; margin-left: 2px; }
.lang-group::before { content: "🌐"; font-size: 0.78rem; margin-right: 2px; opacity: 0.85; }
.lang-pill {
  padding: 5px 9px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  border-radius: 999px; color: rgba(248,250,252,0.7); border: 1px solid rgba(248,250,252,0.25);
  text-decoration: none;
}
a.lang-pill:hover { color: #fff; border-color: rgba(248,250,252,0.5); }
.lang-pill.lang-current {
  color: #fff; background: rgba(248,250,252,0.14); border-color: rgba(248,250,252,0.4); cursor: default;
}
@media (max-width: 860px) {
  .lang-group { margin: 6px 0 0; justify-content: center; width: 100%; }
}
.btn { display: inline-block; padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
/* Header no celular: empilha em blocos centrados, links em linhas fluidas, botões lado a lado */
@media (max-width: 860px) {
  header.site-header { position: static; }
  .nav-row {
    flex-direction: column; align-items: center; gap: 12px;
    padding: 12px 14px;
  }
  .nav-links { justify-content: center; row-gap: 8px; column-gap: 14px; }
  .nav-links a { font-size: 0.82rem; }
  .nav-actions { width: 100%; justify-content: center; }
  .nav-actions .btn { flex: 1 1 0; max-width: 190px; text-align: center; padding: 9px 8px; font-size: 0.8rem; }
}
.btn-ghost { color: var(--froid-branco); border-color: rgba(248,250,252,0.35); }
.btn-ghost:hover { background: rgba(248,250,252,0.08); text-decoration: none; }
.btn-solid { background: var(--froid-azul); color: #fff; }
.btn-solid:hover { background: #2f6fe0; text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: #0b1120 url('img/froid-barra.png') center/cover no-repeat;
  color: var(--froid-branco);
  padding: 96px 0 80px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(2,6,23,0.72) 0%, rgba(2,6,23,0.88) 100%);
}
.hero > .container { position: relative; z-index: 1; }
/* Heros das subpáginas centralizados, acompanhando títulos e leads de seção */
.hero h1 { font-family: var(--font-serif); font-size: 2.6rem; line-height: 1.2; max-width: 780px; margin: 0 auto 20px; text-align: center; }
.hero p.lead { font-size: 1.15rem; color: rgba(248,250,252,0.78); max-width: 620px; margin: 0 auto 32px; text-align: center; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

/* ============================================================
   HERO "NEURO" — hero de página inicial, alinhado ao modelo de
   design de referência (fundo escuro, sinapses, wordmark glow).
   Substitua o conteúdo de .hero-neuro__art por uma <img> real
   exportada da ferramenta de design quando disponível — o SVG
   abaixo é um placeholder ilustrativo gerado em CSS/SVG.
   ============================================================ */
.hero-neuro {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  overflow: hidden;
  /* Cor igual ao fundo da arte froid-hero.png (#000104) para a imagem fundir sem emenda */
  background: #000104;
  color: var(--froid-branco);
  /* 1.5cm entre o header e a arte (imagem recortada, sem margem preta interna) */
  padding: 1.5cm 24px 120px;
}
.hero-neuro__art {
  /* Em fluxo: a arte ocupa a sua própria faixa e o texto flui abaixo, sem sobreposição */
  position: relative;
  width: 100%;
  z-index: 0;
  opacity: 0.95;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-neuro__art svg { width: 100%; height: 100%; }
.hero-neuro__img {
  width: auto; height: auto; display: block;
  max-width: min(1100px, 92%); max-height: 52vh;
  object-fit: contain; margin: 0 auto;
  /* Realça o wordmark FROID embutido na arte */
  filter: brightness(1.22) contrast(1.06);
}
.hero-neuro__overlay {
  position: absolute; inset: 0; z-index: 1;
  /* Vinheta mais leve no centro para não apagar o wordmark da arte */
  background: radial-gradient(ellipse at center, rgba(0,1,4,0) 0%, rgba(0,1,4,0.22) 60%, rgba(0,1,4,0.7) 100%);
}
/* 1.5cm entre a arte e o texto */
.hero-neuro__content { position: relative; z-index: 2; max-width: 900px; margin-top: 1.5cm; }
/* A arte froid-hero.png já traz o wordmark e a tagline — os equivalentes em HTML
   ficam apenas para leitores de ecrã/SEO, sem ocupar espaço visual. */
.hero-neuro__content .hero-neuro__wordmark,
.hero-neuro__content .hero-neuro__tagline {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; margin: 0;
}
.hero-neuro__kicker {
  text-transform: uppercase; letter-spacing: 0.35em; font-size: 0.8rem;
  color: #7dd3fc; font-weight: 700; margin: 0 0 16px;
  position: relative; z-index: 2;
}
.hero-neuro__wordmark {
  font-family: var(--font); font-weight: 800; letter-spacing: 0.05em;
  font-size: clamp(3.2rem, 10vw, 7rem); margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #cfe6ff 60%, #7dd3fc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 60px rgba(125, 211, 252, 0.35);
  line-height: 1;
}
.hero-neuro__tagline {
  text-transform: uppercase; letter-spacing: 0.25em; font-size: 0.9rem;
  color: rgba(248,250,252,0.75); margin: 18px 0 28px; font-weight: 500;
}
.hero-neuro__divider { width: 120px; height: 1px; margin: 0 auto 46px; background: linear-gradient(90deg, transparent, #7dd3fc, transparent); }
.hero-quote { max-width: 760px; margin: 0 auto 32px; padding: 0; }
.hero-quote p {
  font-family: var(--font-serif); font-style: italic;
  font-size: 1.04rem; line-height: 1.75;
  color: rgba(248,250,252,0.88); margin: 0 0 16px;
}
.hero-quote footer {
  font-size: 0.92rem; color: rgba(248,250,252,0.6);
}
.hero-quote footer a { color: #93c5fd; font-weight: 600; }
.hero-neuro__scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: rgba(248,250,252,0.55); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.72rem;
}
.hero-neuro__scroll::after {
  content: ""; width: 1px; height: 34px;
  background: linear-gradient(180deg, rgba(125,211,252,0.9), transparent);
  animation: froid-scroll-pulse 1.8s ease-in-out infinite;
}
@keyframes froid-scroll-pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---------- Sections ---------- */
section.block { padding: 72px 0; border-bottom: 1px solid var(--border); }
section.block.soft { background: var(--paper-soft); }
/* Títulos de seção centralizados em todas as páginas (kicker acompanha para manter o bloco coeso) */
h2.section-title { font-family: var(--font-serif); font-size: 2rem; margin: 0 0 12px; color: #f8fafc; text-align: center; }
p.section-kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; color: var(--froid-azul); font-weight: 700; margin: 0 0 10px; text-align: center; }
/* Texto de apoio das seções também centralizado (bloco limitado a 720px, centrado na página) */
p.section-lead { color: var(--froid-cinza); max-width: 720px; font-size: 1.05rem; margin: 0 auto 40px; text-align: center; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: #1e293b; border: 1px solid #334155; border-radius: var(--radius);
  padding: 26px; box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* ---------- Image placeholders (toda seção normal, exceto Só para Nerds) ---------- */
.img-placeholder {
  position: relative;
  width: 100%;
  min-height: 260px;
  border-radius: var(--radius);
  border: 2px dashed #475569;
  background: repeating-linear-gradient(45deg, #0f172a, #0f172a 10px, #14213d 10px, #14213d 20px);
  display: flex; align-items: center; justify-content: center;
  color: var(--froid-cinza); font-size: 0.85rem; font-weight: 600; text-align: center; padding: 20px;
}
.img-placeholder::before { content: "\1F5BC  ESPAÇO RESERVADO — INSIRA IMAGEM AQUI"; }

/* ---------- Evidence badges ---------- */
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.badge-strong { background: #dcf5e3; color: #15803d; }
.badge-moderate { background: #fef3c7; color: #92400e; }
.badge-weak { background: #fde2d5; color: #b1440e; }
.badge-none { background: #e5e7eb; color: #374151; }
.badge-proprietary { background: #e0e7ff; color: #3730a3; }

.citation { font-size: 0.85rem; color: var(--froid-cinza); border-left: 3px solid var(--froid-azul); padding-left: 12px; margin: 10px 0; }
.citation a { font-weight: 600; }

/* ============================================================
   "SÓ PARA NERDS" — painel técnico avançado
   Requisito do cliente: campo com scroll interno e position: absolute
   dentro de um wrapper relative, para permitir reposicionamento manual
   posterior (ajuste de top/left diretamente neste CSS ou inline).
   ============================================================ */
.nerds-wrapper {
  position: relative;
  min-height: 120px;
  margin: 48px 0 12px;
}
.nerds-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: #334155; color: var(--froid-branco);
  border: none; border-radius: 999px; padding: 10px 20px;
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
  letter-spacing: 0.02em;
}
.nerds-toggle::before { content: "\1F913"; }
.nerds-toggle:hover { background: #475569; }

.nerds-panel {
  /* Posicionamento absoluto solicitado — ajuste top/left/width conforme necessário */
  position: absolute;
  top: 54px;
  left: 0;
  width: 100%;
  max-width: 760px;
  z-index: 20;
  display: none;
  background: var(--froid-preto);
  color: #dbe4ff;
  border-radius: var(--radius);
  border: 1px solid #2a3a5c;
  box-shadow: 0 18px 40px rgba(15,23,42,0.35);
  max-height: 420px;
  overflow-y: scroll;
  padding: 26px 28px;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.7;
}
.nerds-panel.open { display: block; }
.nerds-panel h4 { color: #93c5fd; font-family: var(--font); font-size: 0.95rem; margin: 18px 0 6px; }
.nerds-panel h4:first-child { margin-top: 0; }
.nerds-panel code, .nerds-panel .formula { display: block; background: #0a1226; border-radius: 8px; padding: 10px 12px; margin: 8px 0; color: #a5f3c8; overflow-x: auto; }
.nerds-panel .ref { color: #9fb0d1; font-family: var(--font); font-size: 0.78rem; border-top: 1px dashed #2a3a5c; margin-top: 14px; padding-top: 10px; }
.nerds-panel .ref a { color: #93c5fd; }
.nerds-panel::-webkit-scrollbar { width: 8px; }
.nerds-panel::-webkit-scrollbar-thumb { background: #2a3a5c; border-radius: 4px; }

/* ---------- Footer ---------- */
/* Arte de neurônios como fundo do próprio footer (froid-footer.png, borda #01030d),
   com véu escuro por cima para manter os links legíveis */
footer.site-footer {
  background: linear-gradient(rgba(1,3,13,0.55), rgba(1,3,13,0.8)),
              url('img/froid-footer.png') center / cover no-repeat,
              #01030d;
  color: rgba(248,250,252,0.7); padding: 48px 0 28px; font-size: 0.88rem;
}
footer.site-footer a { color: rgba(248,250,252,0.85); }
footer.site-footer .foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 32px; }
@media (max-width: 780px) { footer.site-footer .foot-grid { grid-template-columns: 1fr 1fr; } }
footer.site-footer h5 { color: var(--froid-branco); font-size: 0.9rem; margin: 0 0 12px; }
footer.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; color: rgba(248,250,252,0.45); font-size: 0.8rem; }

.disclaimer-box {
  background: #451a03; border: 1px solid #92400e; border-radius: var(--radius);
  padding: 20px 24px; font-size: 0.92rem; color: #fcd34d; margin: 32px auto;
  text-align: center;
}
.disclaimer-box strong { color: #fde68a; }

/* ---------- Termos com tooltip (glossário) ---------- */
.term {
  border-bottom: 1px dotted var(--froid-azul);
  cursor: help;
  text-decoration: none;
  color: inherit;
}
.term:hover { border-bottom-style: solid; text-decoration: none; }

/* ---------- Imagens inseridas (substituem os .img-placeholder) ---------- */
.site-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid #334155;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  object-fit: cover;
}
figure.site-fig { margin: 0; }
figure.site-fig figcaption {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--froid-cinza);
  text-align: center;
}

/* ---------- Lightbox: ampliação das fotos ao clicar ---------- */
.zoomable { cursor: zoom-in; }
.zoomable:focus-visible {
  outline: 2px solid var(--froid-azul, #3b82f6);
  outline-offset: 3px;
}
.site-img.zoomable {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.site-img.zoomable:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
}
body.lightbox-lock { overflow: hidden; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(2, 6, 23, 0.92);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.lightbox-overlay.open {
  display: flex;
  opacity: 1;
}
.lightbox-figure {
  margin: 0;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox-img {
  max-width: 96vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid #334155;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);
  object-fit: contain;
}
.lightbox-caption {
  max-width: 720px;
  font-size: 0.86rem;
  color: #e2e8f0;
  text-align: center;
  line-height: 1.4;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  line-height: 1;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #334155;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lightbox-close:hover { background: rgba(30, 41, 59, 0.95); transform: scale(1.05); }
.lightbox-close:focus-visible {
  outline: 2px solid var(--froid-azul, #3b82f6);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .site-img.zoomable,
  .lightbox-overlay,
  .lightbox-close { transition: none; }
  .site-img.zoomable:hover { transform: none; }
}
