* { box-sizing: border-box; }
html, body { margin: 0; min-width: 0; }
body { background: var(--surface-light); color: var(--text-on-light); font-family: Raleway, sans-serif; }
.visually-hidden { border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }

.roadmap-heading { padding: 48px 5% 24px; }
.roadmap-heading h1 { color: var(--heading-on-light); font-size: clamp(38px, 5vw, 56px); font-weight: 700; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }

/* The timeline. The line runs down --line-x: the left edge on phones, the centre from 769px. A card sits --offset
   from the line, joined to it by a connector and a node. The next cards and their dashed line come first, then the
   quarters on the solid line, which ends in a node below the oldest. */
.timeline {
  --line-x: 44px;
  --offset: 36px;
  --line-colour: var(--selected-item);
  --title-colour: var(--link-on-light);
  --label-colour: #525e74;
  padding: 8px 5% 64px;
}
.next-block { padding-bottom: 28px; }
.roadmap-cards { display: grid; gap: 22px; list-style: none; margin: 0; padding: 0; }
.next-block .roadmap-cards { gap: 28px; }
.roadmap-item { display: flex; position: relative; }

/* Connector from the line to the card, and its node on the line. */
.roadmap-item::before { background: var(--line-colour); content: ""; height: 2px; left: var(--line-x); position: absolute; top: 50%; width: var(--offset); }
.quarter .roadmap-item::after { background: var(--surface-light); border: 2px solid var(--line-colour); border-radius: 50%; content: ""; height: 12px; left: var(--line-x); position: absolute; top: 50%; transform: translate(-50%, -50%); width: 12px; z-index: 1; }

.quarters { padding-bottom: 14px; position: relative; }
.quarters::before { border-left: 3px solid var(--line-colour); bottom: 7px; content: ""; left: calc(var(--line-x) - 1.5px); position: absolute; top: 0; }
.quarters::after { background: var(--line-colour); border-radius: 50%; bottom: 0; content: ""; height: 14px; left: var(--line-x); position: absolute; transform: translateX(-50%); width: 14px; }
.quarter { margin-top: 30px; position: relative; }
.quarter:first-child { margin-top: 0; }
.quarter-pill { background: var(--line-colour); border-radius: 999px; color: var(--selected-item-text); font-size: 18px; font-weight: 700; left: var(--line-x); line-height: 1; margin: 0 0 22px; padding: 9px 22px; position: relative; transform: translateX(-50%); white-space: nowrap; width: max-content; z-index: 1; }

/* Next: the hollow node on the line beside the card, and the dashed line on to the first quarter. */
.next-block .roadmap-item::before { background: none; border-top: 2px dashed var(--line-colour); height: 0; }
.next-block .roadmap-item::after { border-left: 3px dashed var(--line-colour); bottom: -28px; content: ""; left: calc(var(--line-x) - 1.5px); position: absolute; top: 50%; }
.next-node { align-items: center; background: var(--surface-light); border: 3px solid var(--line-colour); border-radius: 50%; color: var(--title-colour); display: flex; font-size: 14px; font-weight: 700; height: 52px; justify-content: center; left: var(--line-x); position: absolute; top: 50%; transform: translate(-50%, -50%); width: 52px; z-index: 1; }
.next-block .roadmap-item::before { left: calc(var(--line-x) + 26px); width: calc(var(--offset) - 26px); }
/* Each further next entry continues the dashed line up from the gap above it, so several next entries join. */
.next-block .roadmap-item + .roadmap-item::after { top: -28px; }

/* The card. */
.roadmap-card { align-items: center; background: var(--surface-light); border: 1px solid var(--border-on-light); border-radius: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); color: inherit; display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 9px 18px; margin-left: calc(var(--line-x) + var(--offset)); min-width: 0; padding: 16px 18px; text-decoration: none; }
.next-block .roadmap-card { border: 2px dashed var(--line-colour); }
.roadmap-card:hover, .next-block .roadmap-card:hover { border-color: var(--card-hover-border); }
.card-thumbnail { align-items: center; border: 2px dotted var(--brand-accent); border-radius: 50%; display: flex; flex: none; height: 72px; justify-content: center; width: 72px; }
.card-thumbnail img { aspect-ratio: 1; display: block; object-fit: contain; width: 54px; }
.card-body { border-left: 1px solid var(--border-on-light); flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; padding-left: 18px; }
.card-title { color: var(--title-colour); font-size: 20px; font-weight: 700; line-height: 1.25; margin: 0; }
.card-tagline { color: var(--text-on-light); font-size: 16px; line-height: 1.4; margin: 4px 0 0; }
.card-month { background: color-mix(in srgb, var(--label-colour) 14%, #fff); border-radius: 999px; color: var(--label-colour); display: inline-block; font-size: 16px; font-weight: 600; line-height: 1.2; margin-top: 9px; padding: 3px 14px; }
.card-quarter { background: var(--action-primary); border-radius: 999px; color: var(--action-primary-text); flex: none; font-size: 16px; font-weight: 700; line-height: 1.2; padding: 7px 18px; }

@media (min-width: 769px) {
  .timeline { --line-x: 50%; --offset: 44px; padding: 8px 5.5% 72px; }
  .roadmap-heading { padding-left: 10%; padding-right: 10%; }
  /* Cards alternate from the left of the line, restarting with each quarter; a next card sits on the right. */
  .roadmap-card { flex: 0 1 calc(50% - var(--offset)); margin-left: 0; }
  .quarter .roadmap-item:nth-child(odd) { justify-content: flex-start; }
  .quarter .roadmap-item:nth-child(odd)::before { left: calc(var(--line-x) - var(--offset)); }
  .quarter .roadmap-item:nth-child(even), .next-block .roadmap-item { justify-content: flex-end; }
  .card-thumbnail { height: 85px; width: 85px; }
  .card-thumbnail img { width: 63px; }
}
