/* conn.w0zro.com — printed manual */

:root {
  --desk: #e7e3d8;
  --paper: #f2efe8;
  --ink: #1b1a16;
  --body: #33301f;
  --secondary: #514b3c;
  --muted: #7a745f;
  --rule: #cfc8b4;
  --chip: #e9e4d4;
  --figure-radius: 4px;
  --accent: #5A3FD9;
  --accent-dark: #B9A7FF;
  --term: #141310;
  --term-text: #d8d4c8;
  --serif: 'IBM Plex Serif', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--desk); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.accent { color: var(--accent); }

.sheet {
  max-width: 1120px;
  margin: 0 auto;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── nav ─────────────────────────────────────────────── */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 48px;
  border-bottom: 1px solid var(--ink);
}
.nav.sticky { position: sticky; top: 0; background: var(--paper); z-index: 5; }
.brand { font: 600 15px var(--mono); }
.nav-links { display: flex; gap: 26px; font: 500 12.5px var(--mono); }

/* ── command row ─────────────────────────────────────── */

.cmd {
  display: flex;
  border-radius: var(--figure-radius);
  align-items: center;
  gap: 13px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px;
  font: 400 12.5px var(--mono);
}
.cmd .prompt { opacity: 0.5; }
.cmd .dim { opacity: 0.5; }
.cmd code {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font: inherit;
  background: none;
  padding: 0;
}
.copy {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent-dark);
  cursor: pointer;
}

/* ── landing: hero ───────────────────────────────────── */

.hero { padding: 44px 48px 40px; border-bottom: 1px solid var(--ink); }
.hero h1 {
  font: 700 34px/1.15 var(--serif);
  letter-spacing: -0.015em;
  max-width: 560px;
  margin: 0;
}
.hero .sub {
  font-size: 15px;
  line-height: 1.65;
  color: var(--secondary);
  max-width: 520px;
  margin: 14px 0 0;
}
.hero .cmd { max-width: 720px; margin-top: 24px; }

/* ── landing: annotated figure ───────────────────────── */

