/* ════════════════════════════════════════════════════════════════════
   Daem — the site is a workspace.

   The page is not a document that scrolls. It is the same shape as the
   app: a project rail, workspace tabs, a grid of panes, a status bar.
   Sections are workspaces. Paragraphs live in panes.

   One escape hatch: body.plain flattens all of it into a plain
   document. Everything is in the DOM either way, so nothing here is
   load-bearing for reading the site.
   ════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* Straight from the app's DeckTheme. */
  --bg:        #090914;
  --panel:     #0e0e1d;
  --raised:    #141426;
  --screen:    #0b0b18;
  --line:      #242135;
  --line-2:    #343048;
  --text:      #f4f2f8;
  --muted:     #a39eaf;
  --faint:     #6b6579;
  --accent:    #8b5cf6;
  --accent-2:  #a477ff;
  --selection: #302052;
  --green:     #35e6a1;
  --work:      #9b6dff;
  --fail:      #e06c75;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "JetBrains Mono", monospace;

  --rail: 178px;
  --r: 8px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;               /* the app owns the viewport */
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, dt { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; }

code {
  font-family: var(--mono);
  font-size: .88em;
  color: var(--accent-2);
  background: rgba(139, 92, 246, .1);
  padding: .1em .38em;
  border-radius: 4px;
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--raised);
  color: var(--muted);
}

.vh {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 6px;
  background: var(--accent); color: #fff; font-weight: 600;
  transition: top .15s;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─────────────────────────────  app frame  ───────────────────────────── */

.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr) 34px;
  background: var(--bg);
}

.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--raised);
}

