@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/IBMPlexSans-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2");
}

:root {
  --paper: #f3eee4;
  --ink: #1c1914;
  --muted: #5c564c;
  --line: #d4cbb8;
  --amber: #c47b12;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--amber);
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.88em;
}

kbd {
  border: 1px solid var(--line);
  padding: 0.05em 0.35em;
  font-size: 0.8em;
}

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 5rem;
}

.mast {
  margin-bottom: 2.75rem;
}

.brand {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.lede {
  margin: 1.5rem 0 0;
  font-size: clamp(1.55rem, 4.2vw, 2.05rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 18em;
}

.support {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 32em;
}

.audience {
  margin: 1.15rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 36em;
}

.beats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.beats li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.85rem 1.1rem;
  align-items: start;
}

.beats .n {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 0.35rem;
}

.beats h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.beats p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.beats code {
  color: var(--ink);
  background: transparent;
}

.trust {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1.5rem;
}

.trust-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.trust-list li {
  margin: 0.4rem 0;
}

.trust-list strong {
  color: var(--ink);
  font-weight: 600;
}

.trust-invariant {
  margin-top: 1rem;
}

.trust-invariant summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  list-style-position: outside;
}

.trust-invariant summary:hover {
  color: var(--amber);
}

.invariant {
  margin: 0.75rem 0 0;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.live {
  margin: 1.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.try-steps {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.try-steps li {
  margin: 0.55rem 0;
}

.try-steps a {
  font-weight: 500;
  color: var(--ink);
}

.try-steps a:hover {
  color: var(--amber);
}

.explain-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.explain-sub {
  margin-top: 1.15rem;
}

.explain-grid > div:first-child .explain-sub {
  margin-top: 0;
}

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.65rem 0.5rem;
  margin-top: 0.5rem;
}

.flow-step {
  flex: 1 1 7.5rem;
  min-width: 6.5rem;
  padding: 0.75rem 0 0.65rem;
  border-top: 1px solid var(--ink);
}

.flow-step-center {
  border-top-color: var(--amber);
}

.flow-label {
  display: block;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.flow-desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.flow-arrow {
  flex: 0 0 auto;
  align-self: center;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--muted);
  padding: 0 0.15rem;
}

.operator-notes {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.operator-notes summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.operator-notes summary:hover {
  color: var(--amber);
}

.live[data-status="ok"] {
  color: var(--ink);
}

.live[data-status="fallback"] {
  color: var(--muted);
}

.door {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: baseline;
}

.door a {
  color: var(--ink);
  text-decoration: underline;
  font-size: 0.95rem;
}

.door a.glass {
  color: #fff;
  background: var(--amber);
  text-decoration: none;
  padding: 0.65rem 1.15rem;
  font-weight: 600;
  font-size: 1rem;
  border: none;
}

.door a.glass:hover {
  filter: brightness(1.05);
  color: #fff;
}

.door a:not(.glass):hover {
  color: var(--amber);
}

.repo {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.repo a {
  color: var(--muted);
}

.toc {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--amber);
  text-decoration: underline;
}

.block {
  margin-top: 3.25rem;
  scroll-margin-top: 1.5rem;
}

.section {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.note {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 1.02rem;
}

.note code {
  color: var(--ink);
}

.frag {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.frag strong {
  color: var(--ink);
  font-weight: 600;
}

.facts {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.facts li {
  margin: 0.45rem 0;
}

.facts code {
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0 0;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.45;
}

table.data th,
table.data td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.75rem 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

table.data th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--ink);
}

table.data td {
  color: var(--muted);
}

table.data td:first-child {
  color: var(--ink);
  font-weight: 500;
}

table.data.pair td:first-child {
  font-weight: 500;
  width: 46%;
}

table.data .num {
  width: 2.2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

table.data.scenarios td:first-child {
  font-weight: 400;
}

table.data code {
  font-size: 0.82em;
  color: var(--ink);
  word-break: break-word;
}

table.data tr.row-invariant td {
  background: rgba(196, 123, 18, 0.08);
  color: var(--ink);
}

.demo {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.demo:first-of-type {
  margin-top: 1.25rem;
}

.demo h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.demo dl {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.demo dl > div {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.65rem;
  align-items: start;
}

.demo dt {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.15rem;
}

.demo dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.demo dd code {
  color: var(--ink);
}

.sub {
  margin: 2rem 0 0.65rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  scroll-margin-top: 1.5rem;
}

.chips {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.chips code {
  color: var(--ink);
}

.mono-box {
  margin: 0.85rem 0 0;
  padding: 0.85rem 1rem;
  background: #ebe4d6;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
  color: var(--ink);
}

@media (max-width: 560px) {
  .page {
    padding: 3rem 1.15rem 4rem;
    max-width: 100%;
  }

  .beats li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .flow {
    flex-direction: column;
  }

  .flow-arrow {
    transform: rotate(90deg);
    padding: 0.15rem 0;
  }

  .flow-step {
    flex: 1 1 auto;
    width: 100%;
  }

  .demo dl > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  table.data.pair td:first-child {
    width: auto;
  }
}
