/* ==========================================================================
   Yozza SMP homepage recreation — stylesheet
   Palette and metrics sampled from the user's reference screenshots.
   ========================================================================== */

:root {
  --c-navbar: #1c0a26;
  --c-bg-top: #241030;
  --c-bg-mid: #4a2160;
  --c-bg-deep: #331346;
  --c-primary: #f04fea;
  --c-primary-hover: #f97cf5;
  --c-primary-shadow: #b02bb0;
  --c-text: hsla(0, 0%, 100%, 0.65);
  --c-white: #ffffff;
  --c-gold-light: #ffd6fb;
  --c-gold: #e78bef;
  --c-gold-deep: #c94fd9;
  --c-card: rgba(24, 8, 32, 0.38);
  --c-red: #ff4949;
  --c-red-hover: #e33e3e;
  --c-taupe: #6e5a72;
  --c-taupe-hover: #83678a;
  --c-discord: #8fadf0;
  --c-discord-hover: #628cea;
  --c-discord-dark: #48629b;
  --c-discord-light: #d0dfff;
  --c-store: #e8b8f0;
  --c-dot: #7a6482;
  --radius: 0.375rem;
  --radius-card: 0.625rem;
  --ease-site: cubic-bezier(0.39, 0.58, 0.57, 1);
  --font: "Gilroy", "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: #241030;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--c-text);
  background-color: #241030;
  background-image: linear-gradient(180deg,
      #241030 0%, #2b1640 22%, #3a1d52 44%,
      #45225e 62%, #472364 74%, #3c1e50 90%, #331346 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
a { color: var(--c-primary); }
h1, h2, h3, p, figure { margin: 0; }
button { font-family: inherit; }

/* Gold scrollbar (site-wide, as on the original) */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background-color: #1c0a26; }
::-webkit-scrollbar-thumb {
  background-color: var(--c-primary);
  border-radius: 8px;
  border: 2px solid #1c0a26;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--c-primary-hover); }
html { scrollbar-color: var(--c-primary) #1c0a26; scrollbar-width: thin; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0.75rem;
}

.text-gradient-primary {
  background-image: linear-gradient(180deg,
      #ffd9fb 0%, #f3a0f3 35%, #ea63ea 70%, #cf3ecf 100%);
  background-size: cover;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(240, 79, 234, 0.45));
}

/* ---------- Navbar ---------- */

.site-navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--c-navbar);
}

.navbar-inner {
  display: flex;
  align-items: center;
  height: 112px;
}

.navbar-brand { display: block; line-height: 0; }
.navbar-brand img {
  height: 96px;
  width: auto;
}

.navbar-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 3rem;
  min-width: 0;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--c-white);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s var(--ease-site);
}

.nav-link:hover,
.nav-link.active { color: var(--c-primary); }

.store-link {
  color: var(--c-store);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0.85;
}

.store-link:hover { color: var(--c-store); opacity: 1; }

.ip-button {
  height: 68px;
  padding: 14px 38px;
  border: 0;
  border-radius: var(--radius);
  background-color: var(--c-primary);
  color: var(--c-white);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1.5px 0 var(--c-primary-shadow);
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(240, 79, 234, 0.45);
  transition: background-color 0.2s var(--ease-site), box-shadow 0.2s var(--ease-site);
}

.ip-button:hover { background-color: var(--c-primary-hover); box-shadow: 0 0 28px rgba(240, 79, 234, 0.75); }

.navbar-toggler {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  margin-left: auto;
  background: none;
  border: 0;
  cursor: pointer;
}

.toggler-bar {
  height: 2px;
  width: 100%;
  background: var(--c-white);
  border-radius: 2px;
}

/* Mobile offcanvas menu */
.offcanvas {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  width: min(320px, 84vw);
  background-color: var(--c-navbar);
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease-site), visibility 0.3s;
  visibility: hidden;
}

.offcanvas.open { transform: none; visibility: visible; }

.offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0.75rem;
}

.offcanvas-header img { height: 70px; width: auto; }

