/* ==========================================================================
   backdrop.css: the animated night scene behind the homepage.
   Layers (back to front): sky gradient, moon (turns slowly), haze (stars,
   comet, nebula, mist), sea (waves + reflection, animated inside sea.svg),
   shade (gets darker as you scroll so the scene never competes with text).
   Remove the .backdrop block in index.html and this file to drop it.
   ========================================================================== */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, #0A0920 0%, #090818 55%, #121231 86%, #05040C 100%); }
/* The scene is composed on a 16:10 frame that always covers the screen, anchored at the bottom */
.bd-frame { position: absolute; left: 50%; bottom: 0; width: max(100vw, 160vh); aspect-ratio: 16 / 10; transform: translateX(-50%); }
.bd-haze { position: absolute; inset: 0; width: 100%; height: 100%; }
.bd-sea { position: absolute; left: 0; bottom: 0; width: 100%; height: 13.2%; }

/* The moon turns around its vertical axis: a seamless surface strip slides sideways
   behind a round window, and a shading layer on top makes the disc read as a sphere. */
.bd-moon { position: absolute; left: -6.25%; top: 8%; width: 112.5%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 70px 12px rgba(154, 168, 255, 0.32), 0 0 200px 60px rgba(120, 100, 255, 0.16); }
.bd-moon-surface { position: absolute; top: 0; left: 0; width: 400%; height: 100%;
  background: url(/assets/moon-texture.webp) repeat-x 0 0 / 50% 100%;
  animation: moon-turn 1200s linear infinite; will-change: transform; }
.bd-moon::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(225, 232, 255, 0.16), transparent 30%),
    radial-gradient(circle at 50% 50%, rgba(5, 4, 26, 0.62) 0%, rgba(8, 7, 32, 0.48) 46%, rgba(20, 22, 70, 0.22) 74%, rgba(140, 155, 230, 0.06) 91%, rgba(235, 240, 255, 0.55) 100%),
    linear-gradient(90deg, rgba(5, 4, 20, 0.55), transparent 22%, transparent 78%, rgba(5, 4, 20, 0.55)); }
@keyframes moon-turn { to { transform: translateX(-50%); } }

/* Twinkling stars (positions set by js/backdrop.js; each one jumps to a new place after it fades) */
.bd-stars { position: absolute; inset: 0; }
.tw { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #FFF; opacity: 0;
  box-shadow: 0 0 6px 1px rgba(205, 215, 255, 0.85); animation: twinkle var(--d, 5s) ease-in-out infinite; animation-delay: var(--delay, 0s); }
.tw.big { width: 3px; height: 3px; }
.tw.big::before, .tw.big::after { content: ""; position: absolute; left: 50%; top: 50%; background: rgba(230, 236, 255, 0.85); transform: translate(-50%, -50%); }
.tw.big::before { width: 18px; height: 1px; }
.tw.big::after { width: 1px; height: 18px; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.4); } 45%, 55% { opacity: 1; transform: scale(1); } }

/* Darkens with scroll (--bd-dim from js/backdrop.js) */
.bd-shade { position: absolute; inset: 0; background: #05040C; opacity: calc(0.2 + 0.7 * var(--bd-dim, 0)); transition: opacity 0.25s linear; }
/* "Post-processing": vignette at the edges plus fine film grain */
.bd-post { position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(3, 2, 10, 0.75) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light; opacity: 0.55; }

@media (prefers-reduced-motion: reduce) { .bd-moon-surface, .tw { animation: none; } .tw { opacity: 0.6; } }
