:root {
  --terminal-font: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  --bg: #050807;
  --bg-deep: #020403;
  --panel: rgba(5, 12, 9, 0.9);
  --fg: #d6ffe4;
  --muted: #80a891;
  --green: #65ff9a;
  --cyan: #65d9ff;
  --amber: #ffd166;
  --red: #ff6b6b;
  --glow: rgba(101, 255, 154, 0.42);
  --glow-soft: rgba(101, 217, 255, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--fg);
  font-family: var(--terminal-font);
  background:
    radial-gradient(circle at 18% 12%, rgba(40, 155, 94, 0.18), transparent 32rem),
    radial-gradient(circle at 78% 82%, rgba(40, 122, 155, 0.16), transparent 30rem),
    linear-gradient(145deg, #08110d 0%, #050807 42%, #020403 100%);
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  z-index: 2;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 50%, rgba(0, 0, 0, 0.18) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.018), rgba(0, 255, 98, 0.012), rgba(0, 140, 255, 0.018));
  background-size: 100% 4px, 6px 100%;
  mix-blend-mode: screen;
  opacity: 0.42;
}

body::after {
  z-index: 3;
  background:
    radial-gradient(ellipse at center, transparent 0%, transparent 58%, rgba(0, 0, 0, 0.42) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 18%, transparent 84%, rgba(255, 255, 255, 0.03));
}

::selection {
  color: #001e10;
  background: var(--green);
  text-shadow: none;
}

.terminal {
  --background: transparent;
  --color: var(--fg);
  --link-color: var(--cyan);
  --animation: terminal-glow;
  --glow: 1.35;
  --line-thickness: 2;
  --font: var(--terminal-font);
  --size: 1.05;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: clamp(18px, 3.2vw, 48px);
  color: var(--fg);
  background:
    linear-gradient(180deg, rgba(13, 29, 21, 0.82), rgba(4, 10, 7, 0.94)),
    var(--panel);
  border: 1px solid rgba(101, 255, 154, 0.2);
  box-shadow:
    inset 0 0 52px rgba(101, 255, 154, 0.055),
    inset 0 0 120px rgba(0, 0, 0, 0.62),
    0 0 42px rgba(101, 255, 154, 0.12);
  text-shadow:
    0 0 5px rgba(214, 255, 228, 0.22),
    0 0 18px var(--glow-soft);
}

.terminal::before {
  position: absolute;
  inset: clamp(8px, 1.4vw, 18px);
  z-index: -1;
  border: 1px solid rgba(101, 255, 154, 0.14);
  box-shadow: inset 0 0 24px rgba(101, 255, 154, 0.08);
  content: "";
}

.terminal,
.cmd,
.cmd div,
.terminal-output,
.terminal-output div {
  font-family: var(--terminal-font);
  letter-spacing: 0;
}

.terminal-output > div {
  margin-bottom: 0.22rem;
}

.terminal a,
.terminal .terminal-output a {
  color: var(--cyan);
  text-decoration: none;
  text-shadow: 0 0 8px rgba(101, 217, 255, 0.6);
  border-bottom: 1px solid rgba(101, 217, 255, 0.45);
}

.terminal a:hover,
.terminal .terminal-output a:hover {
  color: #ecfbff;
  border-bottom-color: currentColor;
  text-shadow: 0 0 14px rgba(101, 217, 255, 0.85);
}

.terminal .cmd {
  --color: var(--green);
  margin-top: 0.45rem;
  color: var(--green);
  text-shadow:
    0 0 7px var(--glow),
    0 0 18px rgba(101, 255, 154, 0.18);
}

.cmd .prompt,
.cmd-prompt,
.terminal .command {
  color: var(--green);
  font-weight: 600;
}

.terminal .cursor {
  color: #06140d;
  background: var(--green);
  box-shadow:
    0 0 8px var(--glow),
    0 0 18px rgba(101, 255, 154, 0.35);
}

.terminal .terminal-output [style*="red"],
.terminal .terminal-output .red {
  color: var(--red);
  text-shadow: 0 0 8px rgba(255, 107, 107, 0.42);
}

.terminal .terminal-output [style*="yellow"],
.terminal .terminal-output .yellow {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.35);
}

.terminal .terminal-output [style*="blue"],
.terminal .terminal-output .blue,
.terminal .terminal-output [style*="cyan"],
.terminal .terminal-output .cyan {
  color: var(--cyan);
  text-shadow: 0 0 9px rgba(101, 217, 255, 0.38);
}

.terminal-less {
  background: rgba(2, 6, 4, 0.96);
  border-top: 1px solid rgba(101, 255, 154, 0.22);
}

.autocomplete-menu {
  color: var(--fg);
  background: rgba(2, 8, 5, 0.96);
  border: 1px solid rgba(101, 255, 154, 0.32);
  box-shadow: 0 0 24px rgba(101, 255, 154, 0.16);
}

.autocomplete-menu li {
  color: var(--muted);
}

.autocomplete-menu li.selected {
  color: #04150c;
  background: var(--green);
  text-shadow: none;
}

@media (max-width: 720px) {
  body {
    font-size: 15px !important;
  }

  .terminal {
    --size: 0.92;
    min-height: 100svh;
    padding: 16px 12px;
    border-width: 0;
  }

  .terminal::before {
    inset: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    opacity: 0.22;
  }

  .terminal {
    --animation: terminal-underline;
  }
}
