/* ============================================================================
 * mmux.org — v3 stylesheet
 *
 * Flat, sharp, terminal-honest. No glows, no gradients, minimal radius. The
 * palette is tmux's: a green accent (the status-bar green) over neutral
 * terminal greys; ANSI-ish semantic colors live only inside the window. The
 * centerpiece is the scroll-through demo — a sticky terminal that scrubs scenes.
 *
 * Map: tokens → reset → primitives → nav → hero → demo (sticky scrub) →
 *      #tw window → syntax tones → features → how → install → footer →
 *      responsive → reduced-motion/focus → polish.
 * ========================================================================== */

/* ============================================================================
 * design tokens
 * ========================================================================== */
:root {
  /* base surfaces — neutral terminal dark, flat */
  --bg:        #0d0e10;
  --bg-2:      #131416;
  --surface:   #17181b;
  --surface-2: #1d1f22;
  --surface-3: #26282c;
  --border:    #2a2d31;
  --border-2:  #3a3e44;
  /* the box-drawing line color: ratatui's DarkGray, the unfocused pane border. A
   * touch brighter than --border-2 so the "lines around the sections" actually read. */
  --tui-border: #4a4f56;

  /* ink */
  --text:   #d7d9dc;
  --text-2: #abafb5;
  --muted:  #7c8087;
  --faint:  #4f535a;

  /* accent — tmux green. used sparingly: status bar, active row, links, cursor */
  --green:        #6e9e72;   /* muted sage — subtle, not neon */
  --green-bright: #8bbf8f;   /* legible muted-green text on dark */
  --green-dim:    #4f7355;
  --accent:       #6e9e72;
  --accent-soft:  rgba(110, 158, 114, .13);

  /* terminal ANSI-ish semantic (de-neoned, classic) — inside the window only */
  --red:     #cf8080;
  --yellow:  #c6a96c;
  --blue:    #7ea7c9;
  --magenta: #a98cc4;
  --cyan:    #6fa8ad;

  --running:   var(--green);
  --attention: var(--red);
  --warn:      var(--yellow);
  --info:      var(--blue);
  --add:       var(--green);
  --del:       var(--red);
  --ai:        var(--magenta);

  /* syntax token tones (terminal content) */
  --tok-kw:      #a98cc4;
  --tok-fn:      #7ea7c9;
  --tok-str:     #8aa978;
  --tok-num:     #c6a96c;
  --tok-comment: #7c8490;
  --tok-type:    #7ea7c9;
  --tok-path:    #88b0cf;
  --tok-op:      #abafb5;

  /* depth — one subtle shadow, no glows */
  --shadow: 0 12px 38px -22px rgba(0, 0, 0, .9);
  --ring:   0 0 0 2px var(--bg), 0 0 0 4px var(--green);

  /* shape — sharp */
  --radius:    4px;
  --radius-sm: 3px;

  /* type — system mono for everything, plus one self-hosted pixel display face
   * (Departure Mono, OFL — see fonts/) for the wordmark and headings only. The
   * terminal window NEVER uses the display face: real terminals are system mono. */
  --font: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, monospace;
  --font-display: "Departure Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* scale */
  --page-max: 1120px;
  --measure: 60ch;
}

/* the display face — a pixel mono that matches the squared-off brand mark.
 * Single weight (400): pixel fonts have no true bold, so headings set in it
 * must not ask for one (faux-bold smears the pixels). */
@font-face {
  font-family: "Departure Mono";
  src: url("fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================================
 * reset & base
 * ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--green-bright); }

button { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

[aria-hidden="true"] { user-select: none; }

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--green);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

section {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

/* ============================================================================
 * primitives — kicker, accent text, headings, buttons, copy
 * ========================================================================== */

/* lowercase mono eyebrow above each section (e.g. "// what you get") */
.kicker,
.hero-kicker,
.caption-kicker {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--green);
  margin: 0 0 1rem;
}
.hero-kicker { margin-bottom: .7rem; }

/* accent text fragment — a solid green word inside a heading */
.grad {
  color: var(--green-bright);
}
.brand,
.hero-wordmark,
.footer-brand {
  color: var(--text);
}

