/* VALBLOX home hero: the rendered loop, the embers and the XP panel (brand/viking/hero-motion). Loads after styles.css
   (and after alt-layout.css / the layout's own sheets). assets/js/hero-fx.js measures the hero and sets:
   - .hfx--wide  the panel (.hero__aside) on the right, vertically centred, --hero-aside-w wide (38% at most), the art
                 slid so the longship sits centred between the title and the panel;
   - .hfx--compact (with .hfx--wide) heroes a little narrower: the panel 224px wide, 16px in from the face's edge,
                 a 22px name and no tagline;
   - .hfx--scaled (with .hfx--wide .hfx--compact) where the compact panel only fits with the art drawn smaller: the art
                 vertically centred, melting into the night sky above and the sea below (as stack);
   - .hfx--stack (with .hfx--slim) narrower desktop heroes, signed in: the slim bar under the copy (the hero grows by
                 it), the art at its natural height fading into sky and sea, the longship centred right of the title where it fits (else the page's own crop);
   - .hfx--plain the rest (guests on heroes too narrow for a panel): the art where the page draws it, the loop and the embers;
                 the copy keeps its Sign in, the header's XP chip carries the level;
   - .hfx--slim  phones: the art where the page draws it (the banner), the panel a slim bar under the copy (members
                 only);
   - .hfx--own   wide / compact / scaled / stack: the art is placed by hero-fx.js, so is the copy side's scrim (measured to the
                 title: --hfx-copy);
   - .hfx--idle  off screen, tab hidden or reduced motion: the bar's stripes and shine hold still.
   Without the script nothing here shows: the hero is exactly the page's own. */

.hero[data-hero-fx] { --hero-aside-w: 300px; }

