@import url("https://fonts.googleapis.com/css2?family=VT323&display=swap");

:root {
  /* Muted legacy-amber tone inspired by CRT phosphor */
  --amber: #d29a43;
  --screen: #0b0803;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  background: #060302;
  color: var(--amber);
  font-family: "VT323", "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.05em;
  padding: 32px;
}

.terminal-shell {
  width: min(900px, calc(100vw - 32px));
}

.crt-frame {
  position: relative;
  background: var(--screen);
  border-radius: 18px;
  padding: clamp(16px, 2.5vw, 28px);
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.02),
    0 0 60px rgba(0, 0, 0, 0.7),
    0 0 140px rgba(210, 154, 67, 0.12),
    0 0 220px rgba(210, 154, 67, 0.08);
  isolation: isolate;
  min-height: clamp(180px, 38vw, 240px);
}

.crt-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 70% at 50% 40%, rgba(246, 193, 109, 0.18), transparent 65%),
    radial-gradient(90% 90% at 50% 100%, rgba(0, 0, 0, 0.5), transparent 60%);
  opacity: 0.42;
  pointer-events: none;
}

.crt-frame::after {
  content: "";
  position: absolute;
  inset: -60px;
  background: repeating-linear-gradient(180deg, rgba(255, 210, 130, 0.04), rgba(255, 210, 130, 0.04) 1px, transparent 2px, transparent 4px);
  mix-blend-mode: soft-light;
  opacity: 0.28;
  pointer-events: none;
}

.crt-frame.crt-flicker::before,
.crt-frame.crt-flicker::after {
  animation: crtFlicker 0.22s ease-in-out;
}

.crt-overlay {
  position: absolute;
  inset: -10px;
  background: radial-gradient(40% 30% at 50% 10%, rgba(255, 255, 255, 0.08), transparent 60%);
  filter: blur(8px);
  opacity: 0.24;
  pointer-events: none;
}

.terminal-body {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 12px rgba(246, 193, 109, 0.36));
  text-shadow:
    0 0 8px rgba(246, 193, 109, 0.36),
    0 0 16px rgba(246, 193, 109, 0.32),
    0 0 32px rgba(246, 193, 109, 0.2);
}

.terminal-badge {
  color: var(--amber);
  opacity: 0.9;
  font-size: clamp(16px, 2vw, 20px);
  margin: 0 0 12px;
  letter-spacing: 0.08em;
}

.ascii-art {
  margin: 0;
  white-space: pre;
  color: var(--amber);
  font-size: clamp(8px, 0.9vw + 3px, 13px);
  line-height: 1.05;
  padding: 0;
}

.prompt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: clamp(16px, 2vw, 26px);
  font-size: clamp(16px, 2vw, 22px);
  letter-spacing: 0.12em;
  color: var(--amber);
  width: 100%;
  min-height: 48px;
}

.prompt-path {
  color: rgba(246, 193, 109, 0.8);
}

.prompt-symbol {
  font-weight: 700;
  color: var(--amber);
}

.prompt-cursor {
  display: none;
}

.prompt-output {
  display: inline;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--amber);
  letter-spacing: 0.14em;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.1;
  position: relative;
}

.prompt-output::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 1.1em;
  margin-left: 6px;
  background: var(--amber);
  box-shadow:
    0 0 10px rgba(246, 193, 109, 0.8),
    0 0 20px rgba(246, 193, 109, 0.45);
  animation: cursorFade 1.25s ease-in-out infinite;
  vertical-align: baseline;
}

.prompt-output.status-flash {
  animation: statusFlash 0.52s ease-out;
  text-shadow:
    0 0 10px rgba(246, 193, 109, 0.8),
    0 0 26px rgba(246, 193, 109, 0.45),
    0 0 38px rgba(246, 193, 109, 0.3);
}

@keyframes statusFlash {
  0% {
    opacity: 1;
    transform: translateY(-1px) scale(1.01);
  }
  60% {
    opacity: 0.92;
    transform: translateY(1px) scale(0.995);
  }
  100% {
    opacity: 0.78;
    transform: translateY(0) scale(1);
  }
}

.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 blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.1;
  }
}

@keyframes cursorFade {
  0% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.2;
  }
  100% {
    opacity: 0.9;
  }
}

@keyframes crtFlicker {
  0% {
    opacity: 0.7;
  }
  35% {
    opacity: 0.35;
  }
  65% {
    opacity: 0.8;
  }
  100% {
    opacity: 0.5;
  }
}
