:root {
  color-scheme: light;
  --paper: #f7f8f2;
  --ink: #19281e;
  --muted: #435448;
  --line: #c7d0c3;
  --forest: #133e2b;
  --accent: #d4f486;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
a { color: inherit; text-underline-offset: .22em; }
a:hover, summary:hover { color: #23683e; }
:focus-visible { outline: 3px solid #4f882f; outline-offset: 4px; }
.wrap { width: min(75rem, calc(100% - 6rem)); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus { position: absolute; top: .5rem; left: 1rem; z-index: 2; padding: .6rem; background: white; }
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 5.25rem;
  border-bottom: 1px solid var(--line);
}
.brand, nav { display: flex; align-items: center; }
.brand { gap: .75rem; font-weight: 700; text-decoration: none; }
.brand-mark { position: relative; width: 1.65rem; height: 1.5rem; }
.brand-mark::before, .brand-mark::after {
  content: "";
  position: absolute;
  width: .9rem;
  height: .9rem;
  border: 2px solid var(--forest);
}
.brand-mark::before { top: 0; left: 0; }
.brand-mark::after { right: 0; bottom: 0; background: var(--accent); }
nav { gap: 1.75rem; }
nav a { text-decoration: none; font-size: .9375rem; }
nav a:hover { text-decoration: underline; }
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(3.5rem, 7vw, 6rem);
}
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
h1 { font-size: clamp(3.8rem, 6vw, 6.3rem); line-height: .98; letter-spacing: -.055em; }
h1 em { color: #285b3d; font-weight: inherit; }
.intro p { max-width: 33rem; margin: 1.8rem 0 1.1rem; font-size: 1.15rem; }
.in-text { color: var(--forest); font-weight: 600; }
.experiment {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background-color: var(--forest);
  background-image: radial-gradient(rgba(232, 250, 238, .12) .9px, transparent .9px);
  background-size: 12px 12px;
  color: #f6faee;
  border-radius: .35rem;
}
figcaption { font-family: var(--serif); font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.17; margin-bottom: 1.2rem; }
.switcher { min-inline-size: 0; border: 0; margin: 0; padding: 0; }
.switcher label {
  display: inline-block;
  margin: .1rem .17rem .1rem 0;
  padding: .35rem .7rem;
  border: 1px solid #9ab6a1;
  border-radius: 2rem;
  background: var(--forest);
  color: #f6faee;
  font-size: .875rem;
  cursor: pointer;
}
.switcher input:checked + label { border-color: var(--accent); background: var(--accent); color: #1a3320; }
.switcher input:focus-visible + label { outline: 2px solid white; outline-offset: 3px; }
.chain { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem; margin-block: 1.5rem 1rem; }
.node { position: relative; border: 1px solid #789381; border-radius: .2rem; padding: 1rem; background: #183f2f; }
.node + .node::before { content: ""; position: absolute; top: 50%; left: calc(-1.3rem - 1px); width: 1.3rem; border-top: 2px solid var(--accent); }
.block-num, .node dt { color: #c6d9c8; font-size: .875rem; }
.entry { margin: .48rem 0 1.15rem; font-weight: 650; line-height: 1.25; }
.node dd { color: var(--accent); }
code { font: .9375rem var(--mono); }
.after { display: none; }
#edited:checked ~ .chain .before, #edited:checked ~ .result.before { display: none; }
#edited:checked ~ .chain .after { display: inline; }
#edited:checked ~ .result.after { display: block; }
#edited:checked ~ .chain .node:first-child dd { color: #ffc49a; }
#edited:checked ~ .chain .node + .node::before { border-top: 2px dashed #ffc49a; }
.result { min-height: 3em; line-height: 1.45; font-size: 1rem; }
.model-note { color: #c6d9c8; border-top: 1px solid #577d65; padding-top: .75rem; font-size: .8125rem; }
.chapter { scroll-margin-top: 1rem; display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 7vw, 6rem); border-top: 1px solid var(--line); padding-block: clamp(2.5rem, 6vw, 5rem); }
h2 { max-width: 21rem; font-size: clamp(2rem, 3.3vw, 3.2rem); line-height: 1.1; letter-spacing: -.035em; }
.steps { margin: 0; padding-left: 1.75rem; }
.steps li { padding-left: .4rem; }
.steps li::marker { font-family: var(--mono); color: #406644; font-size: .95rem; }
.steps li + li { margin-top: 1.35rem; }
h3, summary { font-size: 1.15rem; font-weight: 650; line-height: 1.35; }
.steps p, details p { max-width: 60ch; margin-top: .45rem; color: var(--muted); }
details { border-top: 1px solid var(--line); padding: 1rem 0; }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; }
summary::marker { color: #47744b; font-size: .8em; }
footer { display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; border-top: 1px solid var(--line); padding-block: 1.5rem 2.5rem; font-size: .9375rem; }
footer p { font-weight: 650; }
@media (max-width: 58rem) {
  .wrap { width: min(45rem, calc(100% - 3rem)); }
  .hero, .chapter { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding-block: 3rem; }
  h2 { max-width: 32rem; }
}
@media (max-width: 32rem) {
  .wrap { width: calc(100% - 2rem); }
  .masthead { align-items: flex-start; flex-direction: column; gap: .6rem; padding-block: 1.05rem; }
  nav { gap: 1.2rem; }
  h1 { font-size: clamp(3rem, 14vw, 4rem); }
  .intro p { font-size: 1.0625rem; }
  .chain { grid-template-columns: 1fr; gap: .85rem; }
  .node { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .3rem .4rem; }
  .block-num { grid-column: 1 / -1; }
  .entry { margin: 0; align-self: center; }
  .node + .node::before { left: 1.25rem; top: calc(-.85rem - 1px); width: 0; height: .85rem; border-top: none; border-left: 2px solid var(--accent); }
  #edited:checked ~ .chain .node + .node::before { border-top: none; border-left: 2px dashed #ffc49a; }
  .result { min-height: 0; margin-bottom: .8rem; }
  footer { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 23rem) {
  .node { display: block; }
  .entry { margin: .4rem 0; }
}
