<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>404 Not Found</title>
  <style>
    body {
      margin: 1;
      padding: 10;
      background-color: black;
      color: white;
      font-family: 'Courier New', Courier, monospace;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: top;
      align-items: center;
      height: 100vh;
      text-align: center;
    }
    .matrix {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
    }
    canvas {
      display: block;
    }
    h1 {
      margin: 0.1rem 0;
    }
    h2 {
        margin: 1rem 0;
    }
    hx {
        margin: 15rem 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100vh;
        text-align: center;
        font-size: 2rem;
    }
    span {
        transition: color 0.9s ease-in-out;
    }
        
    .green-text {
      color: lime;
      font-weight: bold;
      font-family: 'Lucida Console', Monaco, monospace;
    }
  </style>
</head>
<body>
  <h1 id="animatedText">
      <span>L</span><span>M</span><span>N</span><span>x</span><span>9</span> <span>S</span><span>H</span><span>O</span><span>R</span><span>T</span> <span>U</span><span>R</span><span>L</span>
  </h1>
  <h1 id="animatedText">
      <span>4</span>0<span>4</span> <span>N</span><span>O<span><span>T</span> <span>F</span><span>O</span><span>U</span><span>N</span><span>D</span>
  </h1>
  <h2 id="animatedText">
      <span>No</span> <span>Internet</span> <span>Connection<span> <span>!</span>
  </h2>
  <hx id="animatedText">
      <span>D</span><span>e</span><span>v</span><span>e</span><span>l</span><span>o</span><span>p</span><span>e</span><span>d</span> <span>B</span><span>y</span> <span>L</span><span>M</span><span>N</span><span>x</span><span>9</span>
  </hx>
  <canvas class="matrix"></canvas>

  <script>
    const canvas = document.querySelector('.matrix');
    const ctx = canvas.getContext('2d');
    canvas.width = window.innerWidth;
    canvas.height = window.innerHeight;

    const letters = 'qwertyuioplkjhgfdsazxcvbnmABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
    const fontSize = 16;
    const columns = canvas.width / fontSize;

    const drops = Array(Math.floor(columns)).fill(1);

    let currentColor = '#0F0';
    const colors = ['#0F0', '#FF0000', '#00FFFF', '#FFFF00', '#FF00FF'];

    function drawMatrix() {
      ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
      ctx.fillRect(0, 0, canvas.width, canvas.height);
      ctx.fillStyle = currentColor;
      ctx.font = `${fontSize}px monospace`;

      drops.forEach((y, x) => {
        const text = letters[Math.floor(Math.random() * letters.length)];
        ctx.fillText(text, x * fontSize, y * fontSize);

        if (y * fontSize > canvas.height && Math.random() > 0.975) {
          drops[x] = 0;
        }
        drops[x]++;
      });
    }

    function changeColor() {
      currentColor = colors[Math.floor(Math.random() * colors.length)];
    }

    setInterval(drawMatrix, 40);
    setInterval(changeColor, 1); 

    window.addEventListener('resize', () => {
      canvas.width = window.innerWidth;
      canvas.height = window.innerHeight;
      drops.length = Math.floor(canvas.width / fontSize);
      drops.fill(1);
    });
    
    document.addEventListener("DOMContentLoaded", () => {
        const colors = ["red", "blue", "green", "orange", "purple", "cyan", "pink", "yellow"];
        const textSpans = document.querySelectorAll("#animatedText span");
        function changeColors() {
            textSpans.forEach((span, index) => {
                setTimeout(() => {
                    span.style.color = colors[Math.floor(Math.random() * colors.length)];
                }, index * 50);
            });
        }

    setInterval(changeColors, 1000);
    });
        
  </script>
</body>
</html>