.offcanvas-close {
  background: none;
  border: 0;
  color: var(--c-white);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.offcanvas-body { padding: 1rem 1.25rem 2rem; }

.offcanvas-nav {
  flex-direction: column;
  align-items: flex-start;
  gap: 1.15rem;
}

.offcanvas-nav .nav-link { font-size: 0.9rem; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #120019;
}

.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-subtitle {
  margin-bottom: 0.5rem;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--c-white);
}

.hero-title {
  font-size: 108px;
  font-weight: 600;
  line-height: 1.08;
  color: var(--c-white);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.5rem;
  padding: 1.1rem 4.25rem;
  border: 0;
  border-radius: var(--radius);
  background-color: var(--c-primary);
  color: #000;
  font-size: 1.75rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 0 26px rgba(240, 79, 234, 0.55);
  animation: cta-pulse 3.2s ease-in-out infinite;
  transition: all 0.2s var(--ease-site);
}

.hero-cta:hover { background-color: var(--c-primary-hover); box-shadow: 0 0 40px rgba(240, 79, 234, 0.85); animation-play-state: paused; }

@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(240, 79, 234, 0.45); }
  50% { box-shadow: 0 0 34px rgba(240, 79, 234, 0.8); }
}
.hero-cta .cta-arrow { transform: translateY(1px); }

/* ---------- News section ---------- */

.section-pad { padding: 6rem 0.75rem 5rem; }

.section-head {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: 0.4rem;
}

.news-carousel { position: relative; }

.news-stage { display: grid; }