.section-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  font-weight: 400;            /* the pixel face is single-weight — no faux bold */
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 2.5rem;
}

/* buttons — flat, no glow ------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.2rem;
  font-size: .92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-brand {
  color: #08130a;
  background: var(--green);
  border-color: var(--green);
}
.btn-brand:hover {
  color: #08130a;
  background: var(--green-bright);
  border-color: var(--green-bright);
}
.btn-ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--border-2);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
  background: var(--surface);
}

/* inline copy chip in install rows */
.copy {
  flex: none;
  padding: .32rem .65rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.copy:hover {
  color: var(--text);
  border-color: var(--border-2);
  background: var(--surface-2);
}
.copy--copied {
  color: var(--green-bright);
  border-color: var(--green-dim);
  background: var(--accent-soft);
}

/* ============================================================================
 * nav — slim, sticky, opaque (no blur theatrics)
 * ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 14, 16, .85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0;
}
.brand-mark {
  display: block;
  width: 1.3em;
  height: 1.3em;
  flex: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-left: auto;
  font-size: .9rem;
  color: var(--muted);
}
.nav-links a { color: var(--text-2); }
.nav-links a:hover { color: var(--green-bright); }
.nav-sep { color: var(--faint); }

/* ============================================================================
 * hero — compact, so the demo is reached fast
 * ========================================================================== */
#hero {
  text-align: center;
  padding-top: 2.5rem;    /* compact — the demo terminal should peek above the fold */
  padding-bottom: 1rem;
}
/* the brand tile at hero scale — crisp pixels, no smoothing */
.hero-mark {
  display: block;
  width: clamp(60px, 8.5vw, 92px);
  height: auto;
  margin: 0 auto 1.2rem;
}
.hero-wordmark {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 7.2vw, 4.6rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  margin: 0 0 1.2rem;
}
.hero-caret {
  color: var(--green);
  margin-left: .04em;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.hero-tagline {
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 600;
  color: var(--text);
  margin: 0 auto .85rem;
  max-width: 34ch;
}
.hero-sub {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 56ch;
  margin: 0 auto 1.9rem;
}

/* the single install row — flat bordered box, no glow */
.hero-install {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  padding: .6rem .6rem .6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 100%;
}
.hero-install-prompt { color: var(--green); font-weight: 700; }
.hero-install-cmd {
  font-size: .96rem;
  color: var(--text);
  white-space: nowrap;
  overflow-x: auto;
}
/* quiet backlink under the hero command: the alternative install methods live in #install */
.hero-install-alt {
  display: block;
  margin: .8rem auto 0;
  font-size: .82rem;
  color: var(--text-2);
  text-decoration: none;
}
.hero-install-alt:hover { color: var(--green-bright); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin: 1.5rem auto 0;
}
.hero-chip {
  font-size: .8rem;
  color: var(--text-2);
  padding: .3rem .7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.scroll-cue {
  margin: .9rem 0 0;
  font-size: .82rem;
  color: var(--muted);
  animation: cue-bob 2s ease-in-out infinite;
}
@keyframes cue-bob {
  0%, 100% { transform: translateY(0); opacity: .7; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* ============================================================================
 * the demo — THE centerpiece. A TALL track so the sticky stage scrubs scenes.
 * #demo height drives how much scroll each scene gets (~95vh/scene over 9).
 * The driver (tui.js) maps demo scroll-progress → scene index.
 * ========================================================================== */
#demo {
  /* CRITICAL: the track must be much taller than the 100vh sticky stage,
   * otherwise progress is always 0 and the walkthrough never scrubs.
   * Sized for 10 weighted scenes (~85vh of travel each). */
  min-height: 950vh;
  padding: 0 1.5rem;
  max-width: 1240px;          /* the demo is the star — a touch wider than the rest */
  margin: 0 auto;
}
.demo-stage {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 4.5rem 0;
}
.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  gap: 2.5rem;
  align-items: center;
  width: 100%;
}

/* caption column — children absolutely stacked, cross-faded by --visible */
.demo-caption {
  position: relative;
  min-height: 13rem;
}
.caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
}
.caption--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.caption-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.22;
  color: var(--text);
  margin-bottom: .8rem;
}
.caption-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-2);
  max-width: var(--measure);
}

