/* The roadmap board. One bold thing — the board — in FieldNotes' own type and
   palette; everything around it stays quiet. */
.roadmap-page {
  --board-road: #fffefa;
  --walked: #244d3f;
  --space-later: #9fb09a;
  --pawn: #efce73;
}
.roadmap {
  display: block;
  max-width: 1120px;
  margin: 10px auto 48px;
  padding: 36px 40px 40px;
}

/* Intro: the title, and a score track like the one around a game board. */
.roadmap-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px 56px;
  align-items: end;
  margin-bottom: 30px;
}
.roadmap-intro h1 {
  grid-column: 1;
  font-size: clamp(40px, 5.4vw, 70px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 760;
  margin: 0;
  color: var(--ink);
}
.roadmap-lead {
  grid-column: 1;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 44ch;
  margin: 0;
}
.roadmap-beta {
  grid-column: 1;
  justify-self: start;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--mint);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.roadmap-beta a {
  color: var(--forest);
  font-weight: 650;
}
.score {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: end;
}
.score-headline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 14px;
}
.score-headline strong {
  font-size: 56px;
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.03em;
  color: var(--forest);
  font-variant-numeric: tabular-nums;
}
.score-headline span {
  font-size: 17px;
  color: var(--ink);
}
.score-track {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.score-cell {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--space-later);
}
.score-cell.is-done,
.score-cell.is-current {
  background: var(--forest);
  box-shadow: none;
}
.score-cell.is-current {
  box-shadow: 0 0 0 2px var(--canvas), 0 0 0 4px var(--pawn);
}
.score-cell.is-next {
  background: var(--pawn);
  box-shadow: inset 0 0 0 1.5px var(--forest);
}
.score-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 18px;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
}
.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-space {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--space-later);
}
.legend-space.is-done {
  background: var(--forest);
  box-shadow: none;
}
.legend-space.is-current {
  background: var(--forest);
  box-shadow: 0 0 0 3px var(--pawn);
}
.legend-space.is-next {
  background: var(--pawn);
  box-shadow: inset 0 0 0 2px var(--forest);
}

