/* Backdrop: the MEGA itch page background (generated by Manual/tools/wiki_alt/backdrop.py from Itch/bg_hud.css; don't edit by hand). */
body { background: #0f78c2; }
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #0f78c2; --mx: 0; --my: 0; --sp: 0; }
.bgl { position: absolute; inset: 0; transform: translate3d(calc(var(--mx) * var(--d) * -18px), calc(var(--my) * var(--d) * -10px), 0); }
.bg i { position: absolute; display: block; background-repeat: no-repeat; }

/* flame wisps off the giant */
.bg-wisp-l, .bg-wisp-r { top: -15vh; height: 130vh; width: 160vh; }
.bg-wisp-l { right: 50%; background: url(/img/bg/wisp_l.svg) 0 0 / 100% 100%; transform-origin: 100% 40%;
  animation: mega-bg-wave-l 6.4s ease-in-out infinite alternate, mega-bg-heave 9s ease-in-out infinite alternate; }
.bg-wisp-r { left: 50%; background: url(/img/bg/wisp_r.svg) 0 0 / 100% 100%; transform-origin: 0% 40%;
  animation: mega-bg-wave-r 7.3s ease-in-out infinite alternate, mega-bg-heave 10.5s ease-in-out -3s infinite alternate; }

/* the giant (MEGA on its chest), its eyes, and one layer per eye for the intro */
.bg-loom { transform-origin: 50% 80%;
  transform: translate3d(calc(var(--mx) * var(--d) * -18px), calc(var(--my) * var(--d) * -10px - var(--sp) * 6vh), 0) scale(calc(1 + var(--sp) * .07)); }
.bg-giant, .bg-eyes, .bg-eye { height: 205vh; aspect-ratio: 0.6710; left: 50%; top: calc(var(--head, 0px) + 1vh); margin-left: calc(-102.5vh * 0.6710);
  background-position: center top; background-size: contain; transform-origin: 50% 80%; }
.bg-giant { background-image: url(/img/bg/giant.svg); animation: mega-bg-breathe 7s ease-in-out infinite; }
.bg-eyes { background-image: url(/img/bg/eyes.svg); animation: mega-bg-breathe 7s ease-in-out infinite, mega-bg-eyes 6s ease-in-out -1.2s infinite; }
.bg-eye { display: none !important; }
.bg-eye.e0 { background-image: url(/img/bg/eye_0.svg); transform-origin: 44.72% 14.98%; }
.bg-eye.e1 { background-image: url(/img/bg/eye_1.svg); transform-origin: 55.47% 14.99%; }
.bg-eye.e2 { background-image: url(/img/bg/eye_2.svg); transform-origin: 45.63% 17.21%; }
.bg-eye.e3 { background-image: url(/img/bg/eye_3.svg); transform-origin: 54.56% 17.20%; }

/* skyline, white ground, the four playable Titans */
.bg-skyline { left: 0; right: 0; bottom: 13vh; height: 40vh; background: url(/img/bg/skyline.svg) center bottom / cover no-repeat; }
.bg-sink { transform: translate3d(calc(var(--mx) * var(--d) * -18px), calc(var(--my) * var(--d) * -10px + var(--sp) * 5vh), 0); }
.bg-ground { left: 0; right: 0; bottom: 0; height: 22vh;
  background: url(/img/bg/ground.svg) center bottom / 100% 100% no-repeat, linear-gradient(#f0f0e3, #f0f0e3) center bottom / 100% 40% no-repeat; }
.bg-heroes-l, .bg-heroes-r { bottom: 12vh; height: 26vh; }
.bg-heroes-l { left: max(2vw, calc(50% - 480px - 26vh * 1.507)); aspect-ratio: 1.5072; background: url(/img/bg/heroes_l.svg) left bottom / contain no-repeat; }
.bg-heroes-r { right: max(2vw, calc(50% - 480px - 26vh * 1.477)); aspect-ratio: 1.4771; background: url(/img/bg/heroes_r.svg) right bottom / contain no-repeat; }

/* dust and ash at four depths */
.bg-ash-far { left: -30vw; right: -30vw; top: -60vh; height: 220vh; background: url(/img/bg/ash_far.svg) 0 0 / 520px 520px repeat;
  animation: mega-bg-wind-far 74s linear infinite, mega-bg-sway-a 17s ease-in-out infinite, mega-bg-eddy 23s ease-in-out infinite alternate; }
.bg-ash-mid { left: -30vw; right: -30vw; top: -60vh; height: 220vh; background: url(/img/bg/ash_mid.svg) 140px 90px / 760px 760px repeat;
  animation: mega-bg-wind-mid 44s linear infinite, mega-bg-sway-b 12.3s ease-in-out infinite, mega-bg-eddy 19s ease-in-out -7s infinite alternate-reverse; }
.bg-embers { left: -30vw; right: -30vw; top: -60vh; height: 220vh; background: url(/img/bg/embers.svg) 0 0 / 1100px 1100px repeat;
  animation: mega-bg-wind-near 25s linear infinite, mega-bg-sway-c 8.9s ease-in-out infinite, mega-bg-eddy 15s ease-in-out -4s infinite alternate; }
.bg-dust { left: -10vw; right: -10vw; bottom: 9vh; height: 300px; background: url(/img/bg/dust.svg) 0 100% / 900px 300px repeat-x;
  animation: mega-bg-gust 18s linear infinite, mega-bg-bob 4.3s ease-in-out infinite alternate; }

/* dimmed behind the wiki on every page; the intro shows it at full strength first */
.bg::after { content: ""; position: absolute; inset: 0; background: rgba(5, 9, 28, .94); }  /* deep midnight blue behind the wiki (user's call) */

/* ---------- intro (Main Page, once per visit): the city and the giant rise with its eyes shut, it lunges at the camera as every eye
   snaps open (camera shake), then the backdrop dims and the wiki comes in over it */
html.intro .bg { animation: mega-intro-sky 1s ease-out both, mega-intro-shake .6s linear 1.5s both; }
html.intro .bg::after { opacity: 0; }
html.intro.landed .bg::after { opacity: 1; animation: mega-intro-fade .8s ease-out both; }
html.intro .bg-skyline { animation: mega-bg-rise 1.2s cubic-bezier(.2,.9,.25,1) .05s both; }
html.intro .bg-giant { animation: mega-bg-rise 1.1s cubic-bezier(.2,.9,.25,1) .2s both; }
html.intro .bg-loom { animation: mega-intro-lunge .9s cubic-bezier(.3,0,.2,1) 1.4s both; }
html.intro .bg-eyes { opacity: 0; animation: none; }
html.intro .bg-eye { display: block !important; animation: mega-bg-rise 1.1s cubic-bezier(.2,.9,.25,1) .2s both, mega-intro-open .45s cubic-bezier(.2,.8,.3,1) 1.5s both; }
html.intro .bg-heroes-l { animation: mega-bg-in-l 1.3s cubic-bezier(.2,.9,.25,1) .8s both; }
html.intro .bg-heroes-r { animation: mega-bg-in-r 1.3s cubic-bezier(.2,.9,.25,1) .8s both; }
html.intro .bg-wisp-l, html.intro .bg-wisp-r, html.intro .bg-ash-far, html.intro .bg-ash-mid, html.intro .bg-embers, html.intro .bg-dust { animation-name: mega-intro-fade; animation-duration: 1.8s; animation-delay: .6s; animation-fill-mode: both; animation-iteration-count: 1; }
html.intro .intro-later { opacity: 0; }
html.intro.landed .intro-later { opacity: 1; animation: mega-intro-later .7s ease-out both; }
/* the title splashes onto the giant's chest (alt.js places it), flies up and becomes the header logo */
.intro-title { display: none; }
html.intro .intro-title { display: block; position: fixed; z-index: 60; transform-origin: 0 0; pointer-events: none; opacity: 0; }
html.intro .intro-title.splash { opacity: 1; }
.intro-title img { display: block; width: 100%; height: auto; }
html.intro .intro-title.splash img { animation: mega-title-splash .65s cubic-bezier(.2,.9,.3,1) both; }
html.intro:not(.landed) .banner .logo { opacity: 0; }
@keyframes mega-title-splash { 0% { opacity: 0; transform: scale(2.3); filter: brightness(3) blur(8px); } 45% { opacity: 1; transform: scale(.95); filter: brightness(1.7); }
  70% { transform: scale(1.03); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes mega-intro-sky { from { background-color: #060b13; } }
@keyframes mega-intro-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mega-intro-lunge { 0% { transform: none; } 22% { transform: translateY(5vh) scale(1.17); } 45% { transform: translateY(3vh) scale(1.12); } 100% { transform: none; } }
@keyframes mega-intro-open { 0% { opacity: 0; transform: scaleY(.04); filter: brightness(2.2); } 30% { opacity: 1; transform: scaleY(1.15); filter: brightness(2.2); } 55% { transform: scaleY(1); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes mega-intro-shake { 0% { translate: 0 0; } 10% { translate: -14px 9px; } 20% { translate: 12px -11px; } 30% { translate: -10px -6px; } 40% { translate: 9px 8px; }
  50% { translate: -6px 5px; } 60% { translate: 5px -4px; } 72% { translate: -3px 2px; } 85% { translate: 2px -1px; } 100% { translate: 0 0; } }
@keyframes mega-intro-later { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.intro-skip { display: none; }
html.intro .intro-skip { display: block; position: fixed; right: 18px; bottom: 18px; z-index: 50; padding: 6px 12px; font: 14px "Agenda", sans-serif; color: #f0f0e3;
  background: rgba(6,11,19,.7); border: 1px solid rgba(240,240,227,.4); cursor: pointer; animation: mega-intro-fade .4s ease-out .6s both; }

@keyframes mega-bg-wave-l { from { transform: skewY(2.4deg) scaleX(.96); } to { transform: skewY(-3deg) scaleX(1.05); } }
@keyframes mega-bg-wave-r { from { transform: skewY(-2.4deg) scaleX(.96); } to { transform: skewY(3deg) scaleX(1.05); } }
@keyframes mega-bg-heave { from { translate: 0 -1.2vh; } to { translate: 0 1.4vh; } }
@keyframes mega-bg-swirl { from { transform: rotate(-1.6deg) scale(1.02); } to { transform: rotate(1.6deg) scale(1.06); } }
@keyframes mega-bg-rise { from { translate: 0 14vh; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes mega-bg-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.012); } }
@keyframes mega-bg-eyes { 0% { opacity: 0; } 8% { opacity: 1; } 11% { opacity: .2; } 14%, 70% { opacity: 1; } 85% { opacity: .65; } 100% { opacity: 1; } }
@keyframes mega-bg-in-l { from { translate: -12vw 0; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes mega-bg-in-r { from { translate: 12vw 0; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes mega-bg-wind-far { from { translate: 0 0; } to { translate: 520px 260px; } }
@keyframes mega-bg-wind-mid { from { translate: 0 0; } to { translate: 760px 380px; } }
@keyframes mega-bg-wind-near { from { translate: 0 0; } to { translate: 1100px 550px; } }
@keyframes mega-bg-gust { from { translate: 0 0; } to { translate: -900px 0; } }
@keyframes mega-bg-sway-a { 0%, 100% { transform: translate(0, 0) rotate(0); } 18% { transform: translate(-22px, 14px) rotate(-.5deg); } 37% { transform: translate(-8px, -18px) rotate(.3deg); } 55% { transform: translate(24px, -6px) rotate(.7deg); } 76% { transform: translate(10px, 20px) rotate(-.2deg); } }
@keyframes mega-bg-sway-b { 0%, 100% { transform: translate(0, 0) rotate(0); } 21% { transform: translate(26px, -12px) rotate(.6deg); } 43% { transform: translate(-6px, -26px) rotate(-.4deg); } 62% { transform: translate(-28px, 8px) rotate(-.8deg); } 84% { transform: translate(8px, 22px) rotate(.3deg); } }
@keyframes mega-bg-sway-c { 0%, 100% { transform: translate(0, 0); } 16% { transform: translate(-34px, 10px); } 35% { transform: translate(-12px, -30px); } 52% { transform: translate(30px, -22px); } 71% { transform: translate(36px, 18px); } 88% { transform: translate(-8px, 28px); } }
@keyframes mega-bg-eddy { from { rotate: -1.1deg; } to { rotate: 1.1deg; } }
@keyframes mega-bg-bob { from { transform: translateY(6px); } to { transform: translateY(-10px); } }
@keyframes mega-bg-twinkle { from { opacity: .5; } to { opacity: 1; } }
@keyframes mega-bg-loom { from { transform: none; } to { transform: translateY(-6vh) scale(1.07); } }
@keyframes mega-bg-sink { from { transform: none; } to { transform: translateY(5vh); } }
@keyframes mega-bg-reveal { from { opacity: 0; transform: translateY(46px); clip-path: inset(0 0 100% 0); }
    to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
@keyframes mega-bg-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.3, 1.6); opacity: 0; } }
@keyframes mega-bg-logo { from { transform: translateY(-30px) scale(1.12); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mega-bg-chev { 0%, 100% { background-position: center calc(100% - 12px); } 50% { background-position: center 100%; } }

@media (max-width: 760px) {
  .bg-giant, .bg-eyes, .bg-eye { height: 130vh; top: calc(var(--head, 0px) + 2vh); margin-left: calc(-65vh * 0.6710); }
  .bg-heroes-l, .bg-heroes-r { height: 16vh; bottom: 13vh; }
  .bg-heroes-l { left: -8vw; } .bg-heroes-r { right: -8vw; }
}
@media (prefers-reduced-motion: reduce) {
  .bg *, .bg { animation: none !important; }
  .bgl, .bg-loom, .bg-sink { transform: none !important; }
}