/* ---------------------------------------------------------------- the art layer, over the face, under the copy */
.hfx {
  position: absolute; inset: var(--rw); pointer-events: none; overflow: hidden;
  clip-path: polygon(var(--na) var(--kn), calc(100% - var(--na)) var(--kn), 100% var(--nb), 100% calc(100% - var(--nb)),
                     calc(100% - var(--na)) calc(100% - var(--kn)), var(--na) calc(100% - var(--kn)), 0 calc(100% - var(--nb)), 0 var(--nb));
}
.hfx__art { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: hidden; visibility: hidden; }
/* shown once placed and its still has loaded: from then on it IS the hero's art (same pixels where the page had them) */
.hfx__art.is-placed.has-still { visibility: visible; }
.hfx__still, .hfx__loop { position: absolute; top: 0; height: 100%; display: block; max-width: none; }
.hfx__still { left: 0; width: 100%; }
/* the loop covers orig x 0.40 .. 1.20 of the 6:1 art; its left edge melts into the still over ~40px */
.hfx__loop {
  left: 33.3333%; width: 66.6667%; object-fit: fill; opacity: 0; transition: opacity .9s ease;
  /* --hfx-m0 / -m1 (hero-fx.js): in our own placements the loop melts in from the title's end, so the moving aurora
     never runs behind the headline; otherwise its own left edge melts over 4% */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent var(--hfx-m0, 0px), #000 var(--hfx-m1, 4%));
  mask-image: linear-gradient(90deg, transparent 0, transparent var(--hfx-m0, 0px), #000 var(--hfx-m1, 4%));
}
.hfx__loop.is-on { opacity: 1; }
.hfx__shade { position: absolute; left: 0; top: 0; }
/* our own placements: the copy side's own scrim, measured to the title (--hfx-copy) so it never reaches the
   longship, and the face's gold glow under the button; wide adds a little shade behind the panel */
.hero.hfx--own .hfx__shade {
  background:
    radial-gradient(60% 150% at -8% 125%, rgba(var(--gold-rgb), .2) 0%, rgba(var(--gold-rgb), 0) 100%),
    linear-gradient(90deg, rgba(17, 23, 32, .76) 0, rgba(17, 23, 32, .46) calc(var(--hfx-copy, 380px) * .7),
                    rgba(17, 23, 32, 0) calc(var(--hfx-copy, 380px) + 40px));
}
.hero.hfx--wide .hfx__shade {
  background:
    radial-gradient(60% 150% at -8% 125%, rgba(var(--gold-rgb), .2) 0%, rgba(var(--gold-rgb), 0) 100%),
    linear-gradient(90deg, rgba(17, 23, 32, .76) 0, rgba(17, 23, 32, .46) calc(var(--hfx-copy, 380px) * .7),
                    rgba(17, 23, 32, 0) calc(var(--hfx-copy, 380px) + 40px)),
    linear-gradient(270deg, rgba(13, 18, 26, .34) 0, rgba(13, 18, 26, 0) calc(var(--hero-aside-w) + 80px));
}
.hfx__sparks { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.hfx__sparks.is-on { opacity: 1; }

/* ---------------------------------------------------------------- the panel's place
   wide is layout-v2's .hero__aside slot (home-v2.css, stacked) restated, so it also works without it; these rules
   outrank that one (html ... [data-hero-aside]) so compact and slim can move it; compact narrows it through the
   slot's own --hero-aside-w */
.hero__aside.hxp { display: none; }
html .hero.hfx--wide > .hero__aside.hxp[data-hero-aside] {
  display: block; position: relative; z-index: 3; flex: none; width: var(--hero-aside-w, 300px); max-width: 38%;
  margin-left: auto; align-self: center;
}
.hero[data-hero-fx].hfx--compact { --hero-aside-w: 224px; }
html .hero.hfx--compact > .hero__aside.hxp[data-hero-aside] { max-width: none; margin-right: calc(-1 * var(--hfx-pull, 0px)); }
.hero.hfx--slim { flex-direction: column; align-items: flex-start; justify-content: center; }
html .hero.hfx--slim > .hero__aside.hxp[data-hero-aside] {
  display: block; position: relative; z-index: 3; flex: none; width: min(100%, 340px); max-width: none; margin: 14px 0 0;
  align-self: flex-start;
}
html .hero.hfx--stack > .hero__aside.hxp[data-hero-aside] { width: min(100%, 320px); }
html:not(.is-signed-in) .hero.hfx--slim > .hero__aside.hxp[data-hero-aside] { display: none; }

/* stack: the art keeps its height in the grown face; scaled: the art is drawn smaller in the face. Both melt into the
   night sky above and the sea below (--hfx-a0 / -a1: where the art is fully there, hero-fx.js); the bands carry the
   same scrim as the art's own shade (scaled: and the panel's) */
.hero.hfx--stack .hfx {
  background:
    radial-gradient(60% 150% at -8% 125%, rgba(var(--gold-rgb), .2) 0%, rgba(var(--gold-rgb), 0) 100%),
    linear-gradient(90deg, rgba(17, 23, 32, .76) 0, rgba(17, 23, 32, .46) calc(var(--hfx-copy, 380px) * .7),
                    rgba(17, 23, 32, 0) calc(var(--hfx-copy, 380px) + 40px)),
    linear-gradient(180deg, #010206 0, #010206 var(--hfx-a0, 0px), #011027 var(--hfx-a1, 100%), #011027 100%);
}
.hero.hfx--scaled .hfx {
  background:
    radial-gradient(60% 150% at -8% 125%, rgba(var(--gold-rgb), .2) 0%, rgba(var(--gold-rgb), 0) 100%),
    linear-gradient(90deg, rgba(17, 23, 32, .76) 0, rgba(17, 23, 32, .46) calc(var(--hfx-copy, 380px) * .7),
                    rgba(17, 23, 32, 0) calc(var(--hfx-copy, 380px) + 40px)),
    linear-gradient(270deg, rgba(13, 18, 26, .34) 0, rgba(13, 18, 26, 0) calc(var(--hero-aside-w) + 80px)),
    linear-gradient(180deg, #010206 0, #010206 var(--hfx-a0, 0px), #011027 var(--hfx-a1, 100%), #011027 100%);
}
.hero.hfx--stack .hfx__art, .hero.hfx--scaled .hfx__art {   /* --hfx-fade (hero-fx.js): 22px; scaled: at most twice the band */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 var(--hfx-fade, 22px), #000 calc(100% - var(--hfx-fade, 22px)), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 var(--hfx-fade, 22px), #000 calc(100% - var(--hfx-fade, 22px)), transparent 100%);
}

/* ---------------------------------------------------------------- the panel: a chamfered, frosted plate */
.hxp { --k: 10px; isolation: isolate; color: var(--muted); }
.hxp::before, .hxp::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
/* rim: a 1px ring, iron lit from the top */
.hxp::before {
  inset: 0; background: linear-gradient(180deg, rgba(75, 91, 113, .9) 0%, rgba(50, 62, 79, .8) 45%, rgba(16, 21, 29, .9) 100%);
  clip-path: polygon(evenodd,
    var(--k) 0, calc(100% - var(--k)) 0, 100% var(--k), 100% calc(100% - var(--k)), calc(100% - var(--k)) 100%, var(--k) 100%, 0 calc(100% - var(--k)), 0 var(--k), var(--k) 0,
    calc(var(--k) + .4px) 1px, 1px calc(var(--k) + .4px), 1px calc(100% - var(--k) - .4px), calc(var(--k) + .4px) calc(100% - 1px),
    calc(100% - var(--k) - .4px) calc(100% - 1px), calc(100% - 1px) calc(100% - var(--k) - .4px), calc(100% - 1px) calc(var(--k) + .4px),
    calc(100% - var(--k) - .4px) 1px, calc(var(--k) + .4px) 1px);
}
/* face: steel, nearly solid (the snow and pines only just read through it); a faint frost wash from the top-left */
.hxp::after {
  inset: 1px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(var(--lilac-rgb), .1) 0%, rgba(var(--lilac-rgb), 0) 62%),
    linear-gradient(180deg, rgba(36, 45, 61, .9) 0%, rgba(19, 25, 35, .93) 100%);
  clip-path: polygon(calc(var(--k) - .6px) 0, calc(100% - var(--k) + .6px) 0, 100% calc(var(--k) - .6px), 100% calc(100% - var(--k) + .6px),
                     calc(100% - var(--k) + .6px) 100%, calc(var(--k) - .6px) 100%, 0 calc(100% - var(--k) + .6px), 0 calc(var(--k) - .6px));
}
.hxp > .edge-line { z-index: 1; }
.hxp__member[hidden], .hxp__guest[hidden] { display: none; }
.hxp__member, .hxp__guest { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "name name" "badge xp" "line line";
  column-gap: 12px; padding: 16px 20px 16px 18px; }
.hxp__name {
  grid-area: name; margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 28px; line-height: 32px; letter-spacing: 1.2px; color: var(--white); text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 18px rgba(var(--lilac-rgb), .16);
}
.hxp__row { display: contents; }
/* the level: the header chip's octagon, bigger, in an iron rim; its numeral takes the rank colour (.lvl--low/mid/high) */
.hxp__badge {
  grid-area: badge; align-self: center; width: 46px; height: 46px; padding: 2px; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--iron-hi2), var(--iron-lo1));
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
}
.hxp__badge .lvl {
  width: 42px; height: 42px; font-size: 18px; letter-spacing: .5px;
  background: linear-gradient(180deg, #1F2833, var(--avatar-bg));
  clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px);
}
.hxp__xp { grid-area: xp; align-self: center; min-width: 0; display: grid; gap: 7px; }
/* the bar: VALBLOX's XP track (pointed ends, recessed), the frost bands, slow diagonal stripes and a rare shine */
.hxp__bar {
  position: relative; display: block; height: 20px; background: var(--track);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(16, 21, 29, .8);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, calc(100% - 10px) 100%, 10px 100%, 0 10px);
}
.hxp__fill {
  position: absolute; inset: 2px auto 2px 2px; width: calc((100% - 4px) * var(--hxp, 0));   /* --hxp: 0 .. 1, hero-fx.js */
  overflow: hidden; background: linear-gradient(180deg, #CFEFFF 0 30%, #8FD4F3 30% 68%, #3E7C9C 68% 100%);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, calc(100% - 8px) 100%, 8px 100%, 0 8px);
}
.hxp__stripes {
  position: absolute; top: 0; bottom: 0; left: -26px; right: 0;
  background: linear-gradient(45deg, rgba(20, 70, 104, .4) 25%, rgba(20, 70, 104, 0) 25% 50%, rgba(20, 70, 104, .4) 50% 75%,
              rgba(20, 70, 104, 0) 75%) 0 0 / 26px 26px;   /* a seamless tile: the stripes repeat every 26px across */
  will-change: transform;
}
/* the hot leading edge, as on the header's and the rewards' bars (shell-v2.css "living XP bars") */
.hxp__fill::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 34px; max-width: 100%; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) calc(100% - 9px), rgba(255, 255, 255, .9) calc(100% - 6px)),
    linear-gradient(90deg, color-mix(in srgb, var(--lilac-lighter) 0%, transparent) 0%, color-mix(in srgb, var(--lilac-lighter) 65%, transparent) 100%);
}
.hxp__bar--ghost .hxp__fill::after { display: none; }
/* guests: an empty bar whose frost stripes still run, the idea without a number */
.hxp__bar--ghost .hxp__fill { width: calc(100% - 4px); background: none; }
.hxp__bar--ghost .hxp__stripes {
  background: linear-gradient(45deg, rgba(143, 212, 243, .16) 25%, rgba(143, 212, 243, 0) 25% 50%, rgba(143, 212, 243, .16) 50% 75%,
              rgba(143, 212, 243, 0) 75%) 0 0 / 26px 26px;
}
.hxp__shine {
  position: absolute; top: 0; bottom: 0; left: 0; width: 38%; opacity: 0;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-110%);
}
@media (prefers-reduced-motion: no-preference) {
  .hxp__fill { transition: width 1.2s cubic-bezier(.22, .7, .18, 1); }
  .hxp__stripes { animation: hxp-slide 2.8s linear infinite; }
  .hxp__shine { animation: hxp-shine 11s cubic-bezier(.45, 0, .2, 1) 2.2s infinite; }
  .hero.hfx--idle .hxp__stripes, .hero.hfx--idle .hxp__shine { animation-play-state: paused; }
}
/* one stripe period (the 26px tile) per 2.8 s: ~9 px a second */
@keyframes hxp-slide { from { transform: translateX(0); } to { transform: translateX(26px); } }
/* the shine crosses in ~1.6 s, then rests: once every 11 s */
@keyframes hxp-shine {
  0% { transform: translateX(-110%); opacity: 0; }
  2% { opacity: 1; }
  14.5% { transform: translateX(290%); opacity: 1; }
  16.5%, 100% { transform: translateX(290%); opacity: 0; }
}
.hxp__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "Skranji", sans-serif; font-size: 12px; line-height: 14px; letter-spacing: .4px; color: var(--muted); }
.hxp__meta b { font-weight: 700; color: var(--lilac-light); }
.hxp__line { grid-area: line; margin-top: 12px; font-size: 13px; line-height: 16px; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; }

