:root {
  --bg: #050607;
  --panel: #0a0d0f;
  --panel2: #11161a;
  --text: #f4f4f4;
  --muted: #9ea4aa;
  --green: #68d94f;
  --blue: #74c7ff;
  --pink: #ff9aaa;
  --line: rgba(255,255,255,.08);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(104,217,79,.08), transparent 32%),
    radial-gradient(circle at 80% 40%, rgba(116,199,255,.06), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.terminal-window {
  width: min(1420px, 100%);
  height: min(900px, calc(100vh - 48px));
  background: linear-gradient(180deg, #0b0d0f, #050607 55%, #050607);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 90px rgba(0,0,0,.65), inset 0 1px rgba(255,255,255,.04);
  overflow: hidden;
}

.titlebar {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  background: linear-gradient(180deg, #171b1f, #0e1114);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }
.red { background: #ff5f57; }
.yellow { background: #ffbd2e; }
.green { background: #28c840; }
.title { margin-left: 12px; color: var(--muted); font-size: 13px; }

.screen {
  height: calc(100% - 42px);
  display: grid;
  grid-template-columns: 1.2fr .85fr;
  gap: 36px;
  padding: clamp(24px, 4vw, 56px);
  overflow: hidden;
}

.left { min-width: 0; min-height: 0; }

/* Fixed-height terminal viewport. New lines scroll inside it, so the whole window does not jump. */
.terminal-body {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(104,217,79,.35) transparent;
}

.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(104,217,79,.35); border-radius: 99px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }

.terminal {
  display: inline;
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.62;
  font-size: clamp(15px, 1.25vw, 20px);
  text-shadow: 0 0 12px rgba(255,255,255,.06);
}

.cmd { color: var(--green); }
.link { color: var(--blue); text-decoration: none; }
.link:hover { text-decoration: underline; }
.ok { color: var(--green); }
.dim { color: var(--muted); }

.cursor {
  display: inline-block;
  width: .65em;
  height: 1.15em;
  background: var(--green);
  vertical-align: -0.2em;
  animation: blink 1s steps(1) infinite;
  box-shadow: 0 0 12px rgba(104,217,79,.6);
}

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

.right {
  align-self: start;
  padding-top: 70px;
  color: var(--text);
  overflow: hidden;
}

.bubble, .pig {
  margin: 0;
  font-size: clamp(15px, 1.25vw, 20px);
  line-height: 1.2;
}

.bubble span { color: var(--green); }
.pig { color: var(--pink); margin-top: 10px; filter: drop-shadow(0 0 12px rgba(255,154,170,.12)); }

@media (max-width: 900px) {
  body { padding: 10px; overflow: auto; }
  .terminal-window { height: calc(100vh - 20px); border-radius: 12px; }
  .screen { grid-template-columns: 1fr; gap: 10px; padding: 24px 18px; overflow: auto; }
  .terminal-body { height: 55vh; }
  .right { padding-top: 10px; }
  .title { display: none; }
}