.tb-left  { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.traffic { display: flex; gap: 7px; }
.traffic i { width: 11px; height: 11px; border-radius: 50%; background: #3b3940; }
.traffic i:nth-child(1) { background: #ff655d; }
.traffic i:nth-child(2) { background: #e7b94d; }
.traffic i:nth-child(3) { background: #56c56f; }

.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 680; font-size: 14px; letter-spacing: -.01em;
}
.brand img { border-radius: 5px; }

.tb-center {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
}
.crumb[data-crumb-workspace] { color: var(--muted); }
.crumb-sep { opacity: .5; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 9px; border: 1px solid var(--line-2); border-radius: 999px;
  font-size: 11.5px; color: var(--muted); white-space: nowrap;
}

.tb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 9px;
  border: 1px solid var(--line-2); border-radius: 6px;
  font-size: 12px; color: var(--muted);
  background: var(--panel);
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.tb-btn:hover { color: var(--text); border-color: var(--accent); background: var(--selection); }
.tb-btn[aria-pressed="true"] { color: var(--text); background: var(--selection); border-color: var(--accent); }

.body {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
}

/* ────────────────────────────────  rail  ─────────────────────────────── */

.sidebar {
  min-height: 0;
  display: flex; flex-direction: column;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow: auto;
}

.rail-label {
  padding: 0 8px 8px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint);
}

.rail { display: flex; flex-direction: column; gap: 2px; }

.project {
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 8px; border-radius: 7px;
  font-size: 13px; color: var(--muted); text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.project:hover { background: rgba(255,255,255,.045); color: var(--text); }
.project b {
  flex: none; width: 20px; height: 20px; border-radius: 5px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  background: var(--raised); color: var(--faint);
}
.project span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project em { font-style: normal; font-size: 10.5px; color: var(--faint); font-family: var(--mono); }
.project.is-active {
  color: var(--text);
  background: var(--selection);
  box-shadow: inset 0 0 0 1px rgba(164,119,255,.22);
}
.project.is-active b { color: var(--accent-2); background: #251a3c; }

.rail-foot { margin-top: auto; padding-top: 22px; }
.rail-note { padding: 0 8px; font-size: 11.5px; line-height: 1.5; color: var(--faint); }

/* ────────────────────────────────  tabs  ─────────────────────────────── */

.stage {
  min-height: 0;
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr);
}

.tabbar {
  display: flex; align-items: stretch;
  padding-left: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--raised);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }

.tab {
  flex: none;
  display: grid; place-items: center;
  min-width: 84px; padding: 0 14px;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--faint);
  cursor: pointer;
  transition: color .12s, background .12s;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab.is-active {
  color: var(--text);
  background: var(--selection);
  border-color: var(--line-2);
  box-shadow: inset 0 -2px var(--accent);
}
/* only the active project's tabs are on the bar */
.tab { display: none; }
.tabbar[data-project="daem"]    .tab[data-project="daem"],
.tabbar[data-project="install"] .tab[data-project="install"],
.tabbar[data-project="log"]     .tab[data-project="log"] { display: grid; }

.tab-add   { align-self: center; padding: 0 12px; color: var(--faint); font-size: 15px; }
.tab-meta  { margin-left: auto; align-self: center; padding-right: 14px;
             font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }

/* ──────────────────────────────  pane grid  ──────────────────────────── */

.panes { min-height: 0; position: relative; }

.workspace {
  position: absolute; inset: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
}
.workspace[hidden] { display: none; }

.grid-a {
  grid-template-columns: 1.5fr 1fr 1fr;
  grid-template-rows: 1.18fr .82fr;
}
.grid-a > :nth-child(1) { grid-area: 1 / 1 / 2 / 3; }
.grid-a > :nth-child(2) { grid-area: 2 / 1 / 3 / 2; }
.grid-a > :nth-child(3) { grid-area: 2 / 2 / 3 / 3; }
.grid-a > :nth-child(4) { grid-area: 1 / 3 / 3 / 4; }

.grid-six {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.grid-b {
  grid-template-columns: 1.05fr 1fr 1fr;
  grid-template-rows: 1.25fr .75fr;
}
.grid-b > :nth-child(1) { grid-area: 1 / 1 / 3 / 2; }
.grid-b > :nth-child(2) { grid-area: 1 / 2 / 2 / 4; }
.grid-b > :nth-child(3) { grid-area: 2 / 2 / 3 / 3; }
.grid-b > :nth-child(4) { grid-area: 2 / 3 / 3 / 4; }

.grid-c { grid-template-columns: 1.1fr 1fr 1fr; }

/* ────────────────────────────────  pane  ─────────────────────────────── */

.pane {
  min-width: 0; min-height: 0;
  display: grid;
  grid-template-rows: 30px minmax(0, 1fr);
  background: var(--panel);
}
.pane.term { background: var(--screen); }
.pane-quiet { background: var(--bg); }

.pane-head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 11px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.pane-name {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--muted); letter-spacing: .01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pane-path {
  font-family: var(--mono); font-size: 10px; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pane-badge {
  margin-left: auto; flex: none;
  font-family: var(--mono); font-size: 9.5px;
  padding: 2px 7px; border-radius: 999px;
  color: var(--accent-2); background: rgba(139,92,246,.14);
}

.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dot.ok   { background: var(--green); }
.dot.run  { background: var(--green); animation: breathe 2.6s ease-in-out infinite; }
.dot.work { background: var(--work);  animation: breathe 1.5s ease-in-out infinite; }
.dot.ac   { background: var(--accent-2); }

@keyframes breathe { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

.pane-body { min-height: 0; overflow: auto; padding: 22px; }
.pane-body::-webkit-scrollbar { width: 9px; }
.pane-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 9px; border: 3px solid transparent; background-clip: content-box; }

/* ───────────────────────────  prose in a pane  ───────────────────────── */

.doc .pane-body > * + * { margin-top: 14px; }

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent-2);
}

h1 {
  font-size: clamp(30px, 3.5vw, 52px);
  line-height: 1.02;
  letter-spacing: -.038em;
  font-weight: 700;
}
h1 span { color: var(--muted); }

.lede { font-size: clamp(15px, 1.25vw, 18px); line-height: 1.55; color: var(--text); max-width: 46ch; letter-spacing: -.01em; }
.sub  { font-size: 13.5px; color: var(--muted); max-width: 52ch; }

.doc h3 { font-size: 15.5px; font-weight: 660; letter-spacing: -.015em; }
.doc h3.mt { margin-top: 22px; }
.doc p { font-size: 13.5px; color: var(--muted); max-width: 54ch; }
.doc strong { color: var(--text); font-weight: 620; }

.num {
  font-family: var(--mono); font-size: 11px; color: var(--accent-2);
  letter-spacing: .1em;
}

/* a vocabulary card holds one idea, so it sits in the middle of its pane */
.pane-center .pane-body,
.grid-c .doc .pane-body {
  display: flex; flex-direction: column; justify-content: safe center;
}
.grid-c .doc .pane-body > * { flex: none; }
.pane-center .pane-body > * { flex: none; }

.grid-six .pane-body {
  display: flex; flex-direction: column; justify-content: safe center;
  padding: 26px 28px;
}
.grid-six .pane-body > * { flex: none; }
.grid-six h3 { font-size: 21px; letter-spacing: -.025em; }
.grid-six .num { margin-bottom: 4px; }
.grid-six p { max-width: 38ch; }

/* the statement pane holds its copy in the middle of the pane, the way a
   window with one thing in it does */
.pane-hero .pane-body {
  display: flex; flex-direction: column; justify-content: safe center;
  padding-left: 34px; padding-right: 34px;
}
.pane-hero .pane-body > * { flex: none; }

.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 6px; }
.cta {
  display: inline-flex; align-items: center; height: 34px; padding: 0 15px;
  border: 1px solid var(--accent-2); border-radius: 7px;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 640;
}
.cta-note { font-size: 12px; color: var(--faint); font-family: var(--mono); }

.hint { font-size: 12.5px; color: var(--faint); }
.hint kbd { margin: 0 1px; }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 10.5px;
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--faint);
}
.tag.w { color: var(--work);   border-color: rgba(155,109,255,.4); }
.tag.u { color: var(--accent-2); border-color: rgba(164,119,255,.4); }
.tag.v { color: var(--green);  border-color: rgba(53,230,161,.35); }

