/* ───────── tokens ───────── */
:root {
  --paper: #f5efe3;
  --paper-2: #ebe4d3;
  --surface: #fffdf8;
  --ink: #131210;
  --ink-2: #4b4840;
  --ink-3: #85806f;
  --rule: rgba(19, 18, 16, 0.16);
  --blue: #2b3cff;
  --blue-soft: #e3e6ff;
  --green: #0e8a4e;
  --green-ink: #0a6a3b;
  --green-soft: #d6f0e1;
  --red: #e03a1e;
  --red-ink: #b42a12;
  --red-soft: #fde0d9;
  --amber: #f2a516;
  --amber-ink: #8a5200;
  --amber-soft: #fcebc6;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --display: 'Bricolage Grotesque', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

/* ───────── base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; color-scheme: light; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
h1, h2, h3, p, ol, ul, dl { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
code { font: 0.86em var(--mono); background: rgba(19, 18, 16, 0.07); padding: 0.14em 0.4em; border-radius: 5px; }
kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.3); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-3); }

/* ───────── buttons: chunky, physical ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 11px;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink); box-shadow: 3px 3px 0 var(--ink);
  font: 600 14.5px/1 var(--sans); cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out), opacity 160ms ease;
}
.btn:active:not(:disabled) { transform: translate(2px, 2px) scale(0.98); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13.5px; box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
  .btn:active:not(:disabled) { transform: translate(2px, 2px) scale(0.98); }
}
.btn-danger[data-hint='1']:not(:disabled) { animation: hint 1.6s var(--ease-out) infinite; }
@keyframes hint { 0% { outline: 0 solid color-mix(in srgb, var(--red) 50%, transparent); outline-offset: 2px; } 70%, 100% { outline: 10px solid transparent; outline-offset: 2px; } }

/* ───────── nav ───────── */
.nav { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 2px solid var(--ink); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 18px var(--display); letter-spacing: -0.03em; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--blue); border: 2px solid var(--ink); display: grid; place-items: center; }
.nav-links { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.nav-links a:not(.btn) { padding: 8px 11px; border-radius: 8px; transition: background-color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .nav-links a:not(.btn):hover { background: var(--paper-2); } }
.nav-links .btn { margin-left: 8px; }
@media (max-width: 680px) { .nav-links a:not(.btn) { display: none; } }

/* ───────── entrance ───────── */
.rise { opacity: 0; transform: translateY(10px); filter: blur(4px); animation: rise 620ms var(--ease-out) forwards; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out); transition-delay: calc(var(--i, 0) * 50ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ───────── hero ───────── */
.hero { padding: 64px 0 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font: 500 12.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 12px; border-radius: 99px; border: 2px solid var(--ink); background: var(--surface); }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: live 2s ease-in-out infinite; }
@keyframes live { 50% { opacity: 0.35; } }
h1 { margin-top: 22px; font-weight: 800; font-size: clamp(48px, 9.4vw, 124px); line-height: 0.93; letter-spacing: -0.05em; }
h1 mark { color: inherit; background: linear-gradient(transparent 64%, var(--amber) 64% 93%, transparent 93%); padding: 0 0.05em; margin: 0 -0.05em; }
.lede { margin-top: 26px; max-width: 54ch; font-size: clamp(17px, 2vw, 21px); line-height: 1.5; color: var(--ink-2); }
.lede b { color: var(--ink); font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.cta .btn { height: 50px; padding: 0 22px; font-size: 15.5px; }

/* ───────── demo ───────── */
.demo { margin-top: 52px; background: var(--surface); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink); overflow: hidden; }
.demo-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px 12px 18px; background: var(--blue-soft); border-bottom: 2px solid var(--ink); }
.demo-title { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.demo-title code { background: none; padding: 0; font-weight: 600; font-size: 14px; }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); transition: background-color 200ms ease; }
.demo[data-run='running'] .dot { background: var(--amber); }
.demo[data-run='good'] .dot { background: var(--green); }
.demo[data-run='bad'] .dot { background: var(--red); }
.demo-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; font-weight: 500; user-select: none; -webkit-tap-highlight-color: transparent; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 40px; height: 24px; border-radius: 99px; border: 2px solid var(--ink); background: var(--paper-2); position: relative; transition: background-color 200ms ease; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform 200ms var(--ease-out); }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--blue); outline-offset: 3px; }
.switch:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }

