/* SSHJ header animation v2.1 (plays twice per page open, then rests) - everything is prefixed sshj-hdr-  (additive only; no existing header CSS/markup/image is changed)
   1) the logo's OWN two glints (cut out of half_logo.png) glide once around the gold ring and return home
   2) a soft light sweeps across the divider under the title, offset from the glints
   Method: while the glints travel, a clean copy of the logo (glints retouched out of the ring) is shown exactly over
   img.main-logo and the original is hidden; when both glints are home the original is shown again, so at rest the
   header is the untouched original. Only transform + opacity are animated; nothing moves the layout. */

html.sshj-hdr-on{ --cycle:9s; --d0:2.4s; }
.sshj-hdr-fx, .sshj-hdr-fx i{ display:block; font-style:normal; margin:0; padding:0; border:0; }
.sshj-hdr-fx{ position:absolute; left:0; top:0; width:0; height:0; pointer-events:none; z-index:3; }
.sshj-hdr-logo{ position:absolute; --s:.2132; }

/* orbit layer: clean logo + the two real glints. Hidden at rest. */
.sshj-hdr-layer{ position:absolute; left:0; top:0; width:100%; height:100%; opacity:0; }
.sshj-hdr-clean{ position:absolute; left:0; top:0; width:100%; height:100%; max-width:none; margin:0; padding:0; border:0; }
.sshj-hdr-pivot{ position:absolute; left:49.5%; top:50.46%; width:0; height:0; }   /* centre of the ring */
.sshj-hdr-arm{ position:absolute; left:0; top:0; width:0; height:0; will-change:transform; }
.sshj-hdr-glint{ position:absolute; max-width:none; margin:0; padding:0; border:0; }
.sshj-hdr-arm.a .sshj-hdr-glint{ left:calc(-180.15px * var(--s)); top:calc(-212.22px * var(--s)); width:calc(89px * var(--s)); height:calc(84px * var(--s)); }
.sshj-hdr-arm.b .sshj-hdr-glint{ left:calc(108.85px * var(--s)); top:calc(111.78px * var(--s)); width:calc(83px * var(--s)); height:calc(86px * var(--s)); }

html.sshj-hdr-on .sshj-hdr-layer{ animation:sshj-hdr-layer var(--cycle) linear var(--d0) 2; }
html.sshj-hdr-on .navbar .navbar-brand img.main-logo{ animation:sshj-hdr-orig var(--cycle) linear var(--d0) 2; }
html.sshj-hdr-on .sshj-hdr-arm.a{ animation:sshj-hdr-orbit var(--cycle) cubic-bezier(.37,0,.63,1) var(--d0) 2; }
html.sshj-hdr-on .sshj-hdr-arm.b{ animation:sshj-hdr-orbit var(--cycle) cubic-bezier(.37,0,.63,1) calc(var(--d0) + .25s) 2; }

@keyframes sshj-hdr-orbit{ 0%{transform:rotate(0deg)} 52%{transform:rotate(360deg)} 100%{transform:rotate(360deg)} }
/* the orbit layer fades in over the (still visible) original, then the original steps out; at the end the original steps back
   in underneath while the layer fades out. Both glints are home at those moments, so there is no pop. */
@keyframes sshj-hdr-layer{ 0%{opacity:0} 2%{opacity:1} 55%{opacity:1} 58%{opacity:0} 100%{opacity:0} }
@keyframes sshj-hdr-orig { 0%{opacity:1} 2%{opacity:1} 2.01%{opacity:0} 55%{opacity:0} 55.01%{opacity:1} 100%{opacity:1} }

/* ---------- divider light sweep (unchanged from v1) ---------- */
.sshj-hdr-div{
  position:absolute; overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image:linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.sshj-hdr-shine{
  position:absolute; top:0; left:0; height:100%; width:26%; opacity:0; will-change:transform, opacity;
  background:radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255,238,170,.95) 0, rgba(255,210,100,.6) 38%, rgba(240,175,40,0) 100%);
}
html.sshj-hdr-on .sshj-hdr-shine{ animation:sshj-hdr-sweep var(--cycle) cubic-bezier(.45,.05,.4,1) .5s 2 both; }
@keyframes sshj-hdr-sweep{
  0%  { transform:translateX(-100%); opacity:0; }
  4%  { opacity:1; }
  23% { opacity:1; }
  28% { transform:translateX(385%); opacity:0; }
  100%{ transform:translateX(385%); opacity:0; }
}

@media (prefers-reduced-motion:reduce){ .sshj-hdr-fx{ display:none !important; } }
