@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/eb-garamond-regular.woff2") format("woff2");
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/eb-garamond-italic.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/jetbrains-mono-regular.woff2") format("woff2");
}

:root {
  --bg: #000000;
  --text: #e6e6e6;
  --muted: #6a6a6a;
  --dim: #9a9a9a;
  --line: #171717;
  --code: #8fb8e6;
  --mono: "JetBrains Mono", monospace;
  --sans: "EB Garamond", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-transform: lowercase;
}

::selection { background: #1f1f1f; }

.wrap { max-width: 620px; margin: 0 auto; padding: 0 28px; }

/* header */
header { border-bottom: 1px solid var(--line); }
.nav {
  max-width: 620px; margin: 0 auto; padding: 18px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.5px; color: var(--text); text-decoration: none;
  text-transform: uppercase;
}
.links { display: flex; align-items: center; gap: 18px; }
.links a { color: var(--muted); display: inline-flex; transition: color 0.15s; }
.links a:hover { color: var(--text); }

/* contract address */
.ca { font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: 0.3px; }
.ca .lbl { color: var(--muted); }

/* logo */
.logo { display: flex; justify-content: center; padding: 96px 0 72px; }
.logo img { width: 200px; height: auto; display: block; filter: grayscale(1) contrast(200%); }

/* experiment chart */
.experiment-chart { margin: 0 0 54px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 0 18px; }
.chart-head h2 { margin: 5px 0 0; color: var(--text); font-family: var(--mono); font-size: 13px; }
.chart-index, .chart-status { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.chart-status { padding-top: 4px; }
.chart-status i { display: inline-block; width: 5px; height: 5px; border: 1px solid var(--dim); border-radius: 50%; margin-right: 7px; }
.chart-status.test { color: var(--dim); }
.chart-meta { display: grid; grid-template-columns: 1fr 1.55fr .75fr .85fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chart-meta > div { padding: 12px 12px 11px 0; border-right: 1px solid var(--line); }
.chart-meta > div:not(:first-child) { padding-left: 12px; }
.chart-meta > div:last-child { border-right: 0; }
.chart-meta span, .chart-signals span { display: block; font-family: var(--mono); font-size: 8px; color: var(--muted); margin-bottom: 5px; }
.chart-meta b, .chart-signals b { display: block; font-family: var(--mono); font-size: 10px; color: var(--text); font-weight: 400; }
.probability-readout { display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 18px; padding: 20px 0 18px; border-bottom: 1px solid var(--line); }
.probability-readout > span { font-family: var(--mono); font-size: 9px; color: var(--muted); align-self: center; }
.probability-readout strong { font-family: var(--mono); font-size: 36px; line-height: 1; font-weight: 400; color: var(--text); }
.probability-readout p { margin: 0; font-family: var(--mono); font-size: 9px; color: var(--text); text-align: right; }
.probability-readout small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.plot { padding: 22px 0 8px; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot-grid line { stroke: #202020; stroke-width: 1; stroke-dasharray: 2 5; }
.plot-labels text, .baseline-key text, .awaiting text { fill: var(--muted); font-family: var(--mono); font-size: 8px; }
.plot-labels text { text-anchor: middle; }
.plot-labels text:nth-child(-n+3) { text-anchor: end; }
.plot-labels .axis-title { fill: #555; }
.baseline { fill: none; stroke: #5a5a5a; stroke-width: 1; stroke-dasharray: 4 5; }
.baseline-key line { stroke: #5a5a5a; stroke-width: 1; stroke-dasharray: 4 4; }
.awaiting circle { fill: #000; stroke: #fff; stroke-width: 1; }
.awaiting line { stroke: #555; stroke-width: 1; }
.awaiting text:first-of-type { fill: var(--text); }
.test-marker line { stroke: #6b6b6b; stroke-width: 1; stroke-dasharray: 3 4; }
.test-marker circle { fill: #000; stroke: #fff; stroke-width: 1; }
.test-marker text { fill: var(--muted); font-family: var(--mono); font-size: 8px; text-anchor: end; }
.test-marker text:first-of-type { fill: var(--text); }
.sample-marker line { stroke: #888; stroke-width: 1; }
.sample-marker circle { fill: #fff; stroke: #fff; stroke-width: 1; }
.sample-marker text { fill: var(--muted); font-family: var(--mono); font-size: 8px; text-anchor: end; }
.sample-marker text:first-of-type { fill: var(--text); }
.chart-signals { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid var(--line); }
.chart-signals > div { padding: 12px 0; border-right: 1px solid var(--line); }
.chart-signals > div:not(:first-child) { padding-left: 14px; }
.chart-signals > div:last-child { border-right: 0; }
.chart-note { margin: 0; padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 9px; line-height: 1.6; }

/* intro */
.intro { padding-bottom: 8px; }
.intro p { font-size: 17px; line-height: 1.8; color: var(--text); margin: 0; letter-spacing: -0.1px; }

.essay p { color: var(--dim); margin: 0 0 20px; font-size: 17px; line-height: 1.8; }
.essay p:last-child { margin-bottom: 0; }
.essay .pull {
  color: var(--text); font-size: 17px; line-height: 1.8;
  margin: 30px 0 0; font-style: normal;
}
.essay .cite { font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 26px; }
.essay .cite a { color: var(--dim); text-decoration: none; border-bottom: 1px solid var(--line); }
.essay .cite a:hover { color: var(--text); border-bottom-color: var(--muted); }

.references { margin-top: 30px; border-top: 1px solid var(--line); }
.references p {
  display: grid; grid-template-columns: 26px 1fr auto auto; gap: 12px;
  align-items: baseline; margin: 0; padding: 13px 0;
  border-bottom: 1px solid var(--line); font-family: var(--mono);
  font-size: 11px; line-height: 1.6;
}
.references span { color: var(--muted); }
.references em { color: var(--dim); font-style: normal; }
.references a { color: var(--muted); text-decoration: none; }
.references a:hover { color: var(--text); }

.equation {
  margin: 28px 0; padding: 18px 20px; border: 1px solid var(--line);
  background: #050505; display: flex; flex-direction: column; gap: 8px;
  font-family: var(--mono); font-size: 12px;
}
.equation code { border: 0; background: none; padding: 0; color: var(--text); font-size: 12px; }
.equation .comment { color: var(--muted); }

.signal-list, .protocol, .spec-list { margin: 28px 0 0; }
.signal-list > div, .protocol > div, .spec-list > div {
  display: grid; grid-template-columns: 110px 1fr; gap: 20px;
  padding: 13px 0; border-top: 1px solid var(--line); align-items: baseline;
}
.signal-list dt, .protocol dt, .spec-list dt {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.signal-list dd, .protocol dd, .spec-list dd {
  margin: 0; color: var(--dim); font-size: 17px; line-height: 1.7;
}

code {
  font-family: var(--mono); font-size: 0.88em; color: #cfcfcf;
  background: #0b0b0b; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
/* the one accented value on the whole site */
code.f { color: var(--code); }

hr { border: none; border-top: 1px solid var(--line); margin: 48px 0; }

/* section headings */
h2 {
  font-family: var(--sans); font-size: 16px; font-weight: 400;
  letter-spacing: 0; text-transform: lowercase; color: var(--muted);
  margin: 0 0 32px;
}

/* lore */
.lore p { color: var(--dim); margin: 0 0 18px; }
.lore em { font-style: normal; color: var(--text); }
.lore .cite { font-size: 13px; color: var(--muted); margin-top: 24px; }
.lore .cite a { color: var(--dim); text-decoration: none; border-bottom: 1px solid var(--line); }
.lore .cite a:hover { color: var(--text); border-bottom-color: var(--muted); }

/* diagrams */
.diagram { margin: 6px 0 30px; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram text { font-family: var(--mono); text-anchor: middle; fill: var(--dim); font-size: 12px; }
.diagram .node rect, .diagram .snode circle { fill: #070707; stroke: var(--line2); stroke-width: 1; }
.diagram .node.open rect { stroke-dasharray: 3 4; }
.diagram .node text, .diagram .snode text { fill: var(--text); font-size: 12.5px; }
.diagram .node .sub { fill: var(--muted); font-size: 9.5px; }
.diagram .snode.dead circle { stroke: #333; }
.diagram .snode.dead text { fill: var(--muted); }
.diagram text.acc { fill: var(--code); font-size: 12px; }
.diagram .lab { fill: var(--muted); font-size: 10.5px; }
.diagram line, .diagram path { stroke: #4f4f4f; stroke-width: 1; }
.diagram figcaption { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: center; margin-top: 12px; line-height: 1.5; }

/* prose sections */
.why p, .ledger p { color: var(--dim); margin: 0 0 18px; }
.why p:last-child, .ledger p:last-child { margin-bottom: 0; }

/* notes / qa */
.qa { padding: 16px 0; border-top: 1px solid var(--line); }
.qa:first-of-type { border-top: none; padding-top: 0; }
.qa .q { margin: 0 0 6px; color: var(--text); font-size: 14.5px; font-weight: 600; }
.qa .a { margin: 0; color: var(--dim); font-size: 14px; }

/* how it works */
.mech .step { display: grid; grid-template-columns: 40px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.mech .step:first-of-type { border-top: none; padding-top: 0; }
.mech .step .n { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 3px; }
.mech h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; color: var(--text); }
.mech .step p { margin: 0; color: var(--dim); font-size: 14px; }

/* labelled rows (states, status) */
.srow { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); align-items: baseline; }
.srow:first-of-type { border-top: none; }
.srow .k { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.srow p { margin: 0; color: var(--dim); font-size: 17px; }

/* spec */
.spec dl { margin: 0; font-family: var(--mono); font-size: 13.5px; }
.spec dl > div {
  display: grid; grid-template-columns: 130px 1fr; gap: 16px;
  padding: 11px 0; border-top: 1px solid var(--line);
}
.spec dl > div:first-child { border-top: none; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; color: var(--dim); }

/* footer */
footer {
  max-width: 620px; margin: 96px auto 0; padding: 24px 28px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}

@media (max-width: 560px) {
  .brand { font-size: 8px; letter-spacing: 0; }
  .logo { padding: 64px 0 52px; }
  .logo img { width: 160px; }
  .intro p { font-size: 17px; }
  .spec dl > div,
  .srow { grid-template-columns: 92px 1fr; gap: 12px; }
  footer { flex-direction: column; gap: 6px; }
  .references p { grid-template-columns: 22px 1fr; }
  .references a { grid-column: 2; }
  .chart-meta { grid-template-columns: 1fr 1fr; }
  .chart-meta > div:nth-child(2) { border-right: 0; }
  .chart-meta > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .chart-signals { grid-template-columns: 1fr 1fr; }
  .chart-signals > div:nth-child(2) { border-right: 0; }
  .chart-signals > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .probability-readout { grid-template-columns: 1fr auto; }
  .probability-readout p { grid-column: 1 / -1; text-align: left; }
}
