/* ==========================================================================
   Carnac atmosphere: sparse shooting stars + phosphor headline decay.
   Scoped to Carnac-family pages and the homepage Carnac section only.
   Non-interactive, contrast-preserving, GPU-light, motion-safe.
   ========================================================================== */

/* ---- 1. Shooting stars ---------------------------------------------------- */
.carnac-stars{ pointer-events:none; overflow:hidden; z-index:0; }
.carnac-stars.is-fixed{ position:fixed; inset:0; }
.carnac-stars.is-scoped{ position:absolute; inset:0; }

.carnac-stars .cstar{
  position:absolute;
  top:var(--top,12%); left:var(--left,8%);
  width:var(--len,150px); height:1.4px;
  background:linear-gradient(90deg,
     rgba(255,255,255,0) 0%,
     rgba(139,208,255,0.70) 55%,
     #ffffff 90%,
     rgba(255,255,255,0) 100%);
  border-radius:2px;
  filter:drop-shadow(0 0 3px rgba(70,166,255,0.6));
  opacity:0;
  will-change:transform,opacity;
  transform:rotate(var(--rot,20deg)) translate3d(-40px,0,0) scaleX(.2);
  animation:cstar-run var(--dur,10s) linear var(--delay,0s) infinite;
}
/* Travel is a fixed diagonal distance along the streak's own axis, so it
   behaves identically in the full-page and scoped-band hosts and never adds
   scroll width (host has overflow:hidden). */
@keyframes cstar-run{
  0%   { opacity:0;  transform:rotate(var(--rot,20deg)) translate3d(-40px,0,0)  scaleX(.2); }
  4%   { opacity:.95; }
  12%  { opacity:1;  transform:rotate(var(--rot,20deg)) translate3d(340px,0,0)  scaleX(1); }
  20%  { opacity:0;  transform:rotate(var(--rot,20deg)) translate3d(520px,0,0)  scaleX(.5); }
  100% { opacity:0; }
}

/* Keep all real content above the star layer. */
.carnac-fx-host{ position:relative; }
.carnac-fx-host > .carnac-lift{ position:relative; z-index:1; }

/* ---- 2. Phosphor headline decay ------------------------------------------ */
/* Default and reduced states stay stark white; the sweep only runs on reveal. */
.carnac-phosphor{ color:#fff; }
@supports ((-webkit-background-clip:text) or (background-clip:text)){
  .carnac-phosphor.phosphor-run{
    background-image:linear-gradient(100deg,
      #ffffff 0 40%, #bfe1ff 46%, #45A6FF 50%, #bfe1ff 54%, #ffffff 60% 100%);
    background-size:280% 100%;
    background-repeat:no-repeat;
    -webkit-background-clip:text; background-clip:text;
    -webkit-text-fill-color:transparent; color:transparent;
    animation:carnac-phosphor 2.1s cubic-bezier(.22,.61,.36,1) .2s 1 both;
  }
}
@keyframes carnac-phosphor{
  0%   { background-position:130% 0; }
  100% { background-position:-70% 0; }
}

/* ---- 3. Motion safety ----------------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  .carnac-stars{ display:none !important; }
  .carnac-phosphor.phosphor-run{
    animation:none !important;
    background:none !important;
    -webkit-text-fill-color:#fff !important;
    color:#fff !important;
  }
}
