:root {
  color-scheme: dark;
  --ink: #14110d;
  --ink-2: #1c1813;
  --paper: #f3ead9;
  --paper-2: #e7dcc6;
  --text: #f3ead9;
  --muted: #b5a993;
  --amber: #f5b83d;
  --amber-deep: #855400;
  --on-paper: #1c1712;
  --on-paper-muted: #5c5243;
  --line: rgba(243, 234, 217, 0.14);
  --line-paper: rgba(28, 23, 18, 0.16);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  padding: 8px 14px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 600;
  border-radius: 6px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(var(--maxw), 100% - 40px);
  margin-inline: auto;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h2 {
  margin: 0 0 32px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
}
h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}
p { margin: 0; }

/* Header ------------------------------------------------------------------ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  width: min(var(--maxw), 100% - 40px);
  margin-inline: auto;
  padding: 22px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}
.brand img { display: block; }
.wordmark {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.wordmark em {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  color: var(--amber);
  letter-spacing: -0.01em;
}
nav { display: flex; flex-wrap: wrap; gap: 6px 24px; }
nav a {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}
nav a:hover { color: var(--text); }

/* Hero -------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
  padding-block: clamp(36px, 7vw, 88px) clamp(56px, 9vw, 112px);
}
.hero h1 {
  margin: 0 0 24px;
  font-size: clamp(36px, 5.2vw, 58px);
  line-height: 1.08;
}
.lede {
  max-width: 54ch;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 19px);
}
.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-weight: 600;
}
.pip {
  width: 11px;
  height: 12px;
  background: var(--amber);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

/* Ledger: the archive queue ----------------------------------------------- */
.ledger {
  margin: 0;
  background: var(--paper);
  color: var(--on-paper);
  border-radius: 6px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), 8px 8px 0 var(--amber);
  font-size: 15px;
}
.ledger-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 2px solid var(--on-paper);
  font-weight: 600;
}
.ledger-head span:last-child { font-weight: 400; color: var(--on-paper-muted); }
.ledger-rows { list-style: none; margin: 0; padding: 0; }
.ledger-rows li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 6.5em;
  align-items: baseline;
  gap: 4px 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-paper);
}
.rec { font-family: var(--serif); font-size: 16.5px; }
.len { font-family: var(--mono); font-size: 13px; color: var(--on-paper-muted); }
.state { font-size: 13.5px; font-weight: 600; text-align: right; }
.is-working .state { font-family: var(--mono); font-weight: 400; color: var(--amber-deep); }
.is-queued .state { color: var(--on-paper-muted); font-weight: 400; }
.is-held { background: var(--paper-2); }
.is-held .rec { color: var(--on-paper-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.is-held .state { font-weight: 400; color: var(--on-paper-muted); }
.bar {
  grid-column: 1 / -1;
  height: 4px;
  margin-top: 4px;
  background: var(--line-paper);
  border-radius: 2px;
  overflow: hidden;
}
.bar span { display: block; height: 100%; background: var(--amber-deep); }
.ledger figcaption {
  padding: 10px 20px 12px;
  font-size: 13px;
  color: var(--on-paper-muted);
}

/* Sections ---------------------------------------------------------------- */
.section { padding-block: clamp(56px, 8vw, 96px); }
.band {
  padding-block: clamp(56px, 8vw, 96px);
  background: var(--ink-2);
  border-block: 1px solid var(--line);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--amber);
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  color: var(--amber);
}
.steps p, .outputs p, .promises dd, .status p { color: var(--muted); font-size: 16px; }

.outputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.outputs article { display: flex; flex-direction: column; }
.outputs p { margin-bottom: 16px; }
.outputs pre {
  margin: auto 0 0;
  padding: 16px 18px;
  background: var(--paper);
  color: var(--on-paper);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.promises {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
}
.promises div {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.promises dt { font-weight: 600; font-size: 18px; margin-bottom: 6px; }
.promises dd { margin: 0; max-width: 52ch; }

.status {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
}
.status h2 { margin-bottom: 18px; }
.status p { max-width: 50ch; font-size: 17px; }
.later {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 16px;
}
.later li { padding: 7px 0; border-bottom: 1px solid var(--line); }

/* 404 --------------------------------------------------------------------- */
.notfound { padding-block: clamp(56px, 12vw, 140px); max-width: 640px; }
.notfound h1 { margin: 0 0 18px; font-size: clamp(34px, 5vw, 52px); line-height: 1.1; }
.notfound p { color: var(--muted); margin-bottom: 24px; }

/* Footer ------------------------------------------------------------------ */
.site-footer {
  width: min(var(--maxw), 100% - 40px);
  margin-inline: auto;
  padding: 32px 0 40px;
  color: var(--muted);
  font-size: 14.5px;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .ledger { margin-right: 8px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outputs, .status { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .steps, .promises { grid-template-columns: minmax(0, 1fr); }
  .ledger-rows li { grid-template-columns: minmax(0, 1fr) auto; }
  .ledger-rows .len { display: none; }
  .ledger-head, .ledger-rows li, .ledger figcaption { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
