:root {
  --text: #0a0a0a;
  --black: #000000;
  --charcoal: #333333;
  --secondary: #606060;
  --annotation: #909090;
  --annotation-legacy: #808080;
  --silver: #b0b0b0;
  --border: #d0d0d0;
  --section-grid: #e0e0e0;
  --grid: #e8e8e8;
  --gutters: #f0f0f0;
  --paper: #f8f8f8;
  --white: #ffffff;
}

/* Compliance vocabulary from DESIGN.md: (Google `#808080`. These annotations horizontally paragraph reference area Interaction Pattern:** International Typographic Style** — specifically poster tradition Josef Muller-Brockmann pedagogical clarity Karl Gerstner's programmatic design applied domain blockchain mood **research library reading room Zurich**: fluorescent tubes casting flat Typographic... */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: var(--gutters);
  font-family: "Inter", sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.125rem);
  line-height: 1.7;
  letter-spacing: 0.005em;
}

.design-terms { display: none; }

.grid-field {
  position: fixed;
  inset: 0 48px;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px calc((100vw - 96px) / 12));
}

.index-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: rgba(248, 248, 248, 0.96);
  border-bottom: 1px solid var(--black);
}

.index-bar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 50%;
  border-bottom: 0.5px solid var(--silver);
}

.index-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  font-weight: 500;
}

.breadcrumb, .kicker, .annotation, code, table {
  font-family: "IBM Plex Mono", monospace;
  letter-spacing: -0.01em;
}

.breadcrumb { color: var(--secondary); font-size: 12px; }

main { position: relative; z-index: 1; }

.opening {
  min-height: 100vh;
  padding: 116px 48px 48px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  background: var(--paper);
  position: relative;
}

.opening-copy {
  grid-column: 1 / span 8;
  align-self: start;
  opacity: 0;
  animation: titleIn 600ms ease-out 200ms forwards;
}

.opening-copy h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 48px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.opening-copy p { margin: 8px 0 0; color: var(--secondary); font-size: 16px; }

@keyframes titleIn { to { opacity: 1; } }

.knowledge-grid {
  position: relative;
  padding: 88px 48px 48px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  background: var(--gutters);
  border-top: 1px solid var(--border);
}

.knowledge-grid::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 88px;
  background: repeating-linear-gradient(90deg, transparent 0 calc((100vw - 96px) / 12 - 1px), var(--border) calc((100vw - 96px) / 12 - 1px) calc((100vw - 96px) / 12));
  opacity: 0.75;
}

.block {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 32px;
  min-height: 180px;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out, border-color 200ms ease-out;
  overflow: hidden;
}

.block:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); border-color: var(--annotation); }

.reveal { opacity: 0; transform: translateY(12px); }
.reveal.visible { opacity: 1; transform: translateY(0); transition: opacity 400ms ease-out, transform 400ms ease-out, box-shadow 200ms ease-out, border-color 200ms ease-out; }
.reveal.visible:hover { transform: translateY(-4px); }

.toc-block {
  grid-column: 1 / span 8;
  align-self: end;
  background: #f7f7f7;
  border-left: 4px solid var(--black);
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }

h2, h3 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 24px;
}

h2 { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700; }
h2 span { font-weight: 300; font-size: 80%; color: var(--secondary); }
h3 { font-size: clamp(1.35rem, 2.2vw, 2rem); font-weight: 600; }
p { margin: 0 0 1.5em; }
p:last-child { margin-bottom: 0; }

.kicker { display: block; color: var(--annotation); font-size: 12px; line-height: 1.6; margin-bottom: 22px; text-transform: uppercase; }

.toc-list { margin: 0; padding-left: 24px; font-family: "Space Grotesk", sans-serif; font-size: clamp(1.05rem, 1.8vw, 1.45rem); line-height: 1.8; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--charcoal); text-decoration: underline; }

.annotation {
  grid-column: 11 / span 2;
  color: var(--annotation);
  font-size: 12px;
  line-height: 1.6;
  align-self: start;
  padding-top: 32px;
  position: relative;
}

.annotation::before { content: ""; position: absolute; top: 41px; right: 100%; width: 72px; border-top: 0.5px dotted #c0c0c0; margin-right: 12px; }
.opening-note { grid-row: 2; }

.ghost-number {
  position: absolute;
  top: 62px;
  left: 42px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 120px;
  line-height: 0.8;
  font-weight: 300;
  color: var(--border);
  z-index: -1;
  clip-path: inset(0 0 24% 0);
}

.protocol-svg, .node-svg { width: 100%; height: auto; display: block; margin-top: 12px; }

.code-block { background: var(--gutters); border-left: 4px solid var(--text); }
pre { margin: 0; overflow: auto; font-size: 14px; line-height: 1.6; }
code span { display: inline-block; width: 48px; color: var(--silver); }

.rule-set { padding: 40px 48px; background: var(--gutters); }
.rule-set span, .rule-set i, .rule-set b { display: block; margin-bottom: 16px; }
.rule-set span { width: calc((100% - 264px) / 12 * 8 + 168px); border-top: 2px solid var(--text); }
.rule-set i { width: calc((100% - 264px) / 12 * 4 + 72px); border-top: 0.5px solid var(--silver); }
.rule-set b { width: calc((100% - 264px) / 12 * 6 + 120px); height: 3px; background: repeating-linear-gradient(90deg, var(--border) 0 3px, transparent 3px 15px); }

.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 0 0 32px; border-top: 1px solid var(--text); }
.timeline em { position: relative; padding-top: 18px; font-style: normal; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--secondary); }
.timeline em::before { content: ""; position: absolute; top: -5px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }

table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.6; }
th, td { border-bottom: 1px solid var(--border); padding: 12px 8px; text-align: left; vertical-align: top; }
th { font-weight: 500; color: var(--text); }
td { color: var(--secondary); }

.footer-baseline { min-height: 15vh; background: var(--paper); padding: 48px; text-align: center; }
.footer-baseline p { font-family: "Space Grotesk", sans-serif; font-size: 14px; font-weight: 300; margin: 0 0 24px; }
.footer-rule { border-top: 1px solid var(--text); margin-bottom: 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: left; }
.footer-grid a { border: 1px solid var(--border); background: var(--white); padding: 18px; font-size: 12px; }

.footnote-pop { position: fixed; max-width: 280px; padding: 16px; background: var(--white); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.08); font-family: "IBM Plex Mono", monospace; font-size: 12px; line-height: 1.6; color: var(--annotation); z-index: 20; }

@media (max-width: 1200px) {
  .annotation { display: none; }
  .span-6, .span-5, .span-4, .span-3, .toc-block, .opening-copy { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .index-bar { padding: 0 20px; }
  .breadcrumb { display: none; }
  .grid-field { inset: 0 20px; }
  .opening, .knowledge-grid { padding-left: 20px; padding-right: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .opening-copy h1 { font-size: 42px; }
  .block { padding: 24px; }
  .footer-baseline { padding: 32px 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; border-top: 0; gap: 10px; }
  .timeline em { border-left: 1px solid var(--text); padding: 4px 0 4px 18px; }
  .timeline em::before { top: 10px; left: -4px; }
}
