/* Page tree: "Home" is the root, led by a short vertical bar; the other pages branch off it with
   file-tree connectors (├ for middle items, └ for the last). */
.footer-tree,
.footer-tree__branches {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-tree a {
  display: inline-flex;
  align-items: center;
  color: var(--color-on-dark);
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-base);
}

.footer-tree__root > a {
  gap: var(--space-3);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

.footer-tree__root > a::before {
  content: '';
  flex: none;
  width: 3px;
  height: 1.1em;
  border-radius: 2px;
  background: var(--color-accent-soft);
}

.footer-tree__branches {
  --tree-line: rgb(255 255 255 / 0.28);
  --tree-gap: var(--space-2);
  display: grid;
  gap: var(--tree-gap);
  margin: var(--tree-gap) 0 0 1px; /* the trunk lines up with the centre of the root bar */
  padding-left: 1.4rem;
}

.footer-tree__branches li {
  position: relative;
}

/* Elbow from the trunk to the item (└). */
.footer-tree__branches li::before {
  content: '';
  position: absolute;
  top: calc(-1 * var(--tree-gap));
  left: -1.4rem;
  width: 1rem;
  height: calc(50% + var(--tree-gap));
  border-left: 1px solid var(--tree-line);
  border-bottom: 1px solid var(--tree-line);
  border-bottom-left-radius: 6px;
}

/* Trunk continues past every item but the last (├). */
.footer-tree__branches li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  bottom: calc(-1 * var(--tree-gap));
  left: -1.4rem;
  border-left: 1px solid var(--tree-line);
}

.footer-tree__branches a {
  color: var(--color-on-dark-muted);
  font-size: var(--font-size-base);
}

.footer-tree a:hover,
.footer-tree a:focus-visible {
  color: var(--color-on-dark);
  transform: translateX(3px);
}
