/* Retrato vivo do header e do login (Anakin e Obi-Wan).
   Pálpebras em overlay; portrait_live.js dispara .is-blinking
   em intervalos aleatórios e faz duas piscadas no hover. */
.logo:has(.portrait-live),
.login-logo:has(.portrait-live) {
  background: #0a1024;
  font-size: 0;
}
.logo:has(.portrait-live)::after,
.login-logo:has(.portrait-live)::after {
  z-index: 2;
}
.portrait-live,
.portrait-live-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.portrait-live {
  position: relative;
  overflow: hidden;
}
.portrait-live-inner {
  position: relative;
  overflow: hidden;
  transform-origin: 50% 55%;
  animation: portrait-idle 7.2s ease-in-out infinite;
}
.portrait-live img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.portrait-live-eyes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  overflow: hidden;
}
.portrait-live-lid {
  position: absolute;
  border-radius: 45% 45% 50% 50% / 45% 45% 55% 55%;
  background-repeat: no-repeat;
  box-shadow: inset 0 -1.5px 0 rgba(36, 16, 0, 0.85);
  transform-origin: 50% 0;
  transform: scaleY(0);
  will-change: transform;
}
.portrait-live.is-blinking .portrait-live-lid--l {
  animation: portrait-blink 170ms cubic-bezier(0.25, 1, 0.5, 1);
}
.portrait-live.is-blinking .portrait-live-lid--r {
  animation: portrait-blink 170ms cubic-bezier(0.25, 1, 0.5, 1);
  animation-delay: 14ms;
}

/* Anakin — olhos em y 111–123, x 85–116 e 140–171 (256px). */
.portrait-live--anakin .portrait-live-lid {
  top: 43.6%;
  width: 12.1%;
  height: 4.7%;
  background-color: #8f4c12;
  background-image:
    linear-gradient(180deg, rgba(48, 20, 0, 0.32), rgba(48, 20, 0, 0.16)),
    url('img/anakin-face.png');
  background-size: 100% 100%, 825.8% 2133.3%;
}
.portrait-live--anakin .portrait-live-lid--l {
  left: 33.2%;
  background-position: 0 0, 37.78% 50.82%;
}
.portrait-live--anakin .portrait-live-lid--r {
  left: 54.7%;
  background-position: 0 0, 62.22% 50.82%;
}

/* Obi-Wan — íris em y 98–106, x 93–110 e 145–159 (256px).
   Textura da pele logo abaixo do olho. */
.portrait-live--obiwan .portrait-live-lid {
  width: 10.94%;
  height: 4.69%;
  background-color: #c17a32;
  background-image:
    linear-gradient(180deg, rgba(48, 20, 0, 0.28), rgba(48, 20, 0, 0.12)),
    url('img/obiwan-face.png');
  background-size: 100% 100%, 914.29% 2133.33%;
}
.portrait-live--obiwan .portrait-live-lid--l {
  left: 34.38%;
  top: 38.67%;
  background-position: 0 0, 38.60% 47.54%;
}
.portrait-live--obiwan .portrait-live-lid--r {
  left: 55.47%;
  top: 38.28%;
  background-position: 0 0, 62.28% 47.54%;
}

@keyframes portrait-blink {
  0%, 100% { transform: scaleY(0); }
  36%, 54% { transform: scaleY(1); }
}
@keyframes portrait-idle {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  20% { transform: translate3d(0.45%, 0.55%, 0) rotate(-0.5deg) scale(1.01); }
  44% { transform: translate3d(-0.35%, 0.2%, 0) rotate(0.35deg) scale(1.005); }
  68% { transform: translate3d(0.25%, -0.3%, 0) rotate(-0.25deg) scale(1.008); }
  86% { transform: translate3d(-0.15%, 0.3%, 0) rotate(0.3deg) scale(1.003); }
}
@media (prefers-reduced-motion: reduce) {
  .portrait-live-inner { animation: none; }
  .portrait-live.is-blinking .portrait-live-lid--l,
  .portrait-live.is-blinking .portrait-live-lid--r { animation: none; }
}
