/* One look for every page: a text console. Near-black screen, one monospace font, cyan
   frame lines and prompts, yellow headings, green and red for what the log adds and removes.
   Square corners everywhere. The header and menu are styled in chrome.js. */
:root {
  --space: #040404; --panel: rgba(5, 5, 5, 0.92);
  --ink: #f2f2f2; --muted: #8a8a8a; --line: #2e2e2e;
  --cyan: #ffffff; --yellow: #f2f2f2; --green: #f2f2f2; --red: #ea746c; --pink: #ff66bf;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
html { background: var(--space); color: var(--ink); font: 13px/1.5 var(--mono); }
body { margin: 0; }
::selection { background: var(--cyan); color: #000; }

/* --- The model pages (index.html, view.html): everything is fixed over a full-screen canvas. */
.stage, .stage body { height: 100%; overflow: hidden; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas#c:active { cursor: grabbing; }
/* Full screen (bare.js): only the artwork is left. Escape brings the rest back. */
html.bare .bar, html.bare .menu, html.bare .side, html.bare .tab, html.bare .time { display: none; }
/* Switching cosmos: the one on screen fades to black, and the new one fades in when it is ready. */
canvas#c { transition: opacity 0.35s; }
canvas#c.away { opacity: 0; }
/* While one is loading: a ring at the centre that fills as it arrives, in the heartbeat's pink.
   --p is how much has arrived, 0 to 1 (loading.js). */
#loading { position: fixed; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; opacity: 0; transition: opacity 0.35s; pointer-events: none; transform: rotate(-90deg); }
#loading circle { fill: none; stroke: var(--pink); stroke-width: 2; }
#loading circle:first-child { opacity: 0.18; }
#loading circle:last-child { stroke-dasharray: calc(var(--p, 0) * 100) 100; transition: stroke-dasharray 0.2s linear; }
canvas#c.away + #loading { opacity: 1; }

/* Timeline: labels above, controls below. */
.time { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 3; max-width: 760px; margin: 0 auto; background: var(--panel); box-shadow: 0 0 0 12px var(--panel); }
.labels { display: flex; justify-content: space-between; height: 20px; margin-bottom: 8px; color: var(--muted); font-size: 12px; line-height: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
#state { color: var(--yellow); }
.row { display: flex; align-items: center; gap: 8px; height: 32px; }
.row button { flex: none; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--cyan); display: grid; place-items: center; cursor: pointer; }
.row button:hover:not(:disabled) { border-color: var(--cyan); }
.row button.word { width: auto; padding: 0 12px; font: 12px/30px var(--mono); }
.row.second { margin-top: 8px; }
.row.second .end { flex: none; color: var(--muted); font-size: 12px; }
.row button.sig { width: 32px; padding: 0; }
.row button:disabled { opacity: 0.35; cursor: default; }
.row .zoom { margin-left: 8px; }
/* The sound button: its waves show only while sound is on. */
#sound .waves { opacity: 0.25; }
#sound.on { border-color: var(--cyan); }

#sound.on .waves { opacity: 1; }
/* The picked node's block, at the top of the nodes sidebar. Its height is fixed, so picking
   a node never moves the list under it. */
.tag { flex: none; box-sizing: border-box; height: 52px; margin-bottom: 12px; padding: 7px 10px; border: 1px solid var(--line); font-size: 12px; line-height: 18px; white-space: nowrap; overflow: hidden; }
.tag:has(div) { height: 112px; }
.tag [hidden] { display: none; }
.tag b { display: block; font-weight: 400; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.tag.none b { color: var(--muted); }
.tag > span { display: block; height: 18px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.tag > span[data-for] { color: var(--yellow); }
.tag button { display: inline-block; margin: 4px 1.5ch 0 0; padding: 0; border: 0; background: none; color: var(--cyan); font: inherit; cursor: pointer; }
.tag button:hover { color: var(--ink); }
.tag .field { height: 28px; margin-top: 6px; padding: 0 8px; }
/* The picked node's name sits where the state label does, above the timeline. */
.labels #node { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.labels #node:empty { display: none; }
.labels #when { margin-left: auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.labels #when:hover { color: var(--ink); }
.labels #node:not(:empty) + #state { display: none; }
@media (max-width: 719px) { .labels .left:has(#node:not(:empty)) ~ #when { display: none; } }
.labels .left { display: flex; gap: 1.5ch; min-width: 0; }
.labels #which { flex: none; color: var(--ink); }
.labels #node { color: var(--muted); }
/* The state picker: lights up one state's nodes. Fixed width, so picking never moves the row. */
/* The universe picker: a button, and its list opening upward over the page (nothing moves). */
.pick { position: relative; flex: none; width: 116px; height: 32px; margin-right: 8px; }
.row .pick > button { display: block; width: 100%; padding: 0 8px; font: 12px/30px var(--mono); text-align: left; white-space: nowrap; }
.pick.open > button { border-color: var(--cyan); }
.pick > div { display: none; position: absolute; left: 0; bottom: calc(100% + 8px); width: 100%; box-sizing: border-box; max-height: min(60vh, 464px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; border: 1px solid var(--line); background: #02060b; }
.pick.open > div { display: block; }
.row .pick > div button { display: block; width: 100%; height: 22px; padding: 0 8px; border: 0; color: var(--muted); font: 12px/22px var(--mono); text-align: left; white-space: nowrap; }
.row .pick > div button:hover, .row .pick > div button.on { background: var(--cyan); color: #000; }
@media (max-width: 719px) { .row .zoom, .row #in { display: none; } }
#in, #out { touch-action: none; }
.row svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
#play svg { fill: currentColor; stroke: none; }
.track { position: relative; flex: 1; min-width: 0; height: 20px; margin: 0 4px; }
#ticks { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--line); pointer-events: none; }
.track input { position: relative; display: block; width: 100%; }
input[type=range] { margin: 0; appearance: none; background: transparent; height: 20px; }
input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--line); }
input[type=range]::-moz-range-track { height: 1px; background: var(--line); }
/* The thumb is a text cursor: a solid block. */
input[type=range]::-webkit-slider-thumb { appearance: none; width: 8px; height: 16px; margin-top: -7.5px; border-radius: 0; background: var(--cyan); }
input[type=range]::-moz-range-thumb { width: 8px; height: 16px; border: 0; border-radius: 0; background: var(--cyan); }

/* Sidebars: full-height panes against the screen edges, each with a tab on its inner edge. */
.side { position: fixed; top: 48px; bottom: 0; z-index: 2; box-sizing: border-box; padding: 16px 16px 100px; background: var(--panel); transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1); }
.side.shut > :not(.tab) { visibility: hidden; transition: visibility 0s 0.36s; }
.tab { position: absolute; top: 16px; width: 34px; height: 92px; padding: 0; border: 0; background: var(--panel); color: var(--cyan); cursor: pointer; display: grid; place-items: center; }
.tab span { writing-mode: vertical-rl; font: 12px/1 var(--mono); letter-spacing: 0.16em; }
.side.left { left: 0; width: min(392px, 100vw - 34px); box-shadow: 1px 0 0 var(--line); }
.side.left.shut { transform: translateX(-100%); }
.side.left .tab { left: 100%; box-shadow: inset -1px 0 0 var(--line), inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
.side.left .tab span { transform: rotate(180deg); }
/* The tabs on the left edge, top to bottom: NETWORKS, NODES, LOG. An open sidebar goes over a shut one's tab. */
#nodeside .tab { top: 116px; }
#logside .tab { top: 216px; }
/* The networks there are, one a row; the one on screen is lit. */
#nets button { display: block; width: 100%; height: 22px; padding: 0 8px; border: 0; background: none; color: var(--muted); font: 12px/22px var(--mono); text-align: left; cursor: pointer; }
#nets button:hover, #nets button.on { background: var(--cyan); color: #000; }
/* RAISE: a tab on the same edge, under the other three, that opens nothing. It starts a
   network growing up (view.html) and is lit once it is alive. (The machine's old switch
   shared this.) */
#machine, #alive { position: fixed; left: 0; top: 364px; z-index: 2; box-shadow: inset -1px 0 0 var(--line), inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
#machine span, #alive span { transform: rotate(180deg); }
#machine.on, #alive.on { background: var(--cyan); color: #000; }
.side.left:not(.shut) { z-index: 3; }
#nodeside { display: flex; flex-direction: column; }
#nodeside .field { flex: none; height: 36px; }
#rows { flex: 1; min-height: 0; margin-top: 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#rows > div { position: relative; }
#rows button { position: absolute; left: 0; right: 0; height: 22px; padding: 0 8px; border: 0; background: none; color: var(--muted); font: 12px/22px var(--mono); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
#rows button span { display: inline-block; width: 9ch; color: var(--ink); font-variant-numeric: tabular-nums; }
#rows button:hover, #rows button.on { background: var(--cyan); color: #000; }
#rows button i { display: inline-block; width: 5ch; font-style: normal; font-variant-numeric: tabular-nums; }
#rows button i:empty { display: none; }
#rows button:hover span, #rows button.on span { color: inherit; }
#rows button:hover i, #rows button.on i { color: inherit !important; }
/* The switch above the rows. */
#only, .switch { flex: none; align-self: flex-start; margin-top: 10px; padding: 0; border: 0; background: none; color: var(--cyan); font: 12px/1.5 var(--mono); white-space: pre; cursor: pointer; }
#only:hover, .switch:hover { color: var(--ink); }
@media (max-width: 719px) { #netside .tab { top: 124px; } #nodeside .tab { top: 224px; } #logside .tab { top: 324px; } #lifeside .tab { top: 424px; } }
/* LIFE: what raising is, the network's state, and what can be done in it. Its tab is lit
   once the network is alive. */
#lifeside .tab { top: 316px; }
#lifeside .tab.on { background: var(--cyan); color: #000; }
#lifeside .scroll { height: 100%; overflow-y: auto; }
#lifeside h2 { margin: 0; font: 400 13px/1.5 var(--mono); color: var(--ink); white-space: nowrap; }
#lifeside h3 { margin: 28px 0 0; font: 400 12px/1.5 var(--mono); letter-spacing: 0.04em; color: var(--yellow); }
#lifeside p { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-wrap: pretty; }
#lifeside h3 + p { margin-top: 6px; }
#lifeside .small { margin-top: 28px; }
#lifeside [hidden] { display: none; }
#lifeside dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0 0; font: 12px/1.5 var(--mono); }
#lifeside dt { color: var(--muted); white-space: nowrap; }
#lifeside dd { margin: 0; color: var(--ink); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
#lifeside #r-learn { margin-top: 20px; }
#lifeside .late dt:nth-of-type(n+2), #lifeside .late dd:nth-of-type(n+2), #lifeside .late #r-learn { display: none; }
#lifeside .do, #lifeside .sig { height: 32px; border: 1px solid var(--line); background: transparent; color: var(--cyan); font: 12px/30px var(--mono); cursor: pointer; }
#lifeside .do { margin-top: 18px; padding: 0 14px; }
#lifeside .sig { width: 32px; padding: 0; }
#lifeside .do:hover, #lifeside .sig:hover:not(:disabled) { border-color: var(--cyan); }
#lifeside .do:disabled { opacity: 0.35; cursor: default; }
#lifeside .sigs .do { margin-top: 0; }
#lifeside .sigs, #lifeside .temper { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 12px; }
#lifeside #heard { margin-left: 8px; color: var(--pink); }
.labels #life { flex: none; color: var(--pink); }
.labels #life:empty { display: none; }
#log { height: 100%; margin: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; color: var(--muted); font: 11px/16px var(--mono); }
#log code { font: inherit; white-space: pre; }
#log .del { color: var(--red); }
#log .add { color: var(--green); }
#log .beat { color: var(--pink); text-decoration: none; }
#log a.beat:hover { text-decoration: underline; }
#log .fire { color: var(--cyan); }

#auction { right: 0; width: min(312px, 100vw - 34px); box-shadow: -1px 0 0 var(--line); display: flex; flex-direction: column; white-space: nowrap; font-variant-numeric: tabular-nums; }
#auction.shut { transform: translateX(100%); }
#auction .tab { right: 100%; box-shadow: inset 1px 0 0 var(--line), inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line); }
#auction p { margin: 0; overflow: hidden; text-overflow: ellipsis; }
#lot { height: 20px; color: var(--yellow); }
#left { height: 20px; color: var(--muted); }
#price { height: 40px; font-size: 24px; line-height: 40px; }
/* The bid line is a prompt. */
.act { display: flex; gap: 8px; height: 40px; margin-top: 16px; }
.field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 1ch; padding: 0 12px; border: 1px solid var(--line); cursor: text; }
.field:focus-within { border-color: var(--cyan); }
.field span { color: var(--cyan); }
.field input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; caret-color: var(--cyan); caret-shape: block; }
.field input::placeholder { color: var(--muted); }
.act button { width: 96px; border: 1px solid var(--cyan); border-radius: 0; background: var(--cyan); color: #000; font: inherit; cursor: pointer; }
.act button:disabled { border-color: var(--line); background: transparent; color: var(--muted); cursor: default; }
.act.settle .field { display: none; }
.act.settle button { width: 100%; }
.ended .act { display: none; }

/* --- The about page: a document printed to the same console. */
.doc body { max-width: 68ch; margin: 0 auto; padding: 48px 20px 96px; font-size: 14px; line-height: 1.7; color: #c8c8c8; }
.doc a { color: var(--cyan); }
.doc h1 { margin: 64px 0 0; font: 400 32px/1.15 var(--mono); color: var(--ink); text-wrap: balance; }
.doc .lead { margin: 16px 0 0; font-size: 16px; line-height: 1.6; color: var(--muted); text-wrap: balance; }
.doc h2 { margin: 64px 0 0; font: 400 14px/1.5 var(--mono); letter-spacing: 0.04em; color: var(--yellow); white-space: nowrap; }
.doc h2::before { content: '=== '; color: var(--line); }
.doc h2::after { content: ' ==='; color: var(--line); }
.doc p, .doc ul { margin: 16px 0 0; text-wrap: pretty; }
/* The statement: what the work is, in a few large lines. Then a handful of blocks, each a
   heading, one line and at most one picture. Everything exact is folded away under them. */
.doc .by { margin: 12px 0 0; color: var(--muted); }
.doc .say { margin-top: 72px; }
.doc .say p { margin: 20px 0 0; font-size: 16px; line-height: 1.6; color: var(--ink); text-wrap: balance; }
.doc .say figure { margin: 40px 0 12px; }
.doc .block { margin-top: 112px; }
.doc .block h2 { margin: 0; font-size: 22px; letter-spacing: 0; color: var(--ink); }
.doc .block h2::before, .doc .block h2::after { content: none; }
.doc .block p { margin: 10px 0 0; font-size: 16px; line-height: 1.6; color: var(--muted); text-wrap: balance; }
.doc .block p.more { margin-top: 18px; font-size: 14px; line-height: 1.7; color: #c8c8c8; text-wrap: pretty; }
.doc h2.fold { margin-top: 128px; }
.doc details { margin-top: 0; border-bottom: 1px solid var(--line); }
.doc h2.fold + details { margin-top: 24px; border-top: 1px solid var(--line); }
.doc summary { padding: 12px 0; color: var(--ink); cursor: pointer; list-style: none; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::before { content: '+ '; color: var(--cyan); }
.doc details[open]:not(.closing) summary::before { content: '\2212 '; }
.doc summary:hover { color: var(--cyan); }
/* A section's contents sit in .body (made by the page's script), which slides open and shut. */
.doc details .body { box-sizing: border-box; overflow: hidden; padding-bottom: 28px; }
@media (max-width: 719px) { .doc .block { margin-top: 88px; } }
.doc ul { padding: 0; list-style: none; }
.doc li { margin-top: 8px; padding-left: 2ch; text-indent: -2ch; }
.doc li::before { content: '- '; color: var(--cyan); }
.doc strong { font-weight: 400; color: var(--ink); }
.doc code { font: inherit; color: var(--cyan); white-space: nowrap; }
.doc .rule { margin: 24px 0 0; overflow-x: auto; color: var(--cyan); white-space: nowrap; }
.doc figure { margin: 32px 0 0; }
.doc figure svg { display: block; width: 100%; height: auto; }
.doc figure text { fill: var(--muted); font: 13px var(--mono); text-anchor: middle; }
.doc .gone { stroke: var(--muted); }
.doc .new { stroke: var(--yellow); }
.doc .kept { stroke: var(--ink); }
.doc .pt { fill: var(--ink); }
.doc .ptnew { fill: var(--yellow); }
.doc .pink { stroke: var(--pink); }
.doc .ptpink { fill: var(--pink); }
.doc .block figure { margin: 28px 0 4px; }
