.nf-wrap {
  width: 100%;
  margin: var(--gf-gap-y) 0 calc(var(--gf-gap-y) * 1.6);
}

@media (max-width: 600px) {
  .nf-wrap {
    margin: var(--gf-gap-y) 0 calc(var(--gf-gap-y) * 1.4);
  }
}

.nf-card {
  position: relative;
  padding: 24px 24px 22px;
  overflow: hidden;
  border-radius: var(--gf-radius-xl);
}

@media (max-width: 640px) {
  .nf-card {
    border-radius: var(--gf-radius-lg);
    padding: 18px 16px 16px;
  }
}

.nf-hero {
  position: relative;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(109,94,247,0.18), transparent 60%),
    radial-gradient(120% 120% at 100% 0%, rgba(143,92,255,0.18), transparent 60%),
    radial-gradient(120% 120% at 50% 100%, rgba(42,47,107,0.16), transparent 60%);
}

@media (max-width: 640px) {
  .nf-hero {
    height: 140px;
  }
}

.nf-404 {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 128px;
  letter-spacing: 4px;
  color: #6d5ef7;
  text-shadow: 0 2px 12px rgba(109,94,247,0.25);
  mix-blend-mode: multiply;
  user-select: none;
}

@media (max-width: 640px) {
  .nf-404 {
    font-size: 92px;
  }
}

.nf-404::before,
.nf-404::after {
  content: attr(data-glitch);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: blur(0.5px);
}

.nf-404::before {
  color: #8f5cff;
  clip-path: polygon(0 0, 100% 0, 100% 48%, 0 52%);
  animation: glitchTop 3s infinite linear;
}

.nf-404::after {
  color: #2a2f6b;
  clip-path: polygon(0 48%, 100% 52%, 100% 100%, 0 100%);
  animation: glitchBottom 3s infinite linear;
}

@keyframes glitchTop {
  0% { transform: translate(0); }
  20% { transform: translate(2px,-1px); }
  40% { transform: translate(-2px,1px); }
  60% { transform: translate(1px,0); }
  80% { transform: translate(-1px,1px); }
  100% { transform: translate(0); }
}

@keyframes glitchBottom {
  0% { transform: translate(0); }
  20% { transform: translate(-2px,1px); }
  40% { transform: translate(1px,-1px); }
  60% { transform: translate(-1px,0); }
  80% { transform: translate(2px,-1px); }
  100% { transform: translate(0); }
}

.nf-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.nf-particles span {
  position: absolute;
  left: var(--x);
  top: -16px;
  width: 2px;
  height: 10px;
  background: rgba(109,94,247,0.55);
  border-radius: 2px;
  animation: fall var(--d) linear infinite;
  opacity: var(--t);
}

@keyframes fall {
  0% {
    transform: translateY(-20px) scaleY(0.6);
  }
  100% {
    transform: translateY(200%) scaleY(1);
  }
}

/* Текст 404 */

.nf-title {
  margin: 18px 0 8px;
  font-size: 26px;
  line-height: 1.25;
}

@media (max-width: 768px) {
  .nf-title {
    font-size: 22px;
  }
}

@media (max-width: 479px) {
  .nf-title {
    font-size: 20px;
  }
}

.nf-text {
  color: #656B77;
  margin: 0 0 16px;
  font-size: 15px;
}

@media (max-width: 768px) {
  .nf-text {
    font-size: 14px;
  }
}

@media (max-width: 479px) {
  .nf-text {
    font-size: 13px;
  }
}

/* Кнопки */

.nf-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}

.nf-actions .btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  text-decoration: none;
}

.nf-actions .btn:hover,
.nf-actions .btn:focus {
  text-decoration: none;
}

@media (max-width: 768px) {
  .nf-actions .btn {
    font-size: 13px;
    padding: 9px 16px;
  }
}

@media (max-width: 479px) {
  .nf-actions {
    gap: 10px;
  }

  .nf-actions .btn {
    font-size: 13px;
    padding: 8px 14px;
  }
}

/* Старый блок поиска пока не удаляю из CSS — разметки уже нет */
.nf-search {
  display: none;
}
