/* ── font ──────────────────────────────────────────────────────────────── */
/* Variable-weight latin subset extracted from the original bundle. */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
}

/* ── base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #0c0d10;
}

body {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  -webkit-font-smoothing: antialiased;
  color: #d6dde2;
}

#root {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 4vw;
  cursor: text;
}

/* ── terminal window ───────────────────────────────────────────────────── */
.frame {
  width: min(820px, 100%);
  height: min(620px, 86dvh);
  background: #0a0b0e;
  border: 1px solid #1d2026;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .02);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid #1d2026;
  background: #0d0f13;
  font-size: 11px;
  color: #6a7380;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.titlebar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3f47;
  flex: none;
}

.titlebar .title {
  margin-left: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── output area ───────────────────────────────────────────────────────── */
.output {
  flex: 1;
  overflow: auto;
  padding: 18px 22px;
  font-size: 14px;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}

.banner { color: #5a8c5e; margin-bottom: 8px; }
.banner .sep { color: #3a4047; }

.line { white-space: pre-wrap; word-break: break-word; }

.l-in, .l-in-mode { color: #d6dde2; }
.l-out             { color: #a4b4be; }
.l-err             { color: #e87575; }
.l-sys             { color: #6a7380; }
.l-ok              { color: #7bc78a; }

.label-shell   { color: #5a8c5e; }
.label-contact { color: #e0a85a; }
.label-agent   { color: #d97757; }

.line a { color: #5a8c5e; text-decoration: none; border-bottom: 1px dotted #5a8c5e; }
.line a:hover { color: #d6dde2; border-bottom-color: #d6dde2; }

/* ── live prompt ───────────────────────────────────────────────────────── */
.promptline {
  display: flex;
  align-items: center;
  color: #d6dde2;
}

.promptline .label { margin-right: 8px; flex: none; }
.promptline .typed { white-space: pre-wrap; word-break: break-all; }

.cursor {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  background: #d6dde2;
  margin-left: 1px;
  transform: translateY(2px);
  animation: blink 1.04s steps(1) infinite;
}

@keyframes blink { 50% { background: transparent; } }

/* Hidden real input: invisible but focusable; 16px prevents iOS zoom-on-focus. */
#kbd {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 24px;
  bottom: 0;
  left: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
}

/* ── suggestion chips ──────────────────────────────────────────────────── */
.chips {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid #1d2026;
  background: #0d0f13;
  flex-wrap: wrap;
}

.chips button {
  font-family: inherit;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #1d2026;
  background: transparent;
  color: #7a8590;
  cursor: pointer;
  letter-spacing: .08em;
}

.chips button:hover, .chips button:focus-visible {
  color: #d6dde2;
  border-color: #3a4047;
  outline: none;
}

/* ── static fallback (pre-JS) ──────────────────────────────────────────── */
#fallback h1 {
  font-size: 14px;
  font-weight: 400;
  margin: 0 0 4px;
  color: #d6dde2;
}
#fallback h1::before { content: '$ whoami — '; color: #5a8c5e; }
#fallback p { margin: 0 0 10px; }
#fallback .l-out, #fallback .l-sys { display: block; }
#fallback .fallback-links { list-style: none; margin: 0; padding: 0; }
#fallback .fallback-links a { color: #5a8c5e; text-decoration: none; border-bottom: 1px dotted #5a8c5e; }
#fallback .fallback-links a:hover { color: #d6dde2; border-bottom-color: #d6dde2; }

/* ── mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  #root { padding: 0; }
  .frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .titlebar { padding: 10px 12px; font-size: 10px; }
  .output { padding: 14px 16px; font-size: 13px; }
}