.steps { padding-left: 18px; font-size: 13px; color: var(--muted); }
.steps li + li { margin-top: 6px; }
.steps::marker { color: var(--faint); }

.reqs, .areas { list-style: none; padding: 0; font-size: 13px; }
.reqs li, .areas li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.reqs span, .areas span { flex: none; min-width: 78px; color: var(--text); font-weight: 560; }
.reqs em, .areas em { font-style: normal; color: var(--muted); }
.areas { font-family: var(--mono); font-size: 12px; }
.areas li { padding: 5px 0; }
.areas em { margin-left: auto; color: var(--accent-2); }

.cmds { font-size: 12.5px; }
.cmds dt { font-family: var(--mono); color: var(--text); margin-top: 10px; }
.cmds dt:first-child { margin-top: 0; }
.cmds dd { margin: 2px 0 0; color: var(--faint); }

.stat { display: flex; align-items: baseline; gap: 12px; }
.stat b { font-size: 44px; font-weight: 700; letter-spacing: -.04em; color: var(--accent-2); line-height: 1; }
.stat span { font-size: 13px; color: var(--muted); max-width: 22ch; }

/* ──────────────────────────  terminal in a pane  ─────────────────────── */

.screen {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.72;
  padding: 14px 16px;
  color: #d9d3e4;
}
.screen p { white-space: pre-wrap; word-break: break-word; }
.screen .gap { margin-top: 14px; }
.screen .pr  { color: var(--accent-2); margin-right: 8px; }
.screen .ok  { color: var(--green); margin-right: 6px; }
.screen .ac  { color: var(--accent-2); }
.screen .dim { color: var(--faint); }

