/* The hero's moving backdrop and the page's rails. The layers a page gets are named on its hero:
   <section class="hero" data-backdrop="topo drift rails">. Colours come from the page's own --bd-* tokens.
   Everything here moves with transform only; backdrop.js stops the drawn layers off screen. */

.bd-ground {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  opacity: 0; transition: opacity 700ms cubic-bezier(.16, 1, .3, 1);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 64%, transparent 96%);
          mask-image: linear-gradient(to bottom, #000 0, #000 64%, transparent 96%);
}
.bd-ground.is-on { opacity: 1; }
.bd-layer { position: absolute; inset: 0; }
.bd-layer > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* with a ground behind the whole hero, the window has no panel of its own: the screen lies on the ground */
.hero[data-backdrop] .hero__window { background: transparent; }

/* ---------- drift: three soft fields of colour, slowly changing places ---------- */
.bd-drift { inset: -12%; mix-blend-mode: multiply; }
.bd-drift i { position: absolute; border-radius: 50%; will-change: transform; }
.bd-drift i:nth-child(1) { left: 2%;  top: 4%;  width: 46%; height: 62%; background: radial-gradient(closest-side, var(--bd-t1), transparent 100%); animation: bd-d1 26s ease-in-out infinite; }
.bd-drift i:nth-child(2) { left: 52%; top: -6%; width: 50%; height: 70%; background: radial-gradient(closest-side, var(--bd-t2), transparent 100%); animation: bd-d2 32s ease-in-out infinite; }
.bd-drift i:nth-child(3) { left: 28%; top: 38%; width: 52%; height: 66%; background: radial-gradient(closest-side, var(--bd-t3), transparent 100%); animation: bd-d3 38s ease-in-out infinite; }
@keyframes bd-d1 { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(14%, 9%, 0) scale(1.12); } }
@keyframes bd-d2 { 0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); } 50% { transform: translate3d(-16%, 12%, 0) scale(.92); } }
@keyframes bd-d3 { 0%, 100% { transform: translate3d(0, 0, 0) scale(.96); } 50% { transform: translate3d(8%, -14%, 0) scale(1.1); } }

/* ---------- rails: the column's edges down the whole page ---------- */
.bd-rails { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bd-rails b { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--bd-rail); }
.bd-rails i { position: absolute; top: 0; width: 1px; height: 180px;
  background: linear-gradient(to bottom, transparent, var(--bd-beam) 70%, transparent); will-change: transform; animation: bd-fall linear infinite; }
.bd-rails s { position: absolute; width: 7px; height: 7px; margin: -3px 0 0 -3px; background: var(--p-bg); box-shadow: 0 0 0 1px var(--bd-rail-strong); text-decoration: none; }
@keyframes bd-fall { from { transform: translate3d(0, -200px, 0); } to { transform: translate3d(0, var(--bd-h, 4000px), 0); } }
html.bd-rails-on body { position: relative; }
html.bd-rails-on main, html.bd-rails-on .footer { position: relative; z-index: 1; }
html.bd-rails-on main > section + section { border-top: 1px solid var(--bd-rail); }

/* paused from the hero's pause button, and still for anyone who asks for less motion */
.bd-paused i { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .bd-ground { transition: none; }
  .bd-drift i { animation: none; }
  .bd-rails i { display: none; }
}
