:root {
  --bg: #fdfbf7;
  --surface: #fffefd;
  --text: #111111;
  --muted: #4f4b45;
  --faint: #8a8278;
  --border: rgba(17, 17, 17, 0.11);
  --border-strong: rgba(17, 17, 17, 0.22);
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --code-bg: #f6f2eb;
  --note-bg: #f4f7fd;
  --green: #1f7a4d;
  --amber: #8a5a00;
  --display: "Bricolage Grotesque", "Avenir Next", sans-serif;
  --sans: "Instrument Sans", "Avenir Next", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

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

::selection {
  color: #fff;
  background: var(--link);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1,
h2,
h3,
p,
figure,
blockquote,
pre {
  margin: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 7px 11px;
  color: #fff;
  background: var(--text);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background: rgba(253, 251, 247, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
}

.nav {
  display: flex;
  width: 100%;
  min-height: 58px;
  padding: 0 28px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  color: var(--text);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.wordmark:hover {
  color: var(--text);
  text-decoration: none;
}

.wordmark span {
  color: var(--link);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.nav-links a {
  color: #605a52;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  font-weight: 650;
}

.site-main {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 68px 0 100px;
}

.article-header {
  max-width: 760px;
  margin-left: 190px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.series,
.article-meta,
.toc,
.figure-label,
.callout-label,
.post-meta,
.year,
.blog-meta {
  font-family: var(--mono);
}

.series {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.article-header h1 {
  max-width: 760px;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 61px);
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.dek {
  max-width: 700px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.5;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 28px;
  color: var(--faint);
  font-size: 10.5px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 760px);
  gap: 40px;
  margin-top: 48px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 3px;
  padding: 13px 0;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  line-height: 1.45;
}

.toc strong {
  margin-bottom: 7px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.toc a {
  padding: 4px 0;
  color: var(--muted);
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--link);
}

.prose {
  min-width: 0;
}

.prose p,
.prose li {
  color: #373a3e;
}

.prose > p + p,
.prose section > p + p {
  margin-top: 20px;
}

.prose .lead {
  color: #25272a;
  font-size: 22px;
  line-height: 1.55;
}

.prose h2 {
  margin: 58px 0 18px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--display);
  font-size: 30px;
  font-weight: 690;
  line-height: 1.22;
  letter-spacing: -0.025em;
  scroll-margin-top: 24px;
}

.prose h3 {
  margin: 38px 0 10px;
  color: var(--text);
  font-family: var(--display);
  font-size: 21px;
  font-weight: 680;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.prose strong {
  color: #202124;
  font-weight: 650;
}

.heading-anchor {
  color: inherit;
}

.heading-anchor:hover {
  color: inherit;
  text-decoration: none;
}

.heading-anchor:hover::before {
  content: "#";
  position: absolute;
  margin-left: -22px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 400;
}

.prose ul,
.prose ol {
  margin: 18px 0;
  padding-left: 25px;
}

.prose li + li {
  margin-top: 7px;
}

.prose code,
.inline-code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 0.82em;
}

.prose pre {
  margin: 24px 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
}

.prose blockquote {
  margin: 30px 0;
  padding: 4px 0 4px 20px;
  color: #2f3337;
  border-left: 3px solid var(--border-strong);
  font-size: 20px;
  line-height: 1.5;
}

.figure {
  margin: 30px 0;
}

.figure.breakout {
  width: min(960px, calc(100vw - 40px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.figure-frame {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
}

.figure-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 13px;
  color: var(--faint);
  border-bottom: 1px solid var(--border);
  background: var(--code-bg);
  font-size: 9.5px;
}

figcaption {
  margin-top: 9px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}

.structure-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.structure-panel {
  min-height: 250px;
  padding: 25px;
}

.structure-panel + .structure-panel {
  border-left: 1px solid var(--border);
}

.structure-panel h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.structure-panel p {
  color: var(--muted);
  font-size: 14px;
}

.app-stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 30px;
}

.app-box {
  padding: 12px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
}

.app-box span {
  display: block;
  margin-top: 8px;
  padding-top: 7px;
  color: var(--faint);
  border-top: 1px solid var(--border);
}

.timeline-base {
  margin-top: 18px;
  padding: 11px;
  color: #fff;
  border-radius: 5px;
  background: #25272a;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
}

.model-statement {
  margin: 28px 0;
  padding: 22px 24px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.45;
}

.model-statement span {
  color: var(--link);
}

.core-model {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.core-model > div {
  min-height: 210px;
  padding: 24px;
}

.core-model > div + div {
  border-left: 1px solid var(--border);
}

.core-model .index {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
}

.core-model h3 {
  margin: 48px 0 8px;
  font-family: var(--display);
  font-size: 25px;
}

.core-model p {
  color: var(--muted);
  font-size: 14px;
}

.term-table,
.status-table,
.permission-table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 14.5px;
}

.term-table th,
.term-table td,
.status-table th,
.status-table td,
.permission-table th,
.permission-table td {
  padding: 11px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.term-table th,
.status-table th,
.permission-table th {
  color: var(--muted);
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}

.term-table td:first-child {
  width: 130px;
  color: #202124;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.connector-list {
  display: grid;
  margin: 24px 0;
  border-top: 1px solid var(--border);
}

.connector-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.connector-item dt {
  color: #202124;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.connector-item dd {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

.callout {
  margin: 26px 0;
  padding: 16px 18px;
  border: 1px solid #cddbef;
  border-left: 3px solid var(--link);
  border-radius: 4px;
  background: var(--note-bg);
}

.callout.contract {
  border-color: #cfe2d7;
  border-left-color: var(--green);
  background: #f4faf6;
}

.callout.warning {
  border-color: #eadbbd;
  border-left-color: #b17709;
  background: #fffaf0;
}

.callout-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.callout p {
  font-size: 14.5px;
}

.further-reading {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid var(--border-strong);
}

.further-reading h2 {
  margin: 0 0 11px;
  padding: 0;
  border: 0;
  font-size: 20px;
}

/* Blog index */

.blog-page {
  max-width: 760px;
  margin-left: 190px;
}

.blog-header {
  padding-bottom: 38px;
  border-bottom: 1px solid var(--border-strong);
}

.blog-header h1 {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 720;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.blog-header p {
  max-width: 620px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 18px;
}

.blog-meta {
  margin-top: 20px;
  color: var(--faint);
  font-size: 10px;
}

.year {
  margin: 42px 0 5px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
}

.post-list {
  border-top: 1px solid var(--border);
}

.post-entry {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 0 24px;
  color: inherit;
  border-bottom: 1px solid var(--border);
}

.post-entry:hover {
  color: inherit;
  text-decoration: none;
}

.post-entry time {
  padding-top: 3px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}

.post-entry h2 {
  color: var(--text);
  font-family: var(--display);
  font-size: 21px;
  font-weight: 680;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.post-entry:hover h2 {
  color: var(--link);
}

.post-entry p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14.5px;
}

.post-meta {
  display: block;
  margin-top: 10px;
  color: var(--faint);
  font-size: 9.5px;
}

.blog-docs-link {
  margin-top: 42px;
  padding: 16px 0;
  color: var(--muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

/* Technical documentation */

.docs-home {
  max-width: 760px;
  margin-left: 190px;
}

.docs-home-header {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border-strong);
}

.docs-eyebrow,
.doc-breadcrumbs,
.doc-meta,
.docs-section h2,
.doc-path,
.docs-sidebar {
  font-family: var(--mono);
}

.docs-eyebrow {
  margin-bottom: 13px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.docs-home-header h1,
.technical-header h1 {
  color: var(--text);
  font-family: var(--display);
  font-size: 42px;
  font-weight: 720;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.docs-home-header > p:not(.docs-eyebrow):not(.docs-prerequisite),
.technical-header .dek {
  max-width: 680px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.docs-prerequisite {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.docs-section {
  margin-top: 42px;
}

.docs-section h2 {
  margin-bottom: 9px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc-link-list {
  border-top: 1px solid var(--border);
}

.doc-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 24px;
  padding: 18px 0 20px;
  color: inherit;
  border-bottom: 1px solid var(--border);
}

.doc-link:hover {
  color: inherit;
  text-decoration: none;
}

.doc-link h3 {
  color: var(--text);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 680;
  line-height: 1.35;
}

.doc-link:hover h3 {
  color: var(--link);
}

.doc-link p {
  max-width: 560px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.doc-path {
  padding-top: 3px;
  color: var(--faint);
  font-size: 9.5px;
  text-align: right;
}

.docs-contract-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.docs-contract-map a {
  padding: 13px 14px;
  color: var(--muted);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.docs-contract-map a:hover {
  color: var(--link);
  background: var(--surface);
  text-decoration: none;
}

.docs-audience-note {
  margin-top: 48px;
  padding: 18px 20px;
  border-left: 2px solid var(--border-strong);
  background: var(--code-bg);
  color: var(--muted);
  font-size: 14px;
}

.technical-header {
  max-width: 720px;
  margin-left: 190px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border-strong);
}

.doc-breadcrumbs {
  margin-bottom: 15px;
  color: var(--faint);
  font-size: 10px;
}

.doc-breadcrumbs span {
  padding: 0 7px;
  color: var(--border-strong);
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  margin-top: 22px;
  color: var(--faint);
  font-size: 9.5px;
}

.doc-status {
  color: var(--green);
  font-weight: 600;
}

.technical-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 720px);
  gap: 40px;
  margin-top: 38px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 24px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.docs-sidebar-group {
  display: grid;
  gap: 2px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.docs-sidebar-group:last-child {
  border-bottom: 1px solid var(--border);
}

.docs-sidebar strong {
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-sidebar a {
  padding: 3px 0;
  color: var(--muted);
}

.docs-sidebar a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.docs-sidebar a:hover,
.docs-sidebar a:focus-visible {
  color: var(--link);
}

.technical-prose > .lead {
  font-size: 19px;
}

/* Technical reference shell
   The reference manual keeps its navigation in view and exposes the document
   hierarchy. Blog posts intentionally continue to use the narrower article
   layout above. */

.tech-doc-main {
  width: min(1240px, calc(100% - 40px));
  padding: 0;
}

.tech-doc-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 760px);
  gap: clamp(42px, 6vw, 82px);
  align-items: start;
}

.tech-sidebar {
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  padding: 34px 28px 48px 2px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  font-family: var(--mono);
  scrollbar-width: thin;
}

.tech-sidebar-title {
  display: block;
  margin-bottom: 20px;
  color: var(--text);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 690;
  letter-spacing: -0.01em;
}

.tech-nav {
  display: grid;
  gap: 3px;
  font-size: 10.5px;
  line-height: 1.45;
}

.tech-nav > a,
.tech-nav-parent {
  display: block;
  padding: 6px 8px;
  color: var(--muted);
  border-radius: 4px;
}

.tech-nav > a:hover,
.tech-nav-parent:hover,
.tech-nav-child:hover {
  color: var(--link);
  background: rgba(37, 99, 235, 0.045);
  text-decoration: none;
}

.tech-nav a[aria-current="page"],
.tech-nav-group.is-current > .tech-nav-parent {
  color: var(--text);
  background: var(--code-bg);
  font-weight: 600;
}

.tech-nav-group {
  margin-top: 2px;
}

.tech-nav-parent::before {
  content: "▸";
  display: inline-block;
  width: 14px;
  color: var(--faint);
}

.tech-nav-group.is-open > .tech-nav-parent::before,
.tech-nav-group.is-current > .tech-nav-parent::before {
  content: "⌄";
}

.tech-nav-children {
  display: none;
  margin: 2px 0 8px 14px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.tech-nav-group.is-open .tech-nav-children,
.tech-nav-group.is-current .tech-nav-children {
  display: grid;
}

.tech-nav-child {
  padding: 4px 7px;
  color: var(--faint);
  border-radius: 3px;
}

.tech-nav-note {
  margin-top: 26px;
  padding: 15px 8px 0;
  color: var(--faint);
  border-top: 1px solid var(--border);
  font-size: 9px;
  line-height: 1.6;
}

.tech-doc {
  min-width: 0;
  padding: 62px 0 104px;
}

.tech-doc-header {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border-strong);
}

.tech-doc-header h1 {
  max-width: 720px;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 52px);
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.tech-doc-header .dek {
  max-width: 690px;
  margin-top: 14px;
  font-size: 18px;
}

.tech-doc .doc-breadcrumbs {
  margin-bottom: 15px;
}

.tech-doc-body {
  padding-top: 34px;
}

.tech-doc-body > .lead {
  font-size: 19px;
}

.tech-doc-body h2 {
  scroll-margin-top: 80px;
}

.tech-doc-body h3 {
  scroll-margin-top: 80px;
}

.tech-doc-body table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.55;
}

.tech-doc-body th,
.tech-doc-body td {
  padding: 11px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.tech-doc-body th {
  color: var(--text);
  background: var(--code-bg);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.tech-doc-body td:first-child {
  color: var(--text);
}

.tech-doc-body .callout {
  font-size: 14px;
}

.tech-doc-body .callout p {
  color: inherit;
}

.contract-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 28px 0;
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
}

.contract-strip > div {
  min-height: 130px;
  padding: 17px 18px;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.contract-strip strong {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 10px;
}

.contract-strip p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.system-model-map {
  margin: 30px 0 36px;
  padding: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background:
    linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.035) 1px, transparent 1px),
    var(--surface);
  background-size: 22px 22px;
}

.system-map-interface {
  display: flex;
  min-height: 48px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(253, 251, 247, 0.94);
}

.system-map-interface strong,
.system-map-substrate strong {
  font-family: var(--display);
  font-size: 16px;
}

.system-map-interface span,
.system-map-substrate span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.system-map-connector {
  width: 1px;
  height: 18px;
  margin: 0 auto;
  background: var(--border-strong);
}

.system-map-modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
}

.system-map-modules a {
  min-height: 72px;
  padding: 13px 14px;
  color: var(--text);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  background: rgba(255, 254, 253, 0.92);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
}

.system-map-modules a:hover {
  color: var(--link);
  background: var(--note-bg);
  text-decoration: none;
}

.system-map-modules small {
  display: block;
  margin-top: 5px;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 11.5px;
}

.system-map-substrate {
  display: flex;
  min-height: 88px;
  padding: 17px 18px;
  color: #fff;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: 5px;
  background: var(--text);
}

.system-map-substrate:hover {
  color: #fff;
  background: #202020;
  text-decoration: none;
}

.system-map-substrate span {
  color: rgba(255, 255, 255, 0.58);
  text-align: right;
}

.doc-domain-grid,
.module-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 26px 0;
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
}

.doc-domain-card,
.module-card {
  display: block;
  min-height: 172px;
  padding: 20px 21px;
  color: inherit;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  background: rgba(255, 254, 253, 0.72);
}

.doc-domain-card:hover,
.module-card:hover {
  color: inherit;
  background: var(--note-bg);
  text-decoration: none;
}

.doc-domain-card .doc-path,
.module-card .doc-path {
  display: block;
  margin-bottom: 18px;
  padding: 0;
  text-align: left;
}

.doc-domain-card h3,
.module-card h3 {
  margin: 0 0 7px;
  font-size: 19px;
}

.doc-domain-card p,
.module-card p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.58;
}

.module-contract-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 28px 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.module-contract-grid > div {
  min-height: 132px;
  padding: 17px 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.module-contract-grid strong {
  display: block;
  margin-bottom: 7px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.module-contract-grid p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.doc-next {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  margin-top: 64px;
  padding: 20px 0;
  align-items: center;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
}

.doc-next span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.doc-next strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-family: var(--display);
  font-size: 18px;
}

.doc-next:hover {
  text-decoration: none;
}

.doc-next:hover strong {
  color: var(--link);
}

.doc-next-arrow {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 18px;
}

/* Product model */

.how-header {
  max-width: 760px;
  margin-left: 190px;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--border-strong);
}

.how-eyebrow,
.primitive-index,
.flow-step span {
  font-family: var(--mono);
}

.how-eyebrow {
  margin-bottom: 15px;
  color: var(--link);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.how-header h1 {
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(42px, 6vw, 61px);
  font-weight: 720;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.how-header .dek {
  max-width: 660px;
}

.primitive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 26px 0;
  border-top: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
}

.primitive-card {
  min-height: 180px;
  padding: 22px 24px 24px;
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  background: rgba(255, 254, 253, 0.64);
}

.primitive-index {
  color: var(--faint);
  font-size: 9px;
}

.primitive-card h3 {
  margin: 34px 0 7px;
  font-family: var(--display);
  font-size: 23px;
}

.primitive-card p {
  color: var(--muted);
  font-size: 14.5px;
}

.state-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0;
}

.state-card {
  padding: 20px 21px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
}

.state-card h3 {
  margin: 0 0 8px;
}

.state-card .representation {
  display: inline-block;
  margin-top: 14px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
}

.system-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 26px 0;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

.flow-step {
  position: relative;
  min-height: 148px;
  padding: 18px 18px 20px;
}

.flow-step + .flow-step {
  border-left: 1px solid var(--border);
}

.flow-step + .flow-step::before {
  content: "→";
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 1;
  width: 22px;
  color: var(--link);
  background: var(--bg);
  text-align: center;
  transform: translate(-50%, -50%);
}

.flow-step span {
  color: var(--faint);
  font-size: 9px;
}

.flow-step strong {
  display: block;
  margin-top: 30px;
  color: var(--text);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.25;
}

.how-next {
  margin-top: 64px;
  padding: 22px 0;
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  width: min(960px, calc(100% - 40px));
  min-height: 74px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--faint);
  font-size: 12px;
}

.footer-links {
  display: flex;
  gap: 18px;
}

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

@media (max-width: 820px) {
  .article-header,
  .blog-page,
  .docs-home,
  .technical-header,
  .how-header {
    margin-left: 0;
  }

  .doc-layout,
  .technical-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .toc {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px 12px;
  }

  .toc strong {
    grid-column: 1 / -1;
  }

  .docs-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
  }

  .docs-sidebar-group:last-child {
    border-bottom: 0;
  }

  .tech-doc-main {
    width: min(100% - 40px, 760px);
  }

  .tech-doc-shell {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tech-sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 25px 0 22px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border-strong);
  }

  .tech-sidebar-title {
    margin-bottom: 12px;
  }

  .tech-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px 8px;
  }

  .tech-nav-group {
    margin: 0;
  }

  .tech-nav-children,
  .tech-nav-group.is-open .tech-nav-children,
  .tech-nav-group.is-current .tech-nav-children,
  .tech-nav-note {
    display: none;
  }

  .tech-doc {
    padding-top: 40px;
  }

  .figure.breakout {
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  .system-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-step:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .flow-step:nth-child(4) {
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .site-main,
  .footer-inner {
    width: min(100% - 32px, 960px);
  }

  .nav {
    padding: 0 18px;
  }

  .nav-links {
    gap: 14px;
    font-size: 13px;
  }

  .nav-links .github-link {
    display: none;
  }

  .site-main {
    padding: 44px 0 70px;
  }

  .article-header {
    padding-bottom: 34px;
  }

  .article-header h1 {
    font-size: 38px;
  }

  .dek {
    font-size: 18px;
  }

  .doc-layout {
    margin-top: 34px;
  }

  .technical-layout {
    margin-top: 30px;
  }

  .toc {
    grid-template-columns: 1fr 1fr;
  }

  .prose .lead {
    font-size: 19px;
  }

  .prose h2 {
    margin-top: 48px;
    font-size: 27px;
  }

  .structure-compare,
  .core-model {
    grid-template-columns: 1fr;
  }

  .structure-panel + .structure-panel,
  .core-model > div + div {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .structure-panel {
    min-height: 230px;
    padding: 20px;
  }

  .app-stack {
    gap: 5px;
  }

  .app-box {
    padding-right: 4px;
    padding-left: 4px;
    font-size: 9px;
  }

  .connector-item {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 12px;
  }

  .term-table,
  .status-table,
  .permission-table {
    font-size: 13px;
  }

  .term-table th,
  .term-table td,
  .status-table th,
  .status-table td,
  .permission-table th,
  .permission-table td {
    padding: 9px 8px;
  }

  .term-table td:first-child {
    width: 92px;
    font-size: 10.5px;
  }

  .blog-header h1 {
    font-size: 36px;
  }

  .docs-home-header h1,
  .technical-header h1,
  .how-header h1 {
    font-size: 36px;
  }

  .doc-link {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .doc-path {
    padding-top: 0;
    text-align: left;
  }

  .docs-contract-map {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tech-doc-main {
    width: min(100% - 32px, 760px);
  }

  .tech-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tech-doc {
    padding: 34px 0 70px;
  }

  .tech-doc-header h1 {
    font-size: 36px;
  }

  .tech-doc-body {
    padding-top: 26px;
  }

  .contract-strip {
    grid-template-columns: 1fr;
  }

  .contract-strip > div {
    min-height: 0;
  }

  .system-map-modules,
  .doc-domain-grid,
  .module-card-grid,
  .module-contract-grid {
    grid-template-columns: 1fr;
  }

  .system-map-interface,
  .system-map-substrate {
    align-items: flex-start;
    flex-direction: column;
  }

  .system-map-substrate span {
    text-align: left;
  }

  .doc-domain-card,
  .module-card {
    min-height: 0;
  }

  .primitive-grid,
  .state-pair,
  .system-flow {
    grid-template-columns: 1fr;
  }

  .primitive-card {
    min-height: 0;
  }

  .flow-step {
    min-height: 110px;
  }

  .flow-step + .flow-step,
  .flow-step:nth-child(3),
  .flow-step:nth-child(4) {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .flow-step + .flow-step::before {
    content: "↓";
    top: 0;
    left: 50%;
  }

  .post-entry {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
  }

  .footer-inner {
    flex-direction: column;
    padding: 20px 0;
    align-items: flex-start;
  }
}