.screen .cur i {
  display: inline-block; width: 7px; height: 14px;
  background: var(--accent-2); vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%,49% { opacity: 1 } 50%,100% { opacity: 0 } }

/* progressive reveal, only when JS is driving */
.js-anim .screen[data-anim] > p { opacity: 0; }
.js-anim .screen[data-anim] > p.shown { opacity: 1; transition: opacity .18s ease-out; }

/* ─────────────────────────────  the floor  ───────────────────────────── */

.pane-floor .pane-body { padding: 12px; }

/* Twelve panes at once, each one small enough to read at a glance and
   still recognisably a terminal. This is the argument the page is making. */
.floor {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(182px, 1fr));
  grid-auto-rows: minmax(84px, 1fr);
  gap: 8px;
}
.cell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  padding: 9px 11px 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  font-family: var(--mono);
  position: relative;
  overflow: hidden;
}
.cell-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cell b { font-size: 9.5px; color: var(--faint); font-weight: 500; }
.cell-top span { flex: 1; min-width: 0; font-size: 11.5px; color: var(--text);
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-out { overflow: hidden; }
.cell-out p { font-size: 10px; line-height: 1.65; color: var(--faint);
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell em { font-style: normal; font-size: 10px; color: var(--faint); }

.cell::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--faint);
}
.cell[data-state="done"]::after  { background: var(--green); }
.cell[data-state="work"]::after  { background: var(--work); animation: breathe 1.6s ease-in-out infinite; }
.cell[data-state="queue"]::after { background: var(--accent); opacity: .45; }
.cell[data-state="idle"]::after  { background: var(--line-2); }
.cell[data-state="done"] em  { color: var(--green); }
.cell[data-state="work"] em  { color: var(--work); }

.cell[data-state="done"]  .cell-top .dot { background: var(--green); }
.cell[data-state="work"]  .cell-top .dot { background: var(--work); animation: breathe 1.6s ease-in-out infinite; }
.cell[data-state="queue"] .cell-top .dot { background: var(--accent); opacity: .5; }
.cell[data-state="idle"]  .cell-top .dot { background: var(--line-2); }

/* ──────────────────────────────  status bar  ─────────────────────────── */

.statusbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 400px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  background: var(--raised);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}
.sb-left  { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.sb-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
.sb-item  { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sb-sep   { opacity: .45; }
.sb-out   { color: var(--green); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-out[data-err] { color: var(--fail); }
.sb-hint  { color: var(--faint); }

.sb-cmd {
  display: flex; align-items: center; gap: 8px;
  height: 22px; padding: 0 9px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--bg);
}
.sb-cmd .pr { color: var(--accent-2); }
.sb-cmd input {
  flex: 1; min-width: 0;
  border: 0; background: none; outline: none;
  font-family: var(--mono); font-size: 11px; color: var(--text);
}
.sb-cmd input::placeholder { color: var(--faint); }
.sb-cmd:focus-within { border-color: var(--accent); }

/* ────────────────────────────────  toast  ────────────────────────────── */

.toast {
  position: fixed; right: 18px; bottom: 50px; z-index: 40;
  display: flex; align-items: center; gap: 11px;
  padding: 12px 15px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--raised);
  box-shadow: 0 18px 40px rgba(0,0,0,.5);
  animation: toast-in .32s cubic-bezier(.2,.8,.3,1);
}
.toast[hidden] { display: none; }
.toast b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text); }
.toast span { display: block; font-size: 11.5px; color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* ───────────────────────────  command palette  ───────────────────────── */

.palette {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: start center;
  padding-top: 14vh;
  background: rgba(6,6,12,.68);
  backdrop-filter: blur(6px);
}
.palette[hidden] { display: none; }

.palette-box {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  overflow: hidden;
}
.palette-input {
  width: 100%; height: 50px; padding: 0 18px;
  border: 0; border-bottom: 1px solid var(--line);
  background: none; outline: none;
  font-family: var(--mono); font-size: 14px; color: var(--text);
}
.palette-input::placeholder { color: var(--faint); }

.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 46vh; overflow: auto; }
.palette-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  font-size: 13px; color: var(--muted);
  cursor: pointer;
}
.palette-list li .k { font-family: var(--mono); font-size: 10px; color: var(--faint); flex: none; min-width: 118px; }
.palette-list li .t { color: var(--text); }
.palette-list li .d { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.palette-list li.on { background: var(--selection); box-shadow: inset 0 0 0 1px rgba(164,119,255,.22); }
.palette-list li.on .d { color: var(--muted); }

.palette-foot {
  padding: 9px 14px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--faint);
}
.palette-foot kbd { margin-right: 4px; }

