* {
  font-family: "Jost";
}
body {
    background: black;
    overflow-x: hidden;
    
}
#MatrixCanvas {
    opacity: 0.5;
}
.block__second {
    display: flex;
    justify-content: center;
    align-items: center;
}
.block_fourth {
    height: 100lvh;
}

.swiper-slide {
  position: relative;
}
.title-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2; /* Ensure it stays above the rain effect */
}

.title-text {
  color: #c5fdc5;
  font-size: 60px;
  position: relative;
  text-shadow: 0 0 10px #d4f9d4, 0 0 4px #c1f3c1, 0 0 30px #bcffbc;
  z-index: 2; /* Ensure it stays above the rain effect */
  text-transform: uppercase;
  text-align: center;
}

.title-text::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  animation: glitch 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  transform: translate(-2px, -2px);
  color: rgb(118, 255, 118);
  text-shadow: 0 0 5px rgb(118, 255, 118), 0 0 15px rgb(118, 255, 118);
}

/* Glitch effect for the text */
@keyframes glitch {
  0%, 100% {
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(0);
  }
  33% {
    clip-path: polygon(0 0, 100% 0, 100% 15%, 0 15%);
    transform: translate(-5px, -5px);
  }
  66% {
    clip-path: polygon(0 85%, 100% 85%, 100% 100%, 0 100%);
    transform: translate(5px, 5px);
  }
}

.block__second, .block__reviews {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.block__second .bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #030503;
    box-shadow: inset 0px 0px 38px 200px #000;
}

.bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #000000;
}
.bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, #0a2a0a 0%, #020502 80%);
    opacity: 0.5;
    pointer-events: none;
}

.bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(0deg, rgb(255, 255, 255) 0px, rgb(255, 255, 255) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(90deg, rgb(255, 255, 255) 0px, rgb(255, 255, 255) 1px, transparent 1px, transparent 40px);
    opacity: 0.08;
    pointer-events: none;
}

@media (max-width: 768px) {
  .title-text {
    font-size: 45px;
  }
}

/* Фолбэк на время загрузки канваса */
#canvas-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #0a0f0a 0%, #050805 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    transition: opacity 0.5s ease;
}

.fallback-content {
  text-align: center;
}

.fallback-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #00ff41;
    border-top: 3px solid transparent;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.fallback-text {
    color: #00ff41;
    font-size: 14px;
    letter-spacing: 2px;
    animation: blink 1.5s step-end infinite;
}

.fallback-dots {
    display: inline-block;
    width: 40px;
    text-align: left;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#canvas-fallback.hide {
    opacity: 0;
    pointer-events: none;
}

.grain {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    pointer-event: none;
    z-index: 300;
    transform: translateZ(0);
    pointer-events: none;
    
    &:before {
      content: "";
      top: -10rem;
      left: -10rem;
      width: calc(100% + 20rem);
      height: calc(100% + 20rem);
      z-index: 9999;
      position: fixed;
      background-image: url(https://upload.wikimedia.org/wikipedia/commons/5/5c/Image_gaussian_noise_example.png);
      opacity: 0.10;
      pointer-events: none;
      -webkit-animation: noise 1s steps(2) infinite;
      animation: noise 1s steps(2) infinite;
    }

    @-webkit-keyframes noise {
      to { transform: translate3d(-7rem,0,0) }
    }

    @keyframes noise {
      0% { transform: translate3d(0,9rem,0) }
      10% { transform: translate3d(-1rem,-4rem,0) }
      20% { transform: translate3d(-8rem,2rem,0) }
      30% { transform: translate3d(9rem,-9rem,0) }
      40% { transform: translate3d(-2rem,7rem,0) }
      50% { transform: translate3d(-9rem,-4rem,0) }
      60% { transform: translate3d(2rem,6rem,0) }
      70% { transform: translate3d(7rem,-8rem,0) }
      80% { transform: translate3d(-9rem,1rem,0) }
      90% { transform: translate3d(6rem,-5rem,0) }
      to { transform: translate3d(-7rem,0,0) }
    }
  }