.demo-grid { display: grid; grid-template-columns: 1.05fr 1fr 1.1fr; }
.col { padding: 18px; min-width: 0; }
.col + .col { border-left: 2px solid var(--ink); }
@media (max-width: 960px) { .demo-grid { grid-template-columns: 1fr; } .col + .col { border-left: 0; border-top: 2px solid var(--ink); } }

/* steps */
.steps { display: grid; gap: 9px; }
.steps li { position: relative; display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px 16px; border-radius: 10px; font-size: 13.5px; background: var(--paper); border: 1.5px solid var(--rule); transition: border-color 200ms ease, background-color 200ms ease, opacity 200ms ease, box-shadow 200ms ease; }
.steps .name { font: 500 13px var(--mono); letter-spacing: -0.01em; }
.steps .tag { font: 12px var(--mono); color: var(--ink-3); }
.steps .ico { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-3); position: relative; transition: background-color 200ms ease, border-color 200ms ease; }
.bar { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 4px; display: flex; gap: 2px; }
.bar i { position: relative; display: block; border-radius: 4px; background: var(--rule); overflow: hidden; }
.bar .f1 { flex: 0 0 68%; } .bar .f2 { flex: 1; }
.bar i::after { content: ''; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform var(--d, 0ms) linear; }
.bar .f1::after { background: var(--ink); }
.bar .f2::after { background: var(--amber); }
.steps li[data-step='review'] .f1 { flex: 1; } .steps li[data-step='review'] .f2 { display: none; }

.steps li[data-s='running'] { border-color: var(--ink); background: var(--amber-soft); box-shadow: 2px 2px 0 var(--ink); }
.steps li[data-s='running'] .ico { border-color: var(--ink); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 4px var(--amber); } }
.steps li[data-s='done'] .ico { background: var(--green); border-color: var(--green); }
.steps li[data-s='done'] .ico::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.steps li[data-s='done'] .bar, .steps li[data-s='replayed'] .bar { opacity: 0.35; }
.steps li[data-s='replayed'] { opacity: 0.6; }
.steps li[data-s='replayed'] .ico { background: var(--ink-3); border-color: var(--ink-3); }
.steps li[data-s='limbo'] { border-color: var(--red); background: var(--red-soft); box-shadow: 2px 2px 0 var(--red); }
.steps li[data-s='limbo'] .ico { border-color: var(--red); }
.steps li[data-s='limbo'] .tag { color: var(--red-ink); font-weight: 500; }
.steps li[data-s='limbo'] .f2::after { background: var(--red); }
.legend { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--ink-3); }
.sw { width: 14px; height: 4px; border-radius: 4px; display: inline-block; margin-right: -4px; }
.sw-work { background: var(--ink); } .sw-gap { background: var(--amber); }

