/* Hakhamanesh public cosmic scenery, performance revision.
 * No full-screen CSS blur filters or continuous canvas repaint.
 * Transforms run on small, cached decoration layers; cards keep translucent look. */
.cosmic-background {
  position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;contain:paint;
  background:
    radial-gradient(ellipse 75% 83% at -6% 42%,rgba(111,45,205,.43) 0%,rgba(87,37,160,.16) 49%,transparent 84%),
    radial-gradient(ellipse 62% 68% at 97% 12%,rgba(64,81,177,.28) 0%,transparent 78%),
    radial-gradient(ellipse 45% 65% at 49% 104%,rgba(95,37,175,.24) 0%,transparent 85%),
    linear-gradient(144deg,#100925 0%,#0d0921 48%,#11102c 79%,#090a1b 100%);
}
.cosmic-background::before,.cosmic-background::after {
  content:"";position:absolute;pointer-events:none;
}
/* Large soft gradients already fade into transparency. An animated blur(42px)
   on a >150%-viewport layer was causing expensive GPU raster/compositing. */
.cosmic-background::before {
  z-index:0;inset:-6%;
  background:
    radial-gradient(ellipse 35% 34% at 23% 44%,rgba(147,53,244,.33),transparent 83%),
    radial-gradient(ellipse 31% 35% at 80% 21%,rgba(78,110,219,.19),transparent 85%),
    radial-gradient(ellipse 31% 31% at 64% 81%,rgba(150,49,216,.23),transparent 83%);
  filter:none;will-change:auto;
  animation:none;
}
.cosmic-background::after {
  z-index:1;inset:0;
  background:
    radial-gradient(ellipse 38% 12% at 35% 57%,rgba(159,111,255,.07),transparent 90%),
    radial-gradient(ellipse 33% 16% at 76% 38%,rgba(112,151,255,.065),transparent 90%);
  filter:none;animation:none;will-change:auto;
}
/* The starfield is painted a SINGLE time by JS; opacity/translation are composited. */
.cosmic-canvas {
  position:absolute;inset:-10px;z-index:4;display:block;
  width:calc(100% + 20px);height:calc(100% + 20px);
  opacity:.94;will-change:auto;
  animation:none;
}
.cosmic-orbit {
  position:absolute;z-index:2;width:min(66vw,990px);aspect-ratio:1;
  top:3%;left:-16%;border:1px solid rgba(194,124,255,.14);
  border-radius:50%;box-shadow:0 0 0 60px rgba(131,78,225,.025),inset 0 0 45px rgba(168,89,242,.025);
  transform:rotate(-25deg) scaleX(1.15);
  animation:none;
}
.cosmic-orbit::before,.cosmic-orbit::after {content:"";position:absolute;border:1px solid rgba(192,135,255,.10);border-radius:50%;pointer-events:none;}
.cosmic-orbit::before{inset:14% -13%;transform:rotate(23deg);}
.cosmic-orbit::after{inset:-10% 13%;transform:rotate(-37deg);border-color:rgba(124,147,243,.08);}
.cosmic-orbit.cosmic-orbit-right{width:min(45vw,720px);left:auto;right:-23%;top:35%;opacity:.43;animation:none;transform:rotate(25deg) scaleX(.85);}
/* A real two-dimensional comet silhouette: luminous rounded head, short curved
   violet tail. Drift takes ~13s, not the old ~4s diagonal white slash. */
.cosmic-meteor {
  position:absolute;z-index:3;top:0;left:0;width:132px;height:48px;opacity:0;
  background:url('/assets/cosmic-comet.svg?v=20261108-aligned') center/contain no-repeat;
  box-shadow:none;filter:none;
  transform:translate3d(-200px,-200px,0);
  animation:none;
  transform-origin:18px 24px;
  contain:layout style paint;
}
/* The existing meteor is the first reusable animation slot. Two additional slots
   are generated only on public pages, never more than three concurrent trails. */
.cosmic-meteor.is-flying {will-change:transform,opacity;}
.cosmic-meteor.cosmic-meteor-late {display:none;}
@keyframes cosmic-nebula-travel {
  0%{transform:translate3d(-1.5%,.5%,0) scale(1);opacity:.86;}
  100%{transform:translate3d(2%,1.8%,0) scale(1.025);opacity:1;}
}
@keyframes cosmic-stars-float {
  0%{transform:translate3d(-3px,2px,0);opacity:.90;}
  100%{transform:translate3d(5px,-4px,0);opacity:1;}
}
@keyframes cosmic-orbit-sway {
  from{transform:rotate(-25deg) scaleX(1.15);opacity:.42;}
  to{transform:rotate(-21deg) scaleX(1.13);opacity:.61;}
}
@keyframes cosmic-comet-glide {
  0%,23%{opacity:0;transform:translate3d(86vw,8vh,0) rotate(-19deg);}
  28%{opacity:.62;transform:translate3d(77vw,14vh,0) rotate(-19deg);}
  41%{opacity:.93;transform:translate3d(58vw,27vh,0) rotate(-19deg);}
  52%{opacity:.67;transform:translate3d(40vw,39vh,0) rotate(-19deg);}
  60%,100%{opacity:0;transform:translate3d(26vw,49vh,0) rotate(-19deg);}
}
/* Performance: keep the decorative background behind static surfaces,
   without costly live backdrop-filter compositing over moving gradients. */
.ha-public {background-attachment:scroll;}
.ha-public .ha-header,
.ha-public .ha-language,.ha-public .ha-login,.ha-public .ha-mobile-toggle,
.ha-public .ha-btn-secondary,.ha-public .ha-demo,
.ha-public .ha-route-card,.ha-public .ha-feature-card,.ha-public .ha-experience-row,
.ha-public .ha-pipeline,.ha-public .ha-editorial-art,.ha-public .ha-feature-note,
.ha-public .ha-end-cta,.ha-public .ha-footer,
.auth-cosmic-page .auth-brand-dashboard,.auth-cosmic-page .auth-card,.auth-cosmic-page .auth-back {
  -webkit-backdrop-filter:none;backdrop-filter:none;
}
/* Preserve a rich glass-like appearance with borders and translucency, but
   no heavy full-surface blur of the frame beneath. */
.ha-public .ha-header{background:rgba(21,13,46,.90);}
.ha-public .ha-btn-secondary{background:linear-gradient(135deg,rgba(128,84,180,.27),rgba(57,37,104,.41));}
.auth-cosmic-page .auth-card{background:linear-gradient(155deg,rgba(43,28,78,.92),rgba(21,17,49,.92) 54%,rgba(24,17,49,.94));}
.auth-cosmic-page .auth-brand-dashboard{background:linear-gradient(145deg,rgba(57,34,96,.82),rgba(22,16,52,.85));}
.auth-cosmic-page .auth-brand::after{filter:none;}
@media(max-width:780px){
  .cosmic-orbit{width:108vw;top:8%;left:-54%;opacity:.35;}
  .cosmic-orbit.cosmic-orbit-right{display:none;}
  .cosmic-meteor{width:98px;height:36px;}
  .cosmic-background::before{animation:none;}
  .cosmic-canvas{animation:none;}
}
@media(prefers-reduced-motion:reduce){
  .cosmic-background::before,.cosmic-background::after,.cosmic-orbit,.cosmic-canvas,.cosmic-meteor{
    animation:none!important;will-change:auto!important;
  }
  .cosmic-meteor{display:none;}
}
/* The old oversized hero rings caused horizontal overflow on narrow RTL. */
.ha-public .ha-hero::before,.ha-public .ha-hero::after {display:none;}

/* Smooth-scroll optimization v4: static nebula, static stars and orbits.
   Only small comet sprites are translated by the compositor. */
.ha-public .ha-stardust {animation:none;}
.ha-public .ha-demo-aura {filter:none;}
.auth-cosmic-page .auth-brand::before {animation:none;}
.auth-cosmic-page .auth-brand::after {filter:none;}
.auth-cosmic-page .auth-preview-chart svg path:last-child {animation:none;}
/* Animate a tiny transform, not a growing 100%-width repaint on every scroll. */
.ha-public .ha-progress {width:100%;transform-origin:left center;transform:scaleX(0);}
@media(max-width:780px){
  .cosmic-meteor {width:98px;height:36px;transform-origin:13.364px 18px;}
  .cosmic-orbit {box-shadow:none;}
}
@media(prefers-reduced-motion:reduce){.cosmic-meteor.is-flying{display:none!important;}}

/* Stars sparkle independently on tiny compositor layers; no canvas redraw. */
.cosmic-twinkles{position:absolute;inset:0;z-index:5;pointer-events:none;contain:layout style paint;}
.cosmic-twinkles i{
  position:absolute;display:block;border-radius:50%;background:#f4e7ff;
  box-shadow:0 0 5px 1px rgba(195,154,255,.55);
  opacity:.25;transform:scale(.7);
  animation:cosmic-twinkle ease-in-out infinite alternate;
}
.cosmic-twinkles i:nth-child(3n){background:#c0d3ff;box-shadow:0 0 7px rgba(139,167,255,.6)}
.cosmic-twinkles i:nth-child(7n){background:#ffeacb;box-shadow:0 0 6px rgba(255,217,164,.5)}
@keyframes cosmic-twinkle{
  0%,12%{opacity:.18;transform:scale(.65)}
  72%,100%{opacity:.9;transform:scale(1.33)}
}
.cosmic-twinkles.cosmic-paused i{animation-play-state:paused;}
@media(prefers-reduced-motion:reduce){.cosmic-twinkles i{animation:none;opacity:.55;transform:none;}}
