/* SPA: garante que secoes ocultas fiquem escondidas (vence o display:flex). */
[hidden] { display: none !important; }

/* Space Grotesk (subset latino, self-hosted): fonte display dos titulos.
   Variavel 300-700, um arquivo so (~22KB). O corpo segue na fonte do sistema. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Acento cobre/ambar: remete ao cobre dos condutores. Substitui o azul
     generico (#3b82f6, o azul default do Tailwind). */
  --primary: #b45309;
  --primary-hover: #92400e;
  /* Variante clara do acento, para fundos escuros (strip, hero, brand). */
  --accent-light: #fbbf24;
  --logo: #fcd34d;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --mono4: #f8fafc;
  --white: #ffffff;
  --maxw: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font);
}

/* Selecao de texto na cor do acento. */
::selection { background: var(--primary); color: var(--white); }

* { box-sizing: border-box; }
/* Canvas escuro como rede de seguranca: se algo vazar atras da barra translucida
   do iOS 26, fica no tom do wallpaper (mesmo #0f172a do theme-color), nunca branco. */
/* overflow-x: clip neutraliza o leve scroll horizontal das faixas full-bleed
   (.media-list / .apps-list sangram com 50vw, que conta a barra de rolagem e
   passa ~meia barra alem da area de conteudo). clip, ao contrario de hidden,
   nao cria um scroll container, entao nao quebra sticky nem o scroll vertical. */
html { scroll-behavior: smooth; background: var(--ink); overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Na home o body nao pode ser branco: com viewport-fit=cover ele se estende
   atras da barra inferior translucida do Safari iOS 26 e pintava branco ali,
   por cima de tudo. Escuro deixa a regiao no tom do wallpaper. As outras rotas
   seguem brancas. */
body:has(.page-shell.home:not([hidden])) { background: var(--ink); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  /* Edge-to-edge: respeita o notch/barras laterais sem encostar o conteudo. */
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
main { flex: 1 0 auto; }

/* ---------- Header ---------- */
.site-header { width: 100%; }
/* Grid de 3 colunas: marca | menu | contato. As colunas laterais sao 1fr
   iguais, entao o menu (coluna auto) fica centralizado no header inteiro,
   independentemente das larguras da marca e do botao Contato. */
.site-header .wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}
/* Titulos e marcas usam a fonte display; o corpo segue na fonte do sistema. */
.brand,
.hero h1,
.section-head h2,
.card h3,
.feature-body h2,
.prose h1,
.cta-band h2,
.coffee-band h2,
.strip-num,
.modal-title,
.exp-role,
.contact-form-title,
.notfound-code,
.notfound-title,
.ai-empty__title {
  font-family: var(--font-display);
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--logo);
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; opacity: .85; }
/* Nas paginas internas (Sobre, Contato) o nome do site fica cor de tinta,
   igual ao brand do header esfumacado que aparece ao rolar na home. */
.page-shell:not(.home) .brand { color: var(--ink); }

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}
.nav a {
  font-size: .9rem;
  font-weight: 500;
  color: inherit;
}
.nav a:hover { text-decoration: none; opacity: .7; }
/* Icone de carta (Contato): so no mobile, ao lado do hamburguer. */
.nav-mail { display: none; }

.cta {
  display: inline-block;
  justify-self: end; /* coluna direita do grid: encosta o botao a direita */
  background: var(--primary);
  color: var(--white) !important;
  padding: 9px 20px;
  border-radius: 9999px;
  font-size: .9rem;
  font-weight: 600;
}
.cta:hover { background: var(--primary-hover); text-decoration: none; }

/* Botao de menu (hamburguer): so aparece no mobile (ver media query). */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 6px;
  margin: -6px 0;
  color: inherit;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 26px; height: 26px; display: block; }
/* Especificidade com .nav-toggle para vencer a regra `.nav-toggle svg` acima
   (senao o X ficaria sempre visivel). */
.nav-toggle .nav-toggle__close { display: none; }
.site-header.nav-open .nav-toggle .nav-toggle__open { display: none; }
.site-header.nav-open .nav-toggle .nav-toggle__close { display: block; }

/* Animacao de abertura do menu mobile (roda ao passar para display:flex). */
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .site-header.nav-open .nav,
  .site-header.nav-open .cta { animation: none; }
}

/* ---------- Header unico da home ----------
   Fixo no topo. No inicio: transparente + texto branco sobre o wallpaper.
   Ao rolar (.scrolled, marcado pelo JS): texto cor de tinta e brand reduzido,
   com o esfumacado (.home-frost) surgindo logo atras. Assim ha um so header,
   que troca de cor conforme a rolagem (mesma base .site-header das demais). */
.home .site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
  color: var(--white);
  transition: color .25s ease;
}
.home .site-header .brand {
  color: var(--white);
  white-space: nowrap; /* nunca quebra em 2 linhas (manteria o header alto) */
  transition: color .25s ease, font-size .15s ease;
}
.home .site-header.scrolled { color: var(--ink); }
.home .site-header.scrolled .brand {
  /* Reduzido, igual ao antigo header fixo, para combinar com o subtitulo sticky. */
  color: var(--ink);
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

/* Header das paginas internas (Sobre, Contato): fixo no topo e esfumacado,
   igual ao estado rolado do header da home (.home .site-header.scrolled + .home-frost).
   O frost vai num ::before atras do conteudo (z-index -1) para dissolver so o
   que passa por baixo, mantendo brand/menu/Contato nitidos. */
.page-shell:not(.home) .site-header {
  color: var(--ink);
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
}
.page-shell:not(.home) .site-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(100% + 50px); /* extrapola um pouco abaixo, como na home */
  z-index: -1;
}

/* Pintura do esfumacado, compartilhada pelos dois headers frosted: o da home
   (ao rolar) e o das paginas internas. Aqui fica so o visual (gradiente + blur
   + mascara); a posicao/altura de cada um vem nos blocos especificos acima. */