/* ═══════════════════════════════════════════════════════════════════════
   Flat mode — the same content as an ordinary document.

   Two ways in. `body.plain` is the reader's choice, from the title bar or
   `?plain`. `html.nojs` is the fallback: app.js clears that class the
   moment it runs, so if it never runs — scripting off, or a policy that
   will not load it — the site is a complete document instead of a shell
   with dead tabs. Both land in the same place, which is the point.

   plain mode — the same content as an ordinary document
   ═══════════════════════════════════════════════════════════════════════ */

body.plain { overflow: auto; }body.plain .app,
html.nojs body .app { height: auto; display: block; }body.plain .body,
html.nojs body .body { display: block; }body.plain .sidebar,
html.nojs body .sidebar,
body.plain .tabbar,
html.nojs body .tabbar,
body.plain .pane-head,
html.nojs body .pane-head,
body.plain .tb-center,
html.nojs body .tb-center,
body.plain .pill,
html.nojs body .pill,
body.plain .toast,
html.nojs body .toast,
body.plain .pane-floor,
html.nojs body .pane-floor,
body.plain .sb-cmd,
html.nojs body .sb-cmd { display: none; }
html.nojs body [data-action],
html.nojs body .tab-add,
html.nojs body .tab-meta,
html.nojs body .sb-right,
html.nojs body .hint { display: none; }   /* points at controls that are gone */

body.plain .titlebar,
html.nojs body .titlebar {
  position: sticky; top: 0; z-index: 20;
  grid-template-columns: 1fr auto;
}body.plain .stage,
html.nojs body .stage { display: block; }body.plain .panes,
html.nojs body .panes { position: static; }body.plain .workspace,
html.nojs body .workspace {
  position: static;
  display: block;
  background: none;
  width: min(720px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0 8px;
  border-top: 1px solid var(--line);
}body.plain .workspace[hidden],
html.nojs body .workspace[hidden] { display: block; }body.plain .workspace:first-of-type,
html.nojs body .workspace:first-of-type { border-top: 0; }body.plain .workspace::before,
html.nojs body .workspace::before {
  content: attr(data-title);
  display: block;
  margin-bottom: 22px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-2);
}body.plain .pane,
html.nojs body .pane {
  display: block;
  background: none;
  margin-bottom: 30px;
}body.plain .pane-body,
html.nojs body .pane-body,
body.plain .pane-hero .pane-body,
html.nojs body .pane-hero .pane-body,
body.plain .grid-six .pane-body,
html.nojs body .grid-six .pane-body {
  overflow: visible; padding: 0; max-height: none;
  display: block;                      /* undo the vertical centring */
}body.plain .lede,
html.nojs body .lede,
body.plain .sub,
html.nojs body .sub,
body.plain .doc p,
html.nojs body .doc p,
body.plain .grid-six p,
html.nojs body .grid-six p { max-width: none; }body.plain .doc h3.mt,
html.nojs body .doc h3.mt { margin-top: 26px; }body.plain .num,
html.nojs body .num { margin-bottom: 2px; }body.plain .screen,
html.nojs body .screen {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--screen);
}body.plain .js-anim .screen[data-anim] > p,
html.nojs body .js-anim .screen[data-anim] > p,
body.plain .screen[data-anim] > p,
html.nojs body .screen[data-anim] > p { opacity: 1; }body.plain .statusbar,
html.nojs body .statusbar { border-top: 1px solid var(--line); }body.plain .statusbar,
html.nojs body .statusbar { grid-template-columns: 1fr 1fr; }

