/* The Timeline: a line about Cyrus, four numbers, then the timeline itself. Each line opens a role page. */
.intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lede {
  margin: 0;
  font: 300 clamp(26px, 3.6vw, 34px)/1.2 var(--sans);
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
  text-wrap: balance;
}

.lede-note {
  margin: 0;
  font-size: 15px;
  color: var(--dim);
}

.stats {
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: 24px;
  margin: 0;
}

.stats div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.stats dt,
.metric b {
  font: 400 30px/1 var(--display);
  color: var(--cyan-ink);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.stats dt span,
.metric b span {
  font: 300 26px/1 var(--sans);
  margin-left: 2px;
}

/* the symbol part of a unit ("%+", "+") keeps a little air between its characters: "70%+" */
.stats dt .sym {
  letter-spacing: 0.1em;
  margin-right: -0.1em;
}

.stats dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-2);
}

@media (max-width: 620px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 20px;
  }
}

.stats dt b {
  font-weight: inherit;
}

.tl {
  list-style: none;
  margin: 0;
  padding: 0 0 0 26px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tl::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--edge);
}

.tl li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tl li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--cyan);
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.tl li:first-child::before {
  background: var(--cyan);
}

.tl li:has(.go:hover)::before,
.tl li:has(.go:focus-visible)::before {
  background: var(--cyan);
  transform: scale(1.35);
  box-shadow: inset 0 0 0 1.5px var(--cyan), 0 0 0 5px var(--cyan-soft);
}

.tl .when {
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.tl h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

.tl p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.tl p span {
  color: var(--dim);
}

/* the roles held within a line, a short line each; with a heading, they hang under it */
.tl .subg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-left: 14px;
  font-size: 15px;
  color: var(--ink-2);
}

.tl .subg .sub {
  margin-top: 0;
}

/* a line that wraps hangs under its own start; its years never split */
.tl .sub > span {
  padding-left: 1em;
  text-indent: -1em;
}

.tl .sub .yr {
  white-space: nowrap;
}

.tl .sub {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--edge);
  font-size: 15px;
  color: var(--ink-2);
}

/* a role's page: a summary, the steps as a flow, a number, points, tools, and the roles held within it */
.dsum {
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink);
  max-width: 38ch;
}

.label2 {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
}

.vis {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.flow li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 26px 14px 0 0;
  min-width: 0;
}

.flow li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--cyan);
}

.flow li::after {
  content: "";
  position: absolute;
  left: 19px;
  right: 6px;
  top: 9px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--edge));
}

.flow li:last-child::after {
  display: none;
}

.flow li:last-child::before {
  background: var(--cyan);
}

.flow b {
  font-weight: 500;
  font-size: 15.5px;
  color: var(--ink);
}

.flow small {
  font-size: 13px;
  line-height: 1.4;
  color: var(--dim);
}

@media (max-width: 620px) {
  .flow {
    grid-auto-flow: row;
    gap: 20px;
    padding-left: 24px;
  }

  .flow li {
    padding: 0;
  }

  .flow li::before {
    left: -24px;
    top: 4px;
  }

  .flow li::after {
    left: -18px;
    right: auto;
    top: 22px;
    bottom: -16px;
    width: 1px;
    height: auto;
    background: var(--edge);
  }
}

.metric {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.metric span.c {
  font-size: 15px;
  color: var(--ink-2);
}

.did {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.did li {
  position: relative;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 16px;
}

.did li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.66em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}

.parts {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.parts .label2 {
  margin: 0;
}

.part {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 18px;
  border-left: 1px solid var(--edge);
}

.part h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
}

.part .org {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}

.part .did {
  margin-top: 10px;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tools span {
  font-size: 13px;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--edge);
}

.tools .chip b {
  font-weight: inherit;
}

/* dots run along the flow once, and each step lights up as they arrive */
.flow .run {
  position: absolute;
  left: 19px;
  right: 6px;
  top: 7px;
  height: 5px;
  pointer-events: none;
}

.flow .run i {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0;
}

.view-in .flow .run i {
  animation: runX 0.75s calc(1.5s + var(--i) * 0.75s + var(--j) * 0.13s) cubic-bezier(0.45, 0, 0.55, 1) both;
}

@keyframes runX {
  0% {
    left: 0;
    opacity: 0;
  }
  15%, 85% {
    opacity: 1;
  }
  100% {
    left: calc(100% - 5px);
    opacity: 0;
  }
}

.view-in .flow li::before {
  animation: lit 0.6s calc(1.45s + var(--i) * 0.75s) ease both;
}

@keyframes lit {
  40% {
    background: var(--cyan);
    box-shadow: inset 0 0 0 1.5px var(--cyan), 0 0 0 6px var(--cyan-soft);
  }
}

@media (max-width: 620px) {
  .flow .run {
    left: -20px;
    right: auto;
    top: 22px;
    bottom: -14px;
    width: 5px;
    height: auto;
  }

  .view-in .flow .run i {
    animation-name: runY;
  }
}

@keyframes runY {
  0% {
    top: 0;
    opacity: 0;
  }
  15%, 85% {
    opacity: 1;
  }
  100% {
    top: calc(100% - 5px);
    opacity: 0;
  }
}
