<!-- Script Animasi Home "Security Protocol Version" -->
<style>
  body.security-reset {
    animation: terminalFlash 0.3s ease-in-out;
  }

  @keyframes terminalFlash {
    0% { background-color: #ff0000; }
    100% { background-color: initial; }
  }

  .security-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: #d4d4d4;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    visibility: hidden;
    text-align: center;
  }

  .spinner {
    border: 3px solid #333;
    border-top: 3px solid #0078d4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
  }

  @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
</style>

<div id="security-layer" class="security-overlay">
  <div class="spinner"></div>
  <h2 style="color: #fff; margin-bottom: 10px;">Unauthorized Access Detected</h2>
  <p id="log-text" style="font-size: 14px; opacity: 0.8;">Verifying credentials...</p>
</div>

<script>
  if (document.referrer && document.referrer !== window.location.href) {
    const layer = document.getElementById('security-layer');
    const log = document.getElementById('log-text');
    
    layer.style.visibility = 'visible';
    document.body.classList.add('security-reset');

    const logs = [
      "Analyzing IP signature...",
      "Firewall breach attempt logged.",
      "Redirecting to secure gateway...",
      "Session restored to root directory."
    ];

    let step = 0;
    const process = setInterval(() => {
      log.innerText = logs[step];
      step++;
      if (step >= logs.length) {
        clearInterval(process);
        setTimeout(() => {
          layer.style.visibility = 'hidden';
        }, 600);
      }
    }, 500);
  }
</script>