/* Career roadmap ("Built for the whole career")
   A small navigation map: a winding road with a fork at every stage, a car that drives the route
   as the page scrolls, and a dead end on every wrong turn. roadmap.js adds .rm-js, places the
   cards around the road and draws the map. Without JavaScript the same content shows as a plain
   stacked list. With reduced motion the script adds .rm-static and the route is drawn at once.
   --------------------------------------------------------------------------------------------- */

.rm {
  --rm-coral: #d9553c;
  --rm-coral-ink: #b23a24;
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 8vw, 112px) 0 clamp(32px, 4vw, 64px);
}

/* Desktop and tablet: the roadmap starts soon after Why We Exist. Phones keep 64px. */
@media (min-width: 761px) {
  .rm {
    padding-top: clamp(48px, 3vw + 20px, 64px);
  }
}

.rm::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 30% at 50% 12%, rgba(36, 126, 198, .07), transparent 70%),
    radial-gradient(ellipse 40% 30% at 8% 70%, rgba(36, 126, 198, .045), transparent 70%),
    radial-gradient(ellipse 40% 30% at 94% 45%, rgba(36, 126, 198, .04), transparent 70%);
}

.rm-head {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter);
  text-align: center;
}

.rm-head .kicker {
  color: var(--blue);
}

.rm-head h2 {
  margin: 10px 0 8px;
  color: var(--navy);
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.08;
  letter-spacing: -.03em;
}

.rm-head p {
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.5;
}

.rm-view {
  position: relative;
  z-index: 1;
  margin-top: clamp(24px, 3.5vw, 44px);
}

