:root {
  --bg: #0d1117;
  --fg: #c9d1d9;
  --dim: #6e7681;
  --accent: #f7931a; /* bitcoin orange */
  --green: #7ee787;
  --blue: #79c0ff;
  --red: #ff7b72;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.45;
}

#terminal {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 40vh;
  cursor: text;
}

#output pre,
#output .line {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}

#output pre.art {
  white-space: pre;
  overflow-x: auto;
  line-height: 1.15;
}

/* Scale big ASCII art down on narrow screens instead of scrolling sideways */
#output pre.art { font-size: clamp(7px, 2.1vw, 15px); }

/* ASCII QR codes: '#' = light module. Two ~0.6em chars per module, so a
   1.2em line height keeps modules square. Bold + white for scan contrast. */
#output pre.qr {
  margin: 8px 0;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  font-size: clamp(4px, 1.1vw, 8px);
  white-space: pre;
  overflow: hidden;
}

/* Bitkey art palette */
.art-o { color: #8b949e; }              /* device outline */
.art-f { color: var(--fg); }            /* screen + text */
.art-b { color: #fff; font-weight: 700; }
.art-d { color: var(--dim); }
.art-a { color: var(--accent); }
.art-g { color: var(--green); }
.art-s { color: #21262d; }              /* drop shadow */

/* ---------- top bar: GUI nav + mode toggle ---------- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 16px;
  background: var(--bg);
}
body:not(.gui) #topbar { position: static; padding-bottom: 0; }

#gui-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-right: auto; }
#gui-nav[hidden] { display: none; }
#gui-nav a {
  color: var(--dim);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
#gui-nav a:hover { color: var(--fg); }
#gui-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

#mode-toggle {
  font: inherit;
  font-size: 13px;
  color: var(--dim);
  background: transparent;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
#mode-toggle:hover { color: var(--fg); border-color: var(--dim); }

body.gui #topbar { border-bottom: 1px solid #21262d; }
body.gui #terminal { cursor: auto; padding-top: 20px; }
body.gui #prompt-line { display: none; }
body.gui #output .line { line-height: 1.6; }

#prompt-line { display: flex; gap: 0.6ch; align-items: baseline; }

.prompt { white-space: nowrap; }
.user { color: var(--green); }
.host { color: var(--accent); }
.path { color: var(--blue); }

#cmd {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  caret-color: var(--accent);
  padding: 0;
}

.dim { color: var(--dim); }
.accent { color: var(--accent); }
.green { color: var(--green); }
.blue { color: var(--blue); }
.red { color: var(--red); }
.bold { font-weight: 700; }

#output a { color: var(--blue); }
#output a:hover { color: var(--accent); }

.cmd-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.cmd-link:hover { text-decoration-style: solid; }

.gap { height: 0.8em; }

/* Resume bullets: hanging indent so wrapped lines align after the "- " */
#output .line.bullet { padding-left: 6ch; text-indent: -2ch; margin: 2px 0; }

@media (max-width: 600px) {
  html, body { font-size: 13px; }
  #gui-nav { gap: 4px 14px; }
  #mode-toggle .label { display: none; }
}
