html {
  color-scheme: light;
  font-family: Georgia, "Times New Roman", serif;
  background: #fbfaf7;
  color: #191714;
}

body {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #d8d1c4;
}

.brand {
  font: 700 1.1rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #111;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.9rem;
}

a {
  color: #7d1d1d;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

a:hover {
  color: #111;
}

main {
  max-width: 76rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.intro {
  max-width: 52rem;
  margin-bottom: 3rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  font: 700 0.78rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #675f54;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 4.6rem);
  max-width: 12ch;
}

h2 {
  margin: 0 0 0.8rem;
  font-size: 1.55rem;
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.lede {
  max-width: 43rem;
  font-size: 1.16rem;
  color: #3d3832;
}

.lesson-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  max-width: 52rem;
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  color: #4c463f;
  font-size: 0.98rem;
}

.lesson-topics li {
  margin: 0;
  padding-right: 0.2rem;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.1rem;
  margin-top: 1.2rem;
  font-weight: 700;
}

.section-block {
  border-top: 1px solid #d8d1c4;
  padding: 1.5rem 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem 1.4rem;
}

article p,
.section-block p {
  margin: 0.35rem 0 0;
}

.link-list,
.compact-list,
.columns {
  margin: 0;
  padding-left: 1.25rem;
}

.link-list li {
  margin: 0.45rem 0;
}

.link-list span {
  display: block;
  color: #5e574e;
}

.columns {
  columns: 2 16rem;
}

.note {
  background: #f3efe7;
  margin-inline: -1rem;
  padding-inline: 1rem;
}

footer {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid #d8d1c4;
  color: #5e574e;
  font-size: 0.95rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

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

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    max-width: 100%;
  }
}


.intro.compact {
  max-width: 58rem;
  margin-bottom: 2rem;
}

.intro.compact h1 {
  max-width: 15ch;
}

.compact-list li {
  margin: 0.35rem 0;
}

.link-list strong {
  display: inline-block;
  color: #191714;
}

.section-block article {
  min-width: 0;
}

.section-block article p:last-child {
  font-size: 0.95rem;
}

@media print {
  .site-header nav,
  .quick-links {
    display: none;
  }

  html {
    background: #fff;
  }

  a {
    color: #000;
  }
}


pre {
  max-width: 56rem;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid #d8d1c4;
  background: #fffdf8;
  font-size: 0.9rem;
  line-height: 1.45;
}

pre code {
  font-size: inherit;
}


.lesson {
  max-width: 58rem;
}

.lesson h2 {
  margin-top: 2rem;
}

.lesson h2:first-child {
  margin-top: 0;
}

.lesson p {
  max-width: 48rem;
}

.lesson .link-list {
  max-width: 50rem;
}

.diagram {
  max-width: 58rem;
  margin: 1.25rem 0;
  overflow-x: auto;
}

.diagram svg {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid #d8d1c4;
  background: #fffdf8;
}

.diagram marker path {
  fill: #4c463f;
}

.diagram-arrow {
  fill: none;
  stroke: #4c463f;
  stroke-width: 1.5;
}

.diagram-cell-box,
.diagram-tree-node-box,
.diagram-state-circle {
  fill: #fffaf0;
  stroke: #191714;
  stroke-width: 1.4;
}

.diagram-state-final {
  fill: none;
  stroke: #191714;
  stroke-width: 1.1;
}

.diagram-tree-edge {
  fill: none;
  stroke: #6f675d;
  stroke-width: 1.35;
}

.diagram-tree-root .diagram-tree-node-box {
  stroke-width: 1.8;
}

.diagram-cell-divider,
.diagram-empty-mark {
  stroke: #191714;
  stroke-width: 1.2;
}

.diagram-cell-id,
.diagram-root-label,
.diagram-tree-label,
.diagram-state-label,
.diagram-edge-label,
.diagram-atom {
  fill: #191714;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  text-anchor: middle;
}

.diagram-cell-id,
.diagram-root-label,
.diagram-edge-label {
  fill: #675f54;
  font-size: 0.72rem;
}

.diagram-model {
  display: none;
}

.diagram-error {
  border: 1px solid #b84a3a;
  padding: 1rem;
  background: #fff7f3;
}


.scheme-code .sx-standard {
  color: #8b1e1e;
  font-weight: 700;
}

.scheme-code .sx-local {
  color: #1f5f4a;
  font-weight: 700;
}

.scheme-code .sx-identifier {
  color: #27231d;
}

.scheme-code .sx-literal {
  color: #5b3f8c;
}

.scheme-code .sx-comment {
  color: #6a6f62;
  font-style: italic;
}

.scheme-code .sx-paren {
  color: #8a8174;
}

.code-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  max-width: 48rem;
  margin: 0.75rem 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.code-legend li {
  margin: 0;
}

.term-grid {
  display: grid;
  grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
  gap: 0.55rem 1rem;
  max-width: 58rem;
}

.term-grid dt {
  font-weight: 700;
}

.term-grid dd {
  margin: 0;
}

@media (max-width: 42rem) {
  .term-grid {
    display: block;
  }

  .term-grid dd {
    margin: 0 0 0.8rem;
  }
}

.plain-text-link {
  margin-top: 0.85rem;
  font-size: 0.95rem;
}

.scheme-playground {
  max-width: 56rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #cfc6b8;
  background: #fffdf8;
}

.scheme-playground label {
  display: block;
}

.scheme-playground label span {
  display: block;
  margin-bottom: 0.45rem;
  font: 700 0.8rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
  color: #675f54;
}

.scheme-playground textarea,
.scheme-playground input {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #d8d1c4;
  padding: 0.8rem;
  background: #ffffff;
  color: #191714;
  font: 0.92rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.scheme-playground textarea {
  min-height: 8rem;
  resize: vertical;
}

.scheme-playground input {
  min-height: 2.5rem;
}

.scheme-playground-compact {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.scheme-playground-compact .scheme-playground-actions {
  margin-top: 0;
}

.scheme-playground-compact .scheme-output {
  grid-column: 1 / -1;
}

@media (max-width: 42rem) {
  .scheme-playground-compact {
    display: block;
  }

  .scheme-playground-compact .scheme-playground-actions {
    margin-top: 0.75rem;
  }
}

.scheme-playground-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.scheme-playground button {
  border: 1px solid #7d1d1d;
  padding: 0.35rem 0.75rem;
  background: #7d1d1d;
  color: #fffdf8;
  font: 700 0.86rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
}

.scheme-playground button + button {
  border-color: #8a8174;
  background: #fffdf8;
  color: #191714;
}

.scheme-playground button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.scheme-output {
  margin: 0.8rem 0 0;
  min-height: 2.2rem;
  white-space: pre-wrap;
}
