/* Efficient Transfinite Lists' own: art/arcade.css has the rest. The post
   draws places hollow and pairs grey; here the new path is orange, the walk
   green, and the copied left edges gold, as the post's yellow box. */

:root {
  --hollow: #f4f1e4;
  --pair: #8fb3d9;
  --edge: rgb(244 241 228 / 55%);
  --copy: #f6c85f;
  --build: #f08a4b;
  --walk: #5cbf73;
  --fall: #ef6a5f;
}

html,
body {
  overflow: auto;
}

main {
  max-width: 68rem;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px 2rem;
  line-height: 1.45;
}

h1 {
  margin: 0.2rem 0 0.3rem;
  font-size: 1.6rem;
  color: var(--accent);
}

.lede {
  margin: 0 0 0.8rem;
  color: var(--dim);
  max-width: 52rem;
}

a {
  color: var(--accent);
}

var {
  font-style: italic;
}

code {
  font-family: ui-monospace, monospace;
  font-size: 0.92em;
}

figure {
  margin: 0 0 0.8rem;
  padding: 0.5rem;
  border-radius: 14px;
  background: rgb(0 0 0 / 18%);
  border: 1px solid var(--line);
}

#scroller {
  overflow-x: auto;
  scrollbar-width: thin;
}

#fig {
  display: block;
  margin: 0 auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

figcaption {
  margin: 0.3rem 0.4rem 0.1rem;
}

figcaption p {
  margin: 0.3rem 0;
  max-width: 56rem;
}

.op {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.9rem;
  min-height: 1.6em;
  font-size: 1.1rem;
  font-weight: 700;
}

.op .round {
  white-space: nowrap;
}

code.path {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  padding: 0.05rem 0.4rem;
  border-radius: 8px;
  background: rgb(0 0 0 / 25%);
}

.paren {
  color: var(--dim);
  animation: lit 0.25s var(--d, 0ms) forwards;
}

@keyframes lit {
  to {
    color: var(--ink);
    text-shadow: 0 0 8px rgb(246 200 95 / 60%);
  }
}

#caption {
  min-height: 3em;
}

#caption .try {
  margin-left: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-color: var(--walk);
}

.err {
  color: var(--fall);
}

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.card {
  width: auto;
  padding: 0.8rem 1rem;
}

.card.wide {
  margin-bottom: 0.8rem;
}

.card h2 {
  font-size: 1.1rem;
  margin: 0;
}

.card p {
  margin: 0.3rem 0 0.6rem;
}

.dim {
  color: var(--dim);
  font-size: 0.9rem;
}

.small {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

.readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

#places {
  gap: 0.3rem 0.7rem;
}

#places li {
  font-variant-numeric: tabular-nums;
}

.diffs {
  font-variant-numeric: tabular-nums;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}

.chips button {
  padding: 0.2rem 0.6rem;
  min-width: 2.4rem;
  font-variant-numeric: tabular-nums;
}

#get-chips button {
  border-color: rgb(92 191 115 / 55%);
}

#put-chips button {
  border-color: rgb(240 138 75 / 55%);
}

#get-chips button.miss {
  border-style: dashed;
  border-color: var(--fall);
  color: var(--dim);
}

.ask {
  display: flex;
  gap: 0.4rem;
}

.ask input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgb(0 0 0 / 25%);
  color: var(--ink);
  font: inherit;
  font-family: ui-monospace, monospace;
}

.ask input.bad {
  border-color: var(--fall);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

#examples button.on {
  border-color: var(--accent);
  color: var(--accent);
}

details summary {
  cursor: pointer;
  font-weight: 700;
}

pre {
  overflow-x: auto;
  margin: 0.4rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: rgb(0 0 0 / 30%);
  line-height: 1.4;
}

pre mark {
  background: rgb(246 200 95 / 22%);
  color: var(--copy);
  border-radius: 4px;
}

