/* ==========================================================================
   The hero's attention layer.

   1. A gold segment that travels around the panel's outer edge, forever.
   2. A soft halo behind the panel.
   3. A few sparkles at the corners.
   4. A slow sheen across the face, kept quiet so it does not fight the edge.

   Everything animates transform, opacity or a registered angle. No layout work,
   no jank. All of it stops for reduced motion.
   ========================================================================== */

@property --fx-angle{
  syntax:'<angle>';
  initial-value:0deg;
  inherits:false;
}

.hero-art{
  position:relative;
  display:flex;align-items:center;justify-content:center;
}

/* the stage carries the tilt and the width, so the edge ring can sit outside the
   frame without the frame's clipping cutting it off */
.fx-stage{
  position:relative;
  width:100%;max-width:360px;
  border-radius:16px;
  transform:rotate(-1.2deg);
  /* the panel's shadow belongs to the stage, so it cannot fall across the edge glow */
  box-shadow:0 30px 70px -26px rgba(20,12,32,.75);
}
.hero-art img{transform:none;box-shadow:none}

.fx-frame{
  position:relative;
  z-index:2;               /* above the edge ring: the panel hides all but its 2px rim */
  border-radius:16px;
  overflow:hidden;
  background:#FCF9F3;      /* opaque, so the ring cannot show through the face */
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55);
  isolation:isolate;
}
.fx-frame img{display:block;width:100%;height:auto;border-radius:16px}

/* ---------- the traveling edge, around the hero card ---------- */
.card-halo{position:relative;isolation:isolate}   /* keeps the bloom inside the band */
.card-edge{
  position:absolute;
  inset:-5px;
  border-radius:calc(var(--radius-lg) + 5px);
  /* a comet, not a gradient border: bare for three quarters of the lap, then a
     bright head at 320deg with a short tail behind it */
  background:conic-gradient(from var(--fx-angle),
    rgba(247,146,87,0)     0deg,
    rgba(247,146,87,0)     268deg,
    rgba(247,146,87,.08)   282deg,
    rgba(255,178,120,.40)  296deg,
    rgba(255,214,170,.90)  309deg,
    rgba(255,246,232,1)    317deg,
    rgba(255,255,255,1)    321deg,
    rgba(255,236,210,.85)  325deg,
    rgba(247,146,87,.30)   331deg,
    rgba(247,146,87,0)     340deg);
  animation:fxSpin 4.6s linear infinite;
  pointer-events:none;
  z-index:0;
}
/* the same ring, softened, so the light blooms outward */
.card-edge.glow{
  inset:-11px;
  filter:blur(15px);
  opacity:.72;
  z-index:-1;
}
@keyframes fxSpin{ to { --fx-angle:360deg } }

/* ---------- the halo ---------- */
.fx-ring{
  position:absolute;
  width:118%;height:118%;
  border-radius:50%;
  background:conic-gradient(from 0deg,
    rgba(247,146,87,.0)   0deg,
    rgba(247,146,87,.32)  60deg,
    rgba(142,59,98,.10)   140deg,
    rgba(255,210,170,.30) 220deg,
    rgba(247,146,87,.0)   320deg);
  filter:blur(26px);
  opacity:.55;
  animation:halo 18s linear infinite;
  pointer-events:none;
  z-index:-1;
}
@keyframes halo{ to { transform:rotate(360deg) } }

/* ---------- the sparkles ---------- */
.fx-spark{
  position:absolute;
  width:5px;height:5px;border-radius:50%;
  background:radial-gradient(circle,#FFFFFF 0%,#FFD2AA 45%,rgba(247,146,87,0) 72%);
  box-shadow:0 0 10px 2px rgba(255,210,170,.65);
  pointer-events:none;
  opacity:0;
  animation:twinkle 6s ease-in-out infinite;
}
.fx-spark.s-a{ top:6%;   left:2%;  animation-delay:.4s }
.fx-spark.s-b{ top:24%;  right:1%; animation-delay:2.1s; width:4px;height:4px }
.fx-spark.s-c{ bottom:12%; left:4%; animation-delay:3.6s; width:6px;height:6px }
.fx-spark.s-d{ bottom:4%; right:6%; animation-delay:5.0s; width:3px;height:3px }

@keyframes twinkle{
  0%, 100% { opacity:0; transform:scale(.4) }
  8%       { opacity:1; transform:scale(1) }
  18%      { opacity:.25; transform:scale(.85) }
  26%      { opacity:.9; transform:scale(1.05) }
  40%      { opacity:0; transform:scale(.5) }
}

/* ---------- light theme ----------
   On paper the white-gold head has nothing to shine against, so the comet is
   rebuilt in deep amber with a white core. The amber reads against cream, the
   core reads against the dark card, and the bloom becomes a warm stain. */
html[data-theme="light"] .card-edge{
  inset:-5px;                              /* same geometry as dark */
  border-radius:calc(var(--radius-lg) + 5px);
  background:conic-gradient(from var(--fx-angle),
    rgba(184,74,18,0)     0deg,
    rgba(184,74,18,0)     262deg,
    rgba(184,74,18,.35)   282deg,
    rgba(200,86,30,.95)   300deg,
    rgba(224,116,48,1)    312deg,
    rgba(255,170,110,1)   319deg,
    rgba(255,250,240,1)   322deg,
    rgba(226,120,52,1)    326deg,
    rgba(190,78,22,.55)   332deg,
    rgba(184,74,18,0)     342deg);
}
html[data-theme="light"] .card-edge.glow{
  inset:-11px;                             /* same geometry as dark */
  filter:blur(15px);
  opacity:.85;                              /* amber needs a little more to read on paper */
}

@media (prefers-reduced-motion:reduce){
  .fx-spark,.fx-ring,.card-edge{ animation:none }
  .fx-spark{ opacity:0 }
  .fx-ring{ opacity:.45 }
  /* a still warm edge instead of a moving one */
  .card-edge{ background:linear-gradient(160deg,rgba(255,243,226,.9),rgba(247,146,87,.55)) }
  html[data-theme="light"] .card-edge{ background:linear-gradient(160deg,#E0763A,#C1501A) }
  .card-edge.glow{ opacity:.35 }
}