/* Course map page. Tokens and base type come from labs.css. */
body.hub {
  padding-top: 0;
}
.hub .mono {
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}
.hub .dim {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

/* Masthead */
.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 10px;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.brand img {
  border-radius: 7px;
  display: block;
}
.brand b {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.mast nav {
  display: flex;
  gap: 18px;
  font-size: 14.5px;
}
.mast nav a {
  color: var(--muted);
  text-decoration: none;
}
.mast nav a:hover {
  color: var(--ink);
}

/* Opening: the promise, then Rosa's two paths, then the way in. One column at every width. */
.open {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 22px;
  padding: 44px 0 8px;
}
.open-text {
  max-width: 44rem;
}
.open-text .eyebrow {
  color: var(--s-question);
}
.hub h1 {
  max-width: 20ch;
  font-size: clamp(36px, 5.4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 10px 0 16px;
}
.hub .lede {
  max-width: 46ch;
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
}
.paths-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 18px 20px 12px;
  box-shadow: var(--shadow);
}
.start-row {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}
.for-whom {
  margin: 0;
  max-width: 40ch;
  font-size: 15px;
  color: var(--muted);
  padding-left: 12px;
  border-left: 3px solid var(--s-question);
}
.small-h {
  font-size: 22px;
  margin: 0 0 12px;
}
.outcomes-wrap {
  margin-top: 44px;
}

/* See the payoff: the one-step toy, lower on the page. */
.payoff {
  margin-top: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 36px;
  align-items: center;
}
.payoff-text .eyebrow {
  color: var(--s-estimation);
}
.payoff-text h2 {
  font-size: 28px;
  margin: 6px 0 10px;
}
.payoff-text p {
  margin: 0;
  max-width: 46ch;
  color: var(--ink);
}

/* The toy */
.hero-toy {
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow);
}
.hero-toy figcaption {
  display: grid;
  gap: 2px;
  margin-bottom: 4px;
}
.hero-toy figcaption .eyebrow {
  color: var(--s-estimation);
  margin: 0;
}
.hero-toy figcaption b {
  font-family: "Fraunces", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}
#hero-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.h-axis {
  stroke: var(--rule);
  stroke-width: 1.2;
}
.h-truth {
  stroke: var(--green);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}
.h-curve {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
}
.h-tan {
  stroke: var(--purple);
  stroke-width: 2.4;
  stroke-dasharray: 6 4;
}
.h-gap {
  stroke-width: 3;
  stroke-linecap: round;
}
.h-gap.plug {
  stroke: var(--or);
}
.h-gap.one {
  stroke: var(--purple);
}
.h-dot {
  stroke: var(--paper);
  stroke-width: 2;
}
.h-dot.plug {
  fill: var(--or);
}
.h-dot.one {
  fill: var(--purple);
}
.h-dot.truth {
  fill: var(--green);
}
.h-lab {
  font: 12px "IBM Plex Sans", system-ui, sans-serif;
  fill: var(--muted);
}
.h-lab.end {
  text-anchor: end;
}
.h-lab.mid {
  text-anchor: middle;
}
.h-lab.dim {
  font-style: italic;
}
.h-lab.plug {
  fill: var(--or);
  font-weight: 600;
}
.h-lab.one {
  fill: var(--purple);
  font-weight: 600;
}
.toy-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "lab btn"
    "rng btn";
  column-gap: 14px;
  align-items: center;
  margin-top: 6px;
}
.toy-controls label {
  grid-area: lab;
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.toy-controls input {
  grid-area: rng;
  width: 100%;
  margin: 4px 0 0;
}
.toy-controls .go {
  grid-area: btn;
  font-size: 14.5px;
  padding: 10px 14px;
  white-space: nowrap;
}
.toy-read {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  min-height: 3em;
}
.toy-read b {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
}
.toy-read b.plug {
  color: var(--or);
}
.toy-read b.one {
  color: var(--purple);
}

.continue {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--stage, var(--purple));
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}
.continue .k {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.continue h2 {
  font-size: 23px;
  line-height: 1.15;
  margin: 0;
}
.continue p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}
.continue .prog {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.continue .prog-n {
  color: var(--ink);
}
.continue .prog-row {
  flex: 1 1 160px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.continue .bar {
  flex: 1;
  position: relative;
  height: 6px;
  background: var(--grid);
  border-radius: 3px;
  overflow: hidden;
}
/* Walked through: a light band; checks passed: the solid band on top. */
.continue .bar i {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  height: 100%;
  background: var(--stage, var(--purple));
}
.continue .bar i.walk {
  opacity: 0.35;
}
.continue .actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.go {
  font: inherit;
  font-weight: 500;
  font-size: 15.5px;
  padding: 11px 18px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  border: 0;
  cursor: pointer;
}
.go:hover {
  background: var(--purple);
  color: #fff;
}
.skip {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}
.skip:hover {
  color: var(--ink);
  text-decoration-color: var(--purple);
}
.go:focus-visible,
.skip:focus-visible,
.node:focus-visible,
.row:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}

/* The route: heading, the river as a progress picture (wide screens), then the path list. */
.route {
  margin-top: 44px;
}
.route-head h2 {
  font-size: 28px;
  margin: 0 0 6px;
}
.route-head .route-prog {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink);
}
.route-head p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  font-size: 15.5px;
}
svg.river {
  width: 100%;
  height: auto;
  display: block;
  margin: 14px 0 4px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}
