:root {
  color-scheme: dark;
  --page-bg: #111516;
  --terminal-bg: #080a0b;
  --terminal-fg: #f0f1ee;
  --terminal-muted: #a9b2b0;
  --terminal-accent: #8bd3b1;
  --border: #35403e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--terminal-fg);
}

.page {
  width: min(100% - 36px, 960px);
  margin: 0 auto;
  padding: clamp(28px, 8vh, 82px) 0 30px;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

h1 { margin: 0; font-size: clamp(1.25rem, 4vw, 1.7rem); font-weight: 600; }
.header-mark, footer { color: var(--terminal-muted); font-size: .8rem; }

.terminal {
  border: 1px solid var(--border);
  background: var(--terminal-bg);
  min-height: min(68vh, 620px);
  display: flex;
  flex-direction: column;
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  color: var(--terminal-muted);
  font-size: .75rem;
}

.terminal-status { display: inline-flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--terminal-accent); }

.terminal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  overflow-wrap: anywhere;
  font-size: .9rem;
  line-height: 1.7;
  cursor: text;
}

p { margin: 0; }
.welcome { margin-bottom: 22px; }
.muted { color: var(--terminal-muted); }
.accent, .prompt, a { color: var(--terminal-accent); }
.error { color: #f1a8a8; }

.entry { margin-bottom: 18px; }
.entry-command { margin-bottom: 4px; }
.entry-output { white-space: pre-wrap; }
.entry-output a { text-decoration: underline; text-underline-offset: 3px; }
.entry-output a:hover { color: var(--terminal-fg); }
.entry-output a:focus-visible, input:focus-visible { outline: 2px solid var(--terminal-accent); outline-offset: 3px; }

#command-form { display: flex; align-items: baseline; gap: 10px; }
.prompt { white-space: nowrap; }
input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--terminal-fg);
  font: inherit;
  line-height: inherit;
  caret-color: var(--terminal-accent);
}

footer { margin-top: 18px; }

@media (max-width: 500px) {
  .page { width: min(100% - 24px, 960px); padding-top: 25px; }
  .header-mark { display: none; }
  .terminal { min-height: 72vh; }
  .terminal-body { padding: 18px 14px; font-size: .82rem; }
  #command-form { gap: 7px; }
}
