/* Movimento na abertura do site (Israel aprovou em 31/10/2026). Só a página inicial usa (montar.py, movimento=True).
   1) a imagem "respira" (zoom lento); 2) chuva de 0 e 1 verdes (Matrix) cai atrás do carro e uma faixa de leitura passa pelos computadores (imagem F1 da Runway, 01/11/2026);
   3) o texto entra em degraus; 4) as seções aparecem ao descer a página; 5) botões acendem no mouse. */
.abertura { position: relative; overflow: hidden; isolation: isolate; background: #071a0c; }
.abertura::before, .abertura::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.abertura::before {
  z-index: -3; background: url(img/abertura-f1.webp) center right / cover no-repeat;
  transform-origin: 78% 55%; animation: respira 24s ease-in-out infinite alternate;
}
.abertura::after { z-index: -1; background: linear-gradient(90deg, #071a0c 0%, #071a0ccc 38%, #071a0c33 75%); }
/* carro e computadores recortados por cima da chuva de 0 e 1 (Israel, 01/11/2026: "números caindo por trás") */
.frente-f1 {
  position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: url(img/abertura-f1-frente.webp) center right / cover no-repeat;
  transform-origin: 78% 55%; animation: respira 24s ease-in-out infinite alternate;
}
/* cérebro neural girando dentro da cabeça robô (02/11/2026): mesma "respiração" da imagem, atrás do carro */
.cerebro-f1 { position: absolute; inset: 0; z-index: -2; pointer-events: none; transform-origin: 78% 55%; animation: respira 24s ease-in-out infinite alternate; }
.cerebro-f1 canvas { position: absolute; mix-blend-mode: screen; }
/* gráficos vivos nos 4 monitores (06/11/2026): por cima da camada da frente, com a mesma "respiração" */
.telas-f1 { position: absolute; inset: 0; z-index: -2; pointer-events: none; transform-origin: 78% 55%; animation: respira 24s ease-in-out infinite alternate; }
.telas-f1 canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#dados { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.leitura {
  position: absolute; z-index: -2; top: 0; bottom: 0; right: 4%; width: 46%; pointer-events: none; overflow: hidden;
}
.leitura::before {
  content: ""; position: absolute; left: 0; right: 0; height: 22%; top: -25%;
  background: linear-gradient(180deg, transparent, #5ae6281f 70%, #5ae62866 99%, transparent);
  animation: varre 7s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes respira { from { transform: scale(1); } to { transform: scale(1.07) translateX(-1%); } }
@keyframes varre { 0%, 25% { top: -25%; opacity: 0; } 30% { opacity: 1; } 70% { opacity: 1; } 75%, 100% { top: 105%; opacity: 0; } }

/* texto em degraus */
.abertura-texto > * { opacity: 0; transform: translateY(18px); animation: sobe .9s cubic-bezier(.2, .7, .2, 1) forwards; }
.abertura-texto > :nth-child(1) { animation-delay: .15s; }
.abertura-texto > :nth-child(2) { animation-delay: .35s; }
.abertura-texto > :nth-child(3) { animation-delay: .6s; }
.abertura-texto > :nth-child(4) { animation-delay: .85s; }
@keyframes sobe { to { opacity: 1; transform: none; } }

/* seções aparecem ao rolar (motion.js põe .visivel) */
.mostra { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.mostra.visivel { opacity: 1; transform: none; }

/* botões e cartões acendem */
.btn { transition: box-shadow .25s, transform .25s; }
.btn:hover { box-shadow: 0 0 22px #5ae62866; transform: translateY(-2px); }
.frente, .setor { transition: transform .3s, box-shadow .3s; }
.frente:hover, .setor:hover { transform: translateY(-4px); box-shadow: 0 10px 28px #0008, 0 0 0 1px #5ae62855; }

@media (max-width: 760px) {
  .abertura { background: #071a0c; }
  .abertura::before { background: url(img/abertura-f1.webp) right top / 120% auto no-repeat; transform-origin: 70% 30%; }
  .frente-f1 { background: url(img/abertura-f1-frente.webp) right top / 120% auto no-repeat; transform-origin: 70% 30%; }
  .cerebro-f1, .telas-f1 { transform-origin: 70% 30%; }
  .abertura::after { background: linear-gradient(0deg, #071a0c calc(100% - 56vw), #071a0c00 calc(100% - 30vw)); }
  .leitura { right: 0; width: 70%; bottom: auto; height: 62vw; }
}
@media (prefers-reduced-motion: reduce) {
  .abertura::before, .leitura::before, .frente-f1, .cerebro-f1, .telas-f1 { animation: none; }
  .abertura-texto > *, .mostra { opacity: 1; transform: none; animation: none; transition: none; }
  #dados { display: none; }
}