/* ══════════════════════════════  responsive  ═════════════════════════ */

@media (max-width: 1200px) {
  /* two by two: the statement and the argument on top, two panes under them */
  .grid-a { grid-template-columns: 1.3fr 1fr; grid-template-rows: 1.28fr .72fr; }
  .grid-a > :nth-child(1) { grid-area: 1 / 1 / 2 / 2; }
  .grid-a > :nth-child(2) { grid-area: 2 / 1 / 3 / 2; }
  .grid-a > :nth-child(3) { grid-area: 2 / 2 / 3 / 3; }
  .grid-a > :nth-child(4) { grid-area: 1 / 2 / 2 / 3; }

  .grid-b { grid-template-columns: 1fr 1fr; }
  .grid-b > :nth-child(1) { grid-area: 1 / 1 / 2 / 2; }
  .grid-b > :nth-child(2) { grid-area: 1 / 2 / 2 / 3; }
  .grid-b > :nth-child(3) { grid-area: 2 / 1 / 3 / 2; }
  .grid-b > :nth-child(4) { grid-area: 2 / 2 / 3 / 3; }

  :root { --rail: 158px; }
}

/* A short window is normal on a laptop. The statement gives ground first. */
@media (min-width: 981px) and (max-height: 860px) {
  h1 { font-size: clamp(28px, 4.4vh, 44px); }
  .lede { font-size: 15.5px; }
  .pane-hero .pane-body { padding-top: 16px; padding-bottom: 16px; }
  .doc .pane-body > * + * { margin-top: 11px; }
  .grid-six h3 { font-size: 19px; }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  .app { height: auto; display: block; }
  .body { display: block; }

  .titlebar { position: sticky; top: 0; z-index: 20; }
  .tb-center, .pill { display: none; }

  .sidebar {
    flex-direction: row; align-items: center; gap: 6px;
    padding: 8px 10px;
    border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto;
    position: sticky; top: 46px; z-index: 19;
  }
  .sidebar .rail-label, .rail-foot { display: none; }
  .rail { flex-direction: row; gap: 6px; }
  .project { height: 30px; }
  .project em { display: none; }

  .tabbar { position: sticky; top: 93px; z-index: 18; }
  .tab-meta { display: none; }

  .panes { position: static; }
  .workspace:not([hidden]) {
    position: static;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    gap: 1px;
  }
  body.plain .workspace { display: block !important; }
  .workspace > * { grid-area: auto !important; }
  .pane { min-height: 240px; }
  .pane-body { overflow: visible; }
  .pane-hero .pane-body { padding-top: 30px; padding-bottom: 30px; }

  .statusbar {
    position: sticky; bottom: 0; z-index: 20;
    grid-template-columns: 1fr; height: auto; padding: 8px 12px;
  }
  .sb-cmd, .sb-right { display: none; }

  .toast { right: 12px; left: 12px; bottom: 56px; }
}

@media (max-width: 760px) {
  /* two readable mini-panes beat four unreadable ones */
  .floor { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .tb-btn span { display: none; }
  .tb-btn[data-action="plain"] span { display: inline; }
  h1 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js-anim .screen[data-anim] > p { opacity: 1 !important; }
}

@media print {
  body { overflow: visible; }
  .titlebar, .sidebar, .tabbar, .statusbar, .toast, .palette { display: none; }
  .app, .body, .stage, .panes { display: block; height: auto; }
  .workspace, .workspace[hidden] { position: static; display: block; }
  .pane { display: block; break-inside: avoid; }
  .pane-body { overflow: visible; }
}
