/* ==========================================================================
   Site backgrounds: aurora light over developer code. Four options.
     a  Aurora + code      green / violet / cyan light, code snippets
     b  Ribbons + columns  teal / amber / green ribbons, code columns
     c  Beams + brackets   violet / green beams, giant { } </> symbols
     d  Night editor       dim navy aurora, line-numbered code on the left
   The one in use is set in web/partials/bg.php ($BG).
   ========================================================================== */

.bg-stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-aurora, .bg-code { position: absolute; inset: 0; }
.bg-aurora i { position: absolute; display: block; border-radius: 50%; filter: blur(70px); will-change: transform; }

@media (prefers-reduced-motion: no-preference) {
  .bg-aurora i { animation: aurora-drift 24s ease-in-out infinite alternate; }
  .bg-aurora i:nth-child(2) { animation-duration: 30s; animation-delay: -8s; }
  .bg-aurora i:nth-child(3) { animation-duration: 36s; animation-delay: -15s; }
}
@keyframes aurora-drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.1); }
}

/* a: aurora + code snippets */
.v-a .bg-aurora i:nth-child(1) { width: 60vmax; height: 60vmax; left: -18vmax; top: -24vmax; background: #3df09a; opacity: .30; }
.v-a .bg-aurora i:nth-child(2) { width: 52vmax; height: 52vmax; right: -20vmax; top: 6vh; background: #7c5cff; opacity: .26; }
.v-a .bg-aurora i:nth-child(3) { width: 44vmax; height: 44vmax; left: 32%; bottom: -28vmax; background: #1fb6c9; opacity: .22; }
.v-a .bg-code {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='360' height='360' font-family='monospace' font-size='12'><text x='16' y='30' fill='%233df09a'>const user = await api.get('/projects');</text><text x='40' y='70' fill='%237c5cff'>return json.data.map(p =&gt; p.title);</text><text x='16' y='110' fill='%233df09a'>{ status: 'ok', count: 12 }</text><text x='24' y='150' fill='%231fb6c9'>if (!token) throw new ApiException(401);</text><text x='16' y='200' fill='%237c5cff'>Widget build() =&gt; Scaffold(body: Text('hi'));</text><text x='40' y='240' fill='%233df09a'>final bloc = context.read&lt;SooqCubit&gt;();</text><text x='16' y='290' fill='%231fb6c9'>SELECT * FROM projects WHERE is_published = 1;</text><text x='24' y='330' fill='%233df09a'>$stmt-&gt;execute(['slug' =&gt; $slug]);</text></svg>");
  background-size: 360px 360px; opacity: .14;
}

/* b: ribbons + falling columns, fading out toward the bottom */
.v-b .bg-aurora i:nth-child(1) { width: 150vw; height: 30vh; left: -25vw; top: 8vh; background: #1fb6c9; opacity: .22; rotate: -9deg; }
.v-b .bg-aurora i:nth-child(2) { width: 140vw; height: 24vh; right: -30vw; top: 38vh; background: #f5c451; opacity: .12; rotate: 7deg; }
.v-b .bg-aurora i:nth-child(3) { width: 120vw; height: 26vh; left: -10vw; bottom: -6vh; background: #3df09a; opacity: .20; rotate: -4deg; }
.v-b .bg-code {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='480' font-family='monospace' font-size='13'><text x='12' y='24' fill='%233df09a'>0 1 1 0 1 0</text><text x='12' y='64' fill='%23f5c451'>{ } =&gt; ;</text><text x='12' y='104' fill='%233df09a'>async await</text><text x='12' y='144' fill='%23f5c451'>&lt;/&gt; [ ] ( )</text><text x='12' y='184' fill='%233df09a'>0x7F 0xA3 0x1C</text><text x='12' y='224' fill='%23f5c451'>git push -u origin</text><text x='12' y='264' fill='%233df09a'>npm run build</text><text x='12' y='304' fill='%23f5c451'>flutter run</text><text x='130' y='44' fill='%231fb6c9'>01001</text><text x='130' y='84' fill='%231fb6c9'>import 'pkg';</text><text x='130' y='124' fill='%231fb6c9'>class App {}</text><text x='130' y='164' fill='%231fb6c9'>SELECT *</text><text x='130' y='204' fill='%231fb6c9'>return 0;</text><text x='130' y='244' fill='%231fb6c9'>echo $x;</text><text x='130' y='284' fill='%231fb6c9'>yield *</text><text x='130' y='324' fill='%231fb6c9'>try { } catch</text></svg>");
  background-size: 240px 480px; opacity: .10;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 35%, transparent 95%);
}

/* c: vertical beams + giant brackets */
.v-c .bg-aurora i:nth-child(1) { width: 22vmax; height: 150vh; left: 8vw; top: -30vh; background: #7c5cff; opacity: .28; rotate: 14deg; border-radius: 999px; }
.v-c .bg-aurora i:nth-child(2) { width: 16vmax; height: 140vh; left: 46vw; top: -40vh; background: #3df09a; opacity: .20; rotate: -10deg; border-radius: 999px; }
.v-c .bg-aurora i:nth-child(3) { width: 26vmax; height: 120vh; right: -6vw; top: -20vh; background: #1fb6c9; opacity: .18; rotate: 22deg; border-radius: 999px; }
.v-c .bg-code {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420' font-family='monospace'><text x='30' y='220' font-size='170' fill='%233df09a'>{ }</text><text x='200' y='390' font-size='80' fill='%237c5cff'>&lt;/&gt;</text><text x='260' y='120' font-size='46' fill='%231fb6c9'>=&gt;</text></svg>");
  background-size: 420px 420px; opacity: .10;
}

/* d: dim navy aurora over a line-numbered editor */
.v-d .bg-aurora i:nth-child(1) { width: 50vmax; height: 50vmax; left: -20vmax; top: -10vmax; background: #0f5a48; opacity: .45; }
.v-d .bg-aurora i:nth-child(2) { width: 46vmax; height: 46vmax; right: -16vmax; top: 30vh; background: #1d2f80; opacity: .40; }
.v-d .bg-aurora i:nth-child(3) { width: 36vmax; height: 36vmax; left: 35%; bottom: -20vmax; background: #3df09a; opacity: .14; }
.v-d .bg-code {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='320' font-family='monospace' font-size='12'><text x='8' y='20' fill='%2355706a'>1</text><text x='34' y='20' fill='%233df09a'>import 'app.dart';</text><text x='8' y='52' fill='%2355706a'>2</text><text x='34' y='52' fill='%237c5cff'>void main() {</text><text x='8' y='84' fill='%2355706a'>3</text><text x='34' y='84' fill='%233df09a'>  runApp(App());</text><text x='8' y='116' fill='%2355706a'>4</text><text x='34' y='116' fill='%231fb6c9'>  final db = Db();</text><text x='8' y='148' fill='%2355706a'>5</text><text x='34' y='148' fill='%233df09a'>  await db.open();</text><text x='8' y='180' fill='%2355706a'>6</text><text x='34' y='180' fill='%237c5cff'>}</text><text x='8' y='212' fill='%2355706a'>7</text><text x='34' y='212' fill='%231fb6c9'>// TODO: ship it</text><text x='8' y='244' fill='%2355706a'>8</text><text x='34' y='244' fill='%233df09a'>return 0;</text></svg>");
  background-size: 200px 320px; opacity: .16;
  -webkit-mask-image: linear-gradient(90deg, #000 25%, transparent 65%);
  mask-image: linear-gradient(90deg, #000 25%, transparent 65%);
}

/* The aurora canvas (core/aurora.js) fills the fixed background layer. */
.bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
