/* XV de Alyssa — effects module styles (fx.js / window.XVFX). Only overlays live here; fx.js sets the variables.
   --fx-x, --fx-y : light position, -1..1 (tilt, pointer, touch-drag or the idle sweep)
   --fx-a         : extra band angle (deg)
   --fx-i         : foil intensity 0..1 (opts.intensity)
   --fx-cg/cx/cy/cs/cv : candle glow, glow offset x/y, glow scale, vignette strength */

/* ---------- foil: light moving over gold leaf ----------
   One overlay blended onto the gold below it. `overlay` keeps the gold's own hue: where the light band is, the leaf
   brightens to a hot pale gold; away from it the leaf darkens a little, the way real metal leaf shades as it turns
   from the light. Two layers inside: a broad soft band with darker wings, and a sharp specular core (plus a faint
   second glint) that runs a little ahead of it. */
.fx-foil{
  position:absolute;left:0;top:0;width:100%;height:100%;
  pointer-events:none;overflow:hidden;border-radius:inherit;
  mix-blend-mode:overlay;opacity:var(--fx-i,.85);
  --fx-x:0;--fx-y:0;--fx-a:0deg;
  container-type:size;
  -webkit-user-select:none;user-select:none;
}
.fx-foil::before,.fx-foil::after{
  content:"";position:absolute;pointer-events:none;will-change:transform;
  left:-100%;top:-100%;width:300%;height:300%;
}
@supports (width:1cqmax){
  /* a square layer sized by the longer side, so a wide or tall element stays covered while the band turns */
  .fx-foil::before,.fx-foil::after{left:calc(50% - 150cqmax);top:calc(50% - 150cqmax);width:300cqmax;height:300cqmax}
}
.fx-foil::before{
  background:linear-gradient(90deg,
    rgba(46,32,12,.34) 0%,rgba(46,32,12,.34) 33%,
    rgba(46,32,12,0) 43.5%,
    rgba(255,226,166,.34) 47.5%,rgba(255,240,206,.52) 50%,rgba(255,226,166,.34) 52.5%,
    rgba(46,32,12,0) 56.5%,
    rgba(46,32,12,.34) 67%,rgba(46,32,12,.34) 100%);
  transform:rotate(calc(24deg + var(--fx-a))) translateX(calc((var(--fx-x) * .85 + var(--fx-y) * .35) * 20%));
}
.fx-foil::after{
  background:linear-gradient(90deg,
    rgba(255,214,140,0) 47.2%,rgba(255,214,140,.5) 48.9%,rgba(255,251,238,.96) 50%,rgba(255,214,140,.5) 51.1%,rgba(255,214,140,0) 52.8%,
    rgba(255,232,186,0) 55.4%,rgba(255,236,196,.34) 56.2%,rgba(255,232,186,0) 57%);
  transform:rotate(calc(28deg + var(--fx-a) * 1.2)) translateX(calc((var(--fx-x) * .85 + var(--fx-y) * .35) * 25%));
}
/* calm / reduced motion: the light stays put, softer */
.fx-foil--static{opacity:calc(var(--fx-i,.85) * .6)}

/* text painted with background-clip:text (the gold RSVP): the overlay repeats the text, so the glint stays on the letters */
.fx-foil--text{
  overflow:visible;container-type:normal;white-space:inherit;
  color:transparent;-webkit-text-fill-color:transparent;
  background-image:linear-gradient(calc(112deg + var(--fx-a)),
    rgba(46,32,12,.45) 0%,rgba(46,32,12,.45) 31%,
    rgba(46,32,12,0) 42%,
    rgba(255,232,182,.5) 47%,rgba(255,252,240,1) 50%,rgba(255,232,182,.5) 53%,
    rgba(46,32,12,0) 58%,
    rgba(46,32,12,.45) 69%,rgba(46,32,12,.45) 100%);
  background-size:300% 100%;background-repeat:no-repeat;
  background-position:calc(50% - (var(--fx-x) * .85 + var(--fx-y) * .35) * 30%) 0;
  -webkit-background-clip:text;background-clip:text;
}
.fx-foil--text::before,.fx-foil--text::after{content:none}

/* ---------- candlelight: a warm living glow over a photo ----------
   The glow is soft-light (warms skin and fabric without painting them orange); the edges fall off with a multiply
   vignette, the way a room lit by candles darkens away from the flame. Only transform and opacity change. */
.fx-candle{
  position:absolute;left:0;top:0;width:100%;height:100%;
  pointer-events:none;overflow:hidden;border-radius:inherit;
  --fx-cg:.8;--fx-cx:0%;--fx-cy:0%;--fx-cs:1;--fx-cv:.82;
}
.fx-candle::before,.fx-candle::after{content:"";position:absolute;pointer-events:none}
.fx-candle::before{
  left:-25%;top:-15%;width:150%;height:140%;
  background:radial-gradient(closest-side at 50% 64%,rgba(255,188,108,.95),rgba(255,160,74,.5) 46%,rgba(255,140,52,.14) 78%,rgba(255,140,52,0) 100%);
  mix-blend-mode:soft-light;
  opacity:var(--fx-cg);
  transform:translate3d(var(--fx-cx),var(--fx-cy),0) scale(var(--fx-cs));
  will-change:transform,opacity;
}
.fx-candle::after{
  inset:0;
  background:radial-gradient(ellipse 72% 66% at 50% 60%,rgba(70,36,10,0) 52%,rgba(52,24,6,.34) 82%,rgba(36,16,4,.62) 100%);
  mix-blend-mode:multiply;
  opacity:var(--fx-cv);
}