.home-frost,
.page-shell:not(.home) .site-header::before {
  /* Vidro de verdade: branco menos opaco para o conteudo aparecer atras, blur
     maior e saturacao levemente elevada (o classico do glassmorphism, que
     mantem as cores vivas em vez de acinzentar o que passa por baixo). */
  background: linear-gradient(to bottom, rgba(255,255,255,.86) 35%, rgba(255,255,255,0));
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent);
  mask-image: linear-gradient(to bottom, #000 58%, transparent);
  pointer-events: none;
}

/* ---------- Hero (cover com parallax) ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  /* Preenche a tela toda; dvh evita o "pulo" da barra do navegador no mobile. */
  min-height: 100vh;
  min-height: 100dvh;
  /* Mobile (padrao): foto do Vitor. Desktop troca por captura.png mais abaixo.
     Base do gradiente em preto neutro (antes era navy rgba(15,23,42), que criava
     a nevoa azulada na parte inferior da tela). */
  background-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.55)), url('/assets/vitor.jpg');
  background-size: cover;
  background-position: 50% 50%;
  background-attachment: scroll;
  color: var(--white);
  /* Safe-insets: header nao fica sob o notch; conteudo nao encosta embaixo. */
  padding-top: env(safe-area-inset-top);
  padding-bottom: max(64px, env(safe-area-inset-bottom));
}
/* Grain sutil sobre o wallpaper: ruido SVG inline (feTurbulence, sem request
   extra) em opacidade baixa. Tira o aspecto "flat" da foto de fundo e disfarca
   o banding do gradiente escuro. Fica abaixo do conteudo (.hero-inner, z 1). */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05;
  pointer-events: none;
}
.hero-inner {
  flex: 1;
  position: relative;
  z-index: 1; /* conteudo acima do grain (.hero::after) */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  max-width: 760px;
  padding: 40px 0 20px;
}
.hero-eyebrow {
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin: 0 0 14px;
}

/* ---------- Brand colapsante (Volt Coulomb Tesla -> V C T -> VCT -> VICTOR -> VCT) ----------
   O JS troca o texto do .brand da home (data-typewriter) quadro a quadro: as
   palavras sao comidas pelas pontas ate sobrarem as iniciais, que se juntam em
   VCT, expandem para VICTOR e voltam a VCT (estado de descanso). Largura fixa por
   ch evita o header "pulando" enquanto o texto encolhe. */
.brand[data-typewriter] {
  position: relative;
  display: inline-block;
  min-width: 12ch;
  white-space: pre;            /* preserva os espacos de "V C T" */
  font-variant-ligatures: none;
  font-feature-settings: "tnum" 1;
}
/* Cada letra e um span: ao sair do quadro (.bc-off) ela desvanece e colapsa a
   largura, entao as vizinhas deslizam juntas em vez do corte seco de digitacao.
   max-width folgado (2ch) cobre letras largas como o "m" sem clipar em repouso. */
.brand[data-typewriter] .bc-ch {
  display: inline-block;
  white-space: pre;
  overflow: hidden;
  vertical-align: top;
  max-width: 2ch;
  transition: opacity .3s ease, max-width .3s ease;
}
.brand[data-typewriter] .bc-off {
  opacity: 0;
  max-width: 0;
}
/* ---------- Submenu dos cientistas ----------
   O JS (sci.js) envolve cada brand num .brand-menu e injeta o .brand-sub. Ao
   passar o mouse (ou focar via teclado), o submenu aparece sob o VCT com os tres
   nomes; clicar abre o modal. */
