/* 404 PAGE */

:root {
  --black: #131313;
  --near-black: #070000;
  --deep-red: #3a0000;
  --blood-red: #8b0000;
  --bright-red: #d31313;
  --pale: #e7dfd4;
  --muted: #9a8f86;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--pale);
  background: #131313;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  background:
    radial-gradient(
      circle,
      rgba(180, 0, 0, 0.24) 0 1px,
      transparent 1.5px
    );
  background-size: 7px 7px;
  animation: noise-shift 0.45s steps(2) infinite;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0 3px,
      rgba(110, 0, 0, 0.16) 4px,
      transparent 5px
    );
}

.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(211, 19, 19, 0.08) 43%,
      rgba(211, 19, 19, 0.5) 50%,
      rgba(211, 19, 19, 0.08) 57%,
      transparent 100%
    );
  background-size: 100% 35vh;
  background-repeat: no-repeat;
  animation: scan 7.5s linear infinite;
}

.terminal {
  position: relative;
  z-index: 1;

  width: min(1000px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: clamp(2rem, 7vw, 5rem);

  text-align: center;
  text-transform: uppercase;

  transform: translateY(-75px);
}

.terminal::before {
  display: none;
}

.eyebrow {
  width: fit-content;
  margin: 0 auto 1rem;
  padding: 0.35rem 0.65rem;

  color: var(--pale);
  background: var(--blood-red);
  border: 2px solid #2b0000;

  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;

  box-shadow: 4px 4px 0 #000;
  transform: rotate(-1deg);

  animation: horror-flicker 8s steps(1) infinite;
}

h1 {
  margin: 0 0 1.5rem;
  color: var(--pale);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(3.5rem, 11vw, 8rem);
  line-height: 0.85;
  letter-spacing: -0.05em;
  text-shadow:
    6px 6px 0 #3a0000,
    0 0 18px rgba(211, 19, 19, 0.28);
}

.errorcode {
  display: inline-block;
  color: var(--bright-red);
  text-shadow:
    6px 6px 0 #1e0000,
    0 0 14px rgba(211, 19, 19, 0.55);
  animation: horror-flicker 6s steps(1) infinite;
}

.output {
  max-width: 760px;
  margin: 0 auto 1rem;

  color: var(--pale);
  line-height: 1.55;
  text-align: center;

  text-shadow:
    0 0 5px rgba(211, 19, 19, 0.18);
}

.output::before {
  content: "> ";
  color: var(--bright-red);
  font-weight: 900;
}

.final-message {
  margin-top: 1rem;
  color: var(--bright-red);
  font-style: italic;
  letter-spacing: 0.08em;
}

a {
  color: var(--bright-red);
  text-decoration: none;
  font-weight: 800;
  border-bottom: 1px solid rgba(211, 19, 19, 0.45);
  transition:
    color 0.15s ease,
    text-shadow 0.15s ease,
    border-color 0.15s ease;
}

a::before {
  content: "[";
  color: var(--muted);
}

a::after {
  content: "]";
  color: var(--muted);
}

a:hover,
a:focus-visible {
  color: #ffffff;
  border-color: var(--bright-red);
  text-shadow: 0 0 8px var(--bright-red);
}

@keyframes scan {
  0% {
    background-position: 0 -40vh;
  }

  100% {
    background-position: 0 140vh;
  }
}

@keyframes noise-shift {
  0% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-2px, 1px);
  }

  50% {
    transform: translate(1px, -1px);
  }

  75% {
    transform: translate(2px, 1px);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes horror-flicker {
  0%,
  17%,
  19%,
  52%,
  54%,
  100% {
    opacity: 1;
  }

  18%,
  53% {
    opacity: 0.42;
  }
}

@media (max-width: 680px) {
  .error-image {
    width: min(100%, 700px);
    margin-bottom: 1.4rem;
    pointer-events: none;
  }

  .terminal {
    width: 100%;
    padding: 2rem 1.4rem;
    transform: translateY(-40px);
  }

  h1 {
    font-size: clamp(3.2rem, 19vw, 5.5rem);
  }

  .output {
    font-size: 0.95rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .noise,
  .overlay::before,
  .eyebrow,
  .errorcode {
    animation: none !important;
  }
}
