.create-anatomy {
  container-type: inline-size;
  margin: 36px 0 52px;
  scroll-margin-top: 5rem;
}

.create-anatomy h4,
.creation-demo h4,
.creation-gesture-note h4,
.readability-outcome h3 {
  color: var(--text-primary);
  font: 500 clamp(22px, 2vw, 29px)/1.2 var(--font-editorial);
  letter-spacing: -.02em;
  margin: 0 0 10px;
}

.creation-gesture-note p {
  color: var(--text-reading);
  font: 400 15px/1.7 var(--font-system);
}

.gesture-diagram {
  min-width: 0;
  margin: 0;
  padding: 28px 12px 22px;
  background: var(--surface-interactive);
  border-radius: 6px;
  text-align: center;
  font: 400 14px/1.45 var(--font-system);
}

.gesture-control {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  /* Both control illustrations use 1.5 times the demo dimensions. */
  width: 45px;
  height: 45px;
  margin: 0 auto;
  border: 2px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--text-support);
}

.gesture-revised .gesture-control {
  width: 94.5px;
  height: 72px;
  border: 2px dashed #3898ba;
  background-color: #cce8f399;
  background-image: linear-gradient(to right,
    #88c6dc 0 6px, transparent 6px calc(100% - 6px), #88c6dc calc(100% - 6px) 100%);
  color: #13799f;
}

.gesture-plus {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(currentColor, currentColor) center / 15px 2px no-repeat,
              linear-gradient(currentColor, currentColor) center / 2px 15px no-repeat;
}
.gesture-revised .gesture-plus { border: 2px solid; border-radius: 50%; }

.gesture-diagram figcaption { margin: 0; font: inherit; }
.gesture-surface { display: block; margin-top: 9px; color: var(--text-reading); }
.gesture-outcomes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  position: relative;
  max-width: 24rem;
  margin: 0 auto;
  padding-top: 26px;
}
.gesture-outcomes::before,
.gesture-outcomes::after {
  content: "";
  position: absolute;
  border-color: var(--border-strong);
  border-style: solid;
}
.gesture-outcomes::before {
  top: 5px;
  left: 50%;
  height: 9px;
  border-width: 0 0 0 1px;
}
.gesture-outcomes::after {
  top: 14px;
  left: 25%;
  right: 25%;
  height: 8px;
  border-width: 1px 1px 0;
  border-radius: 3px 3px 0 0;
}
.gesture-outcomes dt { color: var(--text-primary); font-weight: 650; }
.gesture-outcomes dd { margin: 8px 4px 0; color: var(--text-reading); }

/* Both gestures start with the primary mouse button pressed. */
.gesture-motion {
  position: relative;
  display: block;
  width: 84px;
  max-width: 100%;
  height: 40px;
  margin: 6px auto;
  color: #126887;
}
.gesture-mouse {
  position: absolute;
  top: 4px;
  left: calc(50% - 10px);
  width: 21px;
  height: 32px;
  box-sizing: border-box;
  border: 1.5px solid currentColor;
  border-radius: 11px;
  background: var(--surface-raised);
  overflow: hidden;
}
.gesture-mouse::before {
  content: "";
  position: absolute;
  inset: 0 50% 57% 0;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  background: currentColor;
}
.gesture-motion-drag::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  margin-left: 10px;
  right: 14px;
  border-top: 2px dashed currentColor;
}
.gesture-motion-drag::after {
  content: "";
  position: absolute;
  top: calc(50% - 3px);
  right: 12px;
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
}
.gesture-motion-drag .gesture-mouse { left: 0; z-index: 1; }