/* The board: region tints paint first, the road over them, spaces on top. */
.board-wrap {
  position: relative;
  isolation: isolate;
}
.road {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}
.road path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.road-bed {
  stroke: var(--board-road);
  stroke-width: 26;
}
.road-walked {
  stroke: var(--walked);
  stroke-width: 5;
}
.road-ahead {
  stroke: var(--walked);
  stroke-width: 3.5;
  stroke-dasharray: 0.1 11;
  opacity: 0.55;
}
.board {
  list-style: none;
  margin: 0;
  padding: 0;
}
.region {
  position: relative; /* no z-index: stays below the road */
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 24px 40px;
  align-items: center;
  padding: 30px 32px;
  margin-bottom: 20px;
  border-radius: 34px;
  background: var(--tint, var(--mint));
}
.region.is-flipped {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
}
.region.is-flipped .landmark {
  order: 2;
}
.region-travelled { --tint: #e1ebdc; }
.region-research { --tint: #e0eaf2; }
.region-design-system { --tint: #ebe5f3; }
.region-overhaul { --tint: #f4e8dc; }
.region-builder { --tint: #f4edcf; }
.region-schools { --tint: #dde9d9; }
.region-quizzes { --tint: #e3e6f3; }
.region-insight { --tint: #ecf1d6; }

.landmark {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  padding: 18px 22px 22px;
  border-radius: 24px;
  background: var(--paper);
}
.landmark-art {
  width: 132px;
  height: 132px;
  object-fit: contain;
  margin: -4px 0 0 -8px;
}
.landmark h2 {
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 720;
  margin: 0;
  color: var(--ink);
}
.landmark p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.landmark .landmark-count {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
}

/* Spaces. Done is filled, next is yellow, later is an outline: shape and
   fill carry the state, not colour alone. */
.tiles {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 14px;
  margin: 0;
  padding: 14px 0;
}
.tile {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
}
.tile-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: 100%;
  max-width: 170px;
  padding: 4px 6px 8px;
  border: 0;
  border-radius: 16px;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}
.tile-button:hover .tile-space {
  transform: translateY(-2px);
}
.tile-button:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 4px;
}
.tile-space {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--space-later), 0 3px 0 rgba(34, 62, 50, 0.14);
  transition: transform 120ms ease-out;
}
.tile-number {
  font-size: 20px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.tile.is-done .tile-space,
.tile.is-current .tile-space {
  background: var(--forest);
  box-shadow: 0 3px 0 rgba(34, 62, 50, 0.25);
}
.tile.is-done .tile-number,
.tile.is-current .tile-number {
  color: var(--paper);
}
.tile.is-current .tile-space {
  box-shadow: 0 0 0 5px var(--pawn), 0 3px 0 rgba(34, 62, 50, 0.25);
}
.tile.is-next .tile-space {
  background: var(--pawn);
  box-shadow: inset 0 0 0 3px var(--forest), 0 3px 0 rgba(34, 62, 50, 0.18);
}
.tile.is-next .tile-number {
  color: var(--ink);
}
.tile-title {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 620;
  max-width: 17ch;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--tint-label, rgba(255, 254, 250, 0.82));
}
.tile.is-later .tile-title {
  font-weight: 540;
  color: #3d5147;
}
.tile-flag {
  font-size: 12px;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--paper);
}
.tile.is-next .tile-flag {
  background: var(--pawn);
  color: var(--ink);
}

/* The pawn stands on the current space. */
.pawn {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 36px;
  height: 50px;
  margin-left: -18px;
  overflow: visible;
  animation: pawn-hop 700ms cubic-bezier(0.3, 1.4, 0.5, 1) 300ms both;
}
.pawn-body {
  fill: var(--pawn);
  stroke: var(--forest);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.pawn-shine {
  fill: var(--paper);
  opacity: 0.8;
}
.pawn-shadow {
  fill: rgba(34, 62, 50, 0.28);
}
@keyframes pawn-hop {
  from {
    transform: translateY(-26px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* The finish: a checkered edge and the trophy, where the road ends. */
.region-finish {
  display: block;
  margin-top: 8px;
  padding: 46px 32px 40px;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--forest);
  overflow: hidden;
}
.region-finish::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 16px;
  background: repeating-conic-gradient(var(--forest) 0 25%, var(--paper) 0 50%) 0
    0 / 16px 16px;
}
.finish {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}
.finish-art {
  width: 180px;
  height: 180px;
  object-fit: contain;
}
.finish h2 {
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 780;
  margin: 4px 0 0;
  color: var(--forest);
}
.finish-tagline {
  font-size: 19px;
  font-weight: 620;
  margin: 0;
  color: var(--ink);
}
.finish-detail {
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  margin: 8px 0 0;
}
.roadmap-updated {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Tile details. */
.tile-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 50px rgba(34, 62, 50, 0.25);
}
.tile-dialog::backdrop {
  background: rgba(34, 62, 50, 0.38);
}
.tile-dialog form {
  display: grid;
  gap: 10px;
  padding: 26px 28px 28px;
}
.tile-dialog-place {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.tile-dialog h2 {
  font-size: 25px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}
.tile-dialog-status {
  justify-self: start;
  font-size: 13px;
  font-weight: 650;
  padding: 4px 12px;
  border-radius: 999px;
  margin: 2px 0 0;
  background: var(--mint);
  color: var(--forest);
}
.tile-dialog-status.is-current,
.tile-dialog-status.is-done {
  background: var(--forest);
  color: var(--paper);
}
.tile-dialog-status.is-next {
  background: var(--pawn);
  color: var(--ink);
}
.tile-dialog-detail {
  font-size: 16px;
  line-height: 1.6;
  margin: 4px 0 8px;
}
.tile-dialog .button {
  justify-self: start;
}

@media (max-width: 900px) {
  .roadmap {
    padding: 28px 24px 36px;
  }
  .roadmap-intro {
    grid-template-columns: 1fr;
  }
  .score {
    grid-column: 1;
    grid-row: auto;
  }
  .region,
  .region.is-flipped {
    grid-template-columns: minmax(0, 1fr);
  }
  .region.is-flipped .landmark {
    order: 0;
  }
  .landmark {
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 4px 16px;
  }
  .landmark-art {
    width: 88px;
    height: 88px;
    margin: 0;
    grid-row: span 3;
  }
}
@media (max-width: 560px) {
  .roadmap {
    padding: 22px 14px 30px;
    margin-top: 0;
  }
  .score-headline strong {
    font-size: 46px;
  }
  .region {
    padding: 18px 12px;
    border-radius: 26px;
  }
  .landmark {
    padding: 14px 16px;
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .landmark-art {
    width: 64px;
    height: 64px;
  }
  .landmark h2 {
    font-size: 19px;
  }
  .landmark p {
    font-size: 14px;
  }
  .tiles {
    gap: 24px 8px;
  }
  .tile-space {
    width: 54px;
    height: 54px;
  }
  .tile-title {
    font-size: 13px;
  }
  .road-bed {
    stroke-width: 20;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pawn {
    animation: none;
  }
  .tile-space {
    transition: none;
  }
}
@media (forced-colors: active) {
  .road {
    display: none;
  }
}