/* workers + ledger */
.col-mid { display: grid; gap: 10px; align-content: start; }
.worker { border-radius: 10px; padding: 11px 13px; background: var(--paper); border: 1.5px solid var(--rule); transition: border-color 200ms ease, background-color 200ms ease; }
.worker-head { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.pill { font: 500 11px var(--mono); padding: 3px 8px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); transition: background-color 200ms ease, color 200ms ease; }
.lease { height: 5px; border-radius: 5px; background: var(--rule); margin: 9px 0 7px; overflow: hidden; }
.lease i { display: block; height: 100%; background: var(--green); transform-origin: left; transform: scaleX(0); }
.worker-foot { font: 11.5px var(--mono); color: var(--ink-3); min-height: 17px; }
.worker[data-state='running'] { border-color: var(--ink); }
.worker[data-state='running'] .pill { background: var(--green-soft); color: var(--green-ink); }
.worker[data-state='replaying'] { border-color: var(--ink); }
.worker[data-state='replaying'] .pill { background: var(--ink); color: var(--paper); }
.worker[data-state='dead'] { border-color: var(--red); background: var(--red-soft); animation: jolt 360ms var(--ease-out); }
.worker[data-state='dead'] .pill { background: var(--red); color: #fff; }
.worker[data-state='dead'] .lease i { background: var(--red); }
@keyframes jolt { 20% { transform: translateX(-4px); } 45% { transform: translateX(3px); } 70% { transform: translateX(-1px); } 100% { transform: none; } }

.ledger { border-radius: 10px; padding: 11px 13px 8px; background: var(--paper); border: 1.5px dashed var(--ink-3); font-size: 13px; }
.ledger-head { font-weight: 600; margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px; }
.ledger-head .muted { font-weight: 400; font-size: 11.5px; }
.ledger-row, .ledger-foot { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font: 12px var(--mono); }
.ledger-foot { border-top: 1.5px solid var(--rule); margin-top: 4px; padding-top: 8px; color: var(--ink-2); font-family: var(--sans); font-size: 12.5px; }
.ledger b { font: 600 12px var(--mono); font-variant-numeric: tabular-nums; min-width: 2.4ch; text-align: center; padding: 2px 7px; border-radius: 6px; background: var(--paper-2); transition: background-color 250ms ease, color 250ms ease, transform 250ms var(--ease-out); }
.ledger b.bump { transform: scale(1.2); }
.ledger b.good { background: var(--green-soft); color: var(--green-ink); }
.ledger b.bad { background: var(--red); color: #fff; }

/* history */
.log-head { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.log-head .muted { font-weight: 400; font-size: 11.5px; }
.log { font: 12px/1.55 var(--mono); height: 296px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%); mask-image: linear-gradient(to bottom, transparent, #000 22%); }
.log li { display: grid; grid-template-columns: 2.2em 1fr; gap: 8px; padding: 2px 0; animation: logIn 240ms var(--ease-out); }
.log .n { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.log .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log li.replayed { opacity: 0.5; }
.log li.ok .t { color: var(--green-ink); }
.log li.warn .t { color: var(--amber-ink); }
.log li.bad .t { color: var(--red-ink); font-weight: 600; }
@media (max-width: 960px) { .log { height: 210px; } }
@keyframes logIn { from { opacity: 0; transform: translateY(5px); } }

.verdict { padding: 14px 18px; border-top: 2px solid var(--ink); font-size: 14.5px; color: var(--ink-2); min-height: 60px; display: flex; align-items: center; background: var(--paper-2); transition: background-color 300ms ease, color 300ms ease; }
.verdict b { color: var(--ink); font-weight: 600; }
.verdict[data-tone='good'] { background: var(--green-soft); color: var(--green-ink); }
.verdict[data-tone='bad'] { background: var(--red-soft); color: var(--red-ink); }
.verdict[data-tone='warn'] { background: var(--amber-soft); color: var(--amber-ink); }
.verdict[data-tone] b { color: inherit; }

/* ───────── timeline: the page as an event history ───────── */
.timeline { position: relative; margin-top: 40px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 124px; bottom: 0; width: 2px; background: var(--ink); }
.ev { display: grid; grid-template-columns: 164px minmax(0, 1fr); gap: 20px; padding-top: 120px; }
.ev-rail-in { position: sticky; top: 92px; padding-left: 30px; display: flex; flex-direction: column; gap: 2px; }
.node { position: absolute; left: 0; top: 7px; width: 16px; height: 16px; border-radius: 50%; background: var(--blue); border: 2px solid var(--ink); box-shadow: 0 0 0 4px var(--paper); }
.seq { font: 800 34px/1 var(--display); letter-spacing: -0.04em; }
.evt { font: 500 11.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 900px) {
  .timeline::before, .node { display: none; }
  .ev { grid-template-columns: 1fr; gap: 14px; padding-top: 80px; }
  .ev-rail-in { position: static; padding-left: 0; flex-direction: row; align-items: baseline; gap: 12px; }
  .seq { font-size: 26px; }
}

h2 { font-weight: 800; font-size: clamp(30px, 4.8vw, 58px); line-height: 1; letter-spacing: -0.04em; margin-bottom: 36px; }

.how-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 1060px) { .how-grid { grid-template-columns: 1fr; gap: 28px; } }
.code { background: #15130f; color: #efe9d9; border: 2px solid var(--ink); border-radius: 14px; padding: 22px 24px; overflow-x: auto; box-shadow: 6px 6px 0 var(--blue); }
.code pre { margin: 0; font: 13px/1.75 var(--mono); }
.code code { background: none; padding: 0; font-size: inherit; }
.k { color: #c4a7e7; } .f { color: #f0cf8f; } .c { color: #86d3e3; } .s { color: #a9db9f; } .n { color: #f4ab80; } .cm { color: #7d796b; font-style: italic; }
.how-steps { display: grid; gap: 26px; }
.how-steps li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; }
.num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--mono); border: 2px solid var(--ink); background: var(--amber); }
.how-steps h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 4px; }
.how-steps p { color: var(--ink-2); font-size: 15px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1060px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; padding: 18px 18px 20px; box-shadow: 4px 4px 0 var(--ink); }
.js .tile.reveal { transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out), translate 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .tile:hover { translate: -2px -2px; box-shadow: 6px 6px 0 var(--ink); } }
.tile .tag { display: inline-block; font: 500 11px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; border: 1.5px solid var(--ink); margin-bottom: 14px; background: var(--blue-soft); }
.tile:nth-child(4n+2) .tag { background: var(--amber-soft); }
.tile:nth-child(4n+3) .tag { background: var(--green-soft); }
.tile:nth-child(4n) .tag { background: var(--red-soft); }
.tile h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; line-height: 1.1; }
.tile p { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }

