/* Motion layer: cinematic home, view reveals, card fade-in, button light and HUD entrances.
   Everything here is presentation only; motion.js adds .motion-on when motion is allowed. */

/* ---------- Home: living painting ---------- */
.home-hero.has-art { background-image: none; overflow: hidden; }
.hero-art {
  position: absolute; inset: -2.5%; z-index: -2; pointer-events: none;
  background: #0d181a url("./assets/experience/vault-gateway.webp") 65% 50% / cover no-repeat;
  will-change: transform;
}
.hero-light {
  position: absolute; width: 0; height: 0; pointer-events: none;
}
.hero-light:not(.torch)::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: var(--r, 260px); height: var(--r, 260px);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--c, #ffb35a) 0%, color-mix(in srgb, var(--c, #ffb35a) 35%, transparent) 22%, transparent 68%);
  mix-blend-mode: screen;
  opacity: var(--o, .55);
}
.motion-on .hero-light.chest::before { animation: chest-breathe 4.2s ease-in-out infinite; }
.motion-on .hero-light.eyes::before { animation: eyes-wake 7s ease-in-out infinite; }
@keyframes chest-breathe { 0%, 100% { opacity: .42; transform: translate(-50%, -50%) scale(.94); } 50% { opacity: .72; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes eyes-wake { 0%, 62%, 100% { opacity: 0; } 70% { opacity: .9; } 78% { opacity: .35; } 84% { opacity: .8; } }

.hero-embers {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  width: 100%; height: 100%;
}
.hero-embers canvas { width: 100% !important; height: 100% !important; display: block; }

/* Gold sweep across the italic headline word once the intro lands. */
.hero-copy h1 em.shimmer {
  background: linear-gradient(100deg, #edc580 0%, #edc580 38%, #fff3d6 48%, #f5d08f 52%, #edc580 62%, #edc580 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: gold-sweep 5.5s ease-in-out infinite;
  padding-right: .08em;
}
@keyframes gold-sweep { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: 0 0; } }
.motion-on .hero-spark { display: inline-block; animation: spark-turn 6s ease-in-out infinite; }
@keyframes spark-turn { 0%, 100% { transform: rotate(0) scale(1); filter: drop-shadow(0 0 0 #edc58000); } 50% { transform: rotate(180deg) scale(1.25); filter: drop-shadow(0 0 8px #edc580cc); } }

/* ---------- Buttons: light catches the gold ---------- */
/* The shine is an extra background layer, so no button needs to change its positioning. */
.motion-on .primary {
  background-image: linear-gradient(105deg, transparent 42%, #ffffff8c 50%, transparent 58%), linear-gradient(135deg, #efd39a, #c5964d);
  background-size: 300% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  background-repeat: no-repeat;
  transition: background-position .8s cubic-bezier(.2, .7, .2, 1), border-color .18s, transform .18s, box-shadow .3s;
}
.motion-on .primary:hover:not(:disabled) {
  background-image: linear-gradient(105deg, transparent 42%, #ffffffa6 50%, transparent 58%), linear-gradient(135deg, #f8e2b5, #ddb064);
  background-size: 300% 100%, 100% 100%;
  background-position: 0 0, 0 0;
}
.motion-on .hero-build {
  background-image: linear-gradient(105deg, transparent 42%, #ffffff8c 50%, transparent 58%), linear-gradient(135deg, #efd39a, #c5964d);
  background-size: 300% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  background-repeat: no-repeat;
}
.motion-on .hero-play {
  background-image: linear-gradient(105deg, transparent 42%, #ffffff66 50%, transparent 58%), linear-gradient(135deg, #c4493a, #8d241c);
  background-size: 300% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  background-repeat: no-repeat;
}
.motion-on button:active:not(:disabled) { transform: translateY(1px) scale(.97); transition-duration: .06s; }

/* ---------- View changes: lift out of the dark ---------- */
.view-veil {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 45%, #0c101200 0%, #050708 70%);
}
.view-veil::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, #edc580aa, transparent);
  transform: scaleX(var(--rule, 0));
}

/* ---------- Raid HUD: hits register on the HP bar ---------- */
.hurt-veil {
  position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 52%, #8a0d0d99 100%);
}
.raid-hud .hp-track.glint::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, #ffffff88 50%, transparent);
  animation: hp-glint .6s ease-out forwards;
}
@keyframes hp-glint { from { opacity: 1; transform: translateX(-100%); } to { opacity: 0; transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .hero-embers, .view-veil, .hurt-veil { display: none; }
  .hero-copy h1 em.shimmer { animation: none; color: #edc580; background: none; }
}