.brand-menu { position: relative; display: inline-flex; justify-self: start; }
.brand-sub {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 0;
  /* padding-top serve de ponte: sem vao morto entre o brand e o card. */
  padding: 12px 6px 6px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 40;
}
.brand-sub::before {
  /* O card visivel (fundo/borda) comeca abaixo do padding-ponte. */
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 8px; bottom: 0;
  background: var(--ink, #0f172a);
  border: 1px solid color-mix(in srgb, #fff 14%, transparent);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(0,0,0,.34);
  z-index: -1;
}
/* Aberto no desktop por hover/foco; no toque pela classe .is-open (JS). Em ambos
   so vale no topo da home (header sem .scrolled): ao rolar, o dropdown some e o
   VCT volta a ser apenas o link para a home. */
@media (hover: hover) {
  .site-header:not(.scrolled) .brand-menu:hover .brand-sub,
  .site-header:not(.scrolled) .brand-menu:focus-within .brand-sub {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}
.site-header:not(.scrolled) .brand-menu.is-open .brand-sub {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Separador "·" entre os sobrenomes, no estilo do tooltip antigo. */
.brand-sub li { display: flex; align-items: center; }
.brand-sub li + li::before {
  content: "·";
  color: #64748b;
  font-weight: 700;
}
.brand-sub button {
  background: none;
  border: 0;
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--white);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.brand-sub button:hover,
.brand-sub button:focus-visible {
  background: color-mix(in srgb, #fff 12%, transparent);
  outline: none;
}

/* ---------- Modal dos cientistas ---------- */
.sci-modal[hidden] { display: none; }
.sci-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.sci-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8,12,22,.6);
  backdrop-filter: blur(3px);
}
.sci-modal__card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 210px 1fr;
  max-width: 740px;
  width: 100%;
  max-height: 86vh;
  overflow: hidden;
  background: var(--white, #fff);
  color: var(--ink, #0f172a);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: sciIn .18s ease;
}
@keyframes sciIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.sci-modal__img { width: 100%; height: 100%; object-fit: cover; background: #e2e8f0; }
/* O proprio body e o container de rolagem: max-height limita a altura (a linha do
   grid sozinha sobe ate o conteudo inteiro e o cartao recortaria sem rolar). */
.sci-modal__body { padding: 28px 30px; overflow-y: auto; min-height: 0; max-height: 86vh; }
.sci-modal__body h2 { margin: 0 0 2px; font-size: 1.5rem; }
.sci-modal__years { margin: 0 0 16px; color: #64748b; font-size: .9rem; }
.sci-modal__text p { margin: 0 0 12px; line-height: 1.6; }
.sci-modal__text p:last-child { margin-bottom: 0; }
.sci-modal__quote { font-style: italic; color: #475569; border-left: 3px solid #cbd5e1; padding-left: 12px; margin-top: 16px; }
.sci-modal__close {
  position: absolute;
  top: 10px; right: 12px;
  z-index: 2;
  width: 34px; height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  color: #0f172a;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
@media (max-width: 560px) {
  .sci-modal__card { grid-template-columns: 1fr; max-height: 90vh; }
  .sci-modal__img { height: 220px; }
  /* desconta a imagem do topo para o body rolar dentro da tela. */
  .sci-modal__body { max-height: calc(90vh - 220px); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-sub { transition: none; }
  .sci-modal__card { animation: none; }
}
.hero h1 {
  font-size: clamp(2.8rem, 3rem + 4vw, 6rem);
  font-weight: 700;
  line-height: 1.02;
  margin: 0 0 20px;
  letter-spacing: -.03em;
  /* Gradiente sutil no nome: branco escorrendo para o ambar do acento. */
  color: var(--white); /* fallback quando background-clip:text nao existe */
  background: linear-gradient(100deg, #ffffff 55%, #fcd34d 105%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Entrada do hero: eyebrow, nome, lead, botoes e icones sobem em cascata. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes heroIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .hero-eyebrow, .hero h1, .hero-lead, .hero-actions, .hero .social-icons {
    animation: heroIn .7s cubic-bezier(.22,.61,.36,1) both;
  }
  .hero h1 { animation-delay: .08s; }
  .hero-lead { animation-delay: .16s; }
  .hero-actions { animation-delay: .24s; }
  .hero .social-icons { animation-delay: .32s; }
}
.hero-lead {
  font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem);
  color: #e2e8f0;
  margin: 0 0 32px;
  max-width: 620px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 36px; }

/* ---------- Botoes ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 9999px;
  font-size: .98rem;
  font-weight: 600;
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--primary); color: var(--white) !important; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: rgba(255,255,255,.12); color: var(--white) !important; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.2); }

.social-icons {
  display: flex;
  gap: 20px;
}
.social-icons a { display: inline-flex; transition: transform .15s ease; }
.social-icons a:hover { transform: translateY(-3px); }
.social-icons img, .social-icons svg { width: 34px; height: 34px; }
.social-icons svg { color: var(--white); }

/* ---------- Bottom sheet (home): hero vira fundo fixo, sheet rola por cima ----------
   No repouso: aba baixa e estreita (--sheet-peek de altura, --sheet-w-min de largura),
   centralizada, so indicando que ha conteudo. Ao rolar, o JS interpola --sheet-w de
   --sheet-w-min ate 100% e a aba estica para a pagina inteira. */
.home {
  --sheet-peek: 110px;    /* o quanto a aba espia parada */
  --sheet-w-min: 66%;     /* largura da aba parada (~60-70% da tela) */
  --sheet-w: var(--sheet-w-min);  /* largura atual; o JS atualiza no scroll */
  /* Altura do header fixo, em CSS puro INCLUINDO o safe-area do notch. O titulo
     da secao (sticky) usa isto para grudar SEMPRE abaixo do header, sem depender
     de medicao JS (que podia ignorar o safe-area e jogar o titulo por cima). */
  --bar-h: calc(env(safe-area-inset-top) + 80px); /* desktop: header com nav */
}
.home .hero {
  position: fixed;
  /* Ancorado nos quatro lados: o wallpaper preenche o viewport de borda a borda,
     inclusive atras da barra translucida do Safari no iOS 26. Antes usava
     height:100lvh, mas o lvh nao cobre o inset da nova barra e o fundo branco do
     body vazava atras dela. O ICB do fixed nao encolhe quando a barra some ao
     rolar, entao o wallpaper segue estavel sem reenquadrar. */
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
}
.sheet {
  position: relative;
  z-index: 1;
  width: var(--sheet-w);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  /* Mesma referencia fixa (lvh) do hero: a gaveta fica ancorada ao fundo e nao
     se reposiciona quando a barra do navegador some/aparece ao rolar.
     Subtrai o safe-inset inferior para a espiada nao ficar sob o home indicator. */
  margin-top: calc(100lvh - var(--sheet-peek) - env(safe-area-inset-bottom));
  background: var(--ink);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -2px 44px rgba(15,23,42,.32);
  /* Sem overflow:hidden aqui: ele tornaria o .sheet um container de rolagem e
     quebraria o position:sticky dos titulos. Os cantos arredondados sao
     garantidos pelo .sheet-grab (primeiro filho) abaixo. */
}
.sheet-grab {
  background: var(--ink);
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  border-radius: 26px 26px 0 0; /* mantem o topo arredondado sem overflow no .sheet */
}
.sheet-grab-bar {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.5);
}


/* ---------- Faixa de credenciais ---------- */
.strip { background: var(--ink); color: var(--white); }
.strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  padding-top: 34px;
  padding-bottom: 34px;
}
.strip-item { display: flex; flex-direction: column; gap: 6px; }
.strip-num { font-size: 1.5rem; font-weight: 700; color: var(--accent-light); line-height: 1; }
.strip-label { font-size: .9rem; color: #cbd5e1; }

/* ---------- Secoes ---------- */
.section { padding: 72px 0; background: var(--white); }
.section-alt { background: var(--mono4); }
.section-head { max-width: 720px; margin: 0 0 40px; }
.section-head h2 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; margin: 0 0 10px; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- Esfumacado do topo (home) ----------
   Gradiente claro + blur que dissolve o conteudo ao passar sob o brand e o
   subtitulo sticky. Surge ao rolar (.is-visible, marcado pelo JS), atras do
   header (z 30) e abaixo do titulo sticky (z 5), entao borra o fundo sem cobrir
   o texto. A pintura (gradiente/blur/mascara) vem da regra compartilhada. */
.home-frost {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--bar-h, 72px) + 50px); /* cobre o header + o subtitulo */
  z-index: 4;
  opacity: 0;
  transition: opacity .25s ease;
}
.home-frost.is-visible { opacity: 1; }

/* ---------- Titulo da secao fixo ao rolar (sticky), logo abaixo do brand ----------
   display:contents no .section-head dissolve a caixa dele: o bloco de contencao
   do h2 passa a ser o .wrap (alto, do tamanho da secao), entao o sticky acompanha
   a secao inteira ate a proxima assumir. Fundo transparente, mesma fonte. */
.home .section-head { display: contents; }
.home .section-head h2 {
  position: sticky;
  top: calc(var(--bar-h, 72px) + 4px); /* fica logo abaixo do header fixo */
  z-index: 5;
  max-width: 720px;
  transition: font-size .15s ease, font-weight .15s ease, color .15s ease;
}
/* Quando o titulo esta grudado (seguindo) embaixo do brand, fica menor e mais cinza (JS marca). */
.home .section-head h2.is-stuck {
  font-size: 1.55rem;
  font-weight: 600;
  color: #475569;
}
.home .section-head p { max-width: 720px; margin-bottom: 40px; }
.home .section-head h2:only-child { margin-bottom: 40px; }

/* ---------- Cards de projeto ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.card {
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 26px 22px;
  background: var(--white);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
/* Stretched link: o ::after do card-link cobre o card inteiro, deixando o bloco todo clicavel. */
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
/* O link/botao fica colado no rodape do card, alinhando entre cards da mesma linha. */
.card-link { margin-top: auto; align-self: flex-start; }
/* No hover a borda acende no ambar do acento (sombra segue navy, discreta). */
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(15,23,42,.10); border-color: rgba(180,83,9,.45); }

/* ---------- Servicos VCT: faixa de destaque ---------- */
/* Kicker "Marca VCT" acima do titulo. Sobrescreve a margem de 40px que
   .home .section-head p aplica a todo paragrafo do cabecalho. */
.eyebrow {
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
  color: var(--primary); margin: 0 0 12px;
}
.home .section-head .eyebrow { max-width: none; margin: 0 0 12px; }

/* Fundo azul caracteristico da marca, so nesta secao (gradiente CSS, sem imagem).
   Cores extraidas do gradiente do usuario: #4D8DF5 -> #276CD2 -> #014BAE. */
.services-section {
  background: linear-gradient(180deg, #4D8DF5 0%, #276CD2 52%, #014BAE 100%);
  color: var(--white);
}
/* Cabecalho: logo VCT alinhado a esquerda, na borda dos cards. */
.home .section-head.services-head { display: block; text-align: left; margin-bottom: 40px; }
.services-logo {
  width: clamp(180px, 30vw, 280px); height: auto; display: block; margin: 0 0 14px;
  /* Sombra suave para o logo claro destacar do azul. */
  filter: drop-shadow(0 3px 10px rgba(2,28,74,.35));
}
/* Seletor com classe dupla para vencer `.section-head p { color: var(--muted) }`. */
.services-head .services-sub {
  max-width: 620px; margin: 0; color: #d6e0f2;
  font-size: 1.05rem;
}
/* Faixa de servicos: uma coluna, cada servico e uma linha (texto | print). */
.services { display: grid; grid-template-columns: 1fr; gap: 22px; }
.service {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 32px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  background: var(--white);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.service:hover { box-shadow: 0 16px 40px rgba(15,23,42,.10); border-color: rgba(180,83,9,.30); }
.service-body { display: flex; flex-direction: column; min-width: 0; }
.service-badge {
  align-self: flex-start;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--primary); background: rgba(180,83,9,.10);
  border-radius: 999px; padding: 3px 10px; margin-bottom: 14px;
}
/* Icone do app (emblema) ao lado do nome do servico. */
.service-title { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.service-icon { width: 48px; height: 48px; border-radius: 11px; flex: 0 0 auto; box-shadow: 0 2px 8px rgba(15,23,42,.14); }
.service-title h3 { font-size: 1.35rem; font-weight: 700; margin: 0; color: var(--ink); }
.service-body p { color: #334155; font-size: 1rem; margin: 0 0 18px; }
/* Desativa o stretched-link herdado de .card-link: aqui o botao e so o botao,
   e o print e um link independente para o site. */
.service-link { margin-top: auto; }
.service-link::after { content: none; }
/* Preview do site: moldura discreta, escala no hover. */
.service-shot {
  display: block; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(15,23,42,.10);
  line-height: 0;
}
.service-shot img { width: 100%; height: auto; display: block; transition: transform .35s ease; }
.service-shot:hover img { transform: scale(1.03); }

/* ---------- Na midia: carrossel horizontal de cards ---------- */
.media-list {
  list-style: none;
  margin: 0;
  /* Sangra ate a borda direita da tela; a esquerda continua alinhada ao conteudo. */
  margin-right: calc(50% - 50vw);
  /* Folga vertical: o overflow-x recorta tambem o eixo Y, entao a sombra do
     hover precisa caber dentro do padding. A margem negativa neutraliza o
     espaco extra para o layout nao crescer. */
  margin-top: -18px;
  margin-left: -18px;
  padding: 22px 4px 30px 22px;
  /* Espaco no fim para o ultimo card sair de baixo do fade ao rolar. */
  padding-right: max(80px, calc(50vw - 50%));
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  /* Dissolve os cards na borda direita: impressao de lista infinita. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 140px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 140px), transparent);
}
.media-list li { flex: none; width: 260px; scroll-snap-align: start; }
.media-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.media-item:hover {
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(15,23,42,.10);
  border-color: rgba(180,83,9,.45);
}
.media-thumb {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--mono4);
}
.media-text { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.media-source { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.media-title { font-size: .98rem; font-weight: 600; line-height: 1.35; }
/* Apps: o card fica fixo no lugar; as screenshots abrem PARA FRENTE, num
   painel flutuante sobre a pagina (.app-pop, montado via JS no <body> para
   escapar do overflow do carrossel) e num visualizador em tela cheia. */
/* As li esticam (align-items: stretch, padrão do flex): todos os cards da
   fileira ficam com a mesma altura, independente do título quebrar linha. */
.apps-list .media-item { min-height: 224px; }
.apps-list .media-item:not(.app-card) { justify-content: center; }
.app-card .app-head {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 18px;
}
/* A pílula desce para o rodapé do card: alinhada entre cards vizinhos. */
.app-card .app-shots-cue { margin-top: auto; }
.app-card .media-text { text-align: center; align-items: center; }
/* Fonte das imagens do painel/visualizador: nunca renderiza dentro do card. */
.app-shots { display: none; }
/* Pilula "Ver telas": abre o visualizador (unico acesso as telas no touch). */
.app-shots-cue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding: 5px 12px;
  font-size: .74rem;
  font-weight: 600;
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .15s ease, background .15s ease;
}
.app-shots-cue:hover { border-color: rgba(180,83,9,.45); background: rgba(180,83,9,.06); }
/* Painel flutuante do hover: cresce do card em direcao ao leitor (escala + sombra
   profunda). pointer-events none: e so uma previa, o clique continua no card. */
.app-pop {
  position: fixed;
  z-index: 70;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15,23,42,.28);
  opacity: 0;
  transform: scale(.9);
  transition: opacity .16s ease, transform .2s cubic-bezier(.2,.9,.3,1.08);
  pointer-events: none;
}
.app-pop.show { opacity: 1; transform: scale(1); }
.app-pop img {
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--mono4);
}
/* Visualizador em tela cheia: fundo escuro, telas em fileira com scroll-snap. */
.shots-lb {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: rgba(15,23,42,.93);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .2s ease;
}
.shots-lb[hidden] { display: none; }
.shots-lb.show { opacity: 1; }
.shots-lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: #fff;
}
.shots-lb-title { font-size: .95rem; font-weight: 600; }
.shots-lb-close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.shots-lb-close:hover { background: rgba(255,255,255,.26); }
.shots-lb-track {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.shots-lb-track::-webkit-scrollbar { display: none; }
.shots-lb-slide {
  flex: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  padding: 0 16px 8px;
}
.shots-lb-slide img {
  max-width: 100%;
  max-height: 100%;
  height: 76vh;
  width: auto;
  border-radius: 14px;
}
.shots-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.shots-lb-nav:hover { background: rgba(255,255,255,.26); }
.shots-lb-nav.prev { left: 14px; }
.shots-lb-nav.next { right: 14px; }
@media (hover: none) { .shots-lb-nav { display: none; } }
.shots-lb-dots { display: flex; gap: 8px; justify-content: center; padding: 12px 0 18px; }
.shots-lb-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); transition: background .15s ease; }
.shots-lb-dots i.on { background: #fff; }
/* Apps: o icone vira um quadrado centralizado com cantos arredondados estilo iOS. */
.apps-list .media-thumb {
  width: 88px;
  height: 88px;
  margin: 20px auto 4px;
  object-fit: cover;
  border-radius: 22%;
  box-shadow: 0 2px 10px rgba(15,23,42,.14);
}
.card-tag { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); margin-bottom: 12px; }
.card h3 { font-size: 1.3rem; font-weight: 700; margin: 0 0 10px; }
.card p { color: #334155; font-size: 1rem; margin: 0 0 18px; }
/* card-link serve tanto para <a> quanto para <button> (Saiba mais): reset de botao. */
.card-link {
  font-weight: 600;
  font-size: .98rem;
  color: var(--primary);
  font-family: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.card:hover .card-link { text-decoration: underline; }
.card-link .arrow { display: inline-block; transition: transform .15s ease; }
.card:hover .card-link .arrow { transform: translateX(4px); }
.card-link.muted { color: var(--muted); }

/* ---------- Competencias ---------- */
.skills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.skills li {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 10px 20px;
  font-size: .98rem;
  font-weight: 500;
  color: var(--ink);
}

/* Prova social do RMF: uma frase que continua o subtitulo de Apps, preenchida em
   runtime por /api/rmf-stats. Sem caixa nem numeros gigantes — so os valores em
   peso maior/acento, no fio do texto. Fica [hidden] ate os dados chegarem. */
.apps-proof [data-rmf] {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Obra em destaque ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 36px;
  align-items: center;
}
/* Moldura da foto com parallax: recorta a imagem (que e mais alta que a
   moldura) e ancora o overlay do credito. */
.feature-figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15,23,42,.16);
  /* 3:4 acompanha a proporcao da foto (848x1184): o corte vertical fica so na
     folga do parallax. Importa aqui: a pista na base da foto (tirada de fora
     do parque) precisa seguir visivel, e um recorte maior a engolia. */
  aspect-ratio: 3 / 4;
  max-height: 520px;
}
/* Parallax sutil: a imagem tem 106% da altura da moldura, entao no maximo 6%
   da foto fica fora do quadro em qualquer instante. O translateY (ate -5.6%
   da propria altura) e guiado por --pp (0 a 1), que o JS anima conforme a
   figura cruza a tela. Sem JS ou com reduced-motion, para no meio (--pp .5). */
.feature-media {
  display: block;
  width: 100%;
  height: 106%;
  object-fit: cover;
  transform: translateY(calc(var(--pp, .5) * -5.6%));
  will-change: transform;
}
/* Credito da obra sobre a foto, num gradiente escuro na base. */
.feature-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 56px 20px 14px;
  background: linear-gradient(to top, rgba(15,23,42,.78), rgba(15,23,42,0));
  color: #e2e8f0;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .01em;
}
/* Nota de enquadramento: deixa explicito que a foto foi feita de fora do parque. */
.feature-caption-note {
  display: block;
  margin-top: 2px;
  font-size: .78rem;
  font-weight: 500;
  color: #cbd5e1;
}
.feature-body { display: flex; flex-direction: column; justify-content: center; }
.feature-eyebrow {
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
  color: var(--primary); margin: 0 0 12px;
}
.feature-body h2 {
  font-size: clamp(1.7rem, 1.3rem + 2vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px;
}
.feature-text { color: #334155; font-size: 1.05rem; margin: 14px 0 22px; max-width: 52ch; }
.feature-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.feature-chips li {
  background: var(--white); border: 1px solid var(--line); border-radius: 9999px;
  padding: 8px 16px; font-size: .9rem; font-weight: 600; color: var(--ink);
}

/* ---------- Perfil ---------- */
.lead-text { max-width: 760px; font-size: 1.12rem; color: #1e293b; margin: 0; }

/* ---------- Experiencia (timeline) ---------- */
.timeline { display: flex; flex-direction: column; gap: 18px; }
.exp {
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 14px;
  padding: 22px 24px;
  background: var(--white);
}
.exp-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 4px; }
.exp-role { font-size: 1.18rem; font-weight: 700; margin: 0; }
.exp-period { font-size: .85rem; font-weight: 600; color: var(--primary); white-space: nowrap; }
.exp-org { font-size: .95rem; font-weight: 500; color: var(--muted); margin: 0 0 12px; }
.exp p { color: #334155; font-size: 1rem; margin: 0; }

/* ---------- Chamada final ---------- */
.cta-band, .coffee-band { text-align: center; }
.coffee-band h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem); font-weight: 700; margin: 0 0 10px; letter-spacing: -.02em; }
.cta-band h2 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); font-weight: 700; margin: 0 0 10px; letter-spacing: -.02em; }
.cta-band p { color: var(--muted); font-size: 1.1rem; margin: 0 auto 26px; max-width: 620px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.coffee-note { color: var(--muted); font-size: 1.1rem; margin: 0 auto 26px; max-width: 620px; }
.bmc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 9999px;
  background: #FFDD00;
  color: #000000 !important;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .02em;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.bmc-btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.bmc-emoji { font-size: 1.15em; }
.btn-outline { background: transparent; color: var(--primary) !important; border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white) !important; }

/* ---------- Paginas internas ---------- */
.page-shell { display: flex; flex-direction: column; flex: 1; }
.page { padding: 64px 24px 40px; }
.prose { max-width: 720px; margin: 0 auto; }
.prose h1 { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.2rem); font-weight: 600; letter-spacing: -.02em; margin: 0 0 28px; }
.prose p { color: #1e293b; font-size: 1.08rem; margin: 0 0 18px; }

.about-photo {
  float: right;
  width: 190px;
  border-radius: 14px;
  margin: 0 0 18px 28px;
  box-shadow: 0 10px 30px rgba(15,23,42,.18);
}
.leaf-note {
  clear: both;
  margin-top: 30px;
  padding: 16px 18px;
  background: rgba(0,208,132,.08);
  border: 1px solid rgba(0,208,132,.25);
  border-radius: 12px;
  color: #166534;
  font-size: .98rem;
}

.contact-list { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; }
.contact-list svg { width: 28px; height: 28px; color: var(--primary); flex-shrink: 0; }
.contact-list .k { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.contact-list .v { font-weight: 600; font-size: 1.08rem; }

/* ---------- Contato em duas colunas (desktop) ---------- */
/* No mobile fica empilhado (bloco normal); a partir de 761px vira grid.
   Largura cheia (sem max-width) para as bordas alinharem com o cabecalho. */
.contact-prose { max-width: none; }
@media (min-width: 761px) {
  .contact-cols {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 48px;
    align-items: start;
    margin-top: 32px;
  }
  /* Zera as margens de topo internas para as colunas alinharem no topo. */
  .contact-cols .contact-list { margin-top: 0; }
  .contact-cols .contact-form-title { margin-top: 0; }
}

/* ---------- Formulario de contato ---------- */
.contact-form-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; margin: 44px 0 18px; }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: .82rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field-label em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .8; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(180,83,9,.16);
}
.cf-turnstile { margin: 2px 0; min-height: 65px; }
.contact-form .btn { border: 0; cursor: pointer; align-self: flex-start; }
.contact-form .btn:disabled { opacity: .6; cursor: default; transform: none; }
/* Honeypot: fora da tela, mas nao display:none (alguns bots ignoram ocultos). */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 4px 0 0; font-size: .96rem; min-height: 1.2em; }
.form-status.ok { color: #166534; }
.form-status.err { color: #b91c1c; }

/* ---------- Modal "Saiba mais" ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(2px);
}
.modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: 18px;
  padding: 32px 30px 28px;
  box-shadow: 0 24px 60px rgba(15,23,42,.32);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
}
.modal-close:hover { color: var(--ink); }
.modal-title { font-size: 1.5rem; font-weight: 700; margin: 0 32px 14px 0; letter-spacing: -.01em; }
.modal-body { color: #334155; font-size: 1.02rem; }
.modal-body p { margin: 0 0 14px; }
.modal-cta { margin-top: 8px; }

/* ---------- Assistente IA: botao flutuante + chat ---------- */
.ai-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 40;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 4px;
  cursor: pointer;
  overflow: hidden; /* recorta os cantos quadrados da imagem no circulo */
  box-shadow: 0 8px 24px rgba(15,23,42,.22);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ai-fab:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15,23,42,.28); }