.limits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 40px; }
@media (max-width: 800px) { .limits { grid-template-columns: 1fr; gap: 28px; } }
.limit { border-top: 2px solid var(--ink); padding-top: 14px; }
.limit s { display: block; font: 500 14px var(--mono); color: var(--ink-2); text-decoration-color: var(--red); text-decoration-thickness: 2px; margin-bottom: 8px; }
.limit h3 { font-size: 24px; font-weight: 800; line-height: 1.08; letter-spacing: -0.035em; margin-bottom: 8px; }
.limit p { color: var(--ink-2); font-size: 15px; }

.contract { margin-top: 64px; padding: clamp(26px, 4vw, 44px); border: 2px solid var(--ink); border-radius: 18px; background: var(--blue); color: #fff; box-shadow: 8px 8px 0 var(--ink); }
.contract h3 { font: 500 12.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; margin-bottom: 20px; }
.contract ol { counter-reset: c; display: grid; gap: 14px; }
.contract li { counter-increment: c; display: grid; grid-template-columns: 2.6em 1fr; font: 600 clamp(19px, 2.6vw, 28px)/1.25 var(--display); letter-spacing: -0.025em; }
.contract li::before { content: '0' counter(c); font: 500 13px var(--mono); opacity: 0.65; padding-top: 0.75em; letter-spacing: 0; }
.contract b { font-weight: 800; }
.contract span { color: rgba(255, 255, 255, 0.82); }
.contract span b { color: #fff; }

.footer { margin-top: 128px; padding: 26px 0 38px; border-top: 2px solid var(--ink); background: var(--paper-2); font-size: 14px; color: var(--ink-2); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.footer b { color: var(--ink); }
.footer a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }

/* ───────── reduced motion: keep fades and colour, drop movement ───────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { animation: none; opacity: 1; transform: none; filter: none; }
  .js .reveal { transform: none; transition: opacity 200ms ease; transition-delay: 0ms; }
  .live, .worker[data-state='dead'], .log li, .btn-danger[data-hint='1'], .steps li[data-s='running'] .ico { animation: none; }
  .ledger b.bump { transform: none; }
  .btn:hover:not(:disabled), .tile:hover { translate: none; transform: none; }
}


/* ───────── use cases / who / get started ───────── */
.intro { max-width: 62ch; margin: -14px 0 32px; font-size: clamp(16px, 1.8vw, 19px); color: var(--ink-2); }
.sub-h { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.035em; margin: 64px 0 20px; }
.demo-note { margin-top: 20px; max-width: 70ch; font: 13px/1.55 var(--mono); color: var(--ink-3); }
.demo-note a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }

.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .cases { grid-template-columns: 1fr; } }
.case { background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; padding: 20px 20px 18px; box-shadow: 4px 4px 0 var(--ink); display: flex; flex-direction: column; }
.js .case.reveal { transition: opacity 480ms var(--ease-out), transform 480ms var(--ease-out), translate 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .case:hover { translate: -2px -2px; box-shadow: 6px 6px 0 var(--ink); } }
.case h3 { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 8px; }
.case p { color: var(--ink-2); font-size: 15px; line-height: 1.55; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chips span { font: 500 11px var(--mono); letter-spacing: 0.04em; padding: 3px 8px; border-radius: 99px; border: 1.5px solid var(--ink); background: var(--blue-soft); }
.chips span:nth-child(2) { background: var(--amber-soft); } .chips span:nth-child(3) { background: var(--green-soft); }

.who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .who { grid-template-columns: 1fr; } }
.who-card { border-top: 2px solid var(--ink); padding-top: 14px; }
.who-card h4 { margin: 0 0 6px; font: 800 20px/1.15 var(--display); letter-spacing: -0.03em; }
.who-card p { color: var(--ink-2); font-size: 15px; }

