/* ==================================================================
   SET-APART EFFECTS — shared across every public page.
   Loaded alongside each page's own styles; adds layers the pages
   don't already have. All motion is skipped for reduced-motion users.
   ================================================================== */

/* Gold text selection + scrollbar */
::selection{background:rgba(255,210,26,.85);color:#140700;text-shadow:none;-webkit-text-fill-color:#140700}
html{scrollbar-color:#c98a10 #070200}
::-webkit-scrollbar{width:11px;height:11px}
::-webkit-scrollbar-track{background:#070200}
::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#fff1a6,#ffd21a 45%,#ff9f00);border-radius:999px;border:3px solid #070200}
::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,#fff7d1,#ffe04d 45%,#ffb020)}

/* Inline text links draw a line of light on hover */
main p a:not(.btn):not(.button),article p a:not(.btn):not(.button){
  background-image:linear-gradient(90deg,#ffd21a,#fff1a6,#ff9f00);
  background-size:0 1px;background-repeat:no-repeat;background-position:0 100%;
  transition:background-size .45s cubic-bezier(.2,.8,.2,1),color .3s ease}
main p a:not(.btn):not(.button):hover,article p a:not(.btn):not(.button):hover{background-size:100% 1px;color:#fff1a6}

/* Canvas for the light trail, tap shockwaves and rare light showers */
#fx-canvas{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:9990}

/* Halo cursor — a ring of light that follows and swells over anything clickable */
#fx-halo{position:fixed;left:0;top:0;width:34px;height:34px;margin:-17px 0 0 -17px;border-radius:50%;
  pointer-events:none;z-index:9991;opacity:0;
  border:1px solid rgba(255,225,120,.75);
  box-shadow:0 0 18px rgba(255,190,40,.45),inset 0 0 12px rgba(255,210,26,.25);
  background:radial-gradient(circle,rgba(255,241,166,.16),transparent 62%);
  transition:width .3s cubic-bezier(.2,.8,.2,1),height .3s cubic-bezier(.2,.8,.2,1),margin .3s cubic-bezier(.2,.8,.2,1),opacity .3s ease,border-color .3s ease,background .3s ease;
  will-change:transform}
#fx-halo.on{opacity:1}
#fx-halo.hot{width:62px;height:62px;margin:-31px 0 0 -31px;border-color:rgba(255,246,203,.95);
  background:radial-gradient(circle,rgba(255,210,26,.22),transparent 66%)}
#fx-halo.press{width:22px;height:22px;margin:-11px 0 0 -11px}
#fx-halo::after{content:"✦";position:absolute;inset:0;display:grid;place-items:center;color:rgba(255,236,160,.9);
  font-size:10px;line-height:1;opacity:0;transform:rotate(-90deg) scale(.4);transition:.35s cubic-bezier(.2,.8,.2,1)}
#fx-halo.hot::after{opacity:1;transform:none}

/* Edge aurora — side glows that brighten with scroll speed */
.fx-aurora{position:fixed;top:0;bottom:0;width:min(14vw,160px);pointer-events:none;z-index:9989;opacity:0;
  transition:opacity .5s ease}
.fx-aurora.l{left:0;background:linear-gradient(90deg,rgba(255,170,20,.28),transparent)}
.fx-aurora.r{right:0;background:linear-gradient(270deg,rgba(255,170,20,.28),transparent)}

/* Shooting star — passes rarely across the top of the sky */
.fx-comet{position:fixed;top:0;left:0;width:180px;height:2px;pointer-events:none;z-index:9988;border-radius:2px;
  background:linear-gradient(90deg,transparent,rgba(255,210,26,.5) 60%,#fffbe6);
  filter:drop-shadow(0 0 6px rgba(255,210,26,.9));
  animation:fxComet var(--cd,1.6s) cubic-bezier(.3,.1,.4,1) forwards}
.fx-comet::after{content:"";position:absolute;right:-3px;top:50%;width:7px;height:7px;margin-top:-3.5px;border-radius:50%;
  background:#fff;box-shadow:0 0 12px 4px rgba(255,220,110,.9)}
@keyframes fxComet{
  0%{opacity:0;transform:translate(var(--x0),var(--y0)) rotate(var(--ang))}
  12%{opacity:1}
  85%{opacity:1}
  100%{opacity:0;transform:translate(var(--x1),var(--y1)) rotate(var(--ang))}}

/* Rare-light toast */
.fx-toast{position:fixed;left:50%;bottom:28px;z-index:9992;transform:translate(-50%,30px);opacity:0;pointer-events:none;
  padding:12px 22px;border-radius:999px;border:1px solid rgba(255,210,26,.6);
  background:linear-gradient(135deg,rgba(40,16,0,.94),rgba(10,4,0,.94));
  color:#fff1a6;font:700 .82rem/1.3 Cinzel,serif;letter-spacing:.14em;text-transform:uppercase;text-align:center;
  box-shadow:0 18px 60px rgba(0,0,0,.6),0 0 40px rgba(255,190,40,.28);
  transition:opacity .6s ease,transform .6s cubic-bezier(.2,.8,.2,1);max-width:calc(100% - 32px)}
.fx-toast.show{opacity:1;transform:translate(-50%,0)}

/* Page-to-page passage: the old page dims away, the new one opens as an iris of light */
@media (prefers-reduced-motion: no-preference){
  @view-transition{navigation:auto}
  ::view-transition-old(root){animation:fxVtOut .45s ease both}
  ::view-transition-new(root){animation:fxVtIn .75s cubic-bezier(.2,.8,.2,1) both}
}
@keyframes fxVtOut{to{opacity:0;filter:brightness(1.6) sepia(1) blur(6px);transform:scale(1.02)}}
@keyframes fxVtIn{from{clip-path:circle(0% at 50% 40%);filter:brightness(1.8) sepia(.6)}to{clip-path:circle(150% at 50% 40%);filter:none}}

@media (prefers-reduced-motion: reduce){
  #fx-canvas,#fx-halo,.fx-aurora,.fx-comet{display:none !important}
}
@media (pointer: coarse){ #fx-halo{display:none} }
@media print{ #fx-canvas,#fx-halo,.fx-aurora,.fx-comet,.fx-toast{display:none !important} }
