/* ============================================================
   ntrp — living terminal session
   Flat. Monospace. Type + blink + stagger. No SaaS chrome.
   ============================================================ */

:root {
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'SF Mono',
    Menlo, Consolas, monospace;

  --bg: #0a0a0a;
  --fg: #c8c8c8;
  --dim: #5a5a5a;
  --muted: #8a8a8a;
  --prompt: #33b074;
  --cmd: #e8e8e8;
  --out: #b0b0b0;
  --bad: #c44;
  --warn: #c9a227;
  --ok: #33b074;
  --border: #2a2a2a;
  --copy-bg: #1a1a1a;
  --copy-fg: #33b074;

  --color-bg: var(--bg);
  --color-text: var(--fg);
  --color-primary: var(--prompt);
  --font-body: var(--font-mono);
  --text-base: 14px;
  --radius-sm: 0;
  --transition-interactive: 0ms;
  --space-16: 16px;
}

html {
  background: var(--bg);
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #33b074;
  color: #0a0a0a;
}

:focus-visible {
  outline: 1px solid var(--prompt);
  outline-offset: 2px;
}

.screen {
  min-height: 100dvh;
  padding: 0;
  background: var(--bg);
}

.term {
  width: min(72ch, 100%);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
}

.beat.is-pending {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.beat.is-active,
.beat.is-done {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  height: auto;
  overflow: visible;
}

/* Scroll room after last beat so idle prompt can settle on screen */
.term-end {
  height: 16vh;
}

/* Default: enough scroll-arm room (mobile / coarse / unknown pointer) */
.spacer {
  height: clamp(18vh, 22vh, 28vh);
}

.spacer-lg {
  height: clamp(22vh, 26vh, 32vh);
}

/* SON-79: desktop Enter = tight REPL gaps, not page-jumps */
@media (pointer: fine) and (hover: hover) {
  .spacer {
    height: clamp(1.25rem, 4vh, 2.5rem);
  }

  .spacer-lg {
    height: clamp(1.75rem, 5vh, 3rem);
  }

  .term-end {
    height: 10vh;
  }
}

/* SON-78/79 desktop hint — dim after boot; Design may delete #enter-hint */
.enter-hint {
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.02em;
  margin: 0 0 0.15rem;
  user-select: none;
  pointer-events: none;
}

.enter-hint[hidden] {
  display: none !important;
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.55em;
}

.line.blank {
  min-height: 1.1em;
}

.prompt {
  color: var(--prompt);
  user-select: none;
}

.cmd {
  font-family: inherit;
  font-size: inherit;
  color: var(--cmd);
  background: none;
  font-weight: 500;
}

.out {
  color: var(--out);
}

.dim {
  color: var(--dim);
}

.muted {
  color: var(--muted);
}

/* Install row — paste-ready CTA */
#install {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin: 0.25rem 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  background: #0f0f0f;
}

#install .prompt {
  flex-shrink: 0;
}

#install .cmd {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-all;
}

.copy {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--copy-fg);
  background: var(--copy-bg);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}

.copy:hover {
  border-color: var(--prompt);
  color: var(--cmd);
}

.copy:active {
  background: #141414;
}

/* Vital signs — mono columns: name · score · note (no bullets/cards) */
.vital {
  display: grid;
  grid-template-columns: 14ch auto 2ch auto 1fr;
  column-gap: 0.55ch;
  align-items: baseline;
  white-space: nowrap;
}

.vital[hidden],
.vital-block[hidden],
.payoff[hidden],
.payoff-gap[hidden],
.idle-gap[hidden],
.idle-prompt[hidden],
.cursor[hidden] {
  display: none !important;
}

.vital.is-shown {
  display: grid;
}

.vital .name {
  color: var(--cmd);
}

.vital .sep {
  color: var(--dim);
  user-select: none;
}

.vital .score {
  color: var(--cmd);
  font-weight: 600;
  text-align: right;
}

.vital .note {
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
}

.bad { color: var(--bad); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }

.cursor {
  display: inline;
  color: var(--prompt);
  margin-left: 0.05ch;
  animation: blink 1.1s step-end infinite;
}

.cursor.idle-cursor {
  margin-left: 0.35ch;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (max-width: 600px) {
  .term {
    font-size: 12.5px;
    padding: 1.25rem 0.9rem 3rem;
  }

  #install {
    padding: 0.5rem 0.55rem;
  }

  .vital {
    grid-template-columns: 12ch auto 2ch auto minmax(0, 1fr);
    white-space: normal;
  }
}

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

  .beat.is-pending {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
}
