/* Shadow Clan: painted artwork instead of an SVG scene.
   Everything here is either scoped to [data-theme=shadow] or only exists
   inside the hero's .stage-wrap, which other themes hide. */

[data-theme=shadow] .stage-wrap,
[data-theme=shadow] .hero-shade,
[data-theme=shadow] .aa-moon {
  display: block;
}

[data-theme=shadow] .hero .wrap {
  display: flex;
  justify-content: flex-end;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(270deg,rgba(7,7,11,.82),rgba(7,7,11,.35) 45%,transparent 70%);
}

.stage-wrap {
  position: absolute;
  left: -2%;
  top: -2%;
  width: 104%;
  height: 104%;
  will-change: transform;
  transition: transform .25s ease-out;
}

/* The painted hero image, with a slow zoom ("Ken Burns") effect. */
.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: max(100%,calc(var(--hh)*1.884));
  aspect-ratio: 1672/941;
  background: url("images/hero.webp") 0 0/100% 100% no-repeat;
  transform-origin: 30% 40%;
  animation: reveal 1.8s ease-out both,kb 40s ease-in-out infinite alternate;
}

.sm {
  display: none;
  left: 0;
  top: auto;
  bottom: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 941/1672;
  background-image: url("images/phone.webp");
  transform-origin: 50% 70%;
}

@keyframes reveal { from { opacity: 0; filter: brightness(.15) blur(10px) } to { opacity: 1; filter: none } }

.glow {
  position: absolute;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.lamp {
  width: 9%;
  aspect-ratio: 1;
  background: radial-gradient(circle,rgba(255,120,60,.6),rgba(255,60,30,.2) 40%,transparent 68%);
  animation: flick var(--d) infinite;
}

.moon {
  width: 30%;
  aspect-ratio: 1;
  background: radial-gradient(circle,rgba(255,60,50,.32),transparent 65%);
  animation: breathe 7s ease-in-out infinite;
}

.sm .moon {
  width: 40%;
}

.sm .lamp {
  width: 22%;
}

@keyframes flick { 0%,100% { opacity: .85 } 12% { opacity: .45 } 20% { opacity: 1 } 38% { opacity: .6 } 55% { opacity: .95 } 72% { opacity: .5 } }

@keyframes breathe { 0%,100% { opacity: .9; transform: translate(-50%,-50%) scale(1) } 50% { opacity: .5; transform: translate(-50%,-50%) scale(1.14) } }

/* Lightning flash (hero and app background). */
[data-theme=shadow] .flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  background: radial-gradient(circle at 60% 15%,rgba(255,175,150,.5),rgba(255,60,60,.12) 55%,transparent);
  animation: flash 17s infinite;
}

@keyframes flash { 0%,90% { opacity: 0 } 92% { opacity: .5 } 97% { opacity: .06 } 100% { opacity: 0 } }

.wind {
  position: absolute;
  left: 30%;
  top: 34%;
  width: 50%;
  height: 62%;
  overflow: hidden;
  filter: url(#wind);
  -webkit-mask-image: radial-gradient(ellipse closest-side,#000 58%,transparent);
  mask-image: radial-gradient(ellipse closest-side,#000 58%,transparent);
}

.wi {
  position: absolute;
  left: -60%;
  top: -54.84%;
  width: 200%;
  height: 161.3%;
  background: url("images/hero.webp") 0 0/100% 100% no-repeat;
}

[data-theme=shadow] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgba(7,7,11,.7),rgba(7,7,11,.9)),url("images/village.webp") center/cover;
  animation: kb2 60s ease-in-out infinite alternate;
}

@keyframes kb2 { from { transform: scale(1) } to { transform: scale(1.07) } }


/* Portrait: login dialog and store banner. */
[data-theme=shadow] .aa-img {
  background: url("images/portrait.webp") 50% 20%/cover;
}

.banner-shadow {
  background: url("images/portrait.webp") 50% 22%/cover;
}

[data-theme=shadow] .appbg {
  background: linear-gradient(rgba(7,7,11,.45),rgba(7,7,11,.8)),url("images/hero.webp") 28% 20%/cover;
}

@media(prefers-reduced-motion:reduce) {
  .wind {
    display: none;
  }
}

@media(max-width:820px) {
  .sd {
    display: none;
  }
  .sm {
    display: block;
  }
  [data-theme=shadow] .hero {
    height: calc(100vw*1.7769 + 270px);
    align-items: flex-start;
  }
  [data-theme=shadow] .hero .wrap {
    justify-content: flex-start;
    padding-top: 2.5rem;
  }
  [data-theme=shadow] .hero::after {
    height: 14%;
  }
  .hero-shade {
    background: linear-gradient(180deg,rgba(7,7,11,.7),transparent 45%);
  }
  [data-theme=shadow] .hero h1 {
    font-size: clamp(2.2rem,9vw,3rem);
  }
  [data-theme=shadow] .aa-img {
    background-position: 50% 16%;
  }
}