.news-slide {
  grid-area: 1 / 1;
  display: flex;
  align-items: stretch;
  gap: 3rem;
  margin-left: 3rem;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.news-slide.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.news-copy {
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.news-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #e78bef;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(231, 139, 239, 0.65);
  transition: color 0.2s var(--ease-site);
}

.news-title:hover { color: #f2a0f2; }

.news-excerpt {
  margin-bottom: 2rem;
  min-height: 6.2rem;
  line-height: 1.45;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.news-date {
  white-space: nowrap;
  font-size: 0.95rem;
}

.news-rule {
  flex: 1;
  height: 1px;
  border: 0;
  margin: 0;
  background-color: hsla(0, 0%, 100%, 0.22);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--c-gold-light);
  transition: all 0.2s var(--ease-site);
}

.read-more:hover {
  color: var(--c-gold);
  transform: translateX(12px);
}

.read-more svg { transform: scale(0.72); }

.news-figure {
  flex: 1;
  min-height: 19rem;
  margin-left: 1rem;
  border-radius: 10px;
  overflow: hidden;
}

.news-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-controls {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 1.5rem 0 0 3rem;
}

.pg-arrow {
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  color: #8a7a92;
  cursor: pointer;
  transition: color 0.2s var(--ease-site);
}

.pg-arrow:hover { color: #a692ac; }

.pg-dots {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pg-dot {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  padding: 0;
  background: none;
  border: 0;
  color: #82728a;
  cursor: pointer;
  transition: color 0.2s var(--ease-site);
}

.pg-dot:hover { color: #9c8aa4; }

.pg-dot .dot-flower { display: none; }
.pg-dot .dot-circle { display: block; line-height: 0; }
.pg-dot .dot-flower { line-height: 0; }

.pg-dot.active { color: #f2a0f2; }
.pg-dot.active .dot-circle { display: none; }
.pg-dot.active .dot-flower { display: block; }

.more-news-wrap {
  text-align: center;
  margin-top: 4rem;
}

.vote-teaser-cta {
  text-align: center;
  margin-top: 2.5rem;
}

.more-news {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 2.6rem;
  border-radius: var(--radius);
  background-color: var(--c-red);
  color: var(--c-white);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s var(--ease-site);
}

.more-news:hover { background-color: var(--c-red-hover); }

/* ---------- Feature cards ---------- */

.features { padding: 2.5rem 0; }

.feature-card {
  position: relative;
  background-color: var(--c-card);
  border-radius: var(--radius-card);
  overflow: visible;
  box-shadow: 0 0 0 rgba(240, 79, 234, 0);
  transition: box-shadow 0.35s var(--ease-site);
}

.feature-card:hover { box-shadow: 0 0 50px rgba(240, 79, 234, 0.22); }

.feature-inner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 27rem;
  padding: 4rem 3.5rem 4rem 3rem;
}

.feature-media {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.media-left { left: 2.5rem; }
.media-right { right: 2.5rem; }
.media-bottom { bottom: -4px; }
.media-center { top: 50%; transform: translateY(-50%); }

.feature-media img { height: 30rem; width: auto; max-width: 40vw; }
.media-center img { height: 25rem; }

.feature-copy {
  position: relative;
  z-index: 1;
  margin-left: auto;
  max-width: 46%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.feature-copy.copy-left {
  margin-left: 0;
  margin-right: auto;
  align-items: flex-start;
  text-align: left;
  padding-left: 0.5rem;
}

.feature-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: 0.4rem;
}

.feature-sub {
  margin-bottom: 2.75rem;
  color: hsla(0, 0%, 100%, 0.78);
}

.feature-text {
  margin-bottom: 2.75rem;
  line-height: 1.6;
}

.btn-gold,
.btn-taupe,
.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  transition: background-color 0.2s var(--ease-site), color 0.2s var(--ease-site);
}

.btn-gold {
  padding: 0.5rem 1.4rem;
  border-radius: var(--radius);
  background-color: var(--c-primary);
  color: #000;
  font-weight: 700;
  border-top: 4px solid var(--c-primary-hover);
  border-left: 4px solid var(--c-primary-shadow);
  border-bottom: 4px solid var(--c-primary-shadow);
  border-right: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-gold:hover { background-color: var(--c-primary-hover); }

.btn-taupe {
  padding: 0.5rem 1.4rem;
  border-radius: var(--radius);
  background-color: var(--c-taupe);
  color: var(--c-white);
  font-weight: 700;
  border-top: 4px solid var(--c-taupe-hover);
  border-left: 4px solid #453a48;
  border-bottom: 4px solid #453a48;
  border-right: 0;
  text-shadow: 0 2px 0 #453a48;
}

.btn-taupe:hover { background-color: var(--c-taupe-hover); }

.btn-discord {
  padding: 0.5rem 1.4rem;
  background-color: var(--c-discord);
  color: var(--c-white);
  font-weight: 700;
  border-top: 4px solid var(--c-discord-light);
  border-left: 4px solid var(--c-discord-dark);
  border-bottom: 4px solid var(--c-discord-dark);
  border-right: 0;
  text-shadow: 0 2px 0 var(--c-discord-dark);
}

.btn-discord:hover { background-color: var(--c-discord-hover); color: var(--c-white); }
.btn-discord .discord-icon { transform: translateY(1px); }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 4.5rem;
  padding: 3.5rem 0 3rem;
  background-color: var(--c-navbar);
}

.footer-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  list-style: none;
  margin: 0 0 3.25rem;
  padding: 0;
}

.footer-links a {
  color: hsla(0, 0%, 100%, 0.5);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s var(--ease-site);
}

.footer-links a:hover,
.footer-links a.fl-home { color: var(--c-white); }
.footer-links a.fl-home { font-weight: 700; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 1.6rem;
}

.footer-brand img {
  height: 122px;
  width: auto;
}

.footer-legal {
  font-size: 0.72rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.3);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-social a {
  color: var(--c-white);
  transition: color 0.2s var(--ease-site);
}

.footer-social a:hover { color: var(--c-primary); }

/* ---------- Connect modal ---------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-root.open { visibility: visible; opacity: 1; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.connect-panel {
  position: relative;
  width: min(1100px, 100%);
  border-radius: 0;
  padding: 2.5rem 3rem;
  color: var(--c-white);
  background-color: #1c0a26;
  background-image:
    linear-gradient(rgba(12, 8, 5, 0.45), rgba(12, 8, 5, 0.45)),
    radial-gradient(120% 170% at 18% 28%, #3a1d52 0%, #2a1338 48%, #15071e 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 70px rgba(240, 79, 234, 0.22);
  transform: translateY(24px);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

.modal-root.open .connect-panel { transform: none; }

.connect-close {
  position: absolute;
  top: 20px;
  right: 30px;
  padding: 0.35rem;
  background: none;
  border: 0;
  color: var(--c-white);
  opacity: 0.8;
  cursor: pointer;
  transition: opacity 0.2s;
}

.connect-close:hover { opacity: 1; }

.connect-head {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
}

.connect-logo {
  height: 84px;
  width: auto;
  margin-top: 0.75rem;
}

.connect-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--c-white);
  margin: 0.9rem 0 0.25rem;
}

.connect-sub { font-size: 1.1rem; }

.connect-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 24rem;
  margin: 2rem 0 3rem;
}

.connect-item {
  margin: 0.75rem 0;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.6;
  color: hsla(0, 0%, 100%, 0.8);
  text-align: left;
}

.connect-item strong { color: var(--c-white); }
.connect-item .num { font-weight: 700; }

.ip-chip {
  display: inline-block;
  margin: 0 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: 3px;
  background-color: rgba(28, 10, 38, 0.64);
  color: hsla(0, 0%, 100%, 0.9);
  font-weight: 700;
  font-size: 1rem;
}

.connect-ok {
  padding: 0.5rem 4rem;
  border: 0;
  border-radius: var(--radius);
  background-color: var(--c-primary);
  color: #000;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-site);
}

.connect-ok:hover { background-color: var(--c-primary-hover); }

/* ---------- Hero entrance animation ---------- */

@keyframes hero-in {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}

.hero-copy {
  animation: hero-in 0.3s cubic-bezier(0.33, 1, 0.68, 1) 1s both;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy { animation: none; }
  .news-slide { transition: opacity 0.2s ease; transform: none; }
}

/* ---------- Scroll reveal animations (first time scrolled into view) ---------- */

.reveal {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.6s var(--ease-site), transform 0.6s var(--ease-site);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .feature-media img { height: 19rem; }
  .media-center img { height: 18rem; }
  .hero-title { font-size: 72px; }
}

@media (max-width: 980px) {
  .navbar-content { display: none; }
  .navbar-toggler { display: flex; }

  .hero { padding-top: 4rem; min-height: 70vh; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 0.5rem; }
  .hero-title { font-size: 2.5rem; }
  .hero-cta { margin-top: 0.25rem; padding: 0.75rem 3rem; font-size: 1rem; }

  .news-slide {
    flex-direction: column-reverse;
    gap: 0;
    margin-left: 0;
  }

  .news-figure {
    min-height: 0;
    height: 14rem;
    margin: 0 0 2rem;
  }

  .news-copy {
    flex: auto;
    align-items: center;
    text-align: center;
  }

  .news-title { text-align: center; }
  .news-excerpt { min-height: 0; }

  .news-meta {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .news-rule { display: none; }
  .news-controls { justify-content: center; margin-left: 0; }
  .more-news-wrap { margin-top: 2.5rem; }

  .feature-inner {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 0 1.25rem 2.5rem;
  }

  .feature-media {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
    display: flex;
    justify-content: center;
    height: 19rem;
    margin-bottom: 1rem;
  }

  .feature-media img { height: 100%; max-width: 82vw; }

  .feature-copy,
  .feature-copy.copy-left {
    max-width: 100%;
    margin: 0;
    align-items: center;
    text-align: center;
    padding-left: 0;
  }

  .feature-copy .desk-only { display: none; }

  .connect-panel { padding: 1.5rem; }
  .connect-head { flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
  .connect-title { font-size: 2rem; }
  .connect-sub { font-size: 1rem; }
  .connect-list { margin: 1rem 0 2rem; align-items: center; }
  .connect-item { font-size: 1rem; text-align: center; }
  .connect-ok { display: block; margin: 0 auto; padding: 0.5rem 6rem; }
}

@media (max-width: 480px) {
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-social { gap: 1.6rem; }
}





/* Footer active link (Rules page) */
.footer-links a.active { color: #fff; font-weight: 700; }

/* ==========================================================================
   Galaxy background — nebula clouds, drifting starfields, shooting star.
   Implemented entirely on html/body ::before/::after (no markup needed),
   pinned behind all page content with negative z-index.
   ========================================================================== */

html::before,
html::after,
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* Nebula clouds (deepest layer) */
body::before {
  z-index: -4;
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 20%, rgba(240, 79, 234, 0.22), transparent 60%),
    radial-gradient(ellipse 50% 45% at 85% 15%, rgba(90, 60, 200, 0.24), transparent 60%),
    radial-gradient(ellipse 55% 50% at 75% 80%, rgba(74, 33, 96, 0.32), transparent 65%),
    radial-gradient(ellipse 45% 40% at 10% 85%, rgba(201, 79, 217, 0.2), transparent 60%);
  filter: blur(20px);
  animation: nebula-drift 90s ease-in-out infinite alternate;
}

@keyframes nebula-drift {
  0%   { transform: scale(1) translate(0, 0); }
  50%  { transform: scale(1.1) translate(-2%, 1.5%); }
  100% { transform: scale(1) translate(2%, -1.5%); }
}

/* Distant stars (small, dense) */
html::before {
  z-index: -3;
  background-image:
    radial-gradient(2.2px 2.2px at 20px 30px, rgba(255, 255, 255, .95), transparent 100%),
    radial-gradient(1.6px 1.6px at 90px 70px, rgba(255, 255, 255, .8), transparent 100%),
    radial-gradient(2px 2px at 140px 20px, rgba(230, 200, 255, .9), transparent 100%),
    radial-gradient(1.6px 1.6px at 180px 130px, rgba(255, 255, 255, .7), transparent 100%),
    radial-gradient(2.2px 2.2px at 60px 160px, rgba(255, 255, 255, .9), transparent 100%),
    radial-gradient(1.6px 1.6px at 10px 110px, rgba(240, 180, 255, .8), transparent 100%),
    radial-gradient(2px 2px at 160px 90px, rgba(255, 255, 255, .75), transparent 100%),
    radial-gradient(1.6px 1.6px at 110px 180px, rgba(255, 255, 255, .65), transparent 100%),
    radial-gradient(1.8px 1.8px at 45px 5px, rgba(255, 255, 255, .8), transparent 100%),
    radial-gradient(1.6px 1.6px at 195px 145px, rgba(230, 200, 255, .75), transparent 100%);
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: .9;
  animation: stars-drift-a 170s linear infinite;
}

@keyframes stars-drift-a {
  from { background-position: 0 0; }
  to   { background-position: -400px 800px; }
}

/* Nearer, bigger, twinkling stars */
body::after {
  z-index: -2;
  background-image:
    radial-gradient(2.6px 2.6px at 40px 50px, #fff, transparent 100%),
    radial-gradient(3px 3px at 220px 120px, rgba(255, 255, 255, .95), transparent 100%),
    radial-gradient(2.4px 2.4px at 130px 220px, rgba(245, 190, 250, .95), transparent 100%),
    radial-gradient(3px 3px at 260px 40px, rgba(255, 255, 255, .9), transparent 100%),
    radial-gradient(2.6px 2.6px at 60px 260px, rgba(255, 255, 255, .85), transparent 100%),
    radial-gradient(2.4px 2.4px at 190px 170px, rgba(230, 200, 255, .85), transparent 100%),
    radial-gradient(2.2px 2.2px at 100px 10px, rgba(255, 255, 255, .8), transparent 100%),
    radial-gradient(2.4px 2.4px at 280px 200px, rgba(245, 190, 250, .8), transparent 100%);
  background-repeat: repeat;
  background-size: 300px 300px;
  animation: stars-drift-b 230s linear infinite reverse, twinkle 4s ease-in-out infinite;
}

@keyframes stars-drift-b {
  from { background-position: 0 0; }
  to   { background-position: -600px -900px; }
}

@keyframes twinkle {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}

/* Shooting star (periodic glowing streak) */
html::after {
  z-index: -1;
  inset: auto;
  top: 12%;
  left: -4%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 2px rgba(255, 255, 255, .9), 0 0 22px 6px rgba(240, 150, 255, .55);
  animation: shooting-star 9s cubic-bezier(.2, .6, .3, 1) infinite;
  opacity: 0;
}

@keyframes shooting-star {
  0%   { transform: translate(0, 0); opacity: 0; }
  2%   { opacity: 1; }
  18%  { transform: translate(130vw, 65vh); opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html::before, html::after, body::before, body::after { animation: none !important; }
}