/* reduced-motion path: captions become a static stacked list */
.demo-caption--static { min-height: 0; }
.demo-caption--static .caption {
  position: static;
  inset: auto;
  opacity: 1;
  transform: none;
  display: block;
  margin-bottom: 2.25rem;
  pointer-events: auto;
}

/* ============================================================================
 * the terminal window (#tw) — a macOS Terminal window hosting a real TUI: every
 * region inside is its own box-drawing frame (ratatui Block) on ONE terminal
 * background, framed by a rounded mac window with traffic lights + a centered title.
 * ========================================================================== */
.tw {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;                               /* rounded like a mac window */
  box-shadow:                                        /* a soft, lifted mac-window drop */
    0 28px 64px -26px rgba(0, 0, 0, .7),
    0 2px 10px -4px rgba(0, 0, 0, .5);
  overflow: hidden;
  font-size: .9rem;
  line-height: 1.5;
  transition: border-color .2s ease;
  height: 34rem;
}
/* engaged sandbox: no green edge — clicking in leaves the border untouched */

/* the macOS Terminal window bar: traffic lights on the left, a centered title,
 * nothing on the right. A touch lighter than the screen, like real mac chrome. */
.tw-bar {
  flex: none;
  position: relative;                     /* anchors the absolutely-centered title */
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .8rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
}
/* the three traffic lights — decorative (not clickable), but they reveal their
 * glyphs on hover, just like the real ones */
.tw-lights { display: inline-flex; gap: .5rem; align-items: center; }
.tw-lights i {
  position: relative;
  width: .76rem;
  height: .76rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .56rem;
  font-style: normal;
  line-height: 1;
  color: rgba(0, 0, 0, .55);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .2);
}
.tw-lights i:nth-child(1) { background: #ff5f57; }   /* close */
.tw-lights i:nth-child(2) { background: #febc2e; }   /* minimize */
.tw-lights i:nth-child(3) { background: #28c840; }   /* zoom */
.tw-lights i::before { opacity: 0; transition: opacity .12s ease; }
.tw-lights:hover i:nth-child(1)::before { content: "✕"; opacity: 1; }
.tw-lights:hover i:nth-child(2)::before { content: "–"; opacity: 1; }
.tw-lights:hover i:nth-child(3)::before { content: "+"; opacity: 1; }
/* the centered window title (macOS Terminal puts the name in the middle) */
.tw-titlebar-name {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .01em;
}

/* body: the boxed regions sit edge-to-edge on the terminal bg, separated by a
 * hair of gutter so each frame reads as its own box (sidebar | main | git). */
.tw-body {
  flex: 1;
  display: flex;
  gap: 3px;
  /* a little extra room up top so the boxes' title chips sit clear of the window
   * bar — over the terminal bg, never over the lighter chrome (keeps them seamless). */
  padding: .5rem 3px 3px;
  min-height: 0;
  background: var(--surface);
}

/* a boxed region = a ratatui Block: a full line-border with its title cut into the
 * top edge. The sidebar and main pane are regions; the git panel's boxes are too. */
.tw-region {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--tui-border);
  background: transparent;
}
.tw-region--sidebar { flex: none; width: 190px; }
.tw-region--main { flex: 1; min-width: 0; }
/* the title chip masks the top border line and the text hangs just inside it — so
 * it reads as a ratatui Block title without the glyphs spilling above the box. Its
 * bg matches the terminal exactly, so the masked strip is seamless. */
.tw-region-title {
  position: absolute;
  top: -.3em;
  left: .55rem;
  z-index: 1;
  max-width: calc(100% - 1.2rem);
  padding: 0 .35rem;
  background: var(--surface);
  color: var(--text-2);
  font-size: .76rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tw-region-title[hidden] { display: none; }
/* the focused main pane is bordered magenta in the tool (Focus::Terminal) */
.tw--main-focus .tw-region--main { border-color: var(--magenta); }
.tw--main-focus .tw-region--main > .tw-region-title { color: var(--text); }

/* sidebar content. The .tw-region wrapper carries the outer box. */
.tw-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: .7rem 0 .25rem; /* top clears the box's title chip */
  overflow-y: auto;
}

/* Multi-project workspace: active-member group first, manifest order within groups. */
.sb-project {
  flex: none;
  margin: 0 .28rem .38rem;
  padding: .22rem 0 .08rem;
  border: 1px solid var(--tui-border);
}
.sb-project--active { border-color: var(--cyan); }
.sb-project-name {
  padding: 0 .55rem .18rem;
  color: var(--text-2);
  font-size: .7rem;
  font-weight: 600;
}
.sb-project-summary {
  display: flex;
  gap: .55rem;
  padding: .12rem .85rem .08rem;
  font-size: .66rem;
  white-space: nowrap;
  overflow: hidden;
}
.sb-project-working { color: var(--text-2); }
.sb-project-ready { color: var(--green); font-weight: 700; }
.sb-project-failed { color: var(--red); }
.sb-project-git-row {
  display: flex;
  padding: .04rem .85rem .2rem;
  font-size: .66rem;
  white-space: nowrap;
  overflow: hidden;
}
.sb-project-branch {
  color: var(--magenta);
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-project-git { flex: none; margin-left: auto; color: var(--muted); }
.sb-project-git--dirty { color: var(--yellow); }

.sb-section { flex: none; margin-bottom: .28rem; }
/* section heads are cyan + bold in the real tool (theme.rs `header`) */
.sb-head {
  padding: .3rem .85rem .15rem;
  font-size: .67rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.sb-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .26rem .9rem;
  line-height: 1.35;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
}
/* active row = the tool's desaturated indigo selection bar + a green cursor edge */
.sb-row--active {
  background: #2d2d3c;
  color: var(--text);
}
.sb-row--active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--green);
}

/* status dot, colored by data-status — solid, no glow */
.sb-dot {
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--muted);
}
.sb-dot[data-status="running"] { background: var(--green); }
.sb-dot[data-status="exited"]  { background: var(--faint); }
.sb-dot[data-status="stopped"] { background: var(--muted); }

