:root {
  --bg: #0d1117;
  --fg: #e6edf3;
  --accent: #58a6ff;
  --muted: #8b949e;
  --border: #30363d;
  --code-bg: #161b22;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--fg); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; line-height: 1.6; }
header { border-bottom: 1px solid var(--border); padding: 1rem 2rem; }
header nav { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 2rem; }
.site-title { font-size: 1.4rem; font-weight: 700; color: var(--fg); text-decoration: none; }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
nav a { color: var(--muted); text-decoration: none; display: inline-block; padding: .35rem .25rem; white-space: nowrap; }
nav a:hover { color: var(--accent); }
nav a[aria-current="page"] { color: var(--fg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-toggle { display: none; }

/* Phones: the links collapse behind a menu button (only once JS has run). */
@media (max-width: 760px) {
  header { padding: .75rem 1rem; }
  header nav.js-nav { flex-wrap: wrap; justify-content: space-between; }
  .js-nav .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: none; color: var(--fg);
    border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  }
  .js-nav .nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 20px; height: 2px; background: currentColor; border-radius: 1px;
    position: relative; transition: transform .2s ease, background .2s ease;
  }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .js-nav.open .nav-toggle-bars { background: transparent; }
  .js-nav.open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .js-nav.open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .js-nav ul { display: none; flex-basis: 100%; flex-direction: column; gap: 0; padding-top: .5rem; }
  .js-nav.open ul { display: flex; }
  .js-nav ul a { display: block; padding: .75rem .25rem; font-size: 1.05rem; border-top: 1px solid var(--border); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { transition: none; }
}
main { max-width: 860px; margin: 3rem auto; padding: 0 2rem; }
h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 1.8rem; margin: 2rem 0 0.8rem; }
h3 { font-size: 1.3rem; margin: 1.5rem 0 0.5rem; }
p { margin-bottom: 1rem; color: var(--fg); }
a { color: var(--accent); }
pre, code { background: var(--code-bg); border-radius: 6px; font-family: 'Fira Code', Consolas, monospace; }
pre { padding: 1rem; overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); }
code { padding: 0.15em 0.4em; font-size: 0.9em; }
pre code { padding: 0; font-size: 1em; }
.hero { text-align: center; padding: 4rem 0 3rem; }
.hero h1 { font-size: 3.5rem; background: linear-gradient(135deg, #58a6ff, #79c0ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 600px; margin: 1rem auto; }
.install-box { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin: 2rem 0; }
.badges { display: flex; gap: 1rem; justify-content: center; margin: 1.5rem 0; flex-wrap: wrap; }
footer { text-align: center; padding: 2rem; border-top: 1px solid var(--border); color: var(--muted); margin-top: 4rem; }
footer a { color: var(--muted); }

/* ── Try it (in-browser TUI) ───────────────────────────────────────────── */
.try { position: relative; }
.try .lead { color: var(--muted); font-size: 1.1rem; }
.try-picker, .try-keys { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.try-picker button, .try-keys button, .try-ended button {
  background: var(--code-bg); color: var(--fg); border: 1px solid var(--border); border-radius: 6px;
  padding: .4rem .8rem; font: inherit; font-family: 'Fira Code', Consolas, monospace; font-size: .9rem; cursor: pointer;
}
.try-picker button:hover, .try-keys button:hover, .try-ended button:hover { border-color: var(--accent); color: var(--accent); }
.try-picker button.active { background: var(--accent); border-color: var(--accent); color: #0d1117; font-weight: 700; }
.try-keys .hot { border-color: var(--accent); color: var(--accent); }
.try-stage { position: relative; width: min(1100px, calc(100vw - 2rem)); left: 50%; transform: translateX(-50%); }
.try-term { height: min(70vh, 640px); min-height: 360px; background: #0d1117; border: 1px solid var(--border);
  border-radius: 8px; padding: 0; overflow: hidden; }
.try-term:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(88,166,255,.25); }
.try-status, .try-ended { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 1rem; color: var(--muted); background: rgba(13,17,23,.85); border-radius: 8px; }
.try-status[hidden], .try-ended[hidden] { display: none; }
.try-keys { max-width: 860px; }
.try-ideas { padding-left: 1.2rem; color: var(--fg); }
.try-ideas li { margin: .35rem 0; }
kbd { background: var(--code-bg); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: .05em .4em; font-size: max(.85em, 12px); }
.muted { color: var(--muted); font-size: .9rem; }
.cta { display: inline-block; background: var(--accent); color: #0d1117 !important; font-weight: 700; padding: .7rem 1.4rem;
  border-radius: 8px; text-decoration: none; margin: .5rem 0 1rem; }
.cta:hover { filter: brightness(1.1); }
.try-term .xterm-viewport { overflow-y: hidden !important; }
.try-term .xterm { height: 100%; }

/* Demo GIFs: width and height attributes reserve the space; scale to the column. */
.demo-img { display: block; width: 100%; max-width: 100%; height: auto; border-radius: 6px; }

/* Badge images: the height attribute plus auto width keep their space reserved. */
.badges img { height: 20px; width: auto; }

/* ── Installation page ──────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.install-picker { margin: 1.5rem 0 2rem; }
.os-switch { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.os-btn { background: var(--code-bg); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: .5rem 1rem; min-height: 40px; font: inherit; cursor: pointer; }
.os-btn:hover { border-color: var(--accent); }
.os-btn[aria-pressed="true"] { background: var(--accent); color: #0d1117; border-color: var(--accent); font-weight: 600; }
.os-detected { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.os-panel h2 { margin-top: 1rem; }
.channel { border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; margin: 1rem 0; background: var(--bg); }
.channel.recommended { border-color: var(--accent); }
.channel h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
.channel p { margin-bottom: .6rem; color: var(--muted); }
.channel .tag { margin-left: .5rem; padding: .1rem .5rem; border-radius: 999px; background: var(--accent); color: #0d1117; font-size: .75rem; font-weight: 700; vertical-align: middle; }
.cmd { position: relative; }
.cmd pre { margin: 0; padding-right: 5.5rem; }
.copy-btn { position: absolute; top: .5rem; right: .5rem; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; padding: .3rem .7rem; min-height: 32px; font: inherit; font-size: .85rem; cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.done { border-color: #3fb950; color: #3fb950; }
.os-btn:focus-visible, .copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Narrow screens: wrap long commands instead of hiding them under the Copy
   button, and put the button below the text. Copying uses the real text. */
@media (max-width: 600px) {
  .cmd pre { padding-right: 1rem; padding-bottom: 3rem; white-space: pre-wrap; overflow-wrap: anywhere; }
  .copy-btn { top: auto; bottom: .5rem; right: .5rem; }
}
