/* Reserve one-finger drags on Sunny; the surrounding page scrolls normally. */
[data-sunny-turn] {
  touch-action: pinch-zoom;
  user-select: none;
  -webkit-touch-callout: none;
}

.sunny-glasses,
.sunny-glasses > svg,
.sunny-prop-smile {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.sunny-glasses-rim {
  position: absolute;
  opacity: 0;
  left: 26.1%;
  top: 25.76%;
  width: 47.37%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    from 205deg,
    transparent,
    #ffe397 56deg,
    #fffbd5 120deg,
    #fff2af 165deg,
    transparent 222deg
  );
  mask-image: radial-gradient(closest-side, transparent 82%, #0009 90%, #000 95%, transparent 100%);
}
.sunny-prop-smile,
.sunny-prop-o {
  transition:
    transform 250ms cubic-bezier(0.25, 0.7, 0.25, 1),
    opacity 200ms ease-in-out;
}
.sunny-prop-o {
  position: absolute;
  left: 39%;
  top: 32%;
  width: 22%;
  height: 42%;
  opacity: 0;
  transform: scale(1.7, 0.55);
  border-radius: 50%;
  background: linear-gradient(#a46c25, #ffeba0);
}
.sunny-prop-o::before {
  content: "";
  position: absolute;
  inset: 0 2% 7%;
  border-radius: inherit;
  background: radial-gradient(ellipse at 68% 85%, #523521, #291e18 53%, #1c1714 84%);
}
:is([data-shades="wearing"], [data-shades="raising"]) .sunny-prop-smile {
  transform: translateY(6%) scaleX(0.82);
}
[data-shades="peek"] .sunny-prop-smile {
  transform: translateY(62%) scale(0.32, 0.9);
  opacity: 0;
}
[data-shades="peek"] .sunny-prop-o {
  transform: translateY(150%);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .sunny-prop-smile,
  .sunny-prop-o {
    transition: none;
  }
}

/* Put this on the whole portrait, outside the gaze rig and poster handoff. */
.sunny-portrait-presence[hidden],
[data-sunny-leaving][hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .sunny-portrait-presence {
    transform-origin: 50% 58%;
    transform: scale(1);
    opacity: 1;
    transition:
      transform 320ms cubic-bezier(0.18, 0.78, 0.23, 1.55),
      opacity 120ms ease-out;

    @starting-style {
      transform: translateY(7%) scale(0.72);
      opacity: 0;
    }
  }

  .sunny-portrait-presence:is([hidden], [data-away]),
  [data-sunny-leaving] .sunny-portrait-presence {
    transform: scale(0.94);
    opacity: 0;
    transition:
      transform 140ms cubic-bezier(0.4, 0, 0.8, 0.4),
      opacity 120ms ease-in,
      display 140ms allow-discrete;
  }

  /* A dismissing surface stays painted while its portrait leaves. */
  [data-sunny-leaving] {
    transition: display 140ms allow-discrete;
  }
}
