/* Small prepainted highlights; created only for the hovered control or a click. */
html:not(.low-detail) .motion-hover[style] {
  transform: perspective(850px) rotateX(var(--hover-rx, 0deg)) rotateY(var(--hover-ry, 0deg)) translateY(-3px);
  transition: transform .18s ease-out, border-color .18s ease-out, box-shadow .18s ease-out;
}
.motion-hover > .motion-sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.motion-sheen::before {
  content: '';
  position: absolute;
  inset: -65%;
  background: radial-gradient(ellipse at center, #b7eeff20, #cb9ef90b 25%, transparent 55%);
  transform: translate3d(var(--hover-sx, 0px), var(--hover-sy, 0px), 0);
  transition: transform .18s ease-out;
}
.cosmos .cosmos-pulse {
  z-index: 5;
  width: 190px;
  height: 190px;
  margin: -95px;
  border-radius: 50%;
  background: radial-gradient(circle, #ecfaff30 0%, #8bd6ff12 20%, transparent 43%),
    radial-gradient(circle, transparent 42%, #8ddfff90 44%, #b19dff45 45%, transparent 47%);
  opacity: 0;
  animation: cosmos-click .8s ease-out both;
}
.cosmos-pulse::before,.cosmos-pulse::after {
  content: '';
  position: absolute;
  inset: 28%;
  border: 1px solid #c3e9ff50;
  border-radius: 50%;
}
.cosmos-pulse::after { inset: 38%; border-color: #d6aaff55; }
@keyframes cosmos-click {
  0% { transform: scale(.08) rotate(0deg); opacity: .95; }
  35% { opacity: .68; }
  100% { transform: scale(1.9) rotate(20deg); opacity: 0; }
}
@keyframes cosmos-tap {
  0% { transform: scale(.975); }
  45% { transform: translateY(-2px) scale(1.012); }
  100% { transform: none; }
}
html:not(.low-detail) .motion-tap { animation: cosmos-tap .44s ease-out; }
@media (pointer:coarse) {
  .cosmos .cosmos-pulse { width: 140px; height: 140px; margin: -70px; }
  html:not(.low-detail) :is(.link-card,.featured-link,.button,.social-float,.site-header nav a):active {
    transform: scale(.975);
  }
}
@media (hover:hover) and (pointer:fine) {
  html:not(.low-detail) :is(.link-card,.featured-link,.button,.social-float,.site-header nav a):active {
    transform: translateY(1px) scale(.975);
  }
}
.low-detail .motion-sheen,.low-detail .cosmos-pulse { display: none; }
.low-detail .motion-hover { transform: none !important; }
@media (prefers-reduced-motion:reduce) {
  .motion-sheen,.cosmos-pulse { display: none; }
  .motion-hover { transform: none !important; }
}
