/* ── Terminal Theme — Refined ── */

@font-face {
  font-family: 'Commit Mono';
  src: url('/fonts/CommitMono-400-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Commit Mono';
  src: url('/fonts/CommitMono-700-Regular.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Light mode (default) */
:root {
  --text: #2A2D35;
  --bg: #F4F2EE;
  --dim: #8A8D95;
  --accent: #505560;
  --scrollbar: #D0CEC8;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #E0E0E0;
    --bg: #1A1D23;
    --dim: #7A8090;
    --accent: #B0B8C8;
    --scrollbar: #2a2d35;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Commit Mono', 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 15px;
  line-height: 1.7;
  overflow: hidden;
  letter-spacing: 0.01em;
}

#terminal {
  height: 100%;
  height: 100dvh;
  overflow-y: auto;
  padding: 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) var(--bg);
}

#terminal::-webkit-scrollbar { width: 5px; }
#terminal::-webkit-scrollbar-track { background: var(--bg); }
#terminal::-webkit-scrollbar-thumb { background: #2a2520; border-radius: 3px; }

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

/* Input area */
#input-line {
  white-space: pre;
}

#input-prefix { color: var(--dim); }

/* Thin blinking cursor */
.blink {
  animation: blink 1s step-end infinite;
  font-weight: 100;
}

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

/* Hidden real input — positioned inline so mobile scrolls to it */
#hidden-input {
  position: fixed;
  bottom: 0;
  left: 0;
  opacity: 0;
  width: 1px;
  height: 1px;
  border: none;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px; /* prevents iOS zoom on focus */
}

/* Selection */
::selection {
  background: var(--text);
  color: var(--bg);
}

/* Progress bar */
.progress-bar { color: var(--text); }

/* Copyable token */
.copyable {
  cursor: pointer;
  padding: 6px 10px;
  margin: 6px 0;
  border: 1px dashed var(--dim);
  display: inline-block;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.03em;
}
.copyable:hover {
  background: var(--text);
  color: var(--bg);
}
.copyable.copied {
  border-color: var(--accent);
  color: var(--accent);
}

/* Wordmark */
#wordmark {
  font-size: 28px;
  letter-spacing: 0.12em;
  margin-bottom: 32px;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}

#wordmark .flap {
  display: inline-block;
  min-width: 0.6em;
  text-align: center;
  transition: opacity 0.05s;
}

#wordmark .flap.space {
  min-width: 0.4em;
}

#wordmark .flap.settled {
  opacity: 1;
}

#wordmark .flap.flipping {
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
  html, body { font-size: 13px; }
  #terminal { padding: 16px; }
}