@keyframes gesture-click {
  0%, 20%, 45%, 100% { background: var(--surface-raised); }
  25%, 40% { background: currentColor; }
}
@keyframes gesture-slide {
  0%, 20%, 94%, 100% { left: 0; }
  62%, 93% { left: calc(100% - 24px); }
}
@keyframes gesture-drag-button {
  0%, 10%, 66%, 100% { background-color: var(--surface-raised); }
  15%, 65% { background-color: currentColor; }
}
@keyframes gesture-drag-reset {
  0%, 78%, 100% { opacity: 1; }
  92%, 95% { opacity: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  body:not(.motion-paused) .gesture-motion-click .gesture-mouse::before {
    animation: gesture-click 3s infinite;
  }
  body:not(.motion-paused) .gesture-motion-drag {
    --drag-cycle: 3.6s ease-in-out infinite;
    animation: gesture-drag-reset var(--drag-cycle);
  }
  body:not(.motion-paused) .gesture-motion-drag .gesture-mouse,
  body:not(.motion-paused) .gesture-motion-drag::before {
    animation: gesture-slide var(--drag-cycle);
  }
  body:not(.motion-paused) .gesture-motion-drag .gesture-mouse::before {
    animation: gesture-drag-button var(--drag-cycle);
  }
}

.creation-findings dd {
  max-width: 72ch;
  color: var(--text-reading);
  font-size: 14px;
  line-height: 1.65;
}

.anatomy-versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.anatomy-versions figure {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  row-gap: 8px;
  min-width: 0;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

.anatomy-versions h5 {
  margin: 0;
  align-self: center;
  color: var(--text-support);
  font: 600 13px/1.4 var(--font-system);
}

.anatomy-label,
.anatomy-switch {
  display: flex;
  align-items: center;
}

.anatomy-label {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.anatomy-switch {
  gap: 2px;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  font: 500 12px/1.4 var(--font-system);
}

.anatomy-switch label { position: relative; cursor: pointer; }
.anatomy-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.anatomy-switch span {
  display: block;
  padding: 4px 7px;
  border-radius: 3px;
  color: var(--text-support);
}
.anatomy-switch input:checked + span { background: #deebf0; color: #244854; }
.anatomy-switch input:focus-visible + span { outline: 2px solid currentColor; }

.anatomy-versions img {
  display: block;
  width: 100%;
  height: auto;
}

.anatomy-states .anatomy-details,
figure:has([value="details"]:checked) .anatomy-states img:first-child { display: none; }
figure:has([value="details"]:checked) .anatomy-details { display: block; }

.anatomy-versions figcaption {
  margin: 0;
  max-width: 48ch;
  color: var(--text-reading);
  font: 400 14px/1.55 var(--font-system);
}

@container (max-width: 570px) {
  .anatomy-versions {
    grid-template-columns: 1fr;
  }
}

.creation-demo {
  margin: clamp(48px, 6vw, 88px) 0 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(20px, 4vw, 56px);
  padding: clamp(16px, 2.5vw, 24px);
  background: var(--surface-interactive);
  border: 1px solid var(--hairline);
}

.creation-demo h4 {
  margin: 0;
}

.creation-demo .demo-instruction {
  justify-self: end;
  margin: 0;
  max-width: 50ch;
  line-height: 1.55;
}

.creation-demo iframe {
  grid-column: 1 / -1;
  margin-top: 20px;
  box-sizing: border-box;
  height: 340px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: var(--preview-shadow);
}

.creation-findings {
  container-type: inline-size;
  margin: clamp(72px, 8vw, 116px) 0 0;
  padding-block: clamp(24px, 3vw, 40px);
  border-block: 1px solid var(--hairline);
}

.creation-findings:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.creation-findings h4 {
  margin: 0 0 12px;
  font: 600 12px/1.5 var(--font-system);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-support);
}

.testing-takeaway {
  max-width: 35ch;
  margin: 0;
  font: 500 clamp(25px, 2.5vw, 34px)/1.15 var(--font-editorial);
  color: var(--text-primary);
}

.creation-findings dl {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 16px;
  margin: 26px 0 0;
}

.creation-findings dl > div {
  padding: clamp(18px, 2vw, 24px);
  border-radius: 4px;
}

.creation-findings dl > div:has(.finding-positive) { background: var(--surface-positive); }
.creation-findings dl > div:has(.finding-negative) { background: var(--surface-negative); }

.creation-findings dt {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 600 15px/1.5 var(--font-system);
}

.finding-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 650 14px/1 var(--font-system);
}

.creation-findings dd { margin: 8px 0 0; }
.finding-positive { color: var(--text-positive); }
.finding-negative { color: var(--text-negative); }

.readability-outcome {
  margin-top: clamp(32px, 5vw, 72px);
  border-top: 1px solid var(--hairline);
  padding-top: clamp(24px, 3vw, 40px);
}

.readability-outcome p {
  max-width: 64ch;
  margin: 0;
  line-height: 1.7;
  color: var(--text-reading);
}

@media (max-width: 760px) {
  .creation-demo {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .creation-demo .demo-instruction {
    justify-self: start;
  }

  .creation-demo iframe { margin-top: 8px; }
}

@container (max-width: 530px) {
  .creation-findings dl { grid-auto-flow: row; gap: 16px; }
}

#alternatives-tested {
  scroll-margin-top: 6rem;
  padding: 4px 0;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  font: 600 14px/1.5 var(--font-system);
  text-decoration: underline;
  text-underline-offset: .25em;
  cursor: pointer;
}
#alternatives-tested span { display: inline-block; margin-left: .25em; }
html:has(#creation-alternatives[open]) { overflow: hidden; }
#creation-alternatives {
  width: min(56rem, 94vw);
  max-height: min(85vh, 52rem);
  max-height: min(85dvh, 52rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-canvas);
}
#creation-alternatives[open] { display: flex; flex-direction: column; }
#creation-alternatives header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--hairline);
}
#creation-alternatives h2 {
  margin: 0;
  font: 500 clamp(24px, 3vw, 32px)/1.15 var(--font-editorial);
}
#creation-alternatives button {
  cursor: pointer;
  background: var(--surface-interactive);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 7px 12px;
  font: 500 14px/1.4 var(--font-system);
}
.alternatives-body {
  padding: 0 clamp(16px, 3vw, 32px) 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.alternatives-body p {
  margin: 7px 0 0;
  color: var(--text-reading);
  font: 400 15px/1.55 var(--font-system);
}
.alternatives-body > p { max-width: 65ch; margin: 20px 0; }
.alternatives-body ol { list-style: none; padding: 0; margin: 0; }
.alternatives-body li {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--hairline);
}
.alternatives-body h3 { font: 600 17px/1.35 var(--font-system); margin: 0; }
.alternatives-body dl { display: grid; gap: 12px; margin: 12px 0 0; }
.alternatives-body dt { color: var(--text-support); font: 600 13px/1.4 var(--font-system); letter-spacing: .01em; }
.alternatives-body dd {
  margin: 5px 0 0;
  color: var(--text-reading);
  font: 400 15px/1.6 var(--font-system);
}
.alternative-decision dt { color: var(--text-primary); }
.alternatives-body figure { margin: 0; min-width: 0; }
.alternatives-body img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--hairline);
  border-radius: 4px;
}
.alternatives-body figcaption {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
  margin-top: 5px;
  color: var(--text-support);
  font: 400 12px/1.4 var(--font-system);
}
.alternative-choice {
  display: inline-block;
  margin-left: 4px;
  color: var(--accent);
  font: 600 13px/1.4 var(--font-system);
}
@media (max-width: 600px) {
  .alternatives-body li { grid-template-columns: 1fr; gap: 12px; }
  .alternatives-body figure { order: 1; width: min(100%, 368px); }
}
