* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0a0a0a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  position: relative;
}

.background {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(120, 119, 198, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(74, 47, 189, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 20%,
      rgba(59, 130, 246, 0.2) 0%,
      transparent 50%
    );
  filter: blur(60px);
  animation: morphBackground 15s ease-in-out infinite;
}

@keyframes morphBackground {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
}

.container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
}

.glitch-wrapper {
  position: relative;
  display: inline-block;
}

.error-code {
  font-size: 160px;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 30px;
  letter-spacing: -5px;
  position: relative;
  animation: glitchPulse 3s ease-in-out infinite;
}

@keyframes glitchPulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.02);
    filter: brightness(1.2);
  }
}

.glitch-wrapper::before,
.glitch-wrapper::after {
  content: "404";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  font-size: 160px;
  font-weight: 900;
  letter-spacing: -5px;
  opacity: 0.8;
}

.glitch-wrapper::before {
  animation: glitch1 2.5s infinite;
  color: #667eea;
  z-index: -1;
}

.glitch-wrapper::after {
  animation: glitch2 3s infinite;
  color: #f093fb;
  z-index: -2;
}

@keyframes glitch1 {
  0%,
  100% {
    transform: translate(0);
  }
  33% {
    transform: translate(-3px, 3px);
  }
  66% {
    transform: translate(3px, -3px);
  }
}

@keyframes glitch2 {
  0%,
  100% {
    transform: translate(0);
  }
  33% {
    transform: translate(3px, -3px);
  }
  66% {
    transform: translate(-3px, 3px);
  }
}

h1 {
  font-size: 42px;
  margin-bottom: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -1px;
}

p {
  font-size: 18px;
  margin-bottom: 50px;
  color: #a0a0a0;
  line-height: 1.7;
  font-weight: 400;
}

.back-button {
  display: inline-block;
  padding: 18px 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s;
}

.back-button:hover::before {
  left: 100%;
}

.back-button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 50px rgba(102, 126, 234, 0.6);
}

.back-button:active {
  transform: translateY(-1px) scale(1.02);
}

.floating-elements {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floating-element {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(102, 126, 234, 0.6);
  border-radius: 50%;
  animation: float 8s infinite ease-in-out;
}

.floating-element:nth-child(1) {
  left: 10%;
  top: 20%;
  animation-delay: 0s;
}
.floating-element:nth-child(2) {
  left: 80%;
  top: 60%;
  animation-delay: 2s;
}
.floating-element:nth-child(3) {
  left: 30%;
  top: 80%;
  animation-delay: 4s;
}
.floating-element:nth-child(4) {
  left: 70%;
  top: 30%;
  animation-delay: 1s;
}
.floating-element:nth-child(5) {
  left: 50%;
  top: 10%;
  animation-delay: 3s;
}
.floating-element:nth-child(6) {
  left: 15%;
  top: 50%;
  animation-delay: 1.5s;
}
.floating-element:nth-child(7) {
  left: 85%;
  top: 25%;
  animation-delay: 3.5s;
}
.floating-element:nth-child(8) {
  left: 40%;
  top: 40%;
  animation-delay: 2.5s;
}
.floating-element:nth-child(9) {
  left: 65%;
  top: 70%;
  animation-delay: 0.5s;
}
.floating-element:nth-child(10) {
  left: 25%;
  top: 15%;
  animation-delay: 4.5s;
}
.floating-element:nth-child(11) {
  left: 90%;
  top: 45%;
  animation-delay: 1.2s;
}
.floating-element:nth-child(12) {
  left: 5%;
  top: 70%;
  animation-delay: 3.8s;
}
.floating-element:nth-child(13) {
  left: 55%;
  top: 85%;
  animation-delay: 2.2s;
}
.floating-element:nth-child(14) {
  left: 75%;
  top: 15%;
  animation-delay: 4.2s;
}
.floating-element:nth-child(15) {
  left: 35%;
  top: 60%;
  animation-delay: 0.8s;
}
.floating-element:nth-child(16) {
  left: 20%;
  top: 35%;
  animation-delay: 3.2s;
}
.floating-element:nth-child(17) {
  left: 95%;
  top: 80%;
  animation-delay: 1.8s;
}
.floating-element:nth-child(18) {
  left: 45%;
  top: 25%;
  animation-delay: 4.8s;
}
.floating-element:nth-child(19) {
  left: 60%;
  top: 55%;
  animation-delay: 0.3s;
}
.floating-element:nth-child(20) {
  left: 12%;
  top: 65%;
  animation-delay: 2.8s;
}
.floating-element:nth-child(21) {
  left: 78%;
  top: 42%;
  animation-delay: 1.4s;
}
.floating-element:nth-child(22) {
  left: 38%;
  top: 8%;
  animation-delay: 3.9s;
}
.floating-element:nth-child(23) {
  left: 88%;
  top: 90%;
  animation-delay: 0.9s;
}
.floating-element:nth-child(24) {
  left: 52%;
  top: 48%;
  animation-delay: 4.1s;
}
.floating-element:nth-child(25) {
  left: 8%;
  top: 38%;
  animation-delay: 2.1s;
}
.floating-element:nth-child(26) {
  left: 68%;
  top: 18%;
  animation-delay: 3.4s;
}
.floating-element:nth-child(27) {
  left: 42%;
  top: 75%;
  animation-delay: 1.1s;
}
.floating-element:nth-child(28) {
  left: 92%;
  top: 12%;
  animation-delay: 4.6s;
}
.floating-element:nth-child(29) {
  left: 28%;
  top: 92%;
  animation-delay: 0.6s;
}
.floating-element:nth-child(30) {
  left: 58%;
  top: 32%;
  animation-delay: 2.9s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-20px) translateX(10px);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-40px) translateX(-10px);
    opacity: 0.5;
  }
  75% {
    transform: translateY(-20px) translateX(10px);
    opacity: 0.8;
  }
}