.sb-name { flex: none; font-weight: 500; }
.sb-sub {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: .76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* coral attention bell; JS toggles [hidden] */
.sb-bell {
  flex: none;
  margin-left: auto;
  color: var(--attention);
  font-size: .7rem;
  animation: bell-pulse 1s ease-in-out infinite;
}
.sb-bell[hidden] { display: none; }
@keyframes bell-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .45; }
}

/* launcher rows: green "+ New …" (the tool paints these Color::Green) */
.sb-row--launcher { color: var(--green-bright); }
.sb-row--launcher .sb-name { font-weight: 400; }
.sb-plus {
  flex: none;
  width: .5rem;
  text-align: center;
  color: var(--green-bright);
  font-weight: 700;
}
.sb-row--launcher:hover,
.sb-row--launcher:hover .sb-plus { color: var(--green); }
.sb-row--launcher.sb-row--active { color: var(--green-bright); }

/* main pane — fills its boxed region; the session title lives on the box border */
.tw-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: transparent;
}
.tw-tab {
  flex: none;
  padding: .42rem .9rem;
  font-size: .73rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--text-2);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.tw-tab[hidden] { display: none; }

.tw-screen {
  flex: 1;
  padding: .8rem .85rem .65rem; /* top clears the box's title chip */
  overflow: auto;
  line-height: 1.5;
  color: var(--text-2);
}
.screen-line {
  white-space: pre-wrap;
  word-break: break-word;
}
/* block / box-drawing art (the Claude & Codex welcome banners): the screen's 1.7
 * leading tears the glyph rows apart into blank gaps — tile them tight so the logo
 * and the Codex frame read as one continuous mark. A row that's wider than the
 * pane clips with an ellipsis (one clean fold line) instead of spilling or
 * forcing a horizontal scrollbar. */
