/*
  Modern terminal (Ghostty / iTerm feel).
  One monospace face, soft ANSI palette, hierarchy from color + weight + blank lines,
  the way real CLI output does it. Content capped at ~80 columns.
*/
:root {
  --bg: #0d0e11;
  --panel: #17191e;
  --bar: #202329;
  --border: #2c3038;
  --fg: #d7dae0;
  --dim: #8c929d;
  --green: #a6d189;
  --blue: #8caaee;
  --yellow: #e5c890;
  --cyan: #81c8be;
  --magenta: #f4b8e4;
  --red: #e78284;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.7 var(--mono); font-variant-ligatures: none;
  display: flex; padding: 24px 16px; height: 100vh; height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ---- window ---- */
.term {
  margin: 0 auto; width: 100%; min-width: 0; min-height: 0; height: 100%; max-width: 940px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .02) inset;
}
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bar); border-bottom: 1px solid var(--border); }
.dots { display: flex; gap: 8px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; display: block; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.title { flex: 1; text-align: center; color: var(--dim); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langs { display: flex; gap: 4px; }
.langs button {
  font: inherit; font-size: .75rem; line-height: 1.5; padding: 2px 8px; color: var(--dim); background: transparent;
  border: 1px solid var(--border); border-radius: 4px; cursor: pointer;
}
.langs button[aria-pressed="true"] { color: var(--panel); background: var(--green); border-color: var(--green); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* ---- screen ---- */
.screen { position: relative; flex: 1; min-width: 0; min-height: 0; overflow-y: auto; padding: 22px 28px 28px; outline: none; }
.block { margin: 0; }
.cmdline { margin: 0 0 10px; word-break: break-word; }
.u { color: var(--green); font-weight: 700; }
.p { color: var(--blue); font-weight: 700; }
.out { max-width: 80ch; }
.out p { margin: 0 0 1em; }
.out p:last-child { margin-bottom: 0; }
.dim { color: var(--dim); } .r { color: var(--red); } .g { color: var(--green); } .y { color: var(--yellow); }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- banner ---- */
.ascii { overflow-x: auto; max-width: 100%; margin: 6px 0 14px; color: var(--green); font-size: 14px; line-height: 1.2; white-space: pre; }
.ascii.narrow { display: none; }
.who-line { font-size: 1em; font-weight: 400; line-height: inherit; margin: 0 0 18px; }
.who-line .y { font-weight: 700; }

/* ---- cv.md ---- */
.h2 { font-size: 1em; line-height: inherit; color: var(--yellow); font-weight: 700; margin: 28px 0 12px !important; }
.out > .h2:first-child { margin-top: 0 !important; }
.job { margin: 0 0 22px; }
.org { color: var(--blue); font-weight: 700; margin: 0 !important; }
.role { margin: 10px 0 0 2ch; }
.role-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 2ch; margin: 0 0 4px !important; }
.role-h b { font-weight: 700; }
.out ul { margin: 0 0 6px; padding: 0; list-style: none; }
.out li { position: relative; padding-left: 2ch; margin: 0 0 4px; }
.out li::before { content: "-"; position: absolute; left: 0; color: var(--dim); }

/* key/value tables: education, languages, help, whoami */
.kv { display: grid; grid-template-columns: 14ch minmax(0, 1fr); gap: 2px 2ch; }
.kv > .k { color: var(--dim); }
.kv.cmds > .k, .kv.who > .k { color: var(--yellow); }

/* ---- ls -l ---- */
.lsdir { margin: 0 !important; }
.ls { display: grid; grid-template-columns: 10ch 11ch 5ch minmax(0, 1fr); gap: 0 2ch; margin: 0 0 18px; }
.ls > span { padding: 1px 0; }
.ls .perm { color: var(--dim); }
.ls .lang { color: var(--magenta); }
.ls .star { color: var(--yellow); text-align: right; }
.ls a { color: var(--blue); font-weight: 700; }
.ls .desc { color: var(--dim); }

/* ---- prompt: pinned under the output ---- */
.prompt-line { position: relative; display: flex; align-items: center; flex: none; padding: 10px 28px 12px; border-top: 1px solid var(--border); }
.prompt { white-space: nowrap; }
#cmd { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--fg); font: inherit; caret-color: var(--fg); }
@media (prefers-reduced-motion: no-preference) { #cmd { caret-shape: block; } }
.tip { margin-top: 18px !important; font-size: .85rem; }

/* ---- completion menu (zsh menu-select) ---- */
.menu {
  position: absolute; left: 20px; right: 20px; bottom: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none;
  max-height: min(50vh, 18em); overflow-y: auto; background: var(--bar); border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .35); z-index: 2;
}
.menu[hidden] { display: none; }
.menu li { display: grid; grid-template-columns: minmax(14ch, max-content) minmax(0, 1fr); gap: 3ch; padding: 1px 1.5ch; cursor: pointer; }
.menu .mk { color: var(--fg); }
.menu .md { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu li:hover { background: rgba(255, 255, 255, .04); }
.menu li[aria-selected="true"] { background: var(--green); }
.menu li[aria-selected="true"] .mk, .menu li[aria-selected="true"] .md { color: var(--panel); }
.menu li[aria-selected="true"] .mk { font-weight: 700; }

/* ---- tmux-style status bar ---- */
.status {
  flex: none; display: flex; align-items: center; gap: 1ch; padding: 0 1ch;
  background: var(--green); color: var(--panel); font-size: .82rem; line-height: 1.9; white-space: nowrap;
}
.sess { font-weight: 700; }
.tabs { flex: 1; min-width: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { font: inherit; color: inherit; background: none; border: 0; padding: 0 1ch; cursor: pointer; }
.tabs button:hover { background: rgba(0, 0, 0, .12); }
.tabs button[aria-current="true"] { background: var(--panel); color: var(--green); font-weight: 700; }
.tabs button:focus-visible { outline: 2px solid var(--panel); outline-offset: -2px; }
.clock { font-weight: 700; }

.screen::-webkit-scrollbar { width: 10px; } .screen::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }

@media (max-width: 720px) {
  .ascii.wide { display: none; } .ascii.narrow { display: block; }
}
@media (max-width: 640px) {
  body { padding: 0; font-size: 14px; }
  .term { border-radius: 0; border: 0; }
  .prompt-line { padding: 8px 16px 10px; }
  .menu { left: 8px; right: 8px; }
  .sess, .clock { display: none; }
  .screen { padding: 16px 16px 24px; }
  .dots { display: none; }
  .ascii { font-size: 12px; }
  .ls { grid-template-columns: 11ch 4ch minmax(0, 1fr); }
  .ls .perm { display: none; }
  .kv { grid-template-columns: 11ch minmax(0, 1fr); }
  /* skills: key on its own line, value full width */
  .kv.skills { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv.skills > .k { color: var(--yellow); margin-top: 10px; }
  .kv.skills > .k:first-child { margin-top: 0; }
  .role { margin-left: 0; }
}

/* ---- clickable commands (help, ls) ---- */
.cmd {
  font: inherit; color: var(--green); background: none; border: 0; padding: 0; cursor: pointer;
  text-align: left; text-decoration: underline; text-decoration-color: rgba(166, 209, 137, .35); text-underline-offset: 3px;
}
.cmd:hover { text-decoration-color: currentColor; }
.cmd:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.files { display: flex; flex-wrap: wrap; gap: 0 3ch; }
.files .cmd[data-cmd^="ls"] { color: var(--blue); font-weight: 700; text-decoration-color: rgba(140, 170, 238, .35); }
.kv.cmds { margin-top: 4px; }
@media (min-width: 800px) { .kv.cmds { grid-template-columns: 14ch minmax(0, 1fr) 14ch minmax(0, 1fr); } }
