/* Shadowlands: Armory layer (v27).
   Lens vignette, the home-page crate rack and a themed atmosphere for each
   sub-page hero. Pure decoration layered on vault.css, home.css and magic.css:
   every element here is aria-hidden and pointer-events:none, so the store,
   cart and crate viewer behave exactly the same with this file removed.
   Portable: no external requests, all art referenced with relative paths. */

/* ---------- 1. cinematic grade: lens vignette ----------
   vault.css already lays a static film grain over the page (body::after), so
   this only adds the dark lens falloff. It sits under the crate viewer (z 80)
   and the cart drawer (z 90) so neither is ever shaded. */
.ar-grade{position:fixed;inset:0;z-index:60;pointer-events:none;contain:strict;background:radial-gradient(125% 95% at 50% 42%,transparent 60%,rgba(0,0,0,.34) 100%)}

/* ---------- 2. home hero: the armory rack ---------- */
.ar-rack{position:absolute;z-index:0;right:max(24px,calc((100vw - 1232px)/2 + 24px));top:clamp(64px,6.6vw,104px);width:min(640px,52vw);height:clamp(160px,15.5vw,220px);pointer-events:none;perspective:1100px}
.ar-shelf{position:absolute;inset:0;transform-style:preserve-3d;transform:rotateX(calc(var(--ry,0) * -4deg)) rotateY(calc(var(--rx,0) * 7deg));transition:transform .8s cubic-bezier(.2,.8,.2,1)}
.ar-crate{position:absolute;bottom:22%;left:var(--x);width:calc(var(--w) * 1%);aspect-ratio:1;margin:0;transform:translate3d(calc(var(--rx,0) * var(--d) * 14px),0,calc(var(--z) * 1px))}
.ar-crate .ar-body{position:absolute;inset:0}
.ar-live .ar-crate .ar-body{animation:arFloat 6.5s ease-in-out infinite;animation-delay:calc(var(--i) * -1.1s)}
.ar-crate img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;-webkit-mask-image:radial-gradient(closest-side,#000 62%,transparent 100%);mask-image:radial-gradient(closest-side,#000 62%,transparent 100%);filter:saturate(1.08) contrast(1.06)}
.ar-crate .ar-glow{position:absolute;left:8%;right:8%;bottom:-6%;height:34%;border-radius:50%;background:radial-gradient(closest-side,var(--tc),transparent);opacity:.38;filter:blur(14px)}
.ar-crate .ar-refl{position:absolute;left:0;right:0;top:100%;height:46%;overflow:hidden;opacity:.22;-webkit-mask-image:linear-gradient(180deg,#000,transparent 85%);mask-image:linear-gradient(180deg,#000,transparent 85%)}
.ar-crate .ar-refl img{inset:auto;left:0;top:0;width:100%;height:217.4%;transform:scaleY(-1);filter:blur(1.5px) saturate(.8)}
.ar-crate figcaption{position:absolute;left:50%;top:calc(100% + 10px);transform:translateX(-50%);font:600 10px/1 var(--f-mono,"JetBrains Mono",ui-monospace,monospace);letter-spacing:.24em;text-transform:uppercase;color:var(--tc);white-space:nowrap;opacity:.85;text-shadow:0 0 12px var(--tc)}
.ar-crate figcaption::before{content:"";display:block;width:1px;height:8px;margin:0 auto 6px;background:currentColor;opacity:.6}
.ar-floor{position:absolute;left:-6%;right:-6%;bottom:16%;height:1px;background:linear-gradient(90deg,transparent,rgba(224,120,47,.55) 20%,rgba(224,120,47,.55) 80%,transparent);box-shadow:0 0 18px rgba(224,120,47,.5)}
.ar-floor::after{content:"";position:absolute;left:10%;right:10%;top:1px;height:70px;background:radial-gradient(60% 100% at 50% 0,rgba(224,120,47,.12),transparent 70%)}
.ar-tag{position:absolute;right:0;top:-6px;font:600 10px/1 var(--f-mono,"JetBrains Mono",ui-monospace,monospace);letter-spacing:.24em;text-transform:uppercase;color:var(--dim,#5b6a72)}
.ar-tag b{color:var(--teal);font-weight:600}
@keyframes arFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
/* entrance: crates rise out of the floor once the boot screen clears */
.ar-rack .ar-crate{opacity:0;translate:0 28px;transition:transform .8s cubic-bezier(.2,.8,.2,1),opacity .7s ease,translate .9s cubic-bezier(.16,1,.3,1);transition-delay:0s,calc(var(--i) * 90ms),calc(var(--i) * 90ms)}
.ar-rack.in .ar-crate{opacity:1;translate:0 0}
.ar-rack .ar-floor{transform:scaleX(0);transition:transform 1.1s cubic-bezier(.16,1,.3,1)}
.ar-rack.in .ar-floor{transform:scaleX(1)}

@media (max-width:1100px){.ar-rack{width:min(540px,56vw);top:56px}}
/* above phone width the crates overlap, so their name tags collided with each
   other and touched the hero title; the rack's own tag labels the set there */
@media (min-width:761px){.ar-crate figcaption{display:none}}
@media (max-width:760px){
  .ar-rack{position:relative;right:auto;top:auto;width:100%;height:160px;margin:4px 0 0;order:-1}
  .ar-crate figcaption{font-size:9px;letter-spacing:.18em}
  .ar-tag{display:none}
}

/* ---------- 3. sub-page hero atmospheres ---------- */
.ar-atmo{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden}

/* events: two searchlights sweeping the night */
.ar-beam{position:absolute;bottom:-10%;width:34vw;max-width:520px;height:150%;transform-origin:50% 100%;background:linear-gradient(0deg,rgba(255,214,140,0) 0%,rgba(255,214,140,.16) 30%,rgba(255,214,140,.05) 75%,transparent);clip-path:polygon(46% 100%,54% 100%,100% 0,0 0);filter:blur(6px);mix-blend-mode:screen}
.ar-beam.b1{left:52%;transform:rotate(-24deg)}
.ar-beam.b2{left:72%;transform:rotate(18deg)}
.ar-live .ar-beam.b1{animation:arSweepA 11s ease-in-out infinite alternate}
.ar-live .ar-beam.b2{animation:arSweepB 13s ease-in-out infinite alternate}
@keyframes arSweepA{from{transform:rotate(-30deg)}to{transform:rotate(8deg)}}
@keyframes arSweepB{from{transform:rotate(26deg)}to{transform:rotate(-12deg)}}
.ar-haze{position:absolute;left:0;right:0;bottom:0;height:45%;background:radial-gradient(70% 100% at 70% 100%,rgba(255,190,110,.14),transparent 70%)}

/* status: radar scope */
.ar-radar{position:absolute;right:max(-60px,calc((100vw - 1232px)/2 - 40px));top:50%;width:min(560px,62vw);aspect-ratio:1;translate:0 -50%;border-radius:50%;
  background:repeating-radial-gradient(circle,transparent 0 59px,rgba(224,120,47,.16) 59px 60px),linear-gradient(90deg,transparent calc(50% - .5px),rgba(224,120,47,.14) 50%,transparent calc(50% + .5px)),linear-gradient(0deg,transparent calc(50% - .5px),rgba(224,120,47,.14) 50%,transparent calc(50% + .5px));
  box-shadow:inset 0 0 0 1px rgba(224,120,47,.22),0 0 80px -20px rgba(224,120,47,.35);-webkit-mask-image:radial-gradient(closest-side,#000 70%,transparent);mask-image:radial-gradient(closest-side,#000 70%,transparent)}
.ar-sweep{position:absolute;inset:0;border-radius:50%;background:conic-gradient(from 0deg,rgba(224,120,47,.38),rgba(224,120,47,.08) 40deg,transparent 70deg)}
.ar-live .ar-sweep{animation:arSpin 4.8s linear infinite}
@keyframes arSpin{to{transform:rotate(360deg)}}
.ar-blip{position:absolute;width:7px;height:7px;margin:-3.5px;border-radius:50%;background:var(--teal);box-shadow:0 0 12px var(--teal);opacity:.75}
.ar-live .ar-blip{animation:arBlip 4.8s linear infinite;animation-delay:var(--t)}
@keyframes arBlip{0%,6%{opacity:1;transform:scale(1.4)}40%{opacity:.35;transform:scale(1)}100%{opacity:.18}}

/* rules: hazard tape across the hero */
.ar-tape{position:absolute;left:-10%;right:-10%;height:34px;display:flex;align-items:center;overflow:hidden;background:repeating-linear-gradient(-45deg,#e6b422 0 22px,#111 22px 44px);box-shadow:0 10px 30px rgba(0,0,0,.5);opacity:.5}
.ar-tape.t1{top:24%;transform:rotate(-3deg)}
.ar-tape.t2{top:12%;transform:rotate(2.5deg);opacity:.3}
.ar-tape span{flex:none;padding:0 26px;font:700 13px/34px var(--f-cond,"Barlow Condensed",sans-serif);letter-spacing:.3em;text-transform:uppercase;color:#0b0b0b;background:#e6b422;white-space:nowrap}
.ar-tape i{display:flex;gap:44px;white-space:nowrap}
.ar-live .ar-tape.t1 i{animation:arTape 30s linear infinite}
.ar-live .ar-tape.t2 i{animation:arTape 38s linear infinite reverse}
@keyframes arTape{to{transform:translateX(-50%)}}

@media (max-width:760px){
  .ar-radar{width:120vw;right:-55vw;opacity:.7}
  .ar-beam{width:60vw}
  .ar-tape{height:26px}.ar-tape span{font-size:11px;line-height:26px;padding:0 18px}
  .ar-tape.t1{top:22%}.ar-tape.t2{display:none}
}

/* ---------- reduced motion: hold every effect still ---------- */
@media (prefers-reduced-motion:reduce){
  .ar-crate .ar-body,.ar-beam,.ar-sweep,.ar-blip,.ar-tape i{animation:none!important}
  .ar-rack .ar-crate,.ar-rack .ar-floor,.ar-shelf{transition:none!important}
}

/* ---------- performance polish ----------
   Phones and touch screens: a live blur behind the sticky bars has to be redrawn
   every frame while the page scrolls under it, and the film-grain overlay and the
   looping text sheen repaint large areas. Swap them for still, near-identical looks. */
@media (max-width:760px),(hover:none){
  .nav{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:rgba(7,9,11,.96)!important}
  .toolbar,.rtools{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  body::after{display:none!important}
  .mg-sheen{animation:none!important;-webkit-text-fill-color:currentColor!important;background:none!important}
  .ar-crate .ar-refl img{filter:none!important}
  .ar-crate .ar-glow{filter:none!important;opacity:.28!important}
  .h-scan{animation:none!important;opacity:0!important}
}
/* reduced motion: make sure no loop keeps ticking (some were set to a near-zero but endless duration) */
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-iteration-count:1!important}}
/* sections scrolled out of view keep their looping effects frozen (set by armory.js) */
.ar-off,.ar-off *,.ar-off::before,.ar-off::after{animation-play-state:paused!important}
/* desktop: a lighter blur on the sticky bar costs far less while embers move behind it */
@media (min-width:761px) and (hover:hover){
  .nav{backdrop-filter:blur(10px)!important;-webkit-backdrop-filter:blur(10px)!important;background:rgba(7,9,11,.88)!important}
}

/* ---------- print: drop the decoration ---------- */
@media print{.ar-grade,.ar-rack,.ar-atmo{display:none!important}}