.screen-line.art {
  line-height: 1.05;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen-placeholder {
  color: var(--muted);
  white-space: pre-line;
  padding: 1.4rem .5rem;
}
/* green block cursor on the last line — a real block sized to the text height
 * (the ▮ glyph rendered shorter than the text), drawn with a solid background */
.screen-cursor {
  display: inline-block;
  width: .55ch;
  height: 1.1em;
  vertical-align: middle;
  margin: 0 .02em;
  background: var(--green);
  color: transparent;
  animation: caret-blink 1.1s steps(1) infinite;
}

/* line-level tints: a faint colored wash + a colored gutter bar. Diff lines
 * never wrap — a wrapped continuation paints the wash from column 0 and reads
 * as a rendering glitch — they clip with an ellipsis like a real narrow pane. */
.ln-add,
.ln-del {
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ln-add {
  background: rgba(110, 158, 114, .1);
  color: var(--add);
  box-shadow: inset 2px 0 0 var(--green);
}
.ln-del {
  background: rgba(207, 128, 128, .1);
  color: var(--del);
  box-shadow: inset 2px 0 0 var(--red);
}
.ln-cmd { color: var(--text); }
.ln-dim { color: var(--muted); }

/* the active pane gets brighter ink */
.tw--main-focus .tw-screen { color: var(--text); }

/* panel (native git): its own column of boxes, no outer frame or shaded bg — the
 * three git boxes carry their own borders, just like src/app/view/git.rs. */
.tw-panel {
  flex: none;
  width: 200px;
  display: flex;
  flex-direction: column;
  background: transparent;
}
.tw-panel[hidden] { display: none; }
.tw-panel-head {
  flex: none;
  padding: .42rem .8rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.tw-panel-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  /* visible (not auto) so the first box's title chip — which sits above its top
   * border — isn't clipped; the boxes are flex-sized to fit, so nothing overflows. */
  overflow: visible;
  font-size: .76rem;
  line-height: 1.55;
  color: var(--text-2);
}

/* native git panel: three bordered boxes (Changes / Branches / Commits), matching
 * src/app/view/git.rs. The box title sits on the top border like a ratatui Block. */
.git-box {
  position: relative;
  flex: 0 0 auto;
  margin: .55rem 0 0;
  padding: .6rem .3rem .25rem; /* top clears the box's title chip */
  border: 1px solid var(--tui-border);
  border-radius: 0;
}
/* the stack spans the panel's full height, flush top and bottom, so the three boxes
 * line up exactly with the sidebar/main region boxes flanking them. */
.git-box:first-child { flex: 1 1 auto; min-height: 0; margin-top: 0; }
.git-box:last-child { margin-bottom: 0; }
.git-box-title {
  position: absolute;
  top: -.3em;
  left: .45rem;
  max-width: calc(100% - 1rem);
  padding: 0 .3rem;
  background: var(--surface);
  color: var(--muted);
  font-size: .68rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the focused section is bordered magenta in the tool */
.git-box--active { border-color: var(--magenta); }
.git-box--active .git-box-title { color: var(--magenta); }
/* tree rows are column-aligned (pre); a long line (e.g. a Commits-box summary)
 * is clipped with an ellipsis instead of spilling outside the box. */
.git-box-body .screen-line {
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}
.git-sel { background: rgba(169, 140, 196, .16); }
/* the Changes box is clickable in the sandbox: files and folders stage / unstage
 * on click (folders toggle all their children; the checkbox shows [✓]/[~]/[ ]) */
.tw--ready .git-row { cursor: pointer; border-radius: 2px; }
.tw--ready .git-row:hover { background: rgba(110, 158, 114, .16); }

/* bare mode (scene 0): a plain terminal — the mmux chrome is hidden and the main
 * region drops its box so the screen fills the window. The reveal types `mmux`
 * here, then boots the UI in. */
.tw--bare .tw-region--sidebar,
.tw--bare .tw-panel,
.tw--bare .tw-status,
.tw--bare .tw-tab,
.tw--bare .tw-region-title { display: none; }
.tw--bare .tw-body { gap: 0; padding: 0; }
.tw--bare .tw-region--main { border: 0; }

/* boot: when mmux takes over the window, the chrome fades/slides into place */
@keyframes tw-boot-side { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes tw-boot-fade { from { opacity: 0; } to { opacity: 1; } }
.tw--boot .tw-region--sidebar { animation: tw-boot-side .42s ease both; }
.tw--boot .tw-panel           { animation: tw-boot-side .42s ease both; }
.tw--boot .tw-region--main,
.tw--boot .tw-status          { animation: tw-boot-fade .5s ease both; }

/* status bar — the tmux-green signature: green bar, dark text */
.tw-status {
  flex: none;
  padding: .35rem .85rem;
  font-size: .73rem;
  font-weight: 500;
  color: #08130a;
  background: var(--green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* notification (scene 7, "it taps you on the shoulder") — a faithful macOS
   notification banner floating top-right over the terminal. Deliberately set in
   the system UI font (real macOS notifications are SF Pro, not monospace) on a
   dark translucent material that blurs the terminal behind it. */
.tw-toast {
  position: absolute;
  top: 2.7rem;
  right: .85rem;
  z-index: 6;
  width: 19rem;
  max-width: calc(100% - 1.6rem);
  display: flex;
  gap: .6rem;
  padding: .65rem .7rem;
  background: rgba(38, 40, 47, .8);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border: .5px solid rgba(255, 255, 255, .14);
  border-radius: 13px;
  box-shadow: 0 14px 36px -10px rgba(0, 0, 0, .6), 0 2px 6px -2px rgba(0, 0, 0, .45);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  animation: toast-in .34s cubic-bezier(.2, .8, .2, 1);
}
.tw-toast[hidden] { display: none; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(8px, -6px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
/* app icon — the mmux mark (green tile, beveled, the m knocked out), as an inline
   data: SVG (the same mark as the favicon / nav brand). No remote fetch. */
.toast-icon {
  flex: 0 0 auto;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 8px;
  border: .5px solid rgba(255, 255, 255, .1);
  background: #0d0e10 url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20shape-rendering='crispEdges'%3E%3Cg%20fill='%2386efac'%3E%3Crect%20x='0'%20y='0'%20width='15'%20height='1'/%3E%3Crect%20x='0'%20y='1'%20width='1'%20height='14'/%3E%3C/g%3E%3Cg%20fill='%2316a34a'%3E%3Crect%20x='15'%20y='0'%20width='1'%20height='16'/%3E%3Crect%20x='0'%20y='15'%20width='15'%20height='1'/%3E%3C/g%3E%3Cg%20fill='%234ade80'%3E%3Crect%20x='1'%20y='1'%20width='14'%20height='3'/%3E%3Crect%20x='1'%20y='4'%20width='2'%20height='11'/%3E%3Crect%20x='13'%20y='4'%20width='2'%20height='11'/%3E%3Crect%20x='5'%20y='6'%20width='2'%20height='9'/%3E%3Crect%20x='9'%20y='6'%20width='2'%20height='9'/%3E%3Crect%20x='3'%20y='12'%20width='2'%20height='3'/%3E%3Crect%20x='7'%20y='12'%20width='2'%20height='3'/%3E%3Crect%20x='11'%20y='12'%20width='2'%20height='3'/%3E%3C/g%3E%3Cg%20fill='%230d0e10'%3E%3Crect%20x='3'%20y='4'%20width='10'%20height='2'/%3E%3Crect%20x='3'%20y='6'%20width='2'%20height='6'/%3E%3Crect%20x='7'%20y='6'%20width='2'%20height='6'/%3E%3Crect%20x='11'%20y='6'%20width='2'%20height='6'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.toast-main { min-width: 0; flex: 1 1 auto; }
.toast-head {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .05rem;
}
.toast-app {
  font-size: .72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .58);
}
.toast-time {
  margin-left: auto;
  font-size: .7rem;
  color: rgba(255, 255, 255, .42);
  white-space: nowrap;
}
.toast-title {
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.toast-body {
  font-size: .82rem;
  color: rgba(255, 255, 255, .76);
  line-height: 1.35;
  margin-top: .04rem;
}

/* overlay (the closer) — ssh disconnect / reattach scrim. This is the whole
 * pitch in one frame, so the line is set big, in the display face. */
.tw-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--text);
  background: rgba(13, 14, 16, .82);
}
.tw-overlay[hidden] { display: none; }
.tw-overlay[data-overlay="disconnected"] { color: var(--warn); }
.tw-overlay[data-overlay="reattached"]   { color: var(--green); }

/* sandbox hint (finale) — flat pill-less chip */
.tw-sandbox-hint {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: .38rem .85rem;
  font-size: .77rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--green);
  border-radius: 0;
  animation: hint-bob 2s ease-in-out infinite;
}
.tw-sandbox-hint[hidden] { display: none; }
@keyframes hint-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, -3px); }
}

/* ============================================================================
 * syntax token tones — every .tok-<tone> renderLine() can emit
 * ========================================================================== */
.tok-kw      { color: var(--tok-kw); }
.tok-fn      { color: var(--tok-fn); }
.tok-str     { color: var(--tok-str); }
.tok-num     { color: var(--tok-num); }
.tok-comment { color: var(--tok-comment); }
.tok-type    { color: var(--tok-type); }
.tok-path    { color: var(--tok-path); }
.tok-op      { color: var(--tok-op); }
.tok-add     { color: var(--add); }
.tok-del     { color: var(--del); }
.tok-ok      { color: var(--green); }
.tok-warn    { color: var(--warn); }
.tok-info    { color: var(--info); }
.tok-ai      { color: var(--ai); font-weight: 600; }
.tok-dim     { color: var(--muted); }
.tok-prompt,
.tok-brand   { color: var(--green-bright); font-weight: 700; }
/* agent brand marks: Claude's warm orange logo, Codex's teal >_ */
.tok-claude  { color: #cc8a63; }
.tok-codex   { color: var(--cyan); }

/* ============================================================================
 * what you get — a flat spec sheet (man-page vibe, not SaaS cards) beside the
 * real project config: a small mmux.yaml "file" card.
 * ========================================================================== */
.spec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: 3rem;
  align-items: start;
}
.spec {
  margin: 0;
  border-top: 1px solid var(--border);
}
.spec-row {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border);
}
.spec-row dt {
  color: var(--green-bright);
  font-size: .92rem;
  font-weight: 600;
}
.spec-row dd {
  margin: 0;
  font-size: .92rem;
  line-height: 1.65;
  color: var(--text-2);
}

/* the config, shown as the file it is: a name-tab chip on a bordered card */
.yaml-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
}
.yaml-card-name {
  padding: .45rem .9rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--green-bright);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.yaml-card-code {
  margin: 0;
  padding: 1rem 1.1rem 1.1rem;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--text-2);
  overflow-x: auto;
}
.spec-note {
  margin: 1rem 0 0;
  font-size: .84rem;
  line-height: 1.65;
  color: var(--muted);
}
.spec-note code {
  padding: .06rem .35rem;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.spec-note a { color: var(--green-bright); }
.spec-note a:hover { color: var(--text); }

/* ============================================================================
 * how it works — plain language + a live, standalone terminal (#tw-how) the
 * visitor can actually play with. The window itself reuses the .tw styles, so
 * it gets the same height/chrome as the demo above and never feels cramped.
 * ========================================================================== */
.how-lede {
  font-size: 1.04rem;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 64ch;
  margin: -1.25rem 0 2.25rem;
}
.how-lede strong { color: var(--text); font-weight: 700; }

/* centers and bounds the reused .tw window so 3 columns have room to breathe */
.how-demo {
  max-width: 900px;
  margin: 0 auto 2.75rem;
}

/* three plain-language points */
.how-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  max-width: var(--page-max);
}
.how-points li {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text-2);
}
.how-points strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: .3rem;
}

