/* herofx — home hero: the city quietly becomes real, and a red star glint on the spire tip.
   Load after system.css (it restyles .beacon). Colours outside the photographs come from tokens.css only.
   Motion: transform + opacity. */

/* ---------- 1 · real towers on hover, a sunset that floods in on scroll ----------
   herofx.js adds two elements inside .hero__stage, the box of the skyline plate, so they line up at every width:
     flood  first in the stage, so it lies UNDER the engraving and the plate's ink multiplies over it.
            rise   a box that moves up as the page scrolls; its top edge is soft (the front of the rising sky)
            land   inside it, moved down by the same amount, so what it holds stays pinned to the plate:
                     skyimg  the sunset sky, as wide as the hero
                     plate   a warm paper wash in the shape of the engraved city (plate + the three flanks that
                             extend the city sideways), so the sky shows above the roofs, not through the walls
     fx     over the engraving: one small box per landmark tower, each with
            body   the tower as a photograph, cut to the engraved silhouette
            rim    light caught just inside its outline
   JS sets only opacity (towers, flood) and transform (rise, land). The photographs' addresses are set by JS
   (--fx-sky, --fx-city, --fx-towers, --fx-edge) only after they have loaded: nothing here asks for them.
   Off by default: JS off, paused and reduced motion all show the hero exactly as it is without this file. */
.herofx__fx,.herofx__flood{display:none}
.herofx--real .herofx__fx{display:block;position:absolute;inset:0;pointer-events:none}
.herofx__t{position:absolute}
.herofx__body,.herofx__rim{position:absolute;inset:0;opacity:0;background-repeat:no-repeat;will-change:opacity}
.herofx__body{background-image:var(--fx-towers)}
.herofx__rim{background-image:var(--fx-edge)}

.herofx--real .herofx__flood{
  display:block;position:absolute;top:0;height:100%;left:calc(-1 * var(--fx-sl));width:var(--fx-vw);
  visibility:hidden;opacity:0;pointer-events:none;will-change:opacity;
}
.herofx--flood .herofx__flood{visibility:visible}
.herofx__rise{
  position:absolute;inset:0;overflow:hidden;will-change:transform;
  -webkit-mask-image:linear-gradient(180deg,transparent 0,rgba(0,0,0,.45) 16%,#000 34%);mask-image:linear-gradient(180deg,transparent 0,rgba(0,0,0,.45) 16%,#000 34%);
}
.herofx__land{position:absolute;inset:0;will-change:transform}
.herofx__skyimg{position:absolute;inset:0;background:var(--fx-sky) 50% 50%/100% 100% no-repeat}
.herofx__plate{position:absolute;top:0;left:var(--fx-sl);width:var(--fx-w);height:var(--fx-h)}
.herofx__wash{position:absolute;top:0;height:100%;background-image:var(--fx-city);background-repeat:no-repeat}
.herofx__wash--p{left:0;width:100%;background-size:100% 100%}
.herofx__wash--l,.herofx__wash--l2,.herofx__wash--r{display:none}
@media (min-width:761px){
  /* CY 15 Nov: the sunset also reaches the hero words, as a pale wash so the dark text stays readable; full strength to the right of the text column and below the buttons */
  .herofx--real .herofx__flood{
    -webkit-mask-image:linear-gradient(90deg,rgba(0,0,0,.26) var(--fx-kx),#000 calc(var(--fx-kx) + 320px)),linear-gradient(180deg,rgba(0,0,0,.26) var(--fx-ky),#000 calc(var(--fx-ky) + 200px));
    mask-image:linear-gradient(90deg,rgba(0,0,0,.26) var(--fx-kx),#000 calc(var(--fx-kx) + 320px)),linear-gradient(180deg,rgba(0,0,0,.26) var(--fx-ky),#000 calc(var(--fx-ky) + 200px));
    -webkit-mask-composite:source-over;mask-composite:add;
  }
  /* the same geometry as .hero__flank in system.css: the city's right-hand 29% repeats on the left (and mirrored
     further out), the whole plate mirrored on the right */
  .herofx__wash--l,.herofx__wash--l2{display:block;width:calc(var(--fx-w) * .29);background-size:var(--fx-w) var(--fx-h);background-position:100% 0}
  .herofx__wash--l{right:calc(100% - 90px)}
  .herofx__wash--l2{right:calc(100% - 90px + var(--fx-w) * .29);transform:scaleX(-1)}
  .herofx__wash--r{display:block;left:100%;width:100%;background-size:100% 100%;transform:scaleX(-1)}
}
/* the old passing shine washed over the sky; the towers answer the pointer now */
.herofx--ready .hero__sweep{display:none}
body.paused .herofx__fx,body.paused .herofx__flood{display:none!important}
@media (prefers-reduced-motion:reduce){.herofx__fx,.herofx__flood{display:none!important}}

/* ---------- 2 · star glint on the spire tip ----------
   Restyles system.css .beacon (same element, same anchor variables). Thin crossed rays with a bright core.
   The finished frame is the default state; the twinkle only changes scale and opacity. */
.hero .beacon{
  --x:68.73%;--y:29.08%;--mx:84.3%;--my:4.5%;
  --star:clamp(30px,8.4vw,36px);
  width:var(--star);height:var(--star);border-radius:0;background:none;opacity:1;
  animation:herofx-twinkle 5.2s var(--ease-io) infinite;
}
/* the four rays: a concave four-point star, red at the tips, paper-white where they cross */
.hero .beacon::before{
  content:"";position:absolute;inset:0;
  background:radial-gradient(closest-side,var(--white) 0 7%,color-mix(in srgb,var(--red) 62%,var(--white)) 15%,var(--red) 30%,color-mix(in srgb,var(--red) 70%,transparent) 62%,color-mix(in srgb,var(--red) 18%,transparent) 100%);
  -webkit-clip-path:polygon(50% 0,52.4% 47.6%,100% 50%,52.4% 52.4%,50% 100%,47.6% 52.4%,0 50%,47.6% 47.6%);
  clip-path:polygon(50% 0,52.4% 47.6%,100% 50%,52.4% 52.4%,50% 100%,47.6% 52.4%,0 50%,47.6% 47.6%);
}
/* the core: a small bright bead with a soft red halo */
.hero .beacon::after{
  content:"";position:absolute;left:50%;top:50%;width:46%;height:46%;margin:-23% 0 0 -23%;border-radius:50%;
  background:radial-gradient(closest-side,var(--white) 0 16%,color-mix(in srgb,var(--red) 78%,var(--white)) 30%,color-mix(in srgb,var(--red) 34%,transparent) 52%,color-mix(in srgb,var(--red) 10%,transparent) 78%,transparent);
  animation:herofx-core 5.2s var(--ease-io) infinite;
}
@keyframes herofx-twinkle{0%,100%{opacity:1;transform:scale(1)}38%{opacity:.5;transform:scale(.62)}62%{opacity:.86;transform:scale(.84)}}
@keyframes herofx-core{0%,100%{opacity:1;transform:scale(1)}38%{opacity:.78;transform:scale(1.16)}}
@media (min-width:761px){.hero .beacon{--star:clamp(44px,3.6vw,60px)}}
@media (prefers-reduced-motion:reduce){
  .hero .beacon,.hero .beacon::after{animation:none!important}
  .hero .beacon{opacity:1}
}

body.paused .beacon,body.paused .beacon::before,body.paused .beacon::after{animation-play-state:paused}
html:not(.js) .beacon,html:not(.js) .beacon::before,html:not(.js) .beacon::after{animation:none}
