/* =========================================================
   metal-slung.css — HUD de liga metálica (RETEAR)
   Base: antigo metal-popup.html (metaball + nós orbitais),
   reescrito com acabamento cromado/gunmetal e quatro
   nós acessórios: governança, processos, agentes-IA, SLA.
========================================================= */

.metal-slung{
  --alloy-1:#f4f6f7;
  --alloy-2:#b9c3c8;
  --alloy-3:#6c7a82;
  --alloy-4:#2b3338;
  --alloy-5:#0f1417;
  --alloy-glow:rgba(131,180,187,.35);

  position:fixed;
  right:32px;
  bottom:32px;
  width:440px;
  height:440px;
  z-index:1500;
  pointer-events:none;
  isolation:isolate;
  animation:metalEntrance 1.2s cubic-bezier(.16,1,.3,1) both;
}

.metal-slung > *,
.metal-field > *{
  pointer-events:auto;
}

.metal-field{
  position:relative;
  width:100%;
  height:100%;
  filter:url(#metal-goo);
}

/* ---------- Núcleo cromado ---------- */

.metal-core{
  position:absolute;
  top:50%;
  left:50%;
  width:270px;
  height:270px;
  transform:translate(-50%,-50%);
  border-radius:46% 54% 58% 42% / 42% 38% 62% 58%;

  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.95) 0 6%, transparent 22%),
    radial-gradient(circle at 70% 80%, rgba(45,52,104,.55), transparent 55%),
    conic-gradient(from 210deg at 50% 50%,
      var(--alloy-4), var(--alloy-2), var(--alloy-1), var(--alloy-3),
      var(--alloy-5), var(--alloy-3), var(--alloy-1), var(--alloy-2), var(--alloy-4));

  box-shadow:
    0 0 90px var(--alloy-glow),
    0 50px 120px rgba(0,0,0,.5),
    inset 0 0 40px rgba(255,255,255,.25),
    inset 0 -30px 60px rgba(0,0,0,.45);

  overflow:hidden;
  cursor:grab;
  animation:metalMorph 14s ease-in-out infinite, metalFloat 10s ease-in-out infinite;
}

.metal-core:active{
  cursor:grabbing;
}

.metal-sheen{
  position:absolute;
  inset:-40%;
  background:linear-gradient(115deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%);
  animation:metalSheen 6s ease-in-out infinite;
  mix-blend-mode:overlay;
}

.metal-grain{
  position:absolute;
  inset:0;
  background:repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px);
  opacity:.6;
}

.metal-content{
  position:absolute;
  inset:0;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:2.2rem;
  color:#0b1013;
  text-shadow:0 1px 0 rgba(255,255,255,.6);
}

.metal-content small{
  font-family:"IBM Plex Mono", ui-monospace, monospace;
  font-size:.62rem;
  letter-spacing:.2rem;
  text-transform:uppercase;
  opacity:.75;
  margin-bottom:.7rem;
}

.metal-content h3{
  font-family:Inter, "IBM Plex Sans", sans-serif;
  font-size:1.45rem;
  line-height:1.12;
  font-weight:700;
  max-width:200px;
}

.metal-content span{
  margin-top:.7rem;
  font-size:.78rem;
  letter-spacing:.22rem;
  font-weight:600;
  opacity:.7;
}

/* ---------- Nós acessórios ---------- */

.metal-node{
  position:absolute;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,.55), transparent 35%),
    radial-gradient(circle at 50% 60%, var(--alloy-3), var(--alloy-5));
  box-shadow:0 0 40px var(--alloy-glow), inset 0 0 18px rgba(255,255,255,.18);
  cursor:grab;
  animation:metalNode 12s ease-in-out infinite;
}

.metal-node img{
  width:46%;
  height:46%;
  pointer-events:none;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.6));
}

.node-gov  { width:104px; height:104px; top:22px;  right:44px;  animation-delay:-2s; }
.node-flow { width:84px;  height:84px;  bottom:62px; left:18px; animation-delay:-6s; }
.node-agent{ width:74px;  height:74px;  top:40px;  left:52px;  animation-delay:-4s; }
.node-sla  { width:66px;  height:66px;  right:22px; bottom:34px; animation-delay:-8s; }

/* ---------- Partículas e leitura ---------- */

.metal-particles{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  opacity:.8;
  mix-blend-mode:screen;
}

.metal-readout{
  position:absolute;
  left:50%;
  bottom:-6px;
  transform:translateX(-50%);
  padding:.35rem .8rem;
  border-radius:999px;
  background:rgba(11,16,19,.82);
  color:#cfe2e6;
  font-family:"IBM Plex Mono", ui-monospace, monospace;
  font-size:.62rem;
  letter-spacing:.16rem;
  text-transform:uppercase;
  white-space:nowrap;
}

.metal-close{
  position:absolute;
  top:14px;
  right:14px;
  width:36px;
  height:36px;
  border:none;
  border-radius:50%;
  background:rgba(11,16,19,.7);
  color:#fff;
  font-size:1rem;
  cursor:pointer;
  z-index:5;
  transition:transform .3s ease, background .3s ease;
}

.metal-close:hover{
  transform:scale(1.08);
  background:rgba(11,16,19,.9);
}

.metal-slung.is-hidden{
  opacity:0;
  transform:scale(.86) translateY(60px);
  transition:opacity .6s ease, transform .6s ease;
  pointer-events:none;
}

/* ---------- Animações ---------- */

@keyframes metalMorph{
  0%,100%{ border-radius:46% 54% 58% 42% / 42% 38% 62% 58%; }
  25%    { border-radius:58% 42% 40% 60% / 60% 44% 56% 40%; }
  50%    { border-radius:38% 62% 52% 48% / 46% 60% 40% 54%; }
  75%    { border-radius:52% 48% 62% 38% / 36% 54% 46% 64%; }
}

@keyframes metalFloat{
  0%,100%{ transform:translate(-50%,-50%) translateY(0); }
  50%    { transform:translate(-50%,-50%) translateY(-12px); }
}

@keyframes metalNode{
  0%,100%{ transform:translateY(0) scale(1); }
  50%    { transform:translateY(-14px) scale(1.05); }
}

@keyframes metalSheen{
  0%,100%{ transform:translateX(-30%); }
  50%    { transform:translateX(30%); }
}

@keyframes metalEntrance{
  from{ opacity:0; transform:translateY(120px) scale(.72); }
  to  { opacity:1; transform:none; }
}

@media (max-width:768px){
  .metal-slung{ width:230px; height:230px; right:6px; bottom:10px; }
  .metal-core{ width:140px; height:140px; }
  .metal-content{ padding:1rem; }
  .metal-content small{ display:none; }
  .metal-content h3{ font-size:.82rem; max-width:110px; }
  .metal-content span{ font-size:.6rem; margin-top:.4rem; }
  .node-gov{ width:56px; height:56px; top:10px; right:24px; }
  .node-flow{ width:46px; height:46px; bottom:36px; left:8px; }
  .node-agent{ width:40px; height:40px; top:22px; left:28px; }
  .node-sla{ width:36px; height:36px; right:10px; bottom:22px; }
  .metal-close{ width:30px; height:30px; top:4px; right:4px; }
  .metal-readout{ font-size:.54rem; }
}

@media (prefers-reduced-motion:reduce){
  .metal-core,
  .metal-node,
  .metal-sheen{
    animation:none;
  }
}