.ai-fab img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; }
/* Enquanto o balão está visível, o robô "respira" para chamar a atenção. */
.ai-fab.is-nudging { animation: aiFabNudge 2.4s ease-in-out infinite; }

/* ---------- Balão de fala do robô ---------- */
.ai-bubble {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(64px + max(20px, env(safe-area-inset-bottom)) + 16px);
  z-index: 41;
  width: min(320px, calc(100vw - 40px));
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px 15px;
  box-shadow: 0 18px 44px rgba(15,23,42,.20), 0 4px 12px rgba(15,23,42,.10);
  transform-origin: bottom right;
  transform: translateY(8px) scale(.92);
  opacity: 0;
  will-change: transform, opacity;
}
.ai-bubble.is-open { animation: aiBubbleIn .5s cubic-bezier(.18,.9,.32,1.3) forwards; }
.ai-bubble.is-closing { animation: aiBubbleOut .22s ease-in forwards; }
/* Ponteira apontando para o robô, no canto inferior direito. */
.ai-bubble::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: -8px;
  width: 16px;
  height: 16px;
  background: var(--white);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
.ai-bubble__tag {
  display: inline-block;
  font: 600 .68rem/1 var(--font);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(180,83,9,.10);
  padding: 4px 9px;
  border-radius: 999px;
  margin-bottom: 9px;
}
.ai-bubble__text {
  margin: 0 0 12px;
  font-size: .92rem;
  line-height: 1.5;
  color: #334155;
}
.ai-bubble__text strong { color: var(--ink); font-weight: 700; }
.ai-bubble__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 .9rem/1 var(--font);
  color: var(--primary);
  text-decoration: none;
}
.ai-bubble__cta span { transition: transform .15s ease; }
.ai-bubble__cta:hover span { transform: translateX(3px); }
.ai-bubble__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ai-bubble__close:hover { background: var(--mono4); color: var(--ink); }
.ai-bubble__close svg { width: 15px; height: 15px; }

