/* Live homepage brain hero + blue-grid atmosphere (from home-bluegrid mock) */

/* Soft cooler grid so brain blue (#3b9eff) blends with page */
body.v1.home-bluegrid {
  background: #0b1016;
}
body.v1.home-bluegrid .bg-grid {
  background-image:
    radial-gradient(ellipse 80% 50% at 18% -8%, rgba(59, 158, 255, 0.11), transparent 56%),
    radial-gradient(ellipse 55% 38% at 92% 22%, rgba(45, 212, 191, 0.07), transparent 52%),
    radial-gradient(ellipse 45% 35% at 55% 42%, rgba(59, 158, 255, 0.045), transparent 60%),
    linear-gradient(rgba(42, 62, 82, 0.36) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 62, 82, 0.36) 1px, transparent 1px),
    linear-gradient(180deg, #0b1016 0%, #091018 100%);
  background-size: auto, auto, auto, 48px 48px, 48px 48px, auto;
  animation: din-grid-drift-blue 56s linear infinite;
}
@keyframes din-grid-drift-blue {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 0 0, 0 0, 0 0, 48px 48px, -48px 24px, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  body.v1.home-bluegrid .bg-grid { animation: none; }
}

.be-visual {
  position: relative;
  width: 100%;
  max-width: 504px;
  margin: 0 auto;
  aspect-ratio: 1;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  overflow: visible;
  isolation: isolate;
}
.be-visual--md { max-width: 504px; }
.be-visual--hero {
  max-width: none;
  width: min(100%, 520px);
  margin: 0 0 0 auto;
}

/* Soft ambient bloom — large, diffuse, NOT a plate */
.be-visual::before {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 52% 48% at 50% 48%, rgba(59, 158, 255, 0.16), transparent 72%),
    radial-gradient(ellipse 38% 34% at 44% 54%, rgba(45, 212, 191, 0.09), transparent 68%);
  filter: blur(18px);
  opacity: 0.9;
  -webkit-mask-image: radial-gradient(ellipse 70% 68% at 50% 48%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 68% at 50% 48%, #000 20%, transparent 78%);
  animation: be-bloom-breathe 7.5s ease-in-out infinite;
}
@keyframes be-bloom-breathe {
  0%, 100% { opacity: 0.82; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  .be-visual::before { animation: none; }
}

.be-visual__brain {
  position: absolute;
  inset: 4%;
  z-index: 1;
  width: 92%;
  height: 92%;
  object-fit: cover;
  object-position: center 46%;
  pointer-events: none;
  mix-blend-mode: screen;
  -webkit-mask-image:
    radial-gradient(ellipse 62% 60% at 50% 48%,
      #000 28%,
      rgba(0, 0, 0, 0.95) 42%,
      rgba(0, 0, 0, 0.72) 55%,
      rgba(0, 0, 0, 0.4) 68%,
      rgba(0, 0, 0, 0.14) 80%,
      rgba(0, 0, 0, 0.04) 90%,
      transparent 100%);
  mask-image:
    radial-gradient(ellipse 62% 60% at 50% 48%,
      #000 28%,
      rgba(0, 0, 0, 0.95) 42%,
      rgba(0, 0, 0, 0.72) 55%,
      rgba(0, 0, 0, 0.4) 68%,
      rgba(0, 0, 0, 0.14) 80%,
      rgba(0, 0, 0, 0.04) 90%,
      transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  filter: saturate(1.06) contrast(1.03) brightness(1.02);
}

.be-visual canvas.neural-chains,
.be-visual canvas.neural-sparks {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  pointer-events: none;
  -webkit-mask-image:
    radial-gradient(ellipse 64% 62% at 50% 48%,
      #000 30%,
      rgba(0, 0, 0, 0.88) 52%,
      rgba(0, 0, 0, 0.4) 72%,
      rgba(0, 0, 0, 0.08) 88%,
      transparent 100%);
  mask-image:
    radial-gradient(ellipse 64% 62% at 50% 48%,
      #000 30%,
      rgba(0, 0, 0, 0.88) 52%,
      rgba(0, 0, 0, 0.4) 72%,
      rgba(0, 0, 0, 0.08) 88%,
      transparent 100%);
}
.be-visual canvas.neural-chains { z-index: 3; }
.be-visual canvas.neural-sparks { z-index: 2; mix-blend-mode: screen; }

/* Light theme welcome: hide blue brain (+ bloom) — keep lightning + crypto icons.
   Dark theme unchanged (full brain + sparks + chains). */
body.theme-light .welcome-brain.be-visual::before,
body.theme-light .welcome-brain .be-visual__brain {
  display: none !important;
}

/* Homepage hero: brain in RIGHT column */
.hero.hero--brain {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 1.25rem 1.75rem;
  align-items: center;
  max-width: 1180px;
}
.hero.hero--brain .hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.hero.hero--brain .hero-copy .version-tag { margin-bottom: 0; }
.hero.hero--brain .hero-brain {
  align-self: center;
  justify-self: end;
  width: 100%;
}
.hero.hero--brain .hero-visual {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  padding-top: 1.5rem;
}

@media (max-width: 900px) {
  .hero.hero--brain {
    grid-template-columns: 1fr;
  }
  .hero.hero--brain .hero-brain {
    justify-self: center;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
}
