#roadmap {
  --map-width: 72rem;
  width: 100%;
  padding-top: 0;
  background: var(--night);
}
.roadmap-country { max-width: var(--map-width); margin-inline: auto; padding-top: clamp(1.5rem, 3vw, 2.6rem); }
#roadmap-title, #roadmap-status, #roadmap-more { margin-inline: clamp(1rem, 4%, 3rem); }
#roadmap-title { font-size: clamp(1.8rem, 3.8vw, 3rem); }
#roadmap .idea-note { width: min(calc(100% - 2 * var(--edge)), 65rem); max-width: none; margin: 2rem auto 0; }
#roadmap .idea-note h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
.atlas-roadmap { container-type: inline-size; min-width: 0; }
.atlas-trail {
  --land: url('assets/roadmap/mirholm-valley.webp');
  --sprite: clamp(6.5rem, 11cqw, 8.5rem);
  position: relative;
  isolation: isolate;
  padding: 0;
  margin: .5rem 0 0;
  list-style: none;
}
.atlas-trail::after {
  content: '';
  position: absolute;
  z-index: 1;
  pointer-events: none;
  inset: 0;
  background: linear-gradient(to bottom, var(--night), transparent 1.9rem, transparent calc(100% - 1.9rem), var(--night)),
    linear-gradient(to right, var(--night), transparent 3%, transparent 97%, var(--night));
}
.atlas-stop {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(10.4rem, 16.5cqw, 12rem);
  padding-block: 1.5rem;
  scroll-margin-block: 1rem;
}
/* Each stop paints its own quarter of the same valley. Longer lists can grow and the road still joins at the banks. */
.atlas-stop::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--land) center var(--strip) / 100% 400% no-repeat;
  image-rendering: pixelated;
}
.atlas-stop[data-stage="done"] { --x: 34%; --strip: 0%; --place: url('assets/roadmap/mirholm-keep.webp'); }
.atlas-stop[data-stage="working"] { --x: 65%; --strip: 33.333333%; --place: url('assets/roadmap/mirholm-mill.webp'); }
.atlas-stop[data-stage="next"] { --x: 36%; --strip: 66.666667%; --place: url('assets/roadmap/mirholm-gate.webp'); }
.atlas-stop[data-stage="idea"] { --x: 69%; --strip: 100%; --place: url('assets/roadmap/salthaven.webp'); }
.atlas-landmark {
  pointer-events: none;
  position: absolute;
  left: var(--x);
  top: 50%;
  width: var(--sprite);
  aspect-ratio: 96 / 80;
  transform: translate(-50%, -90%);
  background: var(--place) 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated;
}
.atlas-stop[data-stage="working"] .atlas-landmark { background-size: 1200% 100%; }
body[data-motion="on"] .atlas-stop[data-stage="working"] .atlas-landmark { animation: atlas-sails 2.4s steps(12, jump-none) infinite; }
body[data-background="true"] .atlas-landmark { animation-play-state: paused !important; }
@keyframes atlas-sails { to { background-position-x: 100%; } }
.atlas-entries {
  --gutter: clamp(1rem, 3.3cqw, 2.5rem);
  z-index: 2;
  position: relative;
  min-width: 0;
  margin-inline: var(--gutter) calc(100% - var(--x) + var(--sprite) * .5 + .25rem);
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 #10221c, 1px 1px 2px #10221c;
}
.atlas-stop[data-bank="east"] .atlas-entries { margin-inline: calc(var(--x) + var(--sprite) * .5 + .25rem) var(--gutter); }
.atlas-entries::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -1rem -.8rem;
  background: radial-gradient(ellipse closest-side, rgb(14 29 23 / 58%) 36%, transparent 145%);
  pointer-events: none;
}
.atlas-status { display: flex; align-items: center; gap: .45rem; margin-bottom: .28rem; font-size: .875rem; line-height: 1.15; color: #c4d7c0; }
.atlas-status::before { content: ''; width: .42rem; height: .42rem; border: 1px solid currentColor; transform: rotate(45deg); }
.atlas-stop[data-stage="done"] .atlas-status::before { background: #a1b7a1; }
.atlas-stop[data-stage="working"] .atlas-status { color: #ffe09a; }
.atlas-stop[data-stage="working"] .atlas-status::before { background: currentColor; }
.atlas-title { margin: 0; font-size: clamp(1.15rem, 2.05cqw, 1.45rem); font-weight: 400; line-height: 1.12; color: #f6f0db; }
.atlas-stop[data-stage="working"] .atlas-title { font-size: clamp(1.45rem, 2.55cqw, 1.85rem); color: #ffebba; }
.atlas-note { margin: .45rem 0 0; max-width: 38ch; color: #e1e6d7; font-size: 1rem; line-height: 1.32; }
.atlas-tasks { margin: .5rem 0 0; padding: 0; list-style: none; }
.atlas-tasks li { display: flex; align-items: baseline; gap: .38rem; color: #d9deca; font-size: 1rem; line-height: 1.27; }
.atlas-tasks li::before { content: ''; flex: 0 0 .22rem; height: .22rem; background: #afaa80; align-self: start; margin-top: .62em; }
.atlas-tasks a { display: inline-block; padding-block: .16rem; }
.atlas-entries a:hover, .atlas-entries a:focus-visible { color: #ffdf96; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .17em; }
.atlas-stop:focus { outline: none; }
.atlas-stop:focus-visible .atlas-title { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .15em; }
.atlas-roadmap--compact .atlas-trail { margin: 0; }

@container (max-width: 52rem) {
  .atlas-trail { --land: url('assets/roadmap/mirholm-valley-mobile.webp'); --sprite: clamp(5rem, 17cqw, 7.75rem); }
  .atlas-stop { min-height: clamp(9.75rem, 28cqw, 14rem); padding-block: 1.45rem; }
  .atlas-stop[data-bank="west"] { --x: 18%; }
  .atlas-stop[data-bank="east"] { --x: 82%; }
  .atlas-entries { margin-inline: calc(var(--x) + var(--sprite) * .5 + .25rem) var(--gutter); }
  .atlas-stop[data-bank="east"] .atlas-entries { margin-inline: var(--gutter) calc(100% - var(--x) + var(--sprite) * .5 + .25rem); }
  .atlas-title, .atlas-note { max-width: 31ch; }
}
.atlas-roadmap--compact .atlas-trail { --sprite: clamp(5.5rem, 20cqw, 8.5rem); }
.atlas-roadmap--compact .atlas-stop { --x: 82%; min-height: 12rem; }
.atlas-roadmap--compact .atlas-entries { margin-inline: var(--gutter) calc(100% - var(--x) + var(--sprite) * .5 + .25rem); }
.atlas-roadmap--compact .atlas-trail::after, .atlas-roadmap--compact .atlas-stop::before { content: none; }
@container (min-width: 40rem) {
  /* The mill sits at 65% across the wider valley art used by the home cover. */
  .atlas-roadmap--compact .atlas-stop { --x: 65%; }
  .atlas-roadmap--compact .atlas-stop .atlas-entries { margin-inline: var(--gutter) calc(100% - var(--x) + var(--sprite) * .5 + .25rem); }
}
@container (max-width: 28rem) {
  .atlas-roadmap:not(.atlas-roadmap--compact) .atlas-trail { --sprite: clamp(3.75rem, 17cqw, 4.5rem); }
  .atlas-tasks li { align-items: center; }
  .atlas-tasks li::before { align-self: center; margin: 0; }
  .atlas-title a, .atlas-tasks a { display: flex; align-items: center; min-height: 44px; }
}
@container (max-width: 25rem) {
  .atlas-roadmap--compact .atlas-stop { padding: 1.15rem .45rem .45rem; min-height: 0; }
  .atlas-roadmap--compact .atlas-landmark { top: 4.75rem; }
  .atlas-roadmap--compact .atlas-stop .atlas-entries { margin-inline: .65rem; }
  .atlas-roadmap--compact .atlas-entries::before { content: none; }
  .atlas-roadmap--compact :is(.atlas-status, .atlas-title) { margin-right: calc(18cqw + var(--sprite) * .48); }
  .atlas-roadmap--compact .atlas-stop .atlas-title { min-height: 3.15rem; font-size: 1.35rem; }
}
@media (min-width: 90rem) and (min-aspect-ratio: 2/1) {
  #roadmap {
    --map-width: 80rem;
    display: grid;
    grid-template-columns: minmax(0, var(--map-width)) minmax(0, 20rem);
    justify-content: center;
    align-items: start;
    align-content: start;
    gap: clamp(2rem, 4vw, 5rem);
    padding-inline: var(--edge);
  }
  .roadmap-country { width: 100%; }
  #roadmap .atlas-stop { min-height: 22.222cqw; }
  #roadmap .idea-note { width: auto; margin: 0; padding-top: clamp(1.5rem, 3vw, 2.6rem); }
}
