/* presenca-clain.css — a presença viva do CLAIN (10/10/2026). Par de presenca-clain.js; fonte única em superclain/presenca/.
   Tema: --pv-a (cor da luz), --pv-b (o ouro do ponto), --pv-c (o fundo do corpo). Os sistemas gerados trocam pelo nicho.
   Todo movimento fica sob html.pv-vivo; com prefers-reduced-motion (ou em teste automatizado) vale html.pv-calmo: estático. */
:root { --pv-a: #6A2CFF; --pv-b: #E3BC5A; --pv-c: #0A0920; }

/* ---------------------------------------------------------------- o ser */
.pv-ser { position: relative; isolation: isolate; }
.pv-ser > .pv-tela {
  position: absolute; left: 50%; top: 50%; z-index: -1; pointer-events: none;
  width: calc(var(--pv-k, 2.3) * 100%); height: calc(var(--pv-k, 2.3) * 100%); max-width: none;
  transform: translate(-50%, -50%);
}
.pv-ser > .pv-tela { transition: opacity .6s ease; }
.pv-ser > .pv-tela.pv-compilando { opacity: 0; }   /* o plasma esmaece para dentro quando fica pronto */
.pv-ser > svg.gesto { position: relative; z-index: 1; transform-origin: 50% 62%;
  transform: rotate(var(--pv-rot, 0deg)) scale(calc(.8 + (var(--pv-sc, 1) - 1) * .4)); }
.pv-ser .gesto .luz { animation: none !important; transform-box: fill-box; transform-origin: center;
  transform: translate(var(--pv-lx, 0px), var(--pv-ly, 0px)) scale(var(--pv-ls, 1)); }
.pv-ser .gesto path { transition: fill .6s ease; }
html[data-pv-estado="escutando"] .pv-ser .gesto path { fill: #7d4bff; }

/* o ser da home é um botão: tocar nele abre a conversa por voz */
.hero-marca.pv-ser { cursor: pointer; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
/* o ser é o protagonista do topo da home (11/10): no computador, uma coluna própria à direita, com ~50% da altura da primeira
   dobra; no celular e no tablet, centralizado acima do título. A conversa continua na primeira tela, e nada a cobre. */
html.pv .hero-chat .hero-marca.pv-ser { display: grid; place-items: center; aspect-ratio: 1; }
/* o brilho decorativo do topo cobria a rede e a aurora (fica por cima do fundo): com a presença, a luz vem do próprio ser */
html.pv .hero-chat::before { opacity: .3; }
html.pv .hero-chat .hero-marca.pv-ser > svg.gesto { width: 70%; height: auto; }
@media (max-width: 1039.98px) {
  html.pv .hero-chat .hero-topo { flex-direction: column; align-items: stretch; gap: 0; }
  html.pv .hero-chat .hero-marca.pv-ser { width: clamp(92px, 24vw, 160px); margin: 10px auto 6px; align-self: center; }
  html.pv .hero-chat .hero-texto { text-align: center; }
  html.pv .hero-chat .sub { margin-left: auto; margin-right: auto; }
}
/* tela baixa (celular deitado, aparelhos pequenos): o ser volta para o lado do título, para a pergunta e as opções
   continuarem acima da barra de baixo (regra da equipe Celular) */
@media (max-width: 1039.98px) and (max-height: 700px) {
  html.pv .hero-chat .hero-topo { flex-direction: row; align-items: flex-start; gap: 12px; }
  html.pv .hero-chat .hero-marca.pv-ser { width: 52px; margin: 2px 0 0; align-self: flex-start; }
  html.pv .hero-chat .hero-texto { text-align: left; }
  html.pv .hero-chat .sub { margin-left: 0; }
}
@media (min-width: 1040px) {
  html.pv .hero-chat > .faixa {
    display: grid; max-width: min(1280px, 100%); align-items: start; row-gap: 18px;
    grid-template-columns: minmax(0, 1fr) clamp(300px, 32vw, 460px); column-gap: clamp(28px, 3.4vw, 56px);
  }
  html.pv .hero-chat .hero-topo { display: contents; }
  html.pv .hero-chat > .faixa > *, html.pv .hero-chat .hero-texto { grid-column: 1; min-width: 0; }
  html.pv .hero-chat .hero-marca.pv-ser { grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: center; width: min(100%, 50vh, 440px); margin: 0; }
  html.pv .hero-chat .agora, html.pv .hero-chat .lista-inline { margin-top: 0; }
}
.hero-marca.pv-ser:focus-visible { outline: 3px solid #F2C94C; outline-offset: 6px; }
.hero-marca.pv-ser[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -14%; border-radius: 50%; z-index: 2; pointer-events: none;
  border: 2px solid rgba(156, 123, 255, .65); box-shadow: 0 0 18px rgba(106, 44, 255, .55);
}

/* miniaturas: no topo da conversa, no botão flutuante, no assistente do painel e dos sistemas */
.pv-host-mini { display: inline-block; flex: none; width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; }
.pv-host { display: inline-block; flex: none; width: 56px; height: 56px; border-radius: 50%; }
.conversa-topo .ponto.pv-coberto { display: none; }
.falar-flutuante.pv-com-ser .icn { display: none; }
.falar-flutuante.pv-com-ser { min-width: 44px; min-height: 44px; justify-content: center; }   /* alvo de toque de 44 px, mesmo só com o ser */
.pv-host-flut { width: 26px; height: 26px; }
.pv-host-mini-cab { width: 30px; height: 30px; margin-right: 8px; }
#cl-assist-abrir.pv-com-ser > svg, .vend-botao.pv-com-ser > svg, .vend-topo.pv-com-ser > svg { display: none; }
#cl-assist-abrir .pv-host-mini, .vend-botao .pv-host-mini { width: 26px; height: 26px; }
.dna-cab.pv-com-ser { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dna-cab .pv-host-cab { width: 58px; height: 58px; margin: 8px 6px 8px 8px; }

/* ---------------------------------------------------------------- botões da voz (no topo da conversa) */
.pv-btn {
  flex: none; width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; cursor: pointer;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .16); background: transparent; color: inherit;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}
.pv-btn svg { width: 18px; height: 18px; display: block; }
.pv-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.pv-btn[aria-pressed="true"] { background: rgba(106, 44, 255, .38); border-color: rgba(156, 123, 255, .75); color: #fff; }
.pv-btn:focus-visible { outline: 3px solid #F2C94C; outline-offset: 2px; }
.pv-som-obs { width: 32px; height: 32px; margin-left: auto; }

/* ---------------------------------------------------------------- legenda (sempre visível com a voz em jogo) */
/* uma linha discreta de estado (a fala está inteira no balão; aqui só o que está acontecendo, e o que a pessoa está dizendo) */
.pv-legenda { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding: 6px 14px 0; }
.pv-dica { flex: none; margin: 0; font-size: .78rem; letter-spacing: .02em; color: #BDB8DA; }
.pv-fala-leg { flex: 1; min-width: 0; margin: 0; font-size: .85rem; color: #E9E6FF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* no celular a altura é da conversa: a legenda vira só leitura de tela, e o estado aparece no botão de voz */
@media (max-width: 600px) {
  .pv-legenda { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .conversa.pv-em-voz .pv-voz { box-shadow: 0 0 0 3px rgba(242, 201, 76, .35), 0 0 16px rgba(242, 201, 76, .5); }
}
.conversa.pv-em-voz { border-color: rgba(156, 123, 255, .7) !important; }
html[data-pv-estado="escutando"] .conversa.pv-em-voz .pv-dica::before,
html[data-pv-estado="falando"] .conversa.pv-em-voz .pv-dica::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: 1px;
  background: #F2C94C; box-shadow: 0 0 10px #F2C94C;
}
html[data-pv-estado="escutando"] .conversa.pv-em-voz .pv-dica::before { background: #8fd3ff; box-shadow: 0 0 10px #8fd3ff; }

/* ---------------------------------------------------------------- o fundo vivo */
.pv-campo { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
html.pv-calmo .pv-campo { opacity: .7; }
/* a aurora: atrás de tudo (até da rede), sem bloquear nada */
.pv-aurora { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
/* os fios de luz entre o ser e a conversa: por cima, finos, sem bloquear o toque (correm pelas margens, não sobre o texto) */
.pv-fios { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; }
html.pv-calmo .pv-fios { display: none; }

/* ======================================================================== movimento (só com html.pv-vivo) */
/* o pensamento sendo escrito: cada palavra acende (um brilho de ouro que assenta) */
.pv-vivo .pv-w {
  display: inline-block; opacity: 0; transform: translateY(.3em); filter: blur(4px);
  text-shadow: 0 0 14px rgba(242, 201, 76, .95);
  transition: opacity .42s cubic-bezier(.2, .7, .2, 1), transform .5s cubic-bezier(.2, .8, .2, 1), filter .5s ease, text-shadow 1.1s ease;
}
.pv-vivo .pv-w.v { opacity: 1; transform: none; filter: blur(0); text-shadow: 0 0 0 rgba(242, 201, 76, 0); }

/* a conversa respira com o ser: um brilho interno que só muda de opacidade (barato para o navegador) */
.pv-vivo .conversa[data-conversa]::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  box-shadow: inset 0 0 60px rgba(106, 44, 255, .45), inset 0 0 0 1px rgba(156, 123, 255, .5); opacity: 0; transition: opacity .6s ease;
}
html.pv-vivo[data-pv-estado="pensando"] .conversa[data-conversa]::after,
html.pv-vivo[data-pv-estado="escutando"] .conversa[data-conversa]::after,
html.pv-vivo[data-pv-estado="falando"] .conversa[data-conversa]::after,
html.pv-vivo[data-pv-estado="alegria"] .conversa[data-conversa]::after { opacity: 1; }

/* pensando: um traço de sinapse correndo sob os pontos (a presença no topo mostra o raciocínio) */
.pv-vivo .fala.digitando { position: relative; overflow: hidden; }
.pv-vivo .fala.digitando::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(156, 123, 255, .9), #F2C94C, transparent);
  background-size: 50% 100%; background-repeat: no-repeat; animation: pv-sinapse 1.3s cubic-bezier(.6, 0, .4, 1) infinite;
}
@keyframes pv-sinapse { from { background-position: -60% 0; } to { background-position: 160% 0; } }

/* micro-interações: a luz do botão segue o cursor; o toque dá um retorno curto */
.pv-vivo .botao:hover, .pv-vivo .chip:hover, .pv-vivo .pv-btn:hover, .pv-vivo .falar-flutuante:hover {
  background-image: radial-gradient(circle at var(--pv-mx, 50%) var(--pv-my, 50%), rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 60%);
}
.pv-vivo .chip { transition: transform .18s cubic-bezier(.2, .8, .2, 1), background-color .2s ease, border-color .2s ease, box-shadow .25s ease; }
.pv-vivo .chip:hover { transform: translateY(-2px); border-color: rgba(156, 123, 255, .95); box-shadow: 0 8px 22px rgba(106, 44, 255, .28); }
.pv-vivo .chips .chip { animation: pv-chip .5s cubic-bezier(.2, .8, .2, 1) both; }
.pv-vivo .chips .chip:nth-child(2) { animation-delay: .06s; } .pv-vivo .chips .chip:nth-child(3) { animation-delay: .12s; }
.pv-vivo .chips .chip:nth-child(4) { animation-delay: .18s; } .pv-vivo .chips .chip:nth-child(5) { animation-delay: .24s; }
.pv-vivo .chips .chip:nth-child(n+6) { animation-delay: .3s; }
@keyframes pv-chip { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.pv-vivo .pv-toque { animation: pv-toque .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes pv-toque { 0% { transform: scale(.955); box-shadow: 0 0 0 0 rgba(242, 201, 76, .55); } 100% { transform: none; box-shadow: 0 0 0 14px rgba(242, 201, 76, 0); } }
.pv-vivo .esc button, .pv-vivo .esc-modo button { transition: transform .18s ease, box-shadow .25s ease, background-color .2s ease; }
.pv-vivo .esc button:hover, .pv-vivo .esc-modo button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(106, 44, 255, .3); }
.pv-vivo .pv-mudou { animation: pv-mudou .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes pv-mudou { 0% { transform: translateY(-5px); color: #F2C94C; text-shadow: 0 0 14px rgba(242, 201, 76, .8); } 100% { transform: none; } }
.pv-vivo .falar-flutuante { transition: transform .35s cubic-bezier(.2, .9, .25, 1.2), opacity .25s ease, box-shadow .3s ease; }
.pv-vivo .falar-flutuante:hover { box-shadow: 0 12px 36px rgba(106, 44, 255, .6), 0 0 0 6px rgba(106, 44, 255, .15); }

/* rolagem com profundidade: cada bloco entra quando chega à tela, em cascata */
.pv-vivo .pv-entra {
  opacity: 0; transform: translateY(30px) scale(.985); filter: blur(6px);
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .95s cubic-bezier(.2, .8, .2, 1), filter .8s ease;
  transition-delay: calc(var(--pv-i, 0) * 70ms);
}
.pv-vivo .pv-entra.pv-visto { opacity: 1; transform: none; filter: none; }
.pv-vivo .hero::before { transform: translate3d(0, calc(var(--pv-rolagem, 0) * .3px), 0); }

/* ---------------------------------------------------------------- abertura (só na primeira visita; pulável) */
.pv-abertura {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 44%, #15104a 0%, #07091A 62%);
  opacity: 1; transition: opacity .4s ease .02s;
}
.pv-abertura.pv-saindo { opacity: 0; pointer-events: none; }
.pv-abertura-palco { position: relative; width: min(34vmin, 210px); aspect-ratio: 1; transition: transform .42s cubic-bezier(.65, 0, .25, 1); }
.pv-abertura-palco > svg.gesto { position: relative; z-index: 1; width: 100%; height: 100%;
  clip-path: inset(100% 0 0 0); transition: clip-path .7s cubic-bezier(.7, 0, .2, 1) .3s; }
.pv-abertura-palco .gesto .luz { transform: scale(0) !important; transition: transform .55s cubic-bezier(.2, 1.4, .4, 1) .85s; }
.pv-abertura.pv-acende .pv-abertura-palco > svg.gesto { clip-path: inset(0 0 0 0); }
.pv-abertura.pv-acende .pv-abertura-palco .gesto .luz { transform: scale(1) !important; }
.pv-abertura-selo, .pv-abertura-frase {
  position: absolute; left: 0; right: 0; text-align: center; margin: 0; color: #F5F3FF; opacity: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.pv-abertura-selo { top: calc(50% + min(17vmin, 105px) + 34px); font-size: .78rem; letter-spacing: .5em; text-transform: uppercase; color: #BDB8DA;
  transition: opacity .6s ease .95s, letter-spacing 1.1s cubic-bezier(.2, .8, .2, 1) .95s; }
.pv-abertura-frase { top: calc(50% + min(17vmin, 105px) + 60px); font-size: clamp(1.05rem, 3.6vw, 1.5rem); font-weight: 750; letter-spacing: -.01em;
  transform: translateY(8px); transition: opacity .6s ease 1.1s, transform .7s cubic-bezier(.2, .8, .2, 1) 1.1s; }
.pv-abertura.pv-acende .pv-abertura-selo { opacity: 1; letter-spacing: .28em; }
.pv-abertura.pv-acende .pv-abertura-frase { opacity: 1; transform: none; }
.pv-abertura-pular {
  position: fixed; z-index: 1001; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(7, 9, 26, .6);
  color: #F5F3FF; font: inherit; font-size: .9rem; cursor: pointer;
}
.pv-abertura-pular:focus-visible { outline: 3px solid #F2C94C; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .pv-abertura, .pv-abertura-pular { display: none !important; }
}
@media print { .pv-campo, .pv-tela, .pv-legenda, .pv-btn { display: none !important; } }

/* sistemas gerados: a faixa da presença antes da conversa com o agente do departamento (/admin/) */
.pv-faixa-conversa { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.pv-faixa-rot { font-size: .8rem; font-weight: 700; letter-spacing: .04em; opacity: .75; }
.pv-faixa-conversa .pv-som-obs { margin-left: auto; color: inherit; border-color: currentColor; opacity: .8; }

/* a constelação da melhor versão no painel e nos sistemas (sem fundo próprio): por cima, sem bloquear o toque */
.pv-campo.pv-campo-sobre { z-index: 900; opacity: 1; }
.pv-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* painel, modo simples: a marca (imagem) ganha a luz por trás */
.ms-gesto.pv-gesto-vivo { position: relative; background: none !important; }
.pv-host-gesto { position: absolute; inset: 0; border-radius: 50%; }
.pv-gesto-img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; transform: scale(.82); }

/* ---------------------------------------------------------------- o mergulho (zoom infinito para dentro do CLAIN, 11/10) */
.pv-explorar {
  position: absolute; z-index: 3; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; cursor: zoom-in;
  border-radius: 50%; border: 1px solid rgba(242, 201, 76, .45); background: rgba(12, 10, 34, .62); color: #F2C94C;
  box-shadow: 0 0 18px rgba(242, 201, 76, .25); transition: transform .2s ease, box-shadow .2s ease;
}
.pv-explorar svg { width: 24px; height: 24px; display: block; }
.pv-explorar:hover { transform: scale(1.08); box-shadow: 0 0 26px rgba(242, 201, 76, .5); }
.pv-explorar:focus-visible { outline: 3px solid #F2C94C; outline-offset: 3px; }
@media (max-width: 1039.98px) { .pv-explorar { width: 36px; height: 36px; } .pv-explorar svg { width: 20px; height: 20px; } }
.hero-marca.pv-ser { touch-action: pan-y; }
.pv-mergulho {
  position: fixed; inset: 0; z-index: 1000; background: #05040d; touch-action: none; cursor: grab;
  clip-path: circle(0px at var(--pv-mx, 50%) var(--pv-my, 50%)); transition: clip-path .65s cubic-bezier(.6, 0, .2, 1);
}
.pv-mergulho.pv-aberto { clip-path: circle(150vmax at var(--pv-mx, 50%) var(--pv-my, 50%)); }
.pv-mergulho.pv-pleno { clip-path: none; transition: none; }
.pv-mergulho:active { cursor: grabbing; }
html.pv-calmo .pv-mergulho { transition: none; }
html.pv-mergulhando, html.pv-mergulhando body { overflow: hidden; }
.pv-mergulho-tela { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pv-mergulho-sair {
  position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; width: 52px; height: 52px; padding: 0;
  display: grid; place-items: center; cursor: pointer; border-radius: 50%; color: #F2C94C;
  border: 1px solid rgba(242, 201, 76, .5); background: rgba(10, 8, 30, .55); box-shadow: 0 0 22px rgba(242, 201, 76, .3);
}
.pv-mergulho-sair svg { width: 26px; height: 26px; display: block; }
.pv-mergulho-sair:focus-visible { outline: 3px solid #F2C94C; outline-offset: 3px; }
