/* =========================================================
   Smart Badge · objeto renderizado em CSS (hardware brutalist)
   Usado no hero, no product viewer e na camada Hardware.
   ========================================================= */

.badge-scene {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 460px;
  isolation: isolate;
}
/* luz ambiente verde, contida, atrás do objeto */
.badge-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(45% 38% at 50% 46%, rgba(91,254,80,0.10), transparent 70%),
    radial-gradient(60% 55% at 50% 60%, rgba(1,184,154,0.05), transparent 75%);
  filter: blur(4px);
}
/* piso reflexivo sutil sob o badge */
.badge-scene::after {
  content: "";
  position: absolute;
  bottom: 14%;
  width: 56%;
  height: 38px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.6), transparent 70%);
  filter: blur(10px);
  z-index: -1;
}

.badge {
  --bw: clamp(178px, 21vw, 252px);
  position: relative;
  width: var(--bw);
  aspect-ratio: 30 / 41;
  border-radius: 30px;
  background:
    linear-gradient(157deg, #232427 0%, #131315 38%, #0a0a0b 72%, #060607 100%);
  box-shadow:
    var(--shadow-lg),
    var(--edge-top),
    inset 0 0 0 1px rgba(255,255,255,0.05),
    inset -14px -18px 40px rgba(0,0,0,0.65),
    inset 14px 16px 36px rgba(255,255,255,0.03);
  animation: badge-float 7s var(--ease-in-out) infinite;
  will-change: transform;
}
/* sheen diagonal no topo */
.badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(150deg, rgba(255,255,255,0.10), transparent 34%);
  pointer-events: none;
}
/* fio de luz verde na borda esquerda (rim light do accent ambiente) */
.badge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 1px 0 0 rgba(91,254,80,0.10);
  pointer-events: none;
}

/* clipe metálico no topo */
.badge__clip {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 46%;
  height: 22px;
  border-radius: 9px;
  background: linear-gradient(180deg, #4a4b4e 0%, #303134 45%, #1a1b1d 100%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.18);
}
.badge__clip::before {
  content: "";
  position: absolute;
  inset: 6px 14px auto;
  height: 2px;
  border-radius: 2px;
  background: rgba(0,0,0,0.4);
}

/* face interna levemente rebaixada */
.badge__face {
  position: absolute;
  inset: 14px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,0.025), rgba(0,0,0,0.25));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -2px 8px rgba(0,0,0,0.5);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(13px, 1.6vw, 18px);
  overflow: hidden;
}

/* topo da face: mic + led */
.badge__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
/* grelha de microfone: matriz de furos */
.badge__mic {
  width: 52%;
  height: 14px;
  border-radius: 7px;
  background-color: rgba(0,0,0,0.35);
  background-image: radial-gradient(circle, rgba(255,255,255,0.16) 0.9px, transparent 1.3px);
  background-size: 6px 6px;
  background-position: center;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.6);
}
/* LED verde pulsante */
.badge__led {
  position: relative;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c7ffbf, #5BFE50 45%, #2faa2a 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  flex: none;
}
.badge__led::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,254,80,0.6), transparent 70%);
  animation: led-pulse 2.4s var(--ease-in-out) infinite;
}

/* marca discreta, gravada */
.badge__brand {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.5;
}
.badge__brand svg { width: 16px; height: 16px; color: var(--teal); }
.badge__brand span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: -0.02em;
  color: rgba(244,245,242,0.55);
}

/* rodapé da face: serial gravado a laser */
.badge__serial {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-align: center;
  color: rgba(244,245,242,0.20);
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

/* porta USB-C na base */
.badge__usbc {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(180deg, #0a0a0b, #000);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.9), inset 0 0 0 1px rgba(255,255,255,0.05);
}

@keyframes badge-float {
  0%, 100% { transform: translateY(-7px) rotate(-0.6deg); }
  50%      { transform: translateY(7px) rotate(0.6deg); }
}
@keyframes led-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50%      { opacity: 1; transform: scale(1.15); }
}

/* =========================================================
   PRODUCT VIEWER · hotspots por parte (S5)
   ========================================================= */
.badge--viewer { animation: none; } /* pinado: sem float, controla highlight */

.badge__hotspot {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  pointer-events: none;
  box-shadow: 0 0 0 4px rgba(91,254,80,0.10);
}
.badge__hotspot::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(91,254,80,0.4);
  animation: hotspot-ring 1.8s var(--ease-out) infinite;
}
/* posições aproximadas sobre as partes */
.badge__hotspot[data-part="material"] { right: -10px; top: 42%; }
.badge__hotspot[data-part="mic"]      { left: 22%; top: 13%; }
.badge__hotspot[data-part="led"]      { right: 20%; top: 13%; }
.badge__hotspot[data-part="clip"]     { left: 50%; top: -12px; transform: translateX(-50%) scale(0.6); }
.badge__hotspot[data-part="usbc"]     { left: 50%; bottom: -10px; transform: translateX(-50%) scale(0.6); }

.badge--viewer[data-active="0"] .badge__hotspot[data-part="material"],
.badge--viewer[data-active="1"] .badge__hotspot[data-part="mic"],
.badge--viewer[data-active="2"] .badge__hotspot[data-part="led"],
.badge--viewer[data-active="4"] .badge__hotspot[data-part="usbc"] {
  opacity: 1; transform: scale(1);
}
.badge--viewer[data-active="3"] .badge__hotspot[data-part="clip"] {
  opacity: 1; transform: translateX(-50%) scale(1);
}

@keyframes hotspot-ring {
  0%   { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .badge { animation: none; }
  .badge__led::after,
  .badge__hotspot::after { animation: none; }
}

@media (max-width: 560px) {
  .badge-scene { min-height: 360px; }
}
