/**
 * ===================== ADVANCED BLOCKCHAIN BACKGROUND =====================
 *
 * @format
 */

@import url(./base.css);

.bc-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(
    circle at top,
    #3a82b0 0,
    #1a6692 55%,
    #011420 100%
  );
}

/* subtle hex / grid overlay */
.bc-bg::before {
  content: "";
  position: absolute;
  inset: -40px;
  background-image:
    radial-gradient(
      circle at 1px 1px,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 0
    ),
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size:
    22px 22px,
    40px 40px,
    40px 40px;
  mix-blend-mode: soft-light;
  opacity: 0.35;
  animation: bcBackgroundDrift 40s linear infinite;
}

/* noise texture on top */
.bc-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  mix-blend-mode: soft-light;
}
.universe {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, #1e2945, transparent 40%),
    radial-gradient(circle at 80% 70%, #0a0f1b, transparent 45%), #0a0f1b;
  overflow: hidden;
  z-index: -2;
}

.stars {
  position: absolute;
  width: 200%;
  height: 200%;
  background-repeat: repeat;
  animation: starDrift linear infinite;
}

.stars--small {
  background-image:
    radial-gradient(2px 2px at 40px 60px, white, transparent),
    radial-gradient(1px 1px at 120px 140px, white, transparent),
    radial-gradient(1px 1px at 200px 40px, white, transparent);
  animation-duration: 160s;
  opacity: 0.5;
}
.stars--medium {
  background-image:
    radial-gradient(2px 2px at 100px 120px, white, transparent),
    radial-gradient(2px 2px at 300px 80px, white, transparent);
  animation-duration: 110s;
  opacity: 0.7;
}
@keyframes starDrift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-400px, -200px);
  }
}

/* floating data tiles */
.bc-tiles {
  position: absolute;
  inset: 0;
  opacity: 2;
}

.bc-tile {
  position: absolute;
  top: var(--y);
  left: var(--x);
  padding: 10px 18px;
  font-family: "Lexend", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.8);
  background: linear-gradient(
    130deg,
    rgba(255, 255, 255, 0.07),
    rgba(0, 0, 0, 0)
  );
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  backdrop-filter: blur(3px);
  box-shadow:
    0 0 20px rgba(255, 102, 0, 0.18),
    0 0 12px rgba(28, 147, 28, 0.18),
    inset 0 0 12px rgba(255, 255, 255, 0.07);
  transform-origin: center;
  animation:
    bcTileFloat var(--d) ease-in-out infinite,
    bcTilePulse 6s ease-in-out infinite alternate;
}

/* tile floating: slightly organic movement */

@keyframes bcTileFloat {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  25% {
    transform: translate3d(8px, -14px, 0) rotate(2deg);
  }
  50% {
    transform: translate3d(-4px, -24px, 0) rotate(-1deg);
  }
  75% {
    transform: translate3d(-10px, -10px, 0) rotate(1deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

/* light glow breathing */

@keyframes bcTilePulse {
  0% {
    box-shadow:
      0 0 14px rgba(255, 102, 0, 0.15),
      0 0 10px rgba(28, 147, 28, 0.12);
    opacity: 0.4;
  }
  50% {
    box-shadow:
      0 0 24px rgba(255, 102, 0, 0.35),
      0 0 18px rgba(28, 147, 28, 0.28);
    opacity: 0.95;
  }
  100% {
    box-shadow:
      0 0 16px rgba(255, 102, 0, 0.22),
      0 0 12px rgba(28, 147, 28, 0.18);
    opacity: 0.6;
  }
}

/* slow drift of the whole grid */

@keyframes bcBackgroundDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-60px, -120px, 0);
  }
}

/* chain movement left -> right */

@keyframes bcChainScroll {
  0% {
    transform: translateX(0) skewY(-8deg);
  }
  100% {
    transform: translateX(60%) skewY(-8deg);
  }
}

/* ===================== RESPONSIVE BLOCKCHAIN BACKGROUND ===================== */

/* Tablets */

@media (max-width: 992px) {
  .bc-bg::before {
    opacity: 0.25;
    background-size:
      18px 18px,
      32px 32px,
      32px 32px;
  }
  .bc-chain {
    opacity: 0.25 !important;
    height: 45px;
    background-size: 120px 100%;
    filter: drop-shadow(0 0 10px rgba(255, 102, 0, 0.3));
  }
  .bc-tile {
    font-size: 10px;
    padding: 8px 14px;
  }
}

/* Mobile: small screens */

@media (max-width: 768px) {
  .bc-bg {
    background: radial-gradient(
      circle at top,
      #0b0b0b 0,
      #010101 60%,
      #000 100%
    );
  }
  .bc-bg::before {
    opacity: 0.18;
    background-size:
      14px 14px,
      24px 24px,
      24px 24px;
    inset: -20px;
    animation-duration: 65s;
    /* slow for battery */
  }
  .bc-chain {
    height: 35px;
    opacity: 0.18 !important;
    transform: skewY(-4deg);
    background-size: 90px 100%;
  }
  .bc-chain--one {
    top: 15%;
    animation-duration: 38s;
  }
  .bc-chain--two {
    top: 48%;
    animation-duration: 50s;
  }
  .bc-chain--three {
    top: 82%;
    animation-duration: 44s;
  }
  .bc-tile {
    font-size: 8px;
    padding: 6px 12px;
    letter-spacing: 0.1em;
    opacity: 0.75;
    backdrop-filter: blur(2px);
    box-shadow:
      0 0 10px rgba(255, 102, 0, 0.15),
      0 0 8px rgba(28, 147, 28, 0.15),
      inset 0 0 10px rgba(255, 255, 255, 0.04);
    animation-duration: calc(var(--d) * 1.4);
    /* slower float */
  }
}

/* Very small phones */

@media (max-width: 480px) {
  .bc-bg::before {
    opacity: 0.15;
    background-size:
      12px 12px,
      20px 20px,
      20px 20px;
  }
  .bc-chain {
    opacity: 0.14 !important;
    height: 30px;
  }
  .bc-tile {
    font-size: 7px;
    padding: 5px 10px;
  }
  /* Optional: hide floating tiles if too busy */
  /* .bc-tiles { display: none; } */
}

/* Ultra-small displays / low-power mode (optional) */

@media (max-width: 360px) {
  .bc-chain {
    display: none;
    /* fully remove chains */
  }
  .bc-tiles {
    opacity: 0.5;
  }
}
