.asti-face.human { overflow: visible; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.45)); }
.asti-face.human .mouth-shape { display: none; fill: none; stroke: none; animation: none; }
.asti-face.human .mouth-shape.is-active { display: block; animation: none; }
.asti-face.human .mouth-shape path, .asti-face.human .mouth-shape ellipse { transition: none; }

.asti-face.human .body, .asti-face.human .upper { animation: avBreathe 5.2s ease-in-out infinite; transform-box: view-box; transform-origin: 300px 620px; }
@keyframes avBreathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.006); } }

.asti-face.human .head, .asti-face.human .hair-back {
  transform-box: view-box; transform-origin: 300px 400px;
  translate: calc(var(--gx, 0) * 0.35px) calc(var(--gy, 0) * 0.25px);
  rotate: calc(var(--gx, 0) * 0.14deg);
  transition: translate 90ms linear, rotate 90ms linear;
}
.asti-face.human.lipsync .head, .asti-face.human.lipsync .hair-back { translate: calc(var(--gx, 0) * 0.35px) calc(var(--gy, 0) * 0.25px + var(--talk, 0) * -2px); }

.asti-face.human .iris-g { translate: calc(var(--look-x, 0px) * 0.3) calc(var(--look-y, 0px) * 0.36); }
.asti-face.human .lid { transform-box: fill-box; transform-origin: top; transform: scaleY(0); transition: transform 90ms ease-out; }
.asti-face.human.is-blinking .lid, .asti-face.human.is-blinking-double .lid { transform: scaleY(1); }
.asti-face.human .brow { transform-box: fill-box; transform-origin: center; transition: transform 220ms ease; }
.asti-face.human .cheeks { opacity: 0.3; transition: opacity 300ms ease; }

.asti-face.human.expression-listening .brow { transform: translateY(-5px); }
.asti-face.human.expression-thinking .brow-left { transform: translateY(-7px) rotate(-5deg); }
.asti-face.human.expression-thinking .iris-g { translate: 4px -3px; }
.asti-face.human.expression-thinking .head, .asti-face.human.expression-thinking .hair-back { rotate: -3deg; }
.asti-face.human.expression-happy .lid { transform: scaleY(0.08); }
.asti-face.human.expression-happy .cheeks { opacity: 0.42; }
.asti-face.human.expression-happy .brow { transform: translateY(-2px); }
.asti-face.human.expression-surprised .brow { transform: translateY(-9px); }
.asti-face.human.expression-confused .brow-left { transform: translateY(-2px); }
.asti-face.human.expression-confused .brow-right { transform: translateY(-6px); }
.asti-face.human.expression-confused .iris-g { translate: 3px -2px; }
.asti-face.human.expression-confused .head, .asti-face.human.expression-confused .hair-back { rotate: 3deg; }
.asti-face.human.expression-confused .cheeks { opacity: 0.45; }
.asti-face.human.expression-sleepy .lid { transform: scaleY(0.55); }
.asti-face.human.is-blinking.expression-happy .lid, .asti-face.human.is-blinking.expression-sleepy .lid { transform: scaleY(1); }

.asti-face.human .arm-r { transform-box: view-box; transform-origin: 470px 410px; transition: rotate 300ms ease; }
.asti-face.human.expression-speaking .arm-r { rotate: calc(var(--talk, 0) * -3deg); }

body.state-listening .asti-face.human .pin-name rect:first-child { stroke: var(--c-listening); }
@media (prefers-reduced-motion: reduce) { .asti-face.human .body, .asti-face.human .upper { animation: none; } }

/* batalkan gaya mulut robot lama (aturan ber-ID di style.css) */
#astiFace.human #mouthOpen, #astiFace.human #mouthSurprised, #astiFace.human #mouthSmile, #astiFace.human #mouthMedium,
#astiFace.human #mouthSmall, #astiFace.human #mouthNeutral, #astiFace.human #mouthConfused {
  fill: none; stroke: none; filter: none; animation: none !important; transform: none;
}
#astiFace.human.lipsync #mouthMedium, #astiFace.human.lipsync #mouthSmall { fill: none; stroke: none; }
#astiFace.human #mouthConfused { stroke: none; }
#astiFace.human #mouthConfused path { stroke: #B2475B; }

/* kedalaman semu: fitur wajah bergeser lebih jauh daripada bentuk kepala saat kepala menoleh */
.asti-face.human .feat { translate: calc(var(--gx, 0) * 0.9px) calc(var(--gy, 0) * 0.45px); transition: translate 90ms linear; }
.asti-face.human .nose { translate: calc(var(--gx, 0) * 0.5px) 0; }
.asti-face.human .ear-l { translate: calc(var(--gx, 0) * -0.35px) 0; }
.asti-face.human .ear-r { translate: calc(var(--gx, 0) * -0.35px) 0; }

/* mode foto: dipakai otomatis bila assets/avatar/idle.jpg ada */
.photo-avatar { display: none; position: absolute; inset: 0; z-index: 1; align-items: center; justify-content: center; pointer-events: none; }
body.photo-on .photo-avatar { display: flex; }
body.photo-on .asti-face.human { display: none; }
.photo-frame { position: relative; height: 100%; max-height: 100%; aspect-ratio: 245 / 272; border-radius: 30px; overflow: hidden; background: #0a1a3a;
  border: 1.5px solid color-mix(in srgb, var(--accent-soft) 55%, transparent);
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.55), 0 0 44px color-mix(in srgb, var(--accent) 24%, transparent);
  translate: calc(var(--gx, 0) * 0.5px) calc(var(--gy, 0) * 0.3px);
  scale: calc(1 + var(--talk, 0) * 0.01); transition: translate 120ms linear, border-color 400ms ease, box-shadow 400ms ease; }
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 260ms ease; user-select: none; }
.photo-frame img.on { opacity: 1; }
.photo-frame img { translate: calc(var(--gx, 0) * 0.7px) calc(var(--gy, 0) * 0.4px); scale: 1.04; }

/* v5: wajah lebih ceria */
.asti-face.human.expression-idle .cheeks, .asti-face.human.expression-listening .cheeks { opacity: 0.5; }
.asti-face.human.expression-idle .brow { transform: translateY(-2px); }
.asti-face.human.expression-happy .cheeks { opacity: 0.6; }

/* mode 3D VRM */
.vrm-avatar {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 420ms ease-out;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 82%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 82%, transparent 99%);
}
body.vrm-on .vrm-avatar {
  opacity: 1;
}
.vrm-avatar canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
/* ponytail: VRM-only, remove display:none if 2D SVG fallback is needed */
.asti-face.human {
  display: none !important;
  transition: opacity 360ms ease-out;
}
body.vrm-on .asti-face.human,
body.vrm-on #kiosk .asti-face.human {
  opacity: 0;
  pointer-events: none;
  filter: none;
}
body.vrm-on .asti-face.human .body,
body.vrm-on .asti-face.human .upper {
  animation: none;
}
body.photo-on .vrm-avatar {
  display: none;
}
body.state-listening .face-ambient--one {
  transform: scale(calc(1 + var(--listen-pulse, 0) * 0.14));
  transition: transform 140ms ease-out;
}
