:root {
  --paper: #f5f2e9;
  --ink: #22261f;
  --muted: #555b50;
  --red: #a43e33;
  --rule: #969b8f;
  --selected: #ead9d1;
  color-scheme: light;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-underline-offset: 0.22em;
}
a:hover {
  color: var(--red);
}
button,
input,
select {
  font: inherit;
  accent-color: var(--red);
}
button,
select {
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
}
button {
  padding: 11px 16px;
  min-height: 44px;
  cursor: pointer;
}
button:hover {
  background: var(--selected);
}
button[aria-pressed="true"] {
  border-color: var(--red);
  background: var(--selected);
  color: var(--red);
}
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}
::selection {
  background: var(--selected);
  color: var(--ink);
}
[hidden] {
  display: none !important;
}
.masthead {
  margin: 0 32px;
  padding: 23px 0 20px;
  border-bottom: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}
.masthead a {
  font:
    600 27px Georgia,
    serif;
  text-transform: uppercase;
  text-decoration: none;
}
.masthead span,
.small,
.stage-description {
  color: var(--muted);
}
.masthead span {
  font-size: 13px;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 34px 32px;
}
h1 {
  font:
    400 clamp(40px, 5vw, 65px) / 1.04 Georgia,
    serif;
  letter-spacing: -0.025em;
  margin: 0 0 19px;
  text-wrap: balance;
}
h1 br {
  display: none;
}
.intro {
  font-size: 17px;
  line-height: 1.55;
  max-width: 72ch;
  margin: 0 0 32px;
}
.proof-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr);
  gap: 48px;
  border-top: 1px solid var(--red);
  padding-top: 24px;
}
.stage-buttons {
  display: flex;
  gap: 8px;
}
.stage-buttons button {
  flex: 1;
}
.stage-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 23px;
}
h2 {
  font:
    400 26px/1.15 Georgia,
    serif;
  margin: 0;
}
#frame-kind {
  font:
    11px ui-monospace,
    monospace;
  color: var(--red);
  text-transform: uppercase;
}
#stage-description {
  line-height: 1.45;
  margin: 9px 0 0;
  min-height: 42px;
}
.stage-description {
  font-size: 15px;
}
#drawing {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  margin: 7px 0 12px;
  overflow: visible;
}
#drawing text {
  font:
    14px Arial,
    sans-serif;
  fill: var(--ink);
}
#drawing .map-cell {
  stroke: var(--paper);
  stroke-width: 0.8;
  cursor: pointer;
}
#drawing .map-cell.selected {
  stroke: var(--ink);
  stroke-width: 1.6;
}
#drawing .cell-number {
  pointer-events: none;
  font-size: 13px;
}
#drawing .light {
  fill: var(--paper);
}
#ghost path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
  pointer-events: none;
}
#anchor {
  fill: var(--ink);
  pointer-events: none;
}
#anchor-label {
  font-size: 11px !important;
  fill: var(--muted) !important;
}
.scrub-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
}
#stage-output {
  font:
    12px ui-monospace,
    monospace;
}
#scrubber {
  display: block;
  width: 100%;
  min-height: 40px;
  margin: 0;
  cursor: ew-resize;
}
.small {
  font-size: 13px;
  line-height: 1.5;
  margin: 4px 0 12px;
}
.motion {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  min-height: 36px;
}
.motion input {
  width: 17px;
  height: 17px;
}
aside {
  border-left: 1px solid var(--rule);
  padding-left: 30px;
  min-width: 0;
}
.definition {
  margin: 0 0 22px;
  display: grid;
  gap: 8px;
}
.definition strong {
  font:
    400 52px/1 Georgia,
    serif;
  color: var(--red);
}
.definition span {
  font-size: 15px;
  line-height: 1.45;
}
.totals {
  padding: 14px 0 20px;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 10px;
}
.totals div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
}
.totals b {
  font:
    14px ui-monospace,
    monospace;
  white-space: nowrap;
}
aside > label {
  display: block;
  font-size: 14px;
  margin: 12px 0 8px;
}
select {
  width: 100%;
  padding: 10px;
  min-height: 44px;
}
#cell-title {
  font-size: 24px;
  margin: 23px 0 9px;
}
#cell-explanation {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 15px;
}
dl {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
#cell-quantities {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
}
#cell-quantities dd {
  font-family: ui-monospace, monospace;
  text-align: right;
}
details {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 16px 0;
  margin: 24px 0 18px;
}
summary {
  font-size: 15px;
  cursor: pointer;
  min-height: 24px;
}
details p {
  font-size: 14px;
  line-height: 1.5;
}
details dt {
  margin-top: 14px;
}
.hash {
  font:
    11px/1.65 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
}
.source-links {
  display: grid;
  gap: 10px;
}
.permalink {
  font-size: 13px;
}
footer {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  margin-top: 32px;
  padding-top: 17px;
}
#error {
  padding: 20px 0;
  border-top: 1px solid var(--red);
}
#error p {
  max-width: 65ch;
  line-height: 1.5;
}
@media (max-width: 850px) {
  .proof-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  aside {
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding: 26px 0 0;
  }
  .definition {
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 22px;
  }
  .totals {
    max-width: 600px;
  }
  .masthead {
    align-items: flex-start;
  }
  .masthead a {
    font-size: 23px;
  }
  .masthead span {
    max-width: 130px;
    text-align: right;
  }
  #drawing {
    max-height: 440px;
  }
}
@media (max-width: 480px) {
  main {
    padding: 28px 18px;
  }
  .masthead {
    margin: 0 18px;
    padding: 18px 0;
    display: block;
  }
  .masthead a {
    font-size: 22px;
  }
  .masthead span {
    display: block;
    text-align: left;
    max-width: none;
    margin-top: 8px;
  }
  h1 br {
    display: block;
  }
  .intro {
    font-size: 16px;
  }
  .proof-layout {
    padding-top: 18px;
  }
  .stage-buttons {
    gap: 5px;
  }
  .stage-buttons button {
    padding: 11px 7px;
    font-size: 14px;
  }
  .stage-heading {
    display: block;
  }
  .stage-heading h2 {
    font-size: 25px;
  }
  #frame-kind {
    display: block;
    margin-top: 7px;
  }
  #stage-description {
    min-height: 64px;
  }
  .definition strong {
    font-size: 46px;
  }
  .definition span {
    font-size: 14px;
  }
  #cell-quantities {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
.map-caption {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 16px;
}
#mobile-reference {
  display: none;
}
#mobile-reference text {
  font:
    14px Arial,
    sans-serif;
  fill: var(--ink);
}
@media (max-width: 480px) {
  #drawing #reference {
    display: none;
  }
  #mobile-reference {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
    margin: 18px auto 0;
  }
  #drawing {
    max-height: 430px;
    margin-top: 0;
  }
}
@media (max-width: 359px) {
  #drawing .cell-number {
    display: none;
  }
}