@keyframes aiBubbleIn {
  from { transform: translateY(8px) scale(.92); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes aiBubbleOut {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to   { transform: translateY(6px) scale(.94); opacity: 0; }
}
@keyframes aiFabNudge {
  0%, 82%, 100% { transform: translateY(0) rotate(0); }
  87%  { transform: translateY(-4px) rotate(-6deg); }
  92%  { transform: translateY(-4px) rotate(5deg); }
  96%  { transform: translateY(-2px) rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-bubble { transform: none; opacity: 1; }
  .ai-bubble.is-open, .ai-bubble.is-closing { animation: none; }
  .ai-fab.is-nudging { animation: none; }
}

/* O modal do chat ancora no canto inferior direito (nao centralizado). */
.ai-modal { align-items: flex-end; justify-content: flex-end; padding: 0; }
.ai-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 32px));
  height: min(75vh, 620px);
  margin: 0 20px 96px;
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15,23,42,.32);
  overflow: hidden;
}
.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  background: var(--ink);
  color: var(--white);
}
.ai-head__title { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.ai-head__title img { width: 28px; height: 28px; border-radius: 50%; background: var(--white); object-fit: contain; }
.ai-head__actions { display: flex; gap: 6px; }
.ai-iconbtn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px;
  background: rgba(255,255,255,.14); color: var(--white);
  cursor: pointer;
}
.ai-iconbtn:hover { background: rgba(255,255,255,.26); }
.ai-iconbtn svg { width: 16px; height: 16px; }
.ai-iconbtn.hidden { display: none; }