.river .channel-bed {
  fill: none;
  stroke: var(--water);
  stroke-width: 22;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.river .channel {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}
.river .trib {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.85;
}
.river .station circle {
  fill: var(--paper);
  stroke-width: 4;
}
.river .station text {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.river .node {
  cursor: pointer;
  text-decoration: none;
}
.river .node circle.ring {
  fill: var(--paper);
  stroke-width: 2.5;
  transition: r 0.12s;
}
.river .node:hover circle.ring,
.river .node:focus circle.ring {
  r: 13;
}
.river .node.now circle.halo {
  fill: none;
  stroke-width: 3;
  opacity: 0.28;
}
.river .node text {
  font-size: 13px;
  fill: var(--ink);
}
.river .node tspan.n {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  fill: var(--muted);
}
.river .node.now text {
  font-weight: 600;
}
.river .source {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 14px;
  fill: var(--muted);
}
@media (prefers-reduced-motion: no-preference) {
  .river .channel {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: river-flow 1.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  .river .trib,
  .river .node,
  .river .station {
    opacity: 0;
    animation: river-rise 0.5s ease forwards;
  }
  .river .trib {
    animation-name: river-rise-trib;
  }
}
@keyframes river-flow {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes river-rise {
  to {
    opacity: 1;
  }
}
@keyframes river-rise-trib {
  to {
    opacity: 0.85;
  }
}

.retrieval {
  margin: 10px 4px 0;
  font-size: 14.5px;
}
/* The quick identification check: a demoted alternative under the placement card. */
.skip-ahead {
  margin-top: 8px;
  font-size: 14px;
  padding: 2px 4px;
}
.skip-ahead[open] {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--paper);
}
.skip-ahead summary {
  cursor: pointer;
  font-weight: 400;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  padding: 6px 0;
}
.skip-ahead summary:hover {
  color: var(--ink);
}
.skip-ahead[open] summary {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
/* While the placement quiz is open, the quick check steps aside. */
.placement:has(.pl-card.pl-open) .skip-ahead:not([open]) {
  display: none;
}
.skip-ahead p {
  color: var(--muted);
  margin: 10px 0;
}
.skip-ahead fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 4px;
}
.skip-ahead legend {
  font-weight: 500;
  margin-bottom: 6px;
  padding: 0;
}
.skip-ahead label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}
.skip-ahead .result {
  margin: 10px 0 0;
  color: var(--ink);
}
.skip-ahead .result.ok {
  color: var(--green);
}
.skip-ahead .result.no {
  color: var(--red);
}
/* Path list: a coloured spine on the left, one group per roadmap stage. */
.path,
.path .lessons {
  list-style: none;
  margin: 0;
  padding: 0;
}
.path {
  margin-top: 18px;
  --spine-x: 15px;
}
.stage-group {
  position: relative;
}
.stage-group::before {
  content: "";
  position: absolute;
  left: calc(var(--spine-x) - 2px);
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--stage);
  opacity: 0.85;
}
.stage-group:first-child::before {
  top: 22px;
}
.stage-group:last-of-type:not(.elective)::before,
.stage-group.elective::before {
  bottom: 18px;
}
.stage-group.elective {
  margin-top: 26px;
}
.stage-group.elective::before {
  background: none;
  border-left: 3px dashed var(--muted);
  opacity: 0.6;
}
.stage-h {
  list-style: none;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 6px 12px 0;
  cursor: pointer;
}
.stage-h::-webkit-details-marker {
  display: none;
}
.stage-h .dot {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 4px solid var(--stage);
}
.stage-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stage-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stage);
}
.stage-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
}
.stage-h .sum {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stage-h .sum::after {
  content: "▾";
  font-family: system-ui, sans-serif;
  font-size: 12px;
  transition: transform 0.15s;
}
details:not([open]) > .stage-h .sum::after {
  transform: rotate(-90deg);
}
.lessons {
  padding-bottom: 8px !important;
}
.lesson {
  display: grid;
  grid-template-columns: 30px 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 8px 10px 0;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.lesson:hover,
.lesson.hl {
  background: var(--paper);
  box-shadow: var(--shadow);
}
.lesson .node {
  position: relative;
  z-index: 1;
  justify-self: center;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--stage);
}
.lesson.part .node {
  background: linear-gradient(90deg, var(--stage) 50%, var(--bg) 50%);
}
.lesson.done .node {
  background: var(--stage);
}
.lesson.now .node {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--stage) 25%, transparent);
}
.lesson .n {
  font-size: 12.5px;
  color: var(--muted);
  padding-top: 2px;
}
.lesson .t {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.lesson .t b {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.3;
}
.lesson.now .t b {
  font-weight: 600;
}
.lesson .t small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lesson .meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.chip {
  justify-self: start;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--muted);
  white-space: nowrap;
}
.chip.done {
  color: var(--s-interpretation);
  border-color: color-mix(in srgb, var(--s-interpretation) 50%, transparent);
}
.chip.part {
  color: var(--or);
  border-color: color-mix(in srgb, var(--or) 55%, transparent);
}
.chip.now {
  color: var(--purple);
  border-color: var(--purple);
  background: color-mix(in srgb, var(--purple) 10%, transparent);
}

