/* alois. Black and white only. Every raw value lives in :root. */
:root {
  --bg: 0 0% 100%;
  --fg: 0 0% 4%;
  --muted: 0 0% 40%;
  --soft: 0 0% 62%;
  --line: 0 0% 90%;
  --wash: 0 0% 97.5%;
  --accent: 0 78% 46%;

  --font: 'Geist', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;

  --col: 720px;
  --pad: 24px;
  --r: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 220ms;
  --dur-slow: 700ms;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: hsl(var(--bg)); color: hsl(var(--fg)); font: 400 18px/1.65 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid hsl(var(--fg)); outline-offset: 3px; }
canvas { image-rendering: pixelated; display: block; }

/* ---- entry gate: the 1-bit pixel brain is the loader ---- */
.gate { position: fixed; inset: 0; z-index: 50; background: hsl(var(--bg)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; transition: opacity var(--dur-slow) var(--ease), visibility 0s linear var(--dur-slow); }
.gate.gone { opacity: 0; visibility: hidden; }
.gate canvas { margin-bottom: 20px; max-width: 86vw; height: auto !important; }
.gate-name { margin: 0; font: 600 26px/1 var(--font); letter-spacing: -0.02em; }
.gate-status { margin: 0; min-height: 1.6em; font-size: 13px; color: hsl(var(--muted)); }

/* ---- header ---- */
.top nav a { font-size: 15px; color: hsl(var(--muted)); text-decoration: none; }
.top nav a:hover { color: hsl(var(--fg)); }
.top { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px var(--pad); background: hsl(var(--bg)); border-bottom: 1px solid hsl(var(--line)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 21px/1 var(--font); letter-spacing: -0.02em; }
.top nav { display: flex; gap: 22px; align-items: center; }
.link { font: 500 16px/1 var(--font); text-decoration: none; }
.link:hover { color: hsl(var(--accent)); }
.btn { display: inline-flex; align-items: center; font: 500 16px/1 var(--font); border-radius: 999px; padding: 14px 22px; text-decoration: none; cursor: pointer; background: hsl(var(--fg)); color: hsl(var(--bg)); transition: transform var(--dur) var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn-ink { background: hsl(var(--fg)); color: hsl(var(--bg)); border: 1px solid hsl(var(--fg)); }
.btn-line { background: hsl(var(--bg)); color: hsl(var(--fg)); border: 1px solid hsl(var(--line)); }
.btn-lg { font-size: 17px; padding: 16px 24px; }
.menu { position: relative; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); display: flex; flex-direction: column; min-width: 210px; padding: 8px; background: hsl(var(--bg)); border: 1px solid hsl(var(--line)); border-radius: var(--r); }
.menu-list a { padding: 9px 10px; border-radius: 8px; text-decoration: none; font-size: 15px; }
.menu-list a:hover { background: hsl(var(--wash)); }

/* ---- hero with the neuron-cluster field behind it ---- */
main, .foot { max-width: calc(var(--col) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }
.hero { padding: 150px 0 120px; }
.cells { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.top, main, .foot { position: relative; z-index: 1; }
.top { position: sticky; z-index: 10; }

.kicker { font-size: 16px; color: hsl(var(--muted)); margin: 0 0 18px; }
h1 { font: 600 clamp(38px, 6vw, 60px)/1.06 var(--font); letter-spacing: -0.035em; margin: 0; text-wrap: balance; }
h1 .soft { color: hsl(var(--soft)); }
.lede { font-size: 20px; line-height: 1.6; margin: 28px 0 32px; }
.cta { display: flex; flex-wrap: wrap; gap: 26px; align-items: center; margin: 0; }
.ticker { display: flex; justify-content: space-between; gap: 16px; margin: 44px 0 0; font-size: 13px; color: hsl(var(--muted)); }
.reset { flex: none; background: none; border: 0; padding: 0; font-size: 13px; color: hsl(var(--accent)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---- sections ---- */
.sec { padding: 72px 0 8px; }
.num { font-size: 13px; color: hsl(var(--muted)); margin: 0 0 10px; }
h2 { font: 600 34px/1.12 var(--font); letter-spacing: -0.03em; margin: 0 0 22px; }
p { margin: 0 0 20px; text-wrap: pretty; }
.intro { color: hsl(var(--muted)); }
.pull { font: 500 24px/1.4 var(--font); letter-spacing: -0.015em; margin: 32px 0; padding-left: 20px; border-left: 2px solid hsl(var(--fg)); }

/* ---- the backroom: monospace on white, the agent talking to itself ---- */
.room { margin-top: 18px; }
.room-bar { display: flex; justify-content: space-between; align-items: center; padding: 0 0 12px; font-size: 12.5px; color: hsl(var(--muted)); }
.room-bar span:first-child { display: flex; align-items: center; gap: 10px; color: hsl(var(--fg)); }
.room-body { height: min(560px, 66vh); overflow-y: auto; padding: 4px 0 10px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; scrollbar-width: thin; }
.room-body .l { margin: 0; min-height: 1.65em; }
.room-body .dim { color: hsl(var(--muted)); }
.room-body .hi { color: hsl(var(--fg)); font-weight: 500; }
.room-body .tag { font-weight: 500; color: hsl(var(--accent)); }
.room-body .art { line-height: 1.3; }
.room-body .who { font-weight: 500; }
.room-body .cur::after { content: "█"; color: hsl(var(--accent)); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.room-in { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid hsl(var(--fg)); font-size: 15px; }
.room-in .prompt { color: hsl(var(--muted)); white-space: nowrap; }
.room-in input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: hsl(var(--fg)); text-transform: uppercase; padding: 4px 0; }
.room-in input::placeholder { color: hsl(var(--soft)); }
.room-in input:focus-visible { outline: none; }
.room-in:focus-within { border-bottom-color: hsl(var(--accent)); }
.room-in button { font: inherit; background: none; color: hsl(var(--fg)); border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.try { font-size: 13px; color: hsl(var(--muted)); margin-top: 14px; word-spacing: 6px; }

/* fig 1 */
.hyp { margin: 52px 0 0; }
figcaption { font-size: 12.5px; color: hsl(var(--muted)); }
.hyp-statement { font: 500 25px/1.35 var(--font); letter-spacing: -0.02em; margin: 12px 0 24px; }
.hyp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; margin: 0; }
.hyp-grid .span { grid-column: 1 / -1; }
.hyp-grid dt { font-size: 13px; color: hsl(var(--muted)); margin-bottom: 3px; }
.hyp-grid dd { margin: 0; font-size: 16.5px; line-height: 1.5; }
.copy { margin-left: 8px; font-size: 12px; background: none; border: 0; padding: 0; cursor: pointer; color: hsl(var(--accent)); text-decoration: underline; text-underline-offset: 3px; }

/* tables and ascii figures */
.weights { width: 100%; border-collapse: collapse; font-size: 15px; margin: 6px 0 30px; }
.weights th { text-align: left; font: 400 12.5px var(--mono); color: hsl(var(--muted)); padding: 0 12px 8px 0; }
.weights td { padding: 7px 12px 7px 0; vertical-align: top; }
.weights td:first-child { font: 500 14px var(--mono); white-space: nowrap; }
.weights .r { text-align: right; font-family: var(--mono); padding-right: 0; }
.ascii { font: 400 13px/1.6 var(--mono); white-space: pre; overflow-x: auto; margin: 26px 0 12px; padding: 0; }
.eq { font-size: 15px; }
figure { margin: 0 0 20px; }

/* notebook */
.entries { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: e; }
.entries li { counter-increment: e; padding: 0 0 44px; }

.e-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.e-head h3 { font: 600 22px/1.2 var(--font); letter-spacing: -0.02em; margin: 0; }
.e-head h3::before { content: counter(e, decimal-leading-zero) "  "; font: 400 13px var(--mono); color: hsl(var(--muted)); }
.e-score { font: 400 13px var(--mono); color: hsl(var(--muted)); white-space: nowrap; }
.e-text { margin: 10px 0 14px; }
.e-bars { margin: 0 0 12px; font: 400 12.5px/1.55 var(--mono); white-space: pre; overflow-x: auto; }
.e-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: hsl(var(--muted)); margin: 0; }
.e-foot button, .recent button { font: 500 14px var(--mono); background: none; border: 0; padding: 0; color: hsl(var(--fg)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.recent { font-size: 13px; color: hsl(var(--muted)); margin-top: 22px; }

/* receipts: slips of white paper, black ink, perforated top. the cleanest object on the page */
.chain { font-size: 13px; color: hsl(var(--muted)); margin: 26px 0 22px; }
.chain b { color: hsl(var(--fg)); font-weight: 500; }
.slips { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; align-items: start; }
.slip { border: 1px solid hsl(var(--fg)); border-top: 0; border-radius: 0 0 4px 4px; padding: 0 20px 18px; font: 400 12.5px/1.6 var(--mono); }
.slip::before { content: ""; display: block; height: 8px; margin: 0 -20px 16px; background: radial-gradient(circle at 4px 0, hsl(var(--bg)) 3px, hsl(var(--fg)) 3px 4px, transparent 4px) 0 0 / 8px 8px repeat-x, linear-gradient(hsl(var(--fg)), hsl(var(--fg))) 0 0 / 100% 1px no-repeat; }
.slip-head { text-align: center; margin: 0 0 10px; }
.slip-head b { display: block; font: 600 14px/1.4 var(--mono); letter-spacing: 0.08em; }
.slip-row { display: flex; justify-content: space-between; gap: 14px; margin: 0; }
.slip-row span:first-child { color: hsl(var(--muted)); }
.slip-row span:last-child { text-align: right; }
.slip-row.sank span:last-child { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.slip hr { border: 0; border-top: 1px dashed hsl(var(--fg)); margin: 12px 0; }
.slip-subject { font: 600 24px/1.2 var(--font); letter-spacing: -0.02em; text-align: center; margin: 2px 0 2px; }
.slip-why { text-align: center; margin: 0; }
.slip-need { margin: 0; }
.slip-stamp { width: fit-content; margin: 16px auto 0; padding: 4px 10px; border: 1.5px solid hsl(var(--accent)); color: hsl(var(--accent)); font-weight: 500; letter-spacing: 0.2em; transform: rotate(-3deg); }
.slip-hash { margin: 8px 0 0; text-align: center; color: hsl(var(--muted)); font-size: 11px; }

.limits { padding-left: 20px; margin: 0; }
.limits li { margin-bottom: 12px; }
.foot { padding: 36px var(--pad) 70px; margin-top: 64px; font-size: 14px; color: hsl(var(--muted)); }
.foot p { margin: 0 0 8px; }

.rv { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.rv.in { opacity: 1; transform: none; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .top nav a:not([href="#work"]):not([href="#receipts"]) { display: none; }
  .hero { padding-top: 52px; }
  .lede { font-size: 18px; }

  h2 { font-size: 28px; }

  .room-body { font-size: 12.5px; }
  .room-in .prompt { display: none; }
  .hyp-grid { grid-template-columns: 1fr; }
  .weights th:nth-child(3), .weights td:nth-child(3) { display: none; }
  .ascii { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .room-body .cur::after { animation: none; }
  .gate { transition: none; }
}

/* figures from the sources: plain images, captions below, no frames */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 34px 0 30px; align-items: start; }
.plate { margin: 0; }
.plate.wide { margin: 34px 0 30px; }
.plate img { display: block; width: 100%; height: auto; }
.plate figcaption { margin-top: 10px; font-size: 12px; line-height: 1.55; }
.plate figcaption a, .refs a { color: hsl(var(--fg)); }
.plate figcaption a:hover, .refs a:hover { color: hsl(var(--accent)); }
.refs { padding-left: 22px; margin: 0; font-size: 15px; line-height: 1.6; }
.refs li { margin-bottom: 12px; }
.refs a { font-family: var(--mono); font-size: 13px; word-break: break-word; }
@media (max-width: 640px) { .pair { grid-template-columns: 1fr; } }
.plate.wide img { max-width: 600px; }


.top nav .x { display: inline-flex; align-items: center; color: hsl(var(--fg)); }
.top nav .x:hover { color: hsl(var(--accent)); }
@media (max-width: 640px) { .top nav .x { display: inline-flex !important; } }

/* receipt.html: one slip, centred */
.single-main { max-width: 460px; padding-top: 64px; padding-bottom: 80px; }
.slips.one { grid-template-columns: 1fr; }
.single-main .chain { text-align: center; }
.slip-head a { color: inherit; text-decoration: none; }
.slip-head a:hover { color: hsl(var(--accent)); }

/* contract address */
.ca { display: inline-flex; gap: 6px; white-space: nowrap; align-items: center; font-size: 12.5px; background: none; border: 0; padding: 4px 0; color: hsl(var(--fg)); cursor: pointer; }
.ca .ca-label { color: hsl(var(--muted)); }
.ca:hover .ca-short, .ca:hover .ca-label { color: hsl(var(--accent)); }
.ca-full { font-size: 12.5px; background: none; border: 0; padding: 0; color: hsl(var(--fg)); cursor: pointer; word-break: break-all; text-align: left; }
.ca-full:hover { color: hsl(var(--accent)); }
@media (max-width: 640px) { .top nav .ca { display: inline-flex !important; } }
@media (max-width: 400px) { .top nav { gap: 14px; } .top nav a[href="#work"] { display: none; } }

/* live status in the header: what the agent is doing right now */
.live { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; margin: 0 22px; font-size: 12.5px; color: hsl(var(--muted)); text-decoration: none; }
.live i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--accent)); box-shadow: 0 0 0 0 hsl(var(--accent) / 0.5); animation: pulse 1.6s var(--ease) infinite; }
.live span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live span::before { content: "live · "; color: hsl(var(--accent)); }
.live.off i { background: hsl(var(--soft)); animation: none; }
.live.off span::before { content: ""; }
.live:hover span { color: hsl(var(--fg)); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 hsl(var(--accent) / 0.5); } 70% { box-shadow: 0 0 0 7px hsl(var(--accent) / 0); } 100% { box-shadow: 0 0 0 0 hsl(var(--accent) / 0); } }
.brand { flex: none; } .top nav { flex: none; }
@media (max-width: 640px) { .live { margin: 0 10px; font-size: 11.5px; } .top nav a[href="#receipts"], .top nav a[href="./#receipts"] { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .live i { animation: none; } }

/* experiments ledger */
.ex-title { font: 600 17px/1.3 var(--font); margin: 34px 0 6px; }
.ex-title span { font-size: 12.5px; font-weight: 400; color: hsl(var(--muted)); margin-left: 10px; }
.experiments { list-style: none; padding: 0; margin: 0 0 28px; font-size: 14.5px; }
.experiments li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 14px; padding: 7px 0; align-items: baseline; }
.ex-nums { font-size: 12.5px; color: hsl(var(--muted)); }
.ex-verdict { font-size: 12.5px; white-space: nowrap; }
.ex-verdict.ok { color: hsl(var(--fg)); font-weight: 500; }
.ex-verdict a { color: hsl(var(--accent)); }
@media (max-width: 640px) { .experiments li { grid-template-columns: 1fr; gap: 2px; padding: 9px 0; } }
