/* Purple Constellation Theme - Shared by blog index and posts */

.constellation-purple-theme {
  position: relative;
  background:
    radial-gradient(ellipse at center, rgba(26, 8, 45, 0.65) 0%, rgba(12, 4, 24, 0.92) 55%, rgba(3, 1, 8, 0.98) 100%),
    linear-gradient(to bottom right, #04010a, #110425, #050112) !important;
  background-attachment: scroll !important;
  min-height: 100vh;
  overflow-x: hidden;
}

.constellation-purple-theme::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.24) 1px, transparent 1px),
    linear-gradient(45deg, rgba(14, 165, 233, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(236, 72, 153, 0.18) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(16, 185, 129, 0.12) 1px, transparent 1px);
  background-size:
    60px 60px,
    60px 60px,
    80px 80px,
    240px 240px,
    180px 180px;
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
  mask-image:
    radial-gradient(ellipse 600px 500px at 35% 40%, black 5%, rgba(0,0,0,0.7) 20%, rgba(0,0,0,0.3) 40%, transparent 60%),
    radial-gradient(circle 300px at 70% 25%, black 0%, rgba(0,0,0,0.5) 30%, transparent 50%),
    radial-gradient(circle 250px at 20% 75%, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 35%, transparent 55%),
    radial-gradient(circle 200px at 85% 70%, rgba(0,0,0,0.4) 0%, transparent 45%);
  -webkit-mask-image:
    radial-gradient(ellipse 600px 500px at 35% 40%, black 5%, rgba(0,0,0,0.7) 20%, rgba(0,0,0,0.3) 40%, transparent 60%),
    radial-gradient(circle 300px at 70% 25%, black 0%, rgba(0,0,0,0.5) 30%, transparent 50%),
    radial-gradient(circle 250px at 20% 75%, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 35%, transparent 55%),
    radial-gradient(circle 200px at 85% 70%, rgba(0,0,0,0.4) 0%, transparent 45%);
  mask-composite: add;
  -webkit-mask-composite: source-over;
}

.constellation-purple-theme::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 40% 35%, rgba(168, 85, 247, 0.4) 0%, rgba(168, 85, 247, 0.2) 5%, transparent 15%),
    radial-gradient(circle at 60% 50%, rgba(192, 132, 250, 0.3) 0%, rgba(192, 132, 250, 0.15) 5%, transparent 12%),
    radial-gradient(circle at 30% 60%, rgba(139, 92, 246, 0.25) 0%, rgba(139, 92, 246, 0.12) 5%, transparent 10%),
    radial-gradient(circle at 70% 30%, rgba(244, 114, 182, 0.2) 0%, rgba(244, 114, 182, 0.08) 5%, transparent 8%);
  pointer-events: none;
  z-index: 2;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.constellation-purple-theme > * {
  position: relative;
  z-index: 3;
}

.constellation-purple-theme h1,
.constellation-purple-theme h2,
.constellation-purple-theme h3 {
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.constellation-purple-theme p,
.constellation-purple-theme li,
.constellation-purple-theme table,
.constellation-purple-theme th,
.constellation-purple-theme td {
  color: #e2e8f0 !important;
}

.constellation-purple-theme a {
  color: #d8b4fe !important;
  transition: color 0.2s ease;
}

.constellation-purple-theme a:hover {
  color: #f5e0ff !important;
}

.constellation-purple-theme strong {
  color: #ffffff !important;
}

.constellation-purple-theme pre {
  background: #020617 !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
}

/* Normalize article spacing on blog index + posts to override legacy Nextra defaults */
.constellation-purple-theme article,
.constellation-purple-theme main > article,
.constellation-purple-theme main :where(article) {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
}

.constellation-purple-theme header {
  background: transparent !important;
  border-bottom: none !important;
}

.constellation-purple-theme footer {
  border-top: none !important;
  color: #cbd5f5 !important;
}

/* Override inline code color for Nextra */
.constellation-purple-theme :not(pre) > code.nextra-code {
  color: #e0d0ff !important;
}

/* Refined table styling - maintains readability while showing constellation */
.constellation-purple-theme table {
  background: rgba(15, 10, 25, 0.6) !important;
}

.constellation-purple-theme thead {
  background: rgba(168, 85, 247, 0.15) !important;
}

.constellation-purple-theme tbody tr {
  background: transparent !important;
  transition: background 0.2s ease;
}

.constellation-purple-theme tbody tr:hover {
  background: rgba(168, 85, 247, 0.08) !important;
}

.constellation-purple-theme tbody tr:nth-child(odd) {
  background: rgba(168, 85, 247, 0.03) !important;
}

.constellation-purple-theme th,
.constellation-purple-theme td {
  background: transparent !important;
  border-color: rgba(168, 85, 247, 0.3) !important;
  padding: 12px 16px;
}