.rm-world {
  position: relative;
  width: min(1120px, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
}

/* ---- Cards: compact, set beside the road ---- */

.rm-face {
  border-radius: 16px;
  padding: 13px 16px 14px;
  transition: opacity .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .5s var(--ease-out);
}

.rm-card .rm-face {
  background: linear-gradient(160deg, rgba(255, 255, 255, .97), rgba(245, 249, 253, .97));
  border: 1px solid rgba(23, 109, 182, .16);
  box-shadow: 0 16px 34px -20px rgba(16, 43, 69, .3), 0 0 0 3px rgba(36, 126, 198, .05), 0 2px 5px rgba(16, 43, 69, .05);
}

.rm-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rm-num {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #2f8fdc, #176db6);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 3px 8px -2px rgba(23, 109, 182, .5);
}

.rm-card h3 {
  flex: 1;
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.rm-ico {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e6f1fa;
  color: var(--blue);
}

.rm-ico svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rm-card p {
  margin: 8px 0 0;
  color: #3f5468;
  font-size: 14px;
  line-height: 1.5;
}

/* Common mistake: a route alert */
.rm-mistake .rm-face {
  background: linear-gradient(180deg, rgba(255, 250, 247, .98), rgba(255, 244, 239, .98));
  border: 1px solid rgba(217, 85, 60, .28);
  box-shadow: inset 3px 0 0 var(--rm-coral), 0 12px 26px -18px rgba(217, 85, 60, .55), 0 1px 3px rgba(16, 43, 69, .04);
  padding: 10px 13px 11px 15px;
}

.rm-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rm-coral-ink);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.rm-flag::before {
  content: "";
  flex: none;
  width: 12px;
  height: 11px;
  background: var(--rm-coral);
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2022'%3E%3Cpath%20fill-rule='evenodd'%20d='M10.3%201.4a2%202%200%200%201%203.4%200l9.6%2016.8a2%202%200%200%201-1.7%203H2.4a2%202%200%200%201-1.7-3zM10.8%207h2.4v6.5h-2.4zm0%208.3h2.4v2.4h-2.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2022'%3E%3Cpath%20fill-rule='evenodd'%20d='M10.3%201.4a2%202%200%200%201%203.4%200l9.6%2016.8a2%202%200%200%201-1.7%203H2.4a2%202%200%200%201-1.7-3zM10.8%207h2.4v6.5h-2.4zm0%208.3h2.4v2.4h-2.4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.rm-mistake p {
  margin: 5px 0 0;
  color: #48505c;
  font-size: 13px;
  line-height: 1.45;
}

/* Emphasis: the active stage is fully lit, finished stages step back */
.rm-step[data-state="past"] .rm-face {
  opacity: .74;
  box-shadow: 0 8px 18px -14px rgba(16, 43, 69, .22);
}

.rm-step[data-state="past"] .rm-mistake .rm-face {
  box-shadow: inset 3px 0 0 var(--rm-coral), 0 8px 18px -14px rgba(16, 43, 69, .22);
}

.rm-step[data-state="active"] .rm-card .rm-face {
  border-color: rgba(23, 109, 182, .34);
  box-shadow: 0 22px 44px -22px rgba(23, 109, 182, .5), 0 0 0 4px rgba(36, 126, 198, .12), 0 2px 5px rgba(16, 43, 69, .06);
}

/* ---- Without JavaScript: a plain stacked list beside a line ---- */

.rm-steps {
  list-style: none;
  margin: 0;
  padding: 0 0 0 clamp(18px, 4vw, 34px);
  border-left: 3px solid #c9def0;
  display: grid;
  gap: 22px;
}

.rm-step {
  display: grid;
  gap: 10px;
  max-width: 460px;
}

.rm-mistake {
  max-width: 340px;
  margin-left: 22px;
}

/* ---- With JavaScript: cards positioned around the drawn map ---- */

.rm-js .rm-world {
  height: var(--rm-h, 1100px);
}

.rm-js .rm-steps {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
}

.rm-js .rm-step {
  display: contents;
}

.rm-js .rm-card,
.rm-js .rm-mistake {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  max-width: none;
  z-index: 2;
  will-change: transform, opacity;
}

.rm-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* Narrow cards drop the icon so the title has room */
.rm-compact .rm-ico {
  display: none;
}

/* ---- Roads ---- */

.rm-shadow,
.rm-g-edge,
.rm-g-fill,
.rm-g-lane,
.rm-aura,
.rm-edge,
.rm-fill,
.rm-sheen,
.rm-lane,
.rm-b-edge,
.rm-b-fill,
.rm-b-lane {
  fill: none;
  stroke-linecap: butt;
}

/* The map road, before the route has reached it */
.rm-shadow { stroke: rgba(16, 48, 84, .075); }
.rm-g-edge { stroke: #d2dce6; }
.rm-g-fill { stroke: #fcfdfe; }
.rm-g-lane { stroke: #d6e0e9; }

/* The travelled route */
.rm-aura-g { transition: opacity .6s var(--ease-out); }
.rm-aura { stroke: rgba(36, 126, 198, .1); }
.rm-edge { stroke: #0d4f8c; }
.rm-fill { stroke: url(#rm-road); }
.rm-sheen { stroke: rgba(255, 255, 255, .08); }
.rm-lane { stroke: rgba(255, 255, 255, .92); }

/* Wrong roads, once revealed: closed, grey tarmac */
.rm-bwrap { transition: opacity .6s var(--ease-out); }
.rm-b-edge { stroke: #b0a9a1; }
.rm-b-fill { stroke: #d8d2cb; }
.rm-b-lane { stroke: rgba(255, 255, 255, .78); }

/* ---- Junction markers ---- */

.rm-node .rm-halo {
  fill: rgba(36, 126, 198, .24);
  opacity: 0;
  transition: opacity .5s var(--ease-out);
}

.rm-node .rm-node-body {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .5s var(--ease-out);
}

.rm-node .rm-ring {
  fill: #fff;
  stroke: #b7c8d8;
  transition: stroke .4s var(--ease-out);
}

.rm-node-num {
  fill: #9fb3c6;
  font-family: var(--font);
  font-weight: 700;
  transition: fill .4s var(--ease-out);
}

.rm-node.is-past .rm-ring,
.rm-node.is-active .rm-ring,
.rm-node.is-still .rm-ring {
  stroke: var(--blue);
}

.rm-node.is-past .rm-node-num,
.rm-node.is-active .rm-node-num,
.rm-node.is-still .rm-node-num {
  fill: var(--navy);
}

.rm-node.is-past .rm-halo,
.rm-node.is-still .rm-halo {
  opacity: .35;
}

.rm-node.is-active .rm-halo {
  opacity: 1;
}

.rm-node.is-active .rm-node-body {
  transform: scale(1.08);
}

/* ---- Scenery ---- */

.rm-tree { fill: #bfdac7; }
.rm-tree-hi { fill: #d3e8d9; }
.rm-tree-sh { fill: rgba(38, 78, 58, .09); }
.rm-park { fill: #e3efe3; stroke: #d4e6d6; stroke-width: 1.2; }
.rm-path { fill: none; stroke: #f7faf6; stroke-width: 2.6; stroke-linecap: round; }
.rm-water { fill: #d8e9f7; stroke: #c7ddf0; stroke-width: 1.2; }
.rm-water-hi { fill: #e4f0fa; }
.rm-lot { fill: #e6ecf2; }
.rm-bld { fill: #fbfcfd; stroke: #d3dce5; stroke-width: .8; }
.rm-bld-b { fill: #eef3f8; }
.rm-bld-sh { fill: rgba(20, 46, 72, .11); }
.rm-roof { fill: none; stroke: #e1e8ef; stroke-width: .8; }
.rm-topo { fill: none; stroke: #d8e1ea; stroke-width: 1; }
.rm-topo-top { fill: #eaf0f5; }

/* ---- Dead ends ---- */

.rm-board { stroke: rgba(90, 30, 20, .28); stroke-width: .8; }
.rm-lamp { fill: #ffb238; }
.rm-lamp-glow { fill: rgba(255, 178, 56, .3); }
.rm-cone-base { fill: #d65a2a; }
.rm-cone { fill: #f58a3d; }
.rm-cone-band { fill: #fff; }
.rm-trunk { fill: #9c7759; stroke: rgba(70, 42, 24, .3); stroke-width: .8; }
.rm-trunk-hi { fill: none; stroke: #bb9677; stroke-width: 1.6; stroke-linecap: round; }
.rm-roots { fill: #7d5d45; }
.rm-crown { fill: #a3c9ab; }
.rm-crown-hi { fill: #bcd9c3; }
.rm-dirt { fill: #e9ddcb; }
.rm-dirt-edge { stroke: #d6c4ab; stroke-width: 1; stroke-linejoin: round; }
.rm-pebble { fill: #cdbba2; }
.rm-crack { fill: none; stroke: rgba(90, 80, 70, .35); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.rm-endboard { fill: var(--rm-coral); stroke: rgba(90, 30, 20, .3); stroke-width: .8; }
.rm-endboard-line { fill: rgba(255, 255, 255, .92); }
.rm-warn { fill: #fff; stroke: var(--rm-coral); stroke-width: 1.8; stroke-linejoin: round; }

/* ---- Vehicles ---- */

.rm-v-body { fill: url(#rm-vbody); stroke: rgba(10, 40, 70, .32); stroke-width: .8; }
.rm-v-stalled { fill: url(#rm-vbody2); stroke: rgba(40, 50, 60, .3); }
.rm-v-glass { fill: #1b3653; }
.rm-v-side { opacity: .75; }
.rm-v-head { fill: #fff4cf; }
.rm-v-tail { fill: #e2483b; }

/* ---- Small screens ---- */

@media (max-width: 720px) {
  .rm-world {
    width: calc(100% - 24px);
  }

  .rm-card h3 {
    font-size: 16.5px;
  }

  .rm-card p {
    font-size: 13.5px;
    line-height: 1.45;
  }

  .rm-face {
    padding: 11px 13px 12px;
  }

  .rm-mistake .rm-face {
    padding: 9px 11px 10px 13px;
  }

  .rm-mistake p {
    font-size: 12.5px;
    line-height: 1.4;
  }

  .rm-flag {
    font-size: 9.5px;
    letter-spacing: .06em;
  }

  .rm-flag::before {
    width: 10px;
    height: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rm-face,
  .rm-aura-g,
  .rm-bwrap,
  .rm-node .rm-halo,
  .rm-node .rm-node-body,
  .rm-node .rm-ring,
  .rm-node-num {
    transition: none;
  }
}