.foot {
  max-width: 56rem;
}

.k-hollow {
  color: var(--hollow);
}

.k-pair {
  color: var(--pair);
}

.k-copy {
  color: var(--copy);
}

/* the picture */

svg text {
  font-family: inherit;
  text-anchor: middle;
}

.ground {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 5;
}

.edge {
  fill: none;
  stroke: var(--edge);
  stroke-width: 1.8;
}

.edge.copy {
  stroke: var(--copy);
  stroke-opacity: 0.75;
  stroke-width: 1.6;
  stroke-dasharray: 3 4;
}

.arrowhead {
  fill: var(--edge);
}

.arrowhead.copy {
  fill: var(--copy);
}

.arrowhead.walk {
  fill: var(--walk);
}

.edge.copied-now {
  stroke-opacity: 1;
  stroke-width: 2.6;
  filter: drop-shadow(0 0 4px rgb(246 200 95 / 80%));
}

.edge.built {
  animation: pop-edge 0.4s var(--d) both;
}

@keyframes pop-edge {
  from {
    opacity: 0;
  }
}

.edge.walked {
  animation: walk 0.2s var(--d) forwards;
}

@keyframes walk {
  to {
    stroke: var(--walk);
    stroke-opacity: 1;
    stroke-width: 3.2;
    stroke-dasharray: none;
  }
}

.edge.drop {
  animation: fade 0.45s var(--done) forwards;
}

.edge.walked.drop {
  animation:
    walk 0.2s var(--d) forwards,
    fade 0.45s var(--done) forwards;
}

@keyframes fade {
  to {
    opacity: 0.08;
  }
}

.node .dot {
  stroke-width: 1.6;
}

.node.hollow .dot {
  fill: #16292c;
  stroke: var(--hollow);
  stroke-width: 2.4;
}

.node.pair .dot {
  fill: var(--pair);
  stroke: #10232c;
}

.place {
  fill: var(--ink);
  font-size: calc(15px / sqrt(min(1, var(--k, 1))));
}

.node.tap {
  cursor: pointer;
}

.node.tap:hover .dot {
  stroke: var(--walk);
}

.node.tap:hover .place {
  fill: var(--walk);
}

.head-ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0.85;
}

.head-label,
.before-label {
  font-size: calc(14px / sqrt(min(1, var(--k, 1))));
  font-weight: 700;
  fill: var(--accent);
}

.before-label {
  fill: var(--dim);
  font-weight: 400;
}

.node.built {
  transform-box: fill-box;
  transform-origin: center;
  animation: pop 0.4s var(--d) both;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
}

.node.built.pair .dot {
  fill: var(--build);
}

.node.built.hollow .dot {
  stroke: var(--build);
}

.node.follow .dot {
  stroke: var(--ink);
  stroke-width: 3.4;
}

.node.visited .dot {
  animation: lit-node 0.2s var(--d) forwards;
}

@keyframes lit-node {
  to {
    stroke: var(--walk);
    stroke-width: 3.4;
  }
}

.node.drop {
  animation: fade 0.45s var(--done) forwards;
}

.node.arrived .head-ring {
  animation: arrive 0.6s ease-out;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes arrive {
  from {
    stroke: var(--walk);
    stroke-width: 5;
    transform: scale(1.7);
  }
}

.bead {
  fill: var(--walk);
  filter: drop-shadow(0 0 6px rgb(92 191 115 / 90%));
  pointer-events: none;
}

.fall {
  opacity: 0;
  animation: show 0.25s var(--d) forwards;
}

.fall line {
  stroke: var(--fall);
  stroke-width: 2.4;
  stroke-dasharray: 4 4;
}

.fall text {
  fill: var(--fall);
  font-size: 20px;
  font-weight: 700;
}

@keyframes show {
  to {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .cols,
  .readout {
    grid-template-columns: 1fr;
  }
  .op {
    font-size: 1rem;
  }
}
