.nf {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0 120px;
  overflow: hidden;
}

.nf__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 60% 50% at 50% 30%,
      rgba(0, 167, 111, 0.06) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 40% 40% at 80% 20%,
      rgba(0, 196, 140, 0.04) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 40% 40% at 20% 80%,
      rgba(0, 167, 111, 0.03) 0%,
      transparent 60%
    );
  pointer-events: none;
}

.nf__inner {
  position: relative;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Animated receipt/paper illustration */
.nf__visual {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 48px;
}

.nf__receipt {
  position: absolute;
  inset: 20px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  box-shadow:
    0 20px 50px -12px rgba(16, 24, 40, 0.12),
    0 8px 20px -8px rgba(16, 24, 40, 0.08);
  padding: 24px 20px;
  transform: rotate(-6deg);
  animation: receiptWobble 6s ease-in-out infinite;
}

.nf__receipt::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 20px;
  right: 20px;
  height: 14px;
  background: repeating-linear-gradient(
    90deg,
    #fff 0 6px,
    transparent 6px 12px
  );
  border-radius: 0 0 2px 2px;
}

.nf__receipt-line {
  height: 6px;
  border-radius: 3px;
  background: var(--gray-200);
  margin-bottom: 10px;
}
.nf__receipt-line:nth-child(1) {
  width: 70%;
}
.nf__receipt-line:nth-child(2) {
  width: 92%;
}
.nf__receipt-line:nth-child(3) {
  width: 60%;
}
.nf__receipt-line:nth-child(4) {
  width: 85%;
}
.nf__receipt-line--accent {
  background: var(--brand-500);
  opacity: 0.35;
}

.nf__stamp {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-14deg);
  padding: 8px 16px;
  border: 2.5px solid #ef4444;
  border-radius: 6px;
  color: #ef4444;
  font-size: 0.8125rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(254, 242, 242, 0.6);
  animation: stampIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
  white-space: nowrap;
}

.nf__magnify {
  position: absolute;
  bottom: -10px;
  right: -6px;
  width: 88px;
  height: 88px;
  animation: magnifyFloat 5s ease-in-out infinite;
}

@keyframes receiptWobble {
  0%,
  100% {
    transform: rotate(-6deg) translateY(0);
  }
  50% {
    transform: rotate(-4deg) translateY(-6px);
  }
}

@keyframes stampIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-30deg) scale(1.6);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-14deg) scale(1);
  }
}

@keyframes magnifyFloat {
  0%,
  100% {
    transform: translate(0, 0) rotate(8deg);
  }
  50% {
    transform: translate(-8px, -4px) rotate(-6deg);
  }
}

/* 404 number */
.nf__number {
  font-size: clamp(4rem, 10vw, 6.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.nf__number span {
  background: linear-gradient(
    180deg,
    var(--brand-500) 0%,
    var(--brand-700) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nf__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.nf__sub {
  font-size: 1.0625rem;
  color: var(--gray-600);
  margin-bottom: 40px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

.nf__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.nf__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}

.nf__link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  text-align: left;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nf__link-card:hover {
  border-color: var(--brand-500);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(0, 167, 111, 0.15);
}

.nf__link-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nf__link-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nf__link-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
}

.nf__link-sub {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Fade-up animations */
.nf__visual,
.nf__number,
.nf__title,
.nf__sub,
.nf__actions,
.nf__links {
  opacity: 0;
  animation: nfFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.nf__visual {
  animation-delay: 0.05s;
}
.nf__number {
  animation-delay: 0.15s;
}
.nf__title {
  animation-delay: 0.25s;
}
.nf__sub {
  animation-delay: 0.35s;
}
.nf__actions {
  animation-delay: 0.45s;
}
.nf__links {
  animation-delay: 0.55s;
}

@keyframes nfFade {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .nf {
    padding: 60px 0 80px;
  }
  .nf__visual {
    width: 180px;
    height: 180px;
    margin-bottom: 32px;
  }
  .nf__magnify {
    width: 70px;
    height: 70px;
  }
}
