:root {
  --bg: #030604;
  --terminal: #061009;
  --terminal-2: #0a1a0e;
  --green: #4dff88;
  --green-soft: #9dffbd;
  --white: #f2fff6;
  --muted: #98b6a1;
  --error: #ff8f8f;
  --line: rgba(77, 255, 136, 0.22);
  --shadow: rgba(0, 255, 94, 0.18);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(circle at 18% 10%, rgba(77, 255, 136, 0.12), transparent 28rem),
    linear-gradient(135deg, #020403 0%, #06130a 52%, #010201 100%);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  line-height: 1.55;
}

.shutdown body {
  background: #000;
}

.shutdown .terminal {
  display: none;
}

a {
  color: var(--green-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(157, 255, 189, 0.5);
}

a:hover,
a:focus-visible {
  color: var(--white);
  border-bottom-color: var(--white);
}

.terminal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, calc(100% - 28px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--terminal);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.56), 0 0 34px var(--shadow);
  overflow: hidden;
}

.terminal__chrome {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 44px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: linear-gradient(180deg, #102016, #08120b);
}

.terminal__chrome p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.chrome-dots {
  display: flex;
  gap: 8px;
}

.chrome-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--shadow);
}

.chrome-dots span:nth-child(2) {
  opacity: 0.65;
}

.chrome-dots span:nth-child(3) {
  opacity: 0.35;
}

.terminal__screen {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  min-height: 0;
  padding: clamp(16px, 3vw, 34px);
  border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
}

.terminal__screen::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.032) 0,
    rgba(255, 255, 255, 0.032) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
}

.terminal-output {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  min-height: 0;
  padding-right: 8px;
  scrollbar-color: var(--green) transparent;
}

.terminal-entry {
  max-width: 92ch;
}

.terminal-command {
  margin: 0 0 10px;
  color: var(--white);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.command-output {
  margin: 0 0 28px;
  padding-left: clamp(12px, 2vw, 22px);
  border-left: 2px solid var(--line);
}

.command-output h1 {
  margin: 0 0 10px;
  color: var(--green);
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow: 0 0 20px var(--shadow);
}

.emulator-output {
  margin-bottom: 16px;
}

.command-output p {
  margin: 0 0 8px;
  color: var(--white);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.command-output p:empty {
  min-height: 1lh;
}

.prompt,
.path {
  font-weight: 700;
}

.prompt {
  color: var(--green);
}

.path {
  color: var(--green-soft);
}

.terminal-form {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.prompt-line {
  color: var(--muted);
  white-space: nowrap;
}

#terminal-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  color: var(--white);
  background: transparent;
  caret-color: var(--green);
  font: inherit;
}

#terminal-input::selection {
  color: var(--bg);
  background: var(--green);
}

.terminal:focus-within {
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.56), 0 0 42px rgba(77, 255, 136, 0.23);
}

@media (max-width: 680px) {
  .terminal {
    width: min(100% - 16px, 1120px);
    min-height: calc(100vh - 16px);
    margin: 8px auto;
  }

  .terminal-form {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .prompt-line {
    white-space: normal;
  }
}
