/* Trial adapted from StealthWorm's MIT SPACE button on Uiverse.
   https://uiverse.io/StealthWorm/spotty-horse-48
   License: hero-chat-space-LICENSE.txt. Original button remains in index.html. */
#home .hero-chat-open.hero-chat-space {
  width:208px;
  max-width:calc(100% - 32px);
  min-height:48px;
  padding:9px 18px;
  overflow:hidden;
  border:double 2px transparent;
  background-image:linear-gradient(var(--surface-1),var(--surface-1)),linear-gradient(135deg,var(--accent-primary) 10%,var(--accent-secondary) 45%,#8b5cf6 67%,var(--accent-primary) 87%);
  background-origin:border-box;
  background-clip:padding-box,border-box;
  background-size:100% 100%,300% 300%;
  animation:hero-space-gradient 5s ease-in-out infinite paused;
  transition:transform .5s ease,box-shadow .5s ease;
}
#home .hero-chat-space .hero-chat-invite { z-index:2 !important; font-weight:600; }
#home .hero-chat-space :is(.hero-space-stars,.hero-space-glow) { position:absolute; z-index:0 !important; pointer-events:none !important; }
#home .hero-space-stars { inset:0; overflow:hidden; border-radius:inherit; opacity:.4; transition:opacity .5s ease; }
#home .hero-space-stars.has-particles::before,#home .hero-space-stars.has-particles::after { content:none; }
#home .hero-space-stars canvas { position:absolute; inset:0; width:100%; height:100%; z-index:0 !important; pointer-events:none !important; }
/* Stable tile surfaces avoid re-blurring the portrait through a moving border. */
#home .floating-elements.orbit .floating-icon { animation:none; backdrop-filter:none; -webkit-backdrop-filter:none; transform-style:flat; backface-visibility:hidden; }
#home .hero-space-stars::before,#home .hero-space-stars::after {
  content:'';
  position:absolute;
  width:340px;
  height:340px;
  left:calc(50% - 170px);
  top:calc(50% - 170px);
  background-image:radial-gradient(var(--text-0) 1px,transparent 1.5px);
  background-size:29px 29px;
}
/* Move one seamless tile at the reference's roughly 36px/second speed,
   instead of rendering its 200rem star sheet. */
#home .hero-space-stars::before { opacity:.75; background-size:41px 41px; animation:hero-space-drift 1.14s linear infinite paused; }
#home .hero-space-stars::after { animation:hero-space-rotate 90s linear infinite paused; }
#home .hero-space-glow {
  inset:8px -20px -12px;
  background:radial-gradient(ellipse at 30% 70%,var(--accent-primary),transparent 58%),radial-gradient(ellipse at 75% 70%,var(--accent-secondary),transparent 58%);
  filter:blur(12px);
  opacity:.22;
  animation:hero-space-pulse 4s ease-in-out infinite paused;
}
#home .hero-chat-space[data-motion-paused='false'],#home .hero-chat-space[data-motion-paused='false'] .hero-space-glow,
#home .hero-chat-space[data-motion-paused='false'] .hero-space-stars::before,#home .hero-chat-space[data-motion-paused='false'] .hero-space-stars::after { animation-play-state:running; }
#home .hero-chat-space:is(:hover,:focus-visible) { transform:scale(1.1); box-shadow:0 0 20px color-mix(in srgb,var(--accent-secondary) 25%,transparent); }
#home .hero-chat-space:is(:hover,:focus-visible) .hero-space-stars { opacity:1; }
#home .hero-chat-space:active { transform:scale(.99); }
:root[data-theme='light'] #home .hero-space-glow { opacity:.13; }
@keyframes hero-space-gradient { 0%,100% { background-position:0 0,0% 50%; } 50% { background-position:0 0,100% 50%; } }
@keyframes hero-space-drift { from { transform:translateX(0); } to { transform:translateX(-41px); } }
@keyframes hero-space-rotate { from { transform:rotate(0deg); } to { transform:rotate(-360deg); } }
@keyframes hero-space-pulse { 0%,100% { transform:scale(.75); } 70% { transform:scale(1); } }
@media(prefers-reduced-motion:reduce) {
  #home .hero-chat-open.hero-chat-space,#home .hero-space-glow,#home .hero-space-stars::before,#home .hero-space-stars::after { animation:none; }
  #home .hero-chat-space,#home .hero-space-stars { transition:none; }
  #home .hero-chat-space:is(:hover,:focus-visible,:active) { transform:none; }
}