/* ============================================================================
 * install — single command, brew only
 * ========================================================================== */
#install { text-align: center; }
/* install-method tabs: script (default) + Homebrew. One panel shown at a time, so the
 * section never shows more than a single command line. Toggled by tui.js (§11). */
.install-tabs {
  display: flex;
  width: fit-content;
  margin: 0 auto .9rem; /* own line, centered, above the command */
  gap: .3rem;
  padding: .25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.install-tab {
  font: inherit;
  font-size: .85rem;
  color: var(--text-2);
  padding: .35rem .9rem;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.install-tab:hover { color: var(--text); }
.install-tab.is-active {
  color: var(--bg);
  background: var(--green);
  font-weight: 600;
}
.install-row {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem .8rem .8rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  max-width: 100%;
}
/* Required: `display: inline-flex` above beats the UA `[hidden] { display: none }`, so the
   inactive panel stays visible without this (same pattern as .tw-panel[hidden] etc.). This
   is what makes the script/Homebrew tab toggle actually hide the other panel. */
.install-row[hidden] { display: none; }
.install-row-prompt { color: var(--green); font-weight: 700; }
.install-row-cmd {
  font-size: 1.02rem;
  color: var(--text);
  white-space: nowrap;
  overflow-x: auto;
}
.install-platforms {
  margin: .9rem 0 0;
  font-size: .82rem;
  color: var(--text-2);
}
.install-then {
  margin: 1.4rem 0 0;
  color: var(--text-2);
}
.install-then-cmd {
  padding: .12rem .45rem;
  color: var(--green-bright);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.install-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.25rem;
}

/* ============================================================================
 * footer
 * ========================================================================== */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
}
.footer-brand { font-weight: 700; color: var(--text); }
.footer-license { color: var(--muted); }
.footer-sep { color: var(--faint); }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--green-bright); }
.footer-caret {
  color: var(--green);
  animation: caret-blink 1.1s steps(1) infinite;
}