.guide { display: grid; gap: 40px; }
.guide > li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; position: relative; }
.guide > li:not(:last-child)::after { content: ''; position: absolute; left: 19px; top: 46px; bottom: -34px; width: 2px; background: var(--rule); }
.gnum { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: var(--amber); display: grid; place-items: center; font: 800 17px var(--display); box-shadow: 2px 2px 0 var(--ink); }
.gbody { min-width: 0; display: grid; gap: 12px; }
.gbody h3 { font-size: 24px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.gbody p { color: var(--ink-2); font-size: 15.5px; max-width: 70ch; }
.gbody p b { color: var(--ink); }
.gbody .small { font-size: 14px; color: var(--ink-3); }

.term { background: #15130f; color: #efe9d9; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: 4px 4px 0 var(--ink); }
.term-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; min-height: 36px; background: #24211b; font: 500 11.5px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: #a39d8b; }
.term pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.7 var(--mono); }
.term code { background: none; padding: 0; font-size: inherit; }
.term .p { color: #7d796b; user-select: none; margin-right: 0.6em; }
.term-out pre { font-size: 12.5px; line-height: 1.6; color: #d9d3c2; }
.term-out .dim { color: #8f8a79; } .term-out .ok { color: #7fe0a3; } .term-out .bad { color: #ff9a86; }
.term-out .hl { background: rgba(242, 165, 22, 0.22); color: #ffd98a; border-radius: 3px; padding: 0 3px; margin: 0 -3px; }
.copy { display: inline-grid; place-items: center; height: 28px; min-width: 62px; padding: 0 10px; border-radius: 7px; border: 1.5px solid #4a4538; background: transparent; color: #efe9d9; font: 500 11.5px var(--mono); text-transform: none; letter-spacing: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease; }
.copy:active { transform: scale(0.96); }
.copy span { grid-area: 1 / 1; transition: opacity 180ms ease, filter 180ms ease, transform 180ms var(--ease-out); }
.copy .c-done { opacity: 0; filter: blur(3px); transform: scale(0.85); color: #7fe0a3; }
.copy[data-state='done'] { border-color: #7fe0a3; }
.copy[data-state='done'] .c-idle { opacity: 0; filter: blur(3px); transform: scale(0.85); }
.copy[data-state='done'] .c-done { opacity: 1; filter: none; transform: none; }
@media (hover: hover) and (pointer: fine) { .copy:hover { background: rgba(255, 255, 255, 0.08); } }
.code-flat { box-shadow: 4px 4px 0 var(--ink); }
.code-flat pre { font-size: 12.5px; }
.note { padding: 14px 16px; border: 2px solid var(--ink); border-radius: 12px; background: var(--amber-soft); font-size: 14.5px; color: var(--ink); max-width: 78ch; }
.note b { font-weight: 700; }

.apitable { border: 2px solid var(--ink); border-radius: 14px; background: var(--surface); overflow: hidden; box-shadow: 4px 4px 0 var(--ink); }
.arow { display: grid; grid-template-columns: minmax(250px, 0.9fr) 1.4fr; gap: 20px; padding: 13px 18px; align-items: baseline; }
.arow + .arow { border-top: 1.5px solid var(--rule); }
.arow > code { background: none; padding: 0; font: 500 13px var(--mono); color: var(--blue); }
.arow > span { color: var(--ink-2); font-size: 14.5px; }
@media (max-width: 760px) { .arow { grid-template-columns: 1fr; gap: 3px; } }
.note.reveal { margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
  .case:hover { translate: none; }
  .copy span { transition: opacity 120ms ease; filter: none !important; transform: none !important; }
}


/* ───────── playground (real engine on Postgres-in-WASM) ───────── */
.pg-section { padding-top: 120px; }
.pg-intro { max-width: 860px; margin-bottom: 36px; }
.pg-intro h2 { margin: 18px 0 18px; }
.pg-lede { font-size: clamp(16px, 1.9vw, 19px); color: var(--ink-2); max-width: 66ch; }

.pg { position: relative; background: var(--surface); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink); overflow: hidden; }
.pg-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px 10px 18px; background: var(--blue-soft); border-bottom: 2px solid var(--ink); }
.pg-title { display: flex; align-items: center; gap: 9px; font-size: 14px; flex-wrap: wrap; }
.pg[data-boot='ready'] .dot { background: var(--green); }
.pg[data-boot='loading'] .dot { background: var(--amber); }
.pg[data-boot='error'] .dot { background: var(--red); }
.pg-pill { font: 500 11.5px var(--mono); padding: 3px 9px; border-radius: 99px; border: 1.5px solid var(--ink); background: var(--surface); }

.pg-boot { position: absolute; z-index: 5; inset: 53px 0 0 0; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); transition: opacity 240ms var(--ease-out); }
.pg[data-boot='ready'] .pg-boot { opacity: 0; pointer-events: none; }
.pg-boot-in { max-width: 460px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.pg-boot-in h3 { font-size: 28px; font-weight: 800; letter-spacing: -0.035em; }
.pg-boot-in p { color: var(--ink-2); font-size: 15px; }
.pg-bootmsg { min-height: 1.4em; font: 12.5px var(--mono); color: var(--ink-3); }
.pg[data-boot='error'] .pg-bootmsg { color: var(--red-ink); }
.pg[data-boot='loading'] #pgBoot { opacity: 0.5; pointer-events: none; }

.pg-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); min-height: 560px; }
.pg[data-boot='idle'] .pg-main, .pg[data-boot='loading'] .pg-main, .pg[data-boot='error'] .pg-main { opacity: 0.4; pointer-events: none; }
.pg-left { display: grid; align-content: start; }
.pg-right { padding: 16px 18px; border-left: 2px solid var(--ink); min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pg-block { padding: 16px 18px; display: grid; gap: 10px; }
.pg-block + .pg-block { border-top: 2px solid var(--ink); }
@media (max-width: 960px) { .pg-main { grid-template-columns: 1fr; } .pg-right { border-left: 0; border-top: 2px solid var(--ink); } }

.pg-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; }
.pg select, .pg input[type='text'], .pg-signal input { font: 500 12.5px var(--sans); height: 32px; padding: 0 8px; border: 2px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--ink); max-width: 100%; }
.pg-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; flex-wrap: wrap; }
#pgCode { width: 100%; height: 318px; resize: vertical; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 10px; background: #15130f; color: #efe9d9; font: 12.5px/1.65 var(--mono); tab-size: 2; white-space: pre; overflow: auto; }
#pgCode:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.pg-hint { font-size: 13px; color: var(--ink-2); }
.pg-error { padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--red); background: var(--red-soft); color: var(--red-ink); font: 12.5px var(--mono); }
.pg-armnote { min-height: 1.3em; font: 12px var(--mono); color: var(--amber-ink); }
.pg-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pg-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.pg-signal { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; flex-wrap: wrap; }
.pg-signal input { width: 110px; font-family: var(--mono); font-size: 12px; }
.pg-signal input:nth-of-type(2) { width: 150px; }

.pg-workers { display: grid; gap: 8px; }
.pg-worker { display: grid; grid-template-columns: 82px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--rule); background: var(--paper); font-size: 13px; transition: background-color 200ms ease, border-color 200ms ease; }
.pg-worker span { font: 12px var(--mono); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-worker[data-state='busy'] { border-color: var(--ink); background: var(--green-soft); }
.pg-worker[data-state='busy'] span { color: var(--green-ink); }
.pg-worker[data-state='dead'] { border-color: var(--red); background: var(--red-soft); }
.pg-worker[data-state='dead'] span { color: var(--red-ink); }
.pg-kill { height: 26px; padding: 0 10px; font: 600 12px var(--sans); border-radius: 7px; border: 2px solid var(--ink); background: var(--red); color: #fff; cursor: pointer; transition: transform 160ms var(--ease-out); }
.pg-kill:active { transform: scale(0.95); }

.pg-status { font: 13px var(--mono); color: var(--ink-2); min-height: 1.5em; }
.pg-status b { color: var(--ink); }
.pg-link { border: 0; background: none; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-chip { font: 500 11.5px var(--mono); padding: 4px 9px; border-radius: 99px; border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; transition: transform 160ms var(--ease-out), background-color 160ms ease; }
.pg-chip:active { transform: scale(0.96); }
.pg-chip i { font-style: normal; opacity: 0.6; margin-left: 4px; }
.pg-chip[data-sel='true'] { background: var(--ink); color: var(--paper); }
.pg-chip[data-st='failed'], .pg-chip[data-st='stuck'] { border-color: var(--red); }
.pg-chip[data-st='completed'] i { color: var(--green); opacity: 1; }
.pg-empty { font: 12.5px var(--mono); color: var(--ink-3); padding: 6px 2px; }

.pg-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--ink); margin-top: 2px; }
.pg-tabs button { font: 600 13px var(--sans); padding: 8px 12px 9px; border: 2px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; background: none; cursor: pointer; color: var(--ink-3); margin-bottom: -2px; transition: color 160ms ease, background-color 160ms ease; }
.pg-tabs button[aria-selected='true'] { color: var(--ink); background: var(--surface); border-color: var(--ink); border-bottom: 2px solid var(--surface); }
.pg-panel { min-height: 0; flex: 1; }
.pg-panel[hidden] { display: none; }
.pg-history { max-height: 400px; min-height: 300px; overflow: auto; border: 1.5px solid var(--rule); border-radius: 10px; background: var(--paper); }
.pg-history table { width: 100%; border-collapse: collapse; font: 12px/1.5 var(--mono); }
.pg-history td { padding: 3px 8px; vertical-align: top; }
.pg-history .n { color: var(--ink-3); text-align: right; width: 2.6em; font-variant-numeric: tabular-nums; }
.pg-history .t { white-space: nowrap; }
.pg-history .d { color: var(--ink-2); word-break: break-word; }
.pg-history .s { color: var(--ink-3); text-align: right; white-space: nowrap; }
.pg-history tr.ok .t { color: var(--green-ink); }
.pg-history tr.warn .t, .pg-history tr.warn .d { color: var(--amber-ink); }
.pg-history tr.bad .t, .pg-history tr.bad .d { color: var(--red-ink); font-weight: 600; }
.pg-history tr.takeover { background: var(--amber-soft); }
.pg-history tr.takeover td { color: var(--ink); font-weight: 600; }
.pg-history tbody tr { animation: logIn 240ms var(--ease-out); }

.pg-sql { width: 100%; height: 118px; resize: vertical; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 10px; background: #15130f; color: #efe9d9; font: 12.5px/1.6 var(--mono); }
.pg-sqlbar { display: flex; align-items: center; gap: 12px; margin: 8px 0; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.pg-sqlbar kbd { background: rgba(255, 255, 255, 0.25); }
.pg-table { overflow: auto; max-height: 300px; border: 1.5px solid var(--rule); border-radius: 10px; background: var(--paper); }
.pg-table table { width: 100%; border-collapse: collapse; font: 12px/1.5 var(--mono); }
.pg-table th { position: sticky; top: 0; background: var(--paper-2); text-align: left; padding: 5px 9px; font-weight: 600; border-bottom: 1.5px solid var(--rule); }
.pg-table td { padding: 4px 9px; border-bottom: 1px solid var(--rule); vertical-align: top; word-break: break-word; }
.pg-table td i { color: var(--ink-3); }
.pg-table tr.bad td { background: var(--red-soft); color: var(--red-ink); font-weight: 600; }
.pg-meta { margin-top: 6px; font: 12px var(--mono); color: var(--ink-3); }
.pg-sqlerr { padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--red); background: var(--red-soft); color: var(--red-ink); font: 12.5px var(--mono); white-space: pre-wrap; }
.pg-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 10px; font-size: 13px; color: var(--ink-2); }
.pg-stats b { font-family: var(--mono); color: var(--ink); }
.pg-stats .good b { color: var(--green-ink); } .pg-stats .bad b { color: var(--red-ink); }

@media (prefers-reduced-motion: reduce) { .pg-history tbody tr { animation: none; } .pg-boot { transition: none; } }
