/* Page backdrops behind the card. Motion is transform and opacity only. */

.gl-page .backdrop, .bd-stage { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bd-stage { position: relative; height: 78px; border-radius: 12px; background: #07060f; }
.backdrop i, .bd-stage i { position: absolute; display: block; }

.bd-aurora { background: #07060f; }
.bd-aurora i {
  left: -20%; width: 140%; height: 38%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent, #8f6cff) 70%, #36c8ff), transparent);
  opacity: .45;
  animation: bd-drift 14s ease-in-out infinite alternate;
  top: calc(var(--n) * 18%);
  animation-delay: calc(var(--n) * -2s);
}
.bd-mesh i {
  width: 55%; height: 55%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, #8f6cff) 80%, white), transparent 68%);
  opacity: .4;
  animation: bd-mesh 16s ease-in-out infinite alternate;
  left: calc(var(--n) * 18%);
  top: calc(var(--n) * 10%);
}
.bd-starfield { background: radial-gradient(ellipse at 50% 100%, #120c22, #05040c 70%); }
.bd-starfield i {
  width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .8;
  left: calc((var(--n) * 6.4%) + 3%);
  animation: bd-fall calc(7s + var(--n) * .35s) linear infinite;
  animation-delay: calc(var(--n) * -.6s);
}
.bd-starfield i:nth-child(3n) { width: 42px; height: 1px; border-radius: 0; opacity: .7; background: linear-gradient(90deg, transparent, #fff); }
.bd-matrix { background: #031008; }
.bd-matrix i {
  top: -30%; width: 8px; height: 46%;
  left: calc(var(--n) * 9% + 4%);
  background: linear-gradient(transparent, #39ff14 40%, transparent);
  opacity: .55;
  animation: bd-fall calc(2.4s + var(--n) * .15s) linear infinite;
}
.bd-fog i, .bd-mist i {
  width: 48%; height: 42%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, #c9b8ff) 35%, #fff), transparent 70%);
  opacity: .28;
  animation: bd-mesh 18s ease-in-out infinite alternate;
  left: calc(var(--n) * 12% - 6%);
  top: calc(var(--n) * 8%);
}
.bd-mist i { opacity: .18; animation-duration: 24s; }
.bd-bokeh i {
  width: 18%; height: 18%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, #8f6cff) 70%, white), transparent 70%);
  opacity: .55;
  animation: bd-bokeh 9s ease-in-out infinite;
  left: calc(var(--n) * 11%);
  top: calc(20% + var(--n) * 4%);
  animation-delay: calc(var(--n) * -.4s);
}
.bd-synthwave { background: linear-gradient(#1a0830, #05010c); }
.backdrop.bd-synthwave::before, .bd-stage.bd-synthwave::before {
  content: "";
  position: absolute;
  left: -10%; right: -10%; top: 20%; bottom: -30%;
  background-image:
    linear-gradient(rgba(143, 108, 255, .5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 108, 255, .5) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: perspective(180px) rotateX(58deg) translate3d(0, 0, 0);
  transform-origin: center top;
  animation: bd-grid 8s linear infinite;
}
.bd-caustics i {
  width: 40%; height: 30%; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent, #36c8ff) 70%, white);
  opacity: .35;
  animation: bd-bokeh 11s ease-in-out infinite;
  left: calc(var(--n) * 14%);
  top: calc(var(--n) * 9%);
}
.bd-constellation { background: #07060f; }
.bd-constellation i {
  width: 3px; height: 3px; border-radius: 50%; background: #fff;
  box-shadow: 18px 12px 0 color-mix(in srgb, var(--accent, #8f6cff) 80%, white);
  left: calc(var(--n) * 8% + 6%);
  top: calc(var(--n) * 7% + 8%);
  animation: bd-twinkle 3.4s ease-in-out infinite;
  animation-delay: calc(var(--n) * -.3s);
}
.bd-lava i {
  width: 36%; height: 36%; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent, #ff7a3c) 40%, transparent 70%);
  opacity: .7;
  animation: bd-mesh 12s ease-in-out infinite alternate;
  left: calc(var(--n) * 16%);
  top: calc(30% + var(--n) * 6%);
}
.bd-snow i, .bd-rain i {
  top: -20%;
  left: calc(var(--n) * 7% + 2%);
  background: #fff;
  animation: bd-fall calc(6s + var(--n) * .2s) linear infinite;
  animation-delay: calc(var(--n) * -.4s);
}
.bd-snow i { width: 3px; height: 3px; border-radius: 50%; opacity: .85; }
.bd-rain i { width: 1px; height: 28px; opacity: .45; background: linear-gradient(transparent, #d5e6ff); }
.bd-plasma i {
  width: 60%; height: 60%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, #8f6cff) 75%, #36c8ff), transparent 65%);
  opacity: .4;
  animation: bd-mesh 10s ease-in-out infinite alternate;
  left: calc(var(--n) * 14% - 10%);
  top: calc(var(--n) * 12% - 8%);
}
.backdrop-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gl-page .vignette { background: radial-gradient(ellipse at 50% 42%, transparent 16%, rgba(5, 4, 12, .5) 58%, rgba(5, 4, 12, .84) 100%); }

.gl-page.motion-off .backdrop, .gl-page.motion-off .backdrop *,
.gl-page.tab-hidden .backdrop, .gl-page.tab-hidden .backdrop *,
.gl-page .scene.backdrop-still .backdrop, .gl-page .scene.backdrop-still .backdrop * {
  animation-play-state: paused !important;
}
.bd-stage, .bd-stage * { animation-play-state: paused !important; }
.market-card.is-visible .bd-stage, .market-card.is-visible .bd-stage * { animation-play-state: running !important; }

@media (prefers-reduced-motion: reduce) {
  .backdrop, .backdrop *, .bd-stage, .bd-stage * { animation: none !important; }
}

@keyframes bd-drift { from { transform: translate3d(-6%, 0, 0); opacity: .25; } to { transform: translate3d(6%, 8%, 0); opacity: .6; } }
@keyframes bd-mesh { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(8%, -6%, 0) scale(1.15); } }
@keyframes bd-fall { from { transform: translate3d(0, -12vh, 0); opacity: 0; } 12% { opacity: .9; } to { transform: translate3d(10px, 110vh, 0); opacity: .15; } }
@keyframes bd-bokeh { 0%, 100% { transform: translate3d(0, 0, 0) scale(.8); opacity: .35; } 50% { transform: translate3d(0, -12px, 0) scale(1.15); opacity: .8; } }
@keyframes bd-twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes bd-grid {
  from { transform: perspective(180px) rotateX(58deg) translate3d(0, 0, 0); }
  to { transform: perspective(180px) rotateX(58deg) translate3d(0, 28px, 0); }
}
