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

:root {
  --green: #7fbf41;
  --green-dim: #4a7a2e;
  --green-dark: #243a18;
  --amber: #ffb454;
  --red: #ff4b4b;
  --gray: #5a6a55;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}

html,
body {
  height: 100%;
}

body {
  background: #000;
  color: #d7e8d0;
  font-family: var(--mono);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grid-floor {
  position: fixed;
  left: -20%;
  right: -20%;
  bottom: -12vh;
  height: 40vh;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(127, 191, 65, 0.12) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(0deg, rgba(127, 191, 65, 0.12) 0 2px, transparent 2px 60px);
  transform: perspective(300px) rotateX(60deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  animation: gridpulse 6s ease-in-out infinite;
}

@keyframes gridpulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

.boot {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 860px;
  padding: 18px 20px 0;
  font-size: 13px;
  color: var(--green);
  letter-spacing: 1px;
  min-height: 2em;
}

.boot .cursor {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

main {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 32px;
  width: 100%;
  max-width: 960px;
}

.glitch {
  position: relative;
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  letter-spacing: 0.08em;
  color: #eaffda;
  text-shadow: 0 0 18px rgba(127, 191, 65, 0.55);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.glitch::before {
  color: #ff3b3b;
  text-shadow: 0 0 8px rgba(255, 59, 59, 0.6);
  animation: glitchA 3.2s infinite steps(1);
}

.glitch::after {
  color: #3b8dff;
  text-shadow: 0 0 8px rgba(59, 141, 255, 0.6);
  animation: glitchB 2.7s infinite steps(1);
}

@keyframes glitchA {
  0%,
  86%,
  100% {
    transform: none;
    clip-path: inset(0 0 100% 0);
  }
  87% {
    transform: translate(-3px, 1px);
    clip-path: inset(10% 0 62% 0);
  }
  89% {
    transform: translate(3px, -1px);
    clip-path: inset(48% 0 20% 0);
  }
  91% {
    transform: none;
    clip-path: inset(0 0 100% 0);
  }
}

@keyframes glitchB {
  0%,
  78%,
  100% {
    transform: none;
    clip-path: inset(100% 0 0 0);
  }
  79% {
    transform: translate(3px, 1px);
    clip-path: inset(30% 0 46% 0);
  }
  81% {
    transform: translate(-3px, -1px);
    clip-path: inset(58% 0 8% 0);
  }
  83% {
    transform: none;
    clip-path: inset(100% 0 0 0);
  }
}

.tagline {
  margin-top: 10px;
  font-size: clamp(0.7rem, 2vw, 0.95rem);
  letter-spacing: 0.35em;
  color: var(--green-dim);
  text-align: center;
}

.chief-wrap {
  position: relative;
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.glow {
  position: absolute;
  inset: 6% -4%;
  background: radial-gradient(ellipse at center, rgba(127, 191, 65, 0.35), transparent 62%);
  filter: blur(6px);
  pointer-events: none;
  animation: breathe 5s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

#chief {
  position: relative;
  max-width: min(90vw, 640px);
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(127, 191, 65, 0.25), 0 12px 40px rgba(0, 0, 0, 0.8);
  animation: bob 7s ease-in-out infinite;
  cursor: pointer;
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.speech-bubble {
  position: relative;
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid var(--green-dim);
  background: #0a1206;
  color: #eaffda;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.speech-bubble::before {
  content: "\25B8 ";
  color: var(--green);
}

.bubble-pop {
  animation: pop 0.3s;
}

@keyframes pop {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

button,
.btn {
  margin-top: 26px;
  padding: 12px 34px;
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green-dim);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.3em;
  cursor: pointer;
  transition: all 0.15s;
}

button:hover,
.btn:hover {
  background: rgba(127, 191, 65, 0.12);
  box-shadow: 0 0 22px rgba(127, 191, 65, 0.4);
}

button:active,
.btn:active {
  transform: translateY(2px);
}

.terminal {
  margin-top: 30px;
  width: 100%;
  max-width: 640px;
  border: 1px solid var(--green-dark);
  background: rgba(4, 10, 3, 0.75);
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.log {
  flex: 1;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #a8c89a;
  overflow: hidden;
  min-height: 76px;
}

.log .in {
  color: var(--green);
}

.terminal-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--green-dark);
  font-size: 11.5px;
  color: var(--gray);
  letter-spacing: 0.12em;
}

.led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}

.led-green {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: ledblink 2.2s infinite;
}

.led-red {
  background: #6b2a2a;
  box-shadow: 0 0 6px rgba(255, 75, 75, 0.35);
}

@keyframes ledblink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.subnet {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 860px;
  padding: 26px 20px 18px;
}

.subnet ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  font-size: 12.5px;
  letter-spacing: 0.1em;
}

.subnet li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b9cdac;
}

.subnet em {
  font-style: normal;
  color: var(--gray);
}

.subnet li:has(.led-red) {
  color: #7a5f5f;
}

.copyright {
  margin-top: 18px;
  text-align: center;
  font-size: 10.5px;
  color: #3f4d3a;
  letter-spacing: 0.08em;
}

.sources {
  margin-top: 8px;
  text-align: center;
  font-size: 9px;
  color: #2e3a2a;
  letter-spacing: 0.1em;
}

.shake {
  animation: shake 0.9s;
}

@keyframes shake {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-8px, 3px);
  }
  40% {
    transform: translate(7px, -4px);
  }
  60% {
    transform: translate(-5px, -3px);
  }
  80% {
    transform: translate(6px, 3px);
  }
}

.poop {
  position: fixed;
  z-index: 90;
  font-size: 26px;
  pointer-events: none;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(340deg);
    opacity: 0.9;
  }
}

.stats {
  margin-top: 16px;
  width: 100%;
  max-width: 640px;
  border: 1px solid var(--green-dark);
  background: rgba(4, 10, 3, 0.75);
}

.stats-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--green-dark);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--gray);
}

.stats-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 22px;
  font-size: 11.5px;
  line-height: 1.9;
  padding: 10px 14px;
}

.stats-body .k {
  color: var(--gray);
}

.stats-body .v {
  color: var(--green);
  text-align: right;
  font-weight: bold;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .stats-body {
    grid-template-columns: 1fr;
  }
}

.noscript {
  position: relative;
  z-index: 10;
  padding: 20px;
  color: var(--amber);
  text-align: center;
}

.body-404 {
  justify-content: center;
}

.wrap-404 {
  text-align: center;
  padding: 0 20px;
}

.copy-404 {
  margin-top: 14px;
  color: #8fa883;
  font-size: 14px;
  line-height: 1.8;
}

@media (max-width: 640px) {
  .boot {
    font-size: 11px;
  }
  .subnet ul {
    gap: 10px;
  }
  .terminal {
    max-width: 100%;
  }
  .glitch {
    letter-spacing: 0.04em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  #chief,
  .glow {
    animation: none;
  }
}