.ai-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--mono4);
}
.ai-empty { margin: auto; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; }
.ai-empty__icon img { width: 72px; height: 72px; border-radius: 50%; object-fit: contain; background: var(--white); border: 1px solid var(--line); }
.ai-empty__title { font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.ai-empty__sub { font-size: .92rem; max-width: 280px; }
.ai-empty__chips { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 6px; }
.ai-chip {
  text-align: left; font: inherit; font-size: .9rem;
  color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; cursor: pointer;
}
.ai-chip:hover { border-color: var(--primary); color: var(--primary); }

.ai-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: .96rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg--user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg--assistant { align-self: flex-start; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-typing { color: var(--muted); font-style: italic; }
.ai-msg--assistant { white-space: normal; }
.ai-msg--assistant > :first-child { margin-top: 0; }
.ai-msg--assistant > :last-child { margin-bottom: 0; }
.ai-msg--assistant p { margin: 0 0 .5em; }
.ai-msg--assistant ul, .ai-msg--assistant ol { margin: .35em 0; padding-left: 1.25em; }
.ai-msg--assistant li { margin: .15em 0; }
.ai-captcha { margin-top: 10px; min-height: 65px; }
.ai-msg--assistant a { color: var(--primary); text-decoration: underline; }

.ai-composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--white); }
.ai-input {
  flex: 1; font: inherit; font-size: .96rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; resize: none; max-height: 120px; line-height: 1.4;
}
.ai-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(180,83,9,.16); }
.ai-send {
  flex-shrink: 0; width: 42px; height: 42px;
  border: 0; border-radius: 12px;
  background: var(--primary); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ai-send:hover { background: var(--primary-hover); }
.ai-send:disabled { opacity: .6; cursor: default; }
.ai-send svg { width: 18px; height: 18px; }

@media (max-width: 480px) {
  .ai-panel { width: calc(100vw - 16px); height: 80vh; margin: 0 8px 84px; }
  .ai-fab { width: 56px; height: 56px; }
  .ai-bubble { bottom: calc(56px + max(20px, env(safe-area-inset-bottom)) + 14px); }
}

/* ---------- Pagina 404 ---------- */
/* Mobile: empilhado e centralizado. Desktop (>=768px): duas colunas como na
   referencia RMF -> [robo + 404 + texto + botao] | [card de sugestoes]. */
.notfound {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.notfound-robo { flex-shrink: 0; }
/* Coluna principal: robo + codigo + texto + botao, sempre centralizada. */
.notfound-main { display: flex; flex-direction: column; align-items: center; width: 100%; }
@media (min-width: 768px) {
  .notfound {
    max-width: 920px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 56px;
  }
  .notfound-main { flex: 1; width: auto; }
  /* Card vira a coluna da direita: largura fixa, centralizado na vertical. */
  .notfound-card { flex-shrink: 0; width: 360px; align-self: center; }
}
.notfound-code {
  font-size: clamp(5rem, 4rem + 12vw, 9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--line);
  margin: 8px 0 4px;
  user-select: none;
}
.notfound-code span { color: var(--primary); }
.notfound-title { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; margin: 8px 0 10px; }
.notfound-lead { color: var(--muted); font-size: 1.1rem; margin: 0 0 28px; max-width: 460px; }
.notfound-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 40px; }
.notfound-card {
  width: 100%;
  max-width: 420px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 18px;
  background: var(--white);
}
.notfound-card-label {
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 14px 2px 4px;
}
.notfound-suggestions { display: flex; flex-direction: column; }
.notfound-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 2px;
  color: var(--ink);
}
.notfound-row + .notfound-row { border-top: 1px solid var(--line); }
.notfound-row:hover { text-decoration: none; }
.notfound-row .nf-ico { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.notfound-row .nf-label { font-weight: 600; font-size: 1rem; flex: 1; }
.notfound-row .nf-chev { width: 18px; height: 18px; color: var(--muted); transition: transform .15s ease, color .15s ease; }
.notfound-row:hover .nf-chev { transform: translateX(3px); color: var(--primary); }

/* ---------- Reveal on scroll ----------
   As classes sao aplicadas pelo JS (que ja respeita prefers-reduced-motion):
   .reveal esconde, .is-in dispara a subida com o atraso --rd (stagger por
   grupo). Ao fim da animacao o JS remove as duas classes, para o fill-mode
   nao segurar transform/opacity e brigar com os hovers (cards, apps). */
.reveal { opacity: 0; }
.reveal.is-in {
  animation: riseIn .6s cubic-bezier(.22,.61,.36,1) both;
  animation-delay: var(--rd, 0ms);
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  background: var(--mono4);
  border-top: 1px solid var(--line);
  padding: 30px 0;
  /* Safe-inset: nao fica sob a barra de gestos no mobile. */
  padding-bottom: max(30px, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: .9rem;
}
.site-footer .wrap { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; }
/* Citacao do Tesla (o "T" de VCT): tributo discreto no rodape. */
.site-footer .cite { font-style: italic; color: #94a3b8; font-size: .82rem; margin-top: 6px; }
.site-footer .cite cite { font-style: normal; color: var(--muted); }

/* ---------- Responsivo ---------- */

/* Desktop: troca o background pela captura.png com parallax. */
@media (min-width: 761px) {
  .hero {
    background-image: linear-gradient(rgba(0,0,0,.30), rgba(0,0,0,.30)), url('/assets/captura.png');
    background-attachment: fixed;
  }
  /* Icones sociais maiores no desktop. */
  .social-icons { gap: 26px; }
  .social-icons img, .social-icons svg { width: 50px; height: 50px; }
}

/* Tablet: faixa de credenciais e cards em 2 colunas. */
@media (max-width: 900px) {
  .strip-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile: layout mais respirado e legivel. */
@media (max-width: 760px) {
  .wrap { padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); }
  .hero { min-height: 100vh; min-height: 100dvh; padding-bottom: max(40px, env(safe-area-inset-bottom)); background-position: 50% 30%; }
  .hero-inner { padding: 24px 6px; align-items: center; text-align: center; }
  .hero-actions { justify-content: center; }
  .social-icons { justify-content: center; }
  .cards { grid-template-columns: 1fr; }
  /* Empilha texto e print no mobile; o print vai para cima, chamando atencao. */
  .service { grid-template-columns: 1fr; gap: 22px; }
  .service-shot { order: -1; }
  .feature { grid-template-columns: 1fr; gap: 22px; }
  .feature-figure { max-height: 480px; }
  .section { padding: 56px 0; }

  /* Remove o halo azulado (sombra navy) que a aba projetava sobre o wallpaper. */
  .sheet { box-shadow: none; }
  /* Sobe a strip-grid (menos respiro no topo) para mostrar mais da espiada da aba
     antes de comecar a rolagem. */
  .strip-grid { padding-top: 8px; }

  /* Header compacto: so brand + botao de menu. O menu abre como painel
     sobreposto (absoluto), sem empurrar o conteudo. */
  /* Header compacto numa unica linha: brand (encolhe se preciso) + icones. */
  .home {
    --bar-h: calc(env(safe-area-inset-top) + 71px); /* header compacto mobile */
    --sheet-peek: 168px; /* espia mais da aba: mostra mais da strip-grid no repouso */
    --sheet-w-min: 88%;  /* no mobile a aba parada fica mais larga (menos espremida) */
  }
  /* Mais folga so ACIMA do nome (padding-top), nao grosso no geral: a folga extra
     no topo absorve o "settle" de poucos pixels do iOS Safari ao recolher a barra. */
  .site-header .wrap { display: flex; flex-wrap: nowrap; align-items: center; gap: 14px; position: relative; padding-top: 28px; padding-bottom: 13px; }
  .brand { flex: 1; order: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Quando o brand da home esta dentro do .brand-menu, e o wrapper que precisa
     crescer para empurrar os icones (carta + menu) para o canto direito. */
  .brand-menu { flex: 1; order: 0; min-width: 0; }
  .nav-mail {
    display: inline-flex;
    order: 1;
    align-items: center;
    justify-content: center;
    color: inherit;
    padding: 6px;
    margin: -6px 0;
  }
  .nav-mail svg { width: 24px; height: 24px; display: block; }
  .nav-toggle { display: inline-flex; order: 2; }
  .cta { display: none; } /* no mobile, Contato fica no icone de carta (.nav-mail) */

  /* Painel do menu: sai logo abaixo do header, por cima de tudo. */
  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px max(24px, env(safe-area-inset-left)) 14px;
    border-radius: 0 0 18px 18px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 28px rgba(15,23,42,.18);
  }
  .nav a { padding: 11px 2px; font-size: 1rem; }
  .site-header.nav-open .nav { display: flex; animation: menuIn .24s ease both; }

  /* Cor do painel por contexto: clara (texto escuro) ou escura (hero). */
  .page-shell:not(.home) .nav,
  .home .site-header.scrolled .nav { background: rgba(255,255,255,.98); } /* ao rolar: painel claro */
  .home .site-header .nav { background: rgba(15,23,42,.95); } /* no topo: painel escuro sobre o wallpaper */


  /* Ao abrir, a faixa do header tambem ganha fundo, continuo com o painel. */
  .page-shell:not(.home) .site-header.nav-open {
    background: rgba(255,255,255,.98);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  /* Header da home ao abrir o menu: a faixa ganha fundo continuo com o painel.
     Escuro no topo (sobre o wallpaper), claro ao rolar. */
  .home .site-header.nav-open {
    background: rgba(15,23,42,.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .home .site-header.scrolled.nav-open { background: rgba(255,255,255,.98); }
  .about-photo { float: none; display: block; margin: 0 auto 22px; }
  .page { padding: 40px 22px 32px; }
}