/* guest: the same plate, a line that is not a name, an empty bar and the way in */
.hxp__name--muted { font-size: 24px; line-height: 28px; color: var(--muted); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.hxp__guest .hxp__badge { opacity: .7; }
.hxp__cta {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start; pointer-events: auto;
  color: var(--lilac-light); text-decoration: none; text-shadow: 0 0 10px rgba(var(--lilac-rgb), .25);
}
.hxp__cta .ic { width: 14px; height: 14px; transform: scaleX(-1); transition: transform .25s ease; }
.hxp__cta:hover, .hxp__cta:focus-visible { color: var(--white); }
.hxp__cta:hover .ic, .hxp__cta:focus-visible .ic { transform: scaleX(-1) translateX(-3px); }

/* ---------------------------------------------------------------- compact: a little narrower */
.hero.hfx--compact .hxp__member, .hero.hfx--compact .hxp__guest { column-gap: 10px; padding: 14px 16px 15px 14px; }
.hero.hfx--compact .hxp__name { margin-bottom: 8px; font-size: 22px; line-height: 26px; letter-spacing: 1px; }
.hero.hfx--compact .hxp__member .hxp__line { display: none; }
.hero.hfx--compact .hxp__name--muted { font-size: 16px; line-height: 24px; letter-spacing: .8px; }
.hero.hfx--compact .hxp__badge { width: 42px; height: 42px; clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px); }
.hero.hfx--compact .hxp__badge .lvl { width: 38px; height: 38px; font-size: 16px; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
.hero.hfx--compact .hxp__bar { height: 18px; clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, calc(100% - 9px) 100%, 9px 100%, 0 9px); }
.hero.hfx--compact .hxp__fill { clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 7px, calc(100% - 7px) 100%, 7px 100%, 0 7px); }

/* ---------------------------------------------------------------- slim: one compact row under the copy */
.hero.hfx--slim .hxp__member { grid-template-areas: "badge name" "badge xp"; column-gap: 10px; row-gap: 5px; padding: 9px 14px 10px 10px; }
.hero.hfx--slim .hxp__name { margin: 0; font-size: 15px; line-height: 18px; letter-spacing: 1px; }
.hero.hfx--slim .hxp__badge { width: 38px; height: 38px; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); }
.hero.hfx--slim .hxp__badge .lvl { width: 34px; height: 34px; font-size: 15px; clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px); }
.hero.hfx--slim .hxp__bar { height: 12px; clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, calc(100% - 6px) 100%, 6px 100%, 0 6px); }
.hero.hfx--slim .hxp__fill { clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, calc(100% - 4px) 100%, 4px 100%, 0 4px); }
.hero.hfx--slim .hxp__meta, .hero.hfx--slim .hxp__line { display: none; }
.hero.hfx--slim .hxp > .edge-line { display: none; }
