@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  color-scheme: dark;
  --phosphor: #71ff83;
  --phosphor-dim: rgba(113, 255, 131, 0.52);
  --screen: #020603;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #000;
  font-family: "IBM Plex Mono", "Courier New", monospace;
}

.terminal {
  position: relative;
  display: grid;
  width: 100vw;
  min-height: 100svh;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(24, 80, 37, 0.12), transparent 50%),
    var(--screen);
}

.terminal::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 3px,
      rgba(0, 0, 0, 0.28) 4px
    );
  opacity: 0.65;
}

.terminal::after {
  position: absolute;
  z-index: 3;
  inset: -15%;
  pointer-events: none;
  content: "";
  background: radial-gradient(
    ellipse at center,
    transparent 35%,
    rgba(0, 0, 0, 0.42) 68%,
    rgba(0, 0, 0, 0.96) 100%
  );
}

.terminal__glow {
  position: absolute;
  width: 55vw;
  height: 35vh;
  border-radius: 50%;
  background: rgba(50, 255, 90, 0.035);
  filter: blur(60px);
}

.terminal__screen {
  position: relative;
  z-index: 1;
  width: min(920px, 86vw);
  min-height: 250px;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  animation: screen-flicker 8s linear infinite;
}

.terminal__status {
  position: absolute;
  top: -0.5rem;
  right: 0;
  margin: 0;
  color: var(--phosphor-dim);
  font-size: clamp(0.58rem, 1vw, 0.7rem);
  letter-spacing: 0.18em;
}

.terminal__output {
  color: var(--phosphor);
  font-size: clamp(1.05rem, 2.8vw, 2rem);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.025em;
  text-shadow:
    0 0 5px rgba(113, 255, 131, 0.9),
    0 0 18px rgba(73, 255, 103, 0.38);
}

#typed-text {
  white-space: pre-wrap;
}

.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.12em;
  margin-left: 0.15em;
  vertical-align: -0.17em;
  background: var(--phosphor);
  box-shadow:
    0 0 7px rgba(113, 255, 131, 0.95),
    0 0 18px rgba(73, 255, 103, 0.55);
  animation: cursor-blink 0.85s steps(1, end) infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes cursor-blink {
  0%,
  46% {
    opacity: 1;
  }

  47%,
  100% {
    opacity: 0;
  }
}

@keyframes screen-flicker {
  0%,
  18%,
  22%,
  63%,
  100% {
    opacity: 1;
  }

  20% {
    opacity: 0.94;
  }

  64% {
    opacity: 0.97;
  }
}

@media (max-width: 600px) {
  .terminal__screen {
    width: 92vw;
    min-height: 230px;
    padding-inline: 0.75rem;
  }

  .terminal__status {
    right: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .terminal__screen {
    animation: none;
  }

  .cursor {
    animation-duration: 1.4s;
  }
}