.figure {
  display: grid;
  grid-template-columns: 600px 1fr;
  border-bottom: 1px solid var(--ink);
}
.figure-left { padding: 40px 48px 36px; border-right: 1px solid var(--rule); }
.tui { background: var(--term); padding: 20px 22px; border-radius: var(--figure-radius); }
.tui pre { margin: 0; font: 400 13.5px/1.65 var(--mono); color: var(--term-text); }
.t-num { color: var(--accent-dark); }
.t-sel { color: #F778BA; font-weight: 600; }
.t-run { color: #D29922; }
.t-dim { color: #666; }
.t-hint { color: #777; }
.fig-cap {
  font-style: italic;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.figure-notes {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.note { display: flex; gap: 13px; }
.note .marker { color: var(--accent); font: 400 14px var(--mono); flex: none; }
.note p { font-size: 14.5px; color: var(--body); line-height: 1.6; margin: 0; }

/* ── landing: keys ───────────────────────────────────── */

.keys {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 36px 48px 44px;
  gap: 32px;
  font: 400 13px var(--mono);
  border-bottom: 1px solid var(--ink);
}
.keyhead { color: var(--muted); letter-spacing: 0.12em; font-size: 11px; margin-bottom: 8px; }
.keyrow {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dotted var(--rule);
}
.keyrow:last-child { border-bottom: 0; }
.keyrow span:last-child { color: var(--secondary); }

/* ── footer ──────────────────────────────────────────── */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 48px;
  margin-top: auto;
  font: 400 11.5px var(--mono);
  color: var(--muted);
}
.footer.rule-top { border-top: 1px solid var(--ink); }
.foot-links { display: flex; gap: 22px; }

/* ── guide: shell ────────────────────────────────────── */

.guide {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: start;
}
.toc {
  position: sticky;
  top: 53px;
  align-self: start;
  padding: 40px 0 40px 48px;
  font: 400 13px/1.5 var(--mono);
  border-right: 1px solid var(--rule);
}
.toc-head { color: var(--muted); letter-spacing: 0.14em; font-size: 11px; margin-bottom: 14px; }
.toc-list { display: flex; flex-direction: column; gap: 9px; }
.toc .sec { color: var(--muted); }

/* ── guide: content ──────────────────────────────────── */

.doc { padding: 44px 56px 64px; max-width: 720px; min-width: 0; }
.doc h1 { font: 700 40px/1.1 var(--serif); letter-spacing: -0.02em; margin: 0 0 8px; }
.doc .intro { font-size: 16px; color: var(--secondary); margin: 0 0 8px; }
.doc section { border-top: 1px solid var(--ink); margin-top: 40px; padding-top: 26px; }
.doc section:first-of-type { margin-top: 36px; }
.kicker {
  font: 500 12px var(--mono);
  color: var(--accent);
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}
.doc h2 { font: 700 24px var(--serif); margin: 0 0 12px; }
.doc h3 { font: 600 17px var(--serif); margin: 20px 0 6px; }
.doc p { font-size: 15px; line-height: 1.7; color: var(--body); margin: 0 0 12px; }
.doc section > :last-child { margin-bottom: 0; }
.doc code { font-family: var(--mono); font-size: 13px; }
.doc code.chip { background: var(--chip); padding: 1px 5px; }
.doc .cmd { margin: 14px 0; }
.doc .cmd.lead { margin: 0 0 14px; }
.doc .cmd.flush { margin: 0; }
.doc .cmd code { font: inherit; }

/* code blocks */
.code-cap { font: 400 12px var(--mono); color: var(--muted); margin-bottom: 6px; }
.codeblock {
  background: var(--term);
  padding: 14px 18px;
  margin-bottom: 14px;
  border-radius: var(--figure-radius);
}
.codeblock pre { margin: 0; font: 400 13px/1.7 var(--mono); color: var(--term-text); }
.t-key { color: var(--accent-dark); }
.t-str { color: #a3c9a8; }

/* definition tables */
.def { font: 400 13px var(--mono); margin: 0 0 12px; }
.def-row {
  display: flex;
  gap: 18px;
  padding: 7px 0;
  border-bottom: 1px dotted var(--rule);
}
.def-row:last-child { border-bottom: 0; }
.def .term { flex: none; }
.def .term.w60 { width: 60px; }
.def .term.w170 { width: 170px; }
.def .desc { color: var(--secondary); font-family: var(--serif); font-size: 14px; }
.warn { color: #9A6700; }
.muted { color: var(--muted); }

/* config field table */
.fields { font-size: 14px; }
.fields-head, .fields-row {
  display: grid;
  grid-template-columns: 150px 130px 1fr;
  gap: 14px;
}
.fields-head {
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
  font: 500 11px var(--mono);
  color: var(--muted);
  letter-spacing: 0.1em;
}
.fields-row { padding: 8px 0; border-bottom: 1px dotted var(--rule); }
.fields-row:last-child { border-bottom: 0; }
.fields-row .f-name { font: 400 13px var(--mono); }
.fields-row .f-default { font: 400 12.5px var(--mono); color: var(--muted); }
.fields-row .f-desc { color: var(--secondary); line-height: 1.55; }

/* spacing overrides to match the reference */
.doc .mb0 { margin-bottom: 0; }
.doc .mb8 { margin-bottom: 8px; }
.doc .mb10 { margin-bottom: 10px; }
.doc .mb14 { margin-bottom: 14px; }
.doc .mb16 { margin-bottom: 16px; }

/* ── landing: hero demo ──────────────────────────────── */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  gap: 44px;
  align-items: center;
}
.hero-grid h1 { max-width: none; }
.hero-grid .sub { max-width: none; }
.hero-copy > :first-child { margin-top: 0; }

/* the window: conn's two columns, drawn the way conn draws them */
.scr {
  background: var(--term);
  color: #E6E6E6;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 28ch 1ch minmax(0, 1fr);
  font: 400 11px/1.62 var(--mono);
  border-radius: var(--figure-radius);
  overflow: hidden;
}
.scr pre {
  margin: 0;
  font: inherit;
  white-space: pre;
  overflow: hidden;
}
.scr .cell { display: inline-block; overflow: hidden; vertical-align: bottom; }
.scr .scr-div { width: 1px; justify-self: center; background: #30363D; }
.scr .scr-status { grid-column: 1 / -1; margin-top: 4px; white-space: pre; overflow: hidden; }
.scr .b { font-weight: 600; }

.c-fg     { color: #E6E6E6; }
.c-dim    { color: #5C6570; }
.c-label  { color: #8B949E; }
.c-rule   { color: #30363D; }
.c-sel    { color: #F778BA; font-weight: 600; }
.c-accent { color: #79C0FF; }
.c-good   { color: #3FB950; }
.c-attn   { color: #D29922; }
.c-urgent { color: #F778BA; font-weight: 600; }
.c-note   { color: #5C6570; font-style: italic; }
.c-place  { color: #B2DAFB; }
/* The status line: conn's name on a purple ground, then a mode chip in
   its color on a ground two steps off the terminal's, butted against it,
   the rest of the line washed one step off — one wash for every mode,
   the chips alone carrying the color, the way tmux draws it. The
   navigator is in ink: home is not a state. */
.chip-brand { color: #1A1E24; background: #B9A7FF; font-weight: 600; }
.chip-navigate { color: var(--term-text); background: #2B2F35; font-weight: 600; }
.chip-proc { color: #3FB950; background: #2B2F35; font-weight: 600; }
.chip-prefix { color: #D29922; background: #2B2F35; font-weight: 600; }
.wash-navigate, .wash-proc, .wash-prefix { background: #1A1E24; }

.c-cur    { background: #E6E6E6; color: var(--term); }

.demo-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 18px;
  margin-top: 10px;
}
.demo-cap {
  font-style: italic;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.demo-cap kbd {
  font: 500 11.5px var(--mono);
  font-style: normal;
  background: var(--chip);
  color: var(--ink);
  padding: 1px 5px;
  border-bottom: 1px solid var(--rule);
  animation: keyflash 620ms ease-out;
}
@keyframes keyflash {
  from { background: var(--accent); color: var(--paper); border-color: var(--accent); }
  to   { background: var(--chip); color: var(--ink); border-color: var(--rule); }
}
.demo-toggle {
  flex: none;
  background: none;
  border: 0;
  padding: 0;
  font: 400 11.5px var(--mono);
  color: var(--muted);
  cursor: pointer;
}
.demo-toggle:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .demo-cap kbd { animation: none; }
}

/* The window sits beside the copy only where both have room; under that it
   takes the sheet's full width, which is where the pane reads best anyway. */
@media (max-width: 1099px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
}
@media (max-width: 700px) {
  .scr { grid-template-columns: 28ch; font-size: 12px; }
  .scr-div, .scr-pane { display: none; }
}