/* Outcomes */
.outcomes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.outcome {
  padding: 14px 16px;
  border-left: 3px solid var(--stage);
  background: var(--paper);
  border-radius: 0 10px 10px 0;
}
.outcome .eyebrow {
  color: var(--stage);
}
.outcome p {
  margin: 4px 0 0;
  font-size: 15px;
}
.outcome p b {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
}

/* Footer */
.hub-foot {
  margin-top: 44px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--muted);
}
.hub-foot .course-settings {
  margin: 0 0 14px;
}

/* Slim Continue bar for phones, shown by hub.js once a learner has started. */
.resume-bar {
  display: none;
}
@media (max-width: 879px) {
  body.hub {
    padding: 0 18px 88px;
  }
  .mast {
    padding: 12px 0 10px;
  }
  .mast nav a:nth-child(n + 3) {
    display: none;
  }
  .open {
    padding-top: 26px;
    row-gap: 18px;
  }
  .hub h1 {
    font-size: 38px;
  }
  .hub .lede {
    font-size: 17px;
  }
  .paths-card {
    padding: 12px 10px 8px;
    margin: 0 -6px;
  }
  .start-row,
  .payoff {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .outcomes-wrap,
  .payoff {
    margin-top: 32px;
  }
  .payoff-text h2 {
    font-size: 23px;
  }
  .hero-toy {
    padding: 14px 12px 12px;
  }
  .continue h2 {
    font-size: 21px;
  }
  /* Outcomes become a strip you swipe sideways. */
  .outcomes {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -18px;
    padding: 0 18px 6px;
    gap: 10px;
  }
  .outcome {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
  .route {
    margin-top: 32px;
  }
  .route-head h2 {
    font-size: 24px;
  }
  svg.river {
    display: none;
  }
  .stage-title {
    font-size: 17.5px;
  }
  .lesson .t small {
    -webkit-line-clamp: 1;
  }
  .resume-bar:not([hidden]) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 20;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--bg);
    text-decoration: none;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    border-left: 5px solid var(--stage);
    font-size: 14.5px;
  }
  .resume-bar .rb-k,
  .resume-bar .rb-m {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
  }
  .resume-bar .rb-t {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
.h-lab.truth {
  fill: var(--green);
  font-weight: 600;
}
/* Skimmed (marked by placement, never opened): a dashed ring, no fill, a quiet chip. */
.lesson.skim .node {
  border-style: dashed;
}
.chip.skim {
  color: var(--muted);
  border-color: var(--rule);
}
.river .node.skim circle.ring {
  stroke-dasharray: 3 3;
}
/* In-place refreshes (placement result, skims) redraw the river without replaying its entrance. */
svg.river.settled .channel,
svg.river.settled .trib,
svg.river.settled .node,
svg.river.settled .station {
  animation: none !important;
  opacity: 1 !important;
  stroke-dashoffset: 0 !important;
}
svg.river.settled .trib {
  opacity: 0.85 !important;
}

/* For your trial: the regulatory-facing tool, below the route. */
.for-trial {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 28px;
  margin: 40px 0 8px;
  padding: 20px 22px;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--s-question);
  border-radius: 12px;
  background: var(--paper);
}
.for-trial h2 {
  margin: 4px 0 6px;
}
.for-trial p {
  margin: 0;
  color: var(--muted);
}
.for-trial .course-btn {
  font-size: 15px;
  padding: 11px 18px;
}
@media (max-width: 640px) {
  .for-trial {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
  .for-trial .course-btn {
    justify-self: start;
  }
}