/* ============================================================================
 * responsive
 * ========================================================================== */
@media (max-width: 900px) {
  section { padding: 4.5rem 1.25rem; }
  .spec-grid { grid-template-columns: 1fr; gap: 2rem; }
  .how-points { grid-template-columns: 1fr; gap: 1.1rem; }

  /* demo: window over stacked captions */
  #demo { min-height: 950vh; }
  .demo-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .demo-caption { min-height: 9rem; }

  .tw-panel { display: none !important; }

  .nav-sep { display: none; }
  .nav-links { gap: 1rem; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  section { padding: 3.75rem 1rem; }
  .spec-row { grid-template-columns: 1fr; gap: .2rem; }

  .tw { height: 28rem; font-size: .82rem; }
  .tw-region--sidebar { width: 146px; }
  .sb-sub { display: none; }

  .nav-links { gap: .8rem; font-size: .85rem; }
  /* phones: the brand (logo) stays on the left; on the right keep only github —
   * the in-page section links are too much in a narrow header. */
  .nav-links a[href^="#"],
  .nav-links .nav-sep { display: none; }
  .hero-install,
  .install-row { width: 100%; }
}

@media (max-width: 460px) {
  .tw-region--sidebar { width: 120px; }
  .demo-caption--static .caption { margin-bottom: 1.6rem; }
}

/* ============================================================================
 * accessibility — focus ring + reduced motion
 * ========================================================================== */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.tw:focus-visible {
  outline: none;
  box-shadow: var(--shadow), var(--ring);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-caret,
  .footer-caret,
  .screen-cursor { opacity: 1; }
  .scroll-cue { display: none; }
}

/* ============================================================================
 * polish & a11y — themed scrollbars, sr-only announcer
 * ========================================================================== */
.tw-screen,
.tw-panel-screen,
.tw-sidebar {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.tw-screen::-webkit-scrollbar,
.tw-panel-screen::-webkit-scrollbar,
.tw-sidebar::-webkit-scrollbar { width: 8px; height: 8px; }
.tw-screen::-webkit-scrollbar-thumb,
.tw-panel-screen::-webkit-scrollbar-thumb,
.tw-sidebar::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
.tw-screen::-webkit-scrollbar-track,
.tw-panel-screen::-webkit-scrollbar-track,
.tw-sidebar::-webkit-scrollbar-track { background: transparent; }

/* visually-hidden live region — tui.js announces sandbox selection/spawn/stop */
.tw-a11y-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

main[tabindex="-1"]:focus { outline: none; }

/* sandbox: when the finale is playable, sidebar rows look and behave clickable */
.tw--ready .sb-row { cursor: pointer; }
.tw--ready .sb-row:hover { background: var(--accent-soft); color: var(--text); }
.tw--ready .sb-row--launcher:hover .sb-name,
.tw--ready .sb-row--launcher:hover .sb-plus { color: var(--green-bright); }
