/* Maps & Spatial Design (map-work.html): the project index, and the two LA STAP
   research slides rebuilt in HTML around their illustrations. */

/* ---------- the three projects, as parallel cards ---------- */

.mw-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 6rem;
  gap: var(--gap);
  margin: 6rem 0 0;
  padding: 0;
  list-style: none;
}

.mw-cards a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.mw-thumb {
  aspect-ratio: 16 / 9;
  transition: border-color 0.3s ease;
}

.mw-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the LA STAP thumbnail: four of the journey illustrations in a row */
.mw-thumb-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4%;
  padding: 0 7%;
  background: #0b0b0c;
}

.mw-thumb-icons img {
  flex: 1;
  min-width: 0;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
}

.mw-cards a:hover .mw-thumb {
  border-color: var(--accent);
}

.mw-card-project {
  margin: 2.8rem 0 1rem;
  color: var(--accent);
}

.mw-cards h3 {
  text-wrap: pretty; /* no single word left alone on the last line */
  margin: 0;
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

/* ---------- room between a title and the image under it ---------- */

.cs-stage > .cs-stage-head {
  margin-bottom: -0.8rem;
}

.cs-stage > .cs-point + *,
.cs-stage > .cs-stage-head + figure {
  margin-top: 2rem;
}

.cs-statement + .cs-frame-hero {
  margin-top: 5rem;
}

.cs-sys-block > .cs-stage-head {
  margin-bottom: 3.2rem;
}

/* a title with a line of text under it keeps the two together */
.cs-sys-block > .cs-stage-head:has(+ .mw-note) {
  margin-bottom: 0.8rem;
}

.cs-stage > .cs-states {
  margin-top: 1.2rem;
}

/* every project lists the same details; a project with a client gets one more column */
.cs-section > .cs-meta {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 4rem 0 0;
}

.cs-section > .cs-meta + .cs-frame-hero {
  margin-top: 5rem;
}

.cs-frame-hero + .cs-stage,
.mw-hero-states + .cs-sys-block {
  margin-top: 8rem;
}

/* ---------- section leads ---------- */

/* Mach9: the same intersection zoomed in, zoomed out and selected */
.cs-section > .cs-meta + .mw-hero-states {
  margin-top: 5rem;
}

/* the live globe, with the site's layer buttons and data credits on the left */
.mw-globe-fig {
  margin: 0;
}

.mw-globe {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: center;
  gap: var(--gap);
  padding: 2rem 4rem 2rem 5rem;
  background: #101010;
}

.mw-globe-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2.4rem;
}

/* the layer buttons, styled as on mach9.ai: a hairline group, the shown layer lit */
.mw-layers {
  display: inline-flex;
  flex-direction: column;
  padding: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--mono);
  font-size: 1.2rem;
  line-height: 1.5;
}

.mw-layers button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.mw-layers button:hover,
.mw-layers button.is-shown {
  color: #fff;
}

.mw-layers button.is-shown {
  background: rgba(255, 255, 255, 0.1);
}

.mw-layers button:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

.mw-swatch {
  width: 1.2rem;
  height: 2px;
  border-radius: 99px;
  background: var(--c);
  box-shadow: 0 0 5px 1px var(--c);
}

[data-layer="4"] .mw-swatch {
  box-shadow: 0 0 6px 2px var(--c);
}

/* before the globe runs, or where it can't, the layers read as a plain legend */
.mw-globe-fig:not(.is-live) .mw-layers {
  pointer-events: none;
}

.mw-globe-fig:not(.is-live) [data-layer=""] {
  display: none;
}

/* the data credits, small in the panel's bottom left corner */
.mw-credit {
  position: absolute;
  left: 2rem;
  bottom: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.3);
}

.mw-credit a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.mw-credit a:hover {
  color: #fff;
}

.mw-globe-view {
  position: relative;
  width: 100%;
  max-width: 64rem;
  aspect-ratio: 1;
  justify-self: center;
}

.mw-globe-view img,
.mw-globe-view canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.mw-globe-view canvas {
  visibility: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.mw-globe-view canvas:active {
  cursor: grabbing;
}

.is-live .mw-globe-view canvas {
  visibility: visible;
}

.is-live .mw-globe-still {
  visibility: hidden;
}

.mw-caption {
  max-width: 56rem;
  margin-top: 1.6rem;
  color: var(--muted);
}

/* the globe's caption is its introduction, so it reads at full strength */
.mw-globe-fig .mw-caption {
  color: var(--ink-strong);
}

/* "Parameters" in the caption opens the panel, once the globe is live */
.mw-open-tune {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
  cursor: pointer;
}

.mw-open-tune:hover {
  text-decoration-color: currentColor;
}

.mw-globe-fig:not(.is-live) .mw-open-tune {
  text-decoration: none;
  pointer-events: none;
}

/* the parameters button, in the frame's top right corner where settings live */
.mw-tune-toggle {
  position: absolute;
  top: 1.6rem;
  right: 2rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--mono);
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.mw-tune-toggle svg {
  width: 1.4rem;
  height: 1.4rem;
}

.mw-tune-toggle:hover,
.mw-tune-toggle[aria-expanded="true"] {
  color: #fff;
}

.mw-tune-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.mw-globe-fig:not(.is-live) .mw-tune-toggle,
.mw-globe.is-tuning .mw-tune-toggle {
  display: none;
}

/* the panel opens as a third column on the right; the globe makes room */
.mw-globe.is-tuning {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 2fr) minmax(24rem, 1fr);
  grid-template-rows: minmax(0, 1fr);
  padding-right: 2rem;
}

/* the panel scrolls inside the frame's height rather than growing it */
.mw-tune {
  align-self: stretch;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0.4rem 1rem 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.mw-tune[hidden] {
  display: none;
}

.mw-tune-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  background: #101010;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.mw-tune-head p {
  margin: 0;
  font-family: var(--mono);
  color: #fff;
}

.mw-tune-head div {
  display: flex;
  gap: 1.2rem;
}

.mw-tune-head button {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--mono);
  font-size: 1.1rem;
  cursor: pointer;
}

.mw-tune-head button:hover {
  color: #fff;
}

.mw-tune-key {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0 0;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.4);
}

.mw-tune-key i,
.mw-seg button.is-shipped::after,
.mw-range::after {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #8a93ff;
}

.mw-tune-key i {
  display: inline-block;
}

.mw-tune-group {
  display: grid;
  gap: 1rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mw-tune-group[hidden] {
  display: none;
}

.mw-tune-group:last-child {
  border-bottom: 0;
}

.mw-tune-name {
  display: flex;
  justify-content: space-between;
  margin: 0;
  font-family: var(--mono);
  color: #fff;
}

.mw-tune-name button {
  padding: 0;
  border: 0;
  background: none;
  color: #8a93ff;
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.mw-tune-what {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.45);
}

.mw-seg {
  display: flex;
  padding: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.mw-seg button {
  position: relative;
  flex: 1 1 auto;
  padding: 0.5rem 0.6rem;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono);
  font-size: 1.05rem;
  white-space: nowrap;
  cursor: pointer;
}

.mw-seg button:hover {
  color: #fff;
}

.mw-seg button[aria-checked="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mw-seg button.is-shipped::after {
  content: "";
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 0.4rem;
  height: 0.4rem;
}

.mw-slider {
  display: grid;
  gap: 0.2rem;
  cursor: pointer;
}

.mw-slider > span:first-child {
  display: flex;
  justify-content: space-between;
}

.mw-slider output {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

/* a thin track, with a dot at the shipped value */
.mw-range {
  position: relative;
  display: block;
  height: 1.8rem;
}

.mw-range::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.mw-range::after {
  content: "";
  position: absolute;
  top: calc(50% - 0.9rem);
  left: calc(var(--mark) * (100% - 1.2rem) + 0.6rem);
  margin-left: -0.25rem;
  pointer-events: none;
}

.mw-range input {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.mw-range input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #fff;
}

.mw-range input::-moz-range-thumb {
  width: 1.2rem;
  height: 1.2rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.mw-tune button:focus-visible,
.mw-range input:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

/* ---------- design decisions under the globe ---------- */

/* the before/after comparisons under the board */
.mw-decs {
  margin-top: 8rem;
}

/* text on the left, a small before/after slider on the right */
.mw-dec {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 44rem);
  gap: var(--gap);
  align-items: start;
}

.mw-dec + .mw-dec {
  margin-top: 6.4rem;
}

.mw-dec-title {
  margin: 0 0 1.2rem;
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.mw-dec-text p:last-child {
  max-width: 48rem;
}

.mw-cmp {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.mw-cmp-stage {
  --pos: 50%;
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.6rem;
  background: #121212;
}

.mw-cmp-stage img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.mw-cmp-before {
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.mw-cmp-stage input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

.mw-cmp-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  border-left: 1px solid rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.mw-cmp-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -1.2rem;
  width: 2.4rem;
  height: 2.4rem;
  margin-top: -1.2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.mw-cmp-stage input:focus-visible ~ .mw-cmp-handle::after {
  outline: 1px solid #fff;
  outline-offset: 3px;
}

.mw-cmp-tag {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  background: rgba(16, 16, 16, 0.7);
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

/* the side we chose */
.mw-cmp-tag.mw-cmp-chosen {
  background: #fff;
  color: #101010;
}

.mw-cmp-tag + .mw-cmp-tag {
  left: auto;
  right: 1.2rem;
}

.mw-cmp-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.mw-cmp-opts .cs-caps {
  margin-right: 0.4rem;
  color: var(--muted);
}

.mw-cmp-opts button {
  padding: 0.4rem 1rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.mw-cmp-opts button:hover {
  color: var(--fg, inherit);
}

.mw-cmp-opts button[aria-pressed="true"] {
  border-color: currentColor;
  color: inherit;
}

/* the way out to the full case study, at the end of each section */
.mw-more-row {
  margin: 7rem 0 0;
}

/* sections here open with an eyebrow, not a page title, so every anchor
   lands with the eyebrow just under the top of the window */
.cs-section {
  scroll-margin-top: 3rem;
}

/* a recording with its four beats beside it */
.mw-lead {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--gap);
  align-items: start;
  margin-top: 4rem;
}

.cs-stage-head + .mw-lead {
  margin-top: 0;
}

.mw-lead + .cs-bgstates {
  margin-top: 5rem;
}

.mw-note {
  max-width: 48rem;
  margin: 0;
}

.mw-more {
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  text-decoration: none;
}

.mw-more:hover {
  color: var(--accent);
}

/* the arrow is always there, and steps forward on hover */
.mw-more .pd-arrow {
  opacity: 1;
  transform: none;
}

.mw-more:hover .pd-arrow {
  transform: translateX(0.4rem);
}

/* ---------- research slides ---------- */

.mw-slide {
  padding: 3rem;
  border: 1px solid var(--line);
  --slide-bg: #f7f7f7;
  border-radius: 1.4rem;
  background: var(--slide-bg);
  overflow-x: auto;
}

:root[data-theme="dark"] .mw-slide {
  --slide-bg: #262626;
}

/* ---------- Rider Journey, laid out like the original research slide ----------
   Six steps on one line, then a branch: up (dotted) to a transfer, which loops
   back to "locate bus stop", or down (solid) to the destination. Heights are
   fixed so the connectors can be drawn with plain borders:
   illustrations calc(8.5 * var(--u)) tall, the line calc(11 * var(--u)) below their top edge. */

.mw-slide {
  container-type: inline-size;
}

/* --u is 1/84 of the slide, so the whole drawing scales with it and always
   fits: nothing scrolls sideways. On a phone it stops shrinking and scrolls. */
.mw-rj {
  --u: max(100cqw / 84, 0.62rem);
  --rj-gap: calc(1.4 * var(--u));
  --rj-label: calc(7 * var(--u)); /* the column that names the touch point rows */
  --rj-col: calc((100% - var(--rj-label) - 7 * var(--rj-gap)) / 8.2); /* the last column is 2.2 wide */
  min-width: calc(84 * var(--u));
  --rj-ink: #8f8f8f;
  --rj-soft: #c4c4c4;
}

:root[data-theme="dark"] .mw-rj {
  --rj-ink: #8a8a8a;
  --rj-soft: #5c5c5c;
}

.mw-rj-map {
  position: relative;
  padding-top: calc(7 * var(--u));
  padding-left: calc(var(--rj-label) + var(--rj-gap));
}

.mw-rj-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, 2.2fr);
  gap: var(--rj-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mw-rj-steps > li {
  position: relative;
  min-width: 0;
}

/* the photo of each step, as on the original slide */
.mw-rj-photo {
  display: block;
  width: 100%;
  height: calc(11.6 * var(--u));
  margin: 0;
  object-fit: cover;
}

/* the illustration of each step sits on the line, where the slide had a dot:
   big enough to read, small enough to leave the photo in charge */
.mw-rj-dot {
  position: absolute;
  z-index: 1;
  top: calc(12.8 * var(--u));
  left: 0;
  width: calc(4.4 * var(--u));
  height: calc(4.4 * var(--u));
  margin: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 calc(0.35 * var(--u)) var(--slide-bg);
}

/* the line from each step to the next one, 15u below the top of the photos */
.mw-rj-steps > li:not(.mw-rj-end)::before {
  content: "";
  position: absolute;
  top: calc(15 * var(--u) - 1.5px);
  left: calc(2.2 * var(--u));
  width: calc(100% + var(--rj-gap));
  border-top: 3px solid var(--rj-ink);
}

/* planning happens before the rider reaches the system: lighter, dotted */
.mw-rj-steps > li:first-child::before {
  border-top: 3px dotted var(--rj-soft);
}

.mw-rj h4 {
  margin: calc(6.8 * var(--u)) 0 calc(0.8 * var(--u));
  font-size: calc(1.25 * var(--u));
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--ink-strong);
}

.mw-rj-steps ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: calc(1.05 * var(--u));
  line-height: 1.3;
}

.mw-rj-steps ul li + li {
  margin-top: calc(0.6 * var(--u));
}

/* the last column: transfer above the line, destination below it */
.mw-rj-end {
  min-height: calc(30 * var(--u));
}

.mw-rj-connect,
.mw-rj-arrive {
  position: absolute;
  left: calc(3.4 * var(--u));
  right: 0;
  padding-left: calc(5.2 * var(--u));
}

.mw-rj-connect {
  top: calc(-5.5 * var(--u));
}

.mw-rj-arrive {
  top: calc(16.2 * var(--u));
}

.mw-rj-end .mw-rj-photo {
  width: calc(5.5 * var(--u));
  height: calc(7.3 * var(--u));
  margin-left: calc(-5.2 * var(--u));
}

.mw-rj-end .mw-rj-dot {
  top: calc(7.9 * var(--u));
}

.mw-rj-end h4 {
  margin: calc(1.4 * var(--u)) 0 calc(0.6 * var(--u));
}

/* dotted branch up to the transfer, solid trunk down to the destination */
.mw-rj-end::before,
.mw-rj-end::after {
  content: "";
  position: absolute;
  left: calc(2.2 * var(--u) - 1.5px);
  width: calc(1.4 * var(--u));
}

.mw-rj-end::before {
  top: calc(4.6 * var(--u) - 1.5px);
  height: calc(10.4 * var(--u));
  border-top: 3px dotted var(--rj-soft);
  border-left: 3px dotted var(--rj-soft);
  border-top-left-radius: calc(1 * var(--u));
}

.mw-rj-end::after {
  top: calc(15 * var(--u));
  height: calc(11.3 * var(--u) + 1.5px);
  border-bottom: 3px solid var(--rj-ink);
  border-left: 3px solid var(--rj-ink);
  border-bottom-left-radius: calc(1 * var(--u));
}

/* the transfer loops back to "locate bus stop" */
.mw-rj-loop {
  position: absolute;
  top: calc(0.4 * var(--u));
  left: calc(var(--rj-label) + var(--rj-col) + 2 * var(--rj-gap) + 4.4 * var(--u));
  right: calc(2.2 * var(--rj-col) - 6.15 * var(--u));
  height: calc(1.1 * var(--u));
  border: 3px dotted var(--rj-soft);
  border-bottom: 0;
  border-radius: calc(1 * var(--u)) calc(1 * var(--u)) 0 0;
}

.mw-rj-loop::before {
  content: "";
  position: absolute;
  left: -3px;
  top: calc(1 * var(--u));
  height: calc(5.2 * var(--u));
  border-left: 3px dotted var(--rj-soft);
}

.mw-rj-loop::after {
  content: "";
  position: absolute;
  right: calc(-0.65 * var(--u) - 1.5px);
  top: calc(0.4 * var(--u));
  border: calc(0.65 * var(--u)) solid transparent;
  border-top: calc(0.9 * var(--u)) solid var(--rj-soft);
  border-bottom: 0;
}

/* touch point rows: the name in the label column, each cell under its step */
.mw-rj-row {
  display: grid;
  grid-template-columns: var(--rj-label) minmax(0, 1fr);
  gap: var(--rj-gap);
  align-items: start;
  margin-top: calc(2.4 * var(--u));
  padding-top: calc(1.2 * var(--u));
  border-top: 1px solid var(--line);
}

.mw-rj-row + .mw-rj-row {
  margin-top: calc(1.2 * var(--u));
}

.mw-rj-row p {
  margin: 0;
  font-size: calc(1.05 * var(--u));
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-strong);
}

.mw-rj-row ul {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(0, 2.2fr);
  gap: var(--rj-gap);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: calc(1.05 * var(--u));
  line-height: 1.3;
  color: var(--muted);
}

/* the last cell lines up with the transfer and destination text above it */
.mw-rj-row li:last-child {
  padding-left: calc(8.6 * var(--u));
}

/* ---------- Design Opportunities, in the same slide format ---------- */

.mw-do {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(7 * var(--u));
  margin: 0;
  padding: calc(1 * var(--u)) 0;
  list-style: none;
}

.mw-do > li {
  position: relative;
  display: flex;
  flex-direction: column;
}

.mw-do h4 {
  flex: 1;
  margin: 0 0 calc(1.4 * var(--u));
}

.mw-do img {
  display: block;
  margin: 0;
  border-radius: 50%;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

/* the arrow from one move to the next, level with the circles */
.mw-do > li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: calc(-3.5 * var(--u));
  bottom: calc((84 * var(--u) - 21 * var(--u)) / 8);
  transform: translate(50%, 50%);
  font-size: calc(2 * var(--u));
  line-height: 1;
  color: var(--rj-ink);
}

/* ---------- iPhone mockups on a near-black stage ---------- */

.mw-stage {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2.4rem;
  margin: 0;
  padding: 4.5rem 4rem;
  list-style: none;
  border-radius: 1.4rem;
  background: #19191c;
}

.mw-stage-pair {
  grid-template-columns: repeat(2, 24rem);
  gap: 5rem;
  justify-content: center;
  padding: 6rem 4rem;
}

/* percentages keep the bezel and corners in proportion at any phone width */
.mw-phone {
  position: relative;
  padding: 3.4%;
  border-radius: 17% / 7.9%;
  background: #060607;
  box-shadow: 0 0 0 1px #3b3440, 0 2.4rem 4rem rgba(0, 0, 0, 0.45);
}

.mw-phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 390 / 844;
  border-radius: 14% / 6.5%;
  background: #000;
}

/* dynamic island */
.mw-phone::after {
  content: "";
  position: absolute;
  top: 2.9%;
  left: 50%;
  width: 26%;
  aspect-ratio: 3.5;
  border-radius: 99rem;
  background: #060607;
  transform: translateX(-50%);
}

@media (max-width: 800px) {
  .mw-stage {
    grid-template-columns: repeat(5, 15rem);
    padding: 3rem 2rem;
    overflow-x: auto;
  }

  .mw-stage-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }

  .mw-lead {
    grid-template-columns: 1fr;
  }

  .mw-hero-states {
    grid-template-columns: 1fr;
  }

  .mw-globe {
    grid-template-columns: 1fr;
    padding: 2.4rem;
  }

  .mw-layers {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .mw-globe {
    padding-bottom: 4.4rem;
  }

  .mw-credit {
    left: 2.4rem;
  }

  .mw-globe.is-tuning {
    grid-template-columns: 1fr;
    padding-right: 2.4rem;
  }

  /* room for the parameters button above the layer buttons */
  .mw-globe-fig.is-live .mw-globe {
    padding-top: 6rem;
  }

  .mw-tune {
    max-height: none;
  }

  .mw-dec {
    grid-template-columns: 1fr;
  }


  .cs-section > .cs-meta {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mw-cards {
    grid-template-columns: 1fr;
    gap: 5rem;
  }

  .mw-slide {
    padding: 2rem;
  }

}

/* the two tradeoff cases sit clear of the line that introduces them */
.cs-sys-block + .cs-cases {
  margin-top: 3.2rem;
}

/* ---------- each section opens with its name, then one line on what it is ---------- */

.mw-title {
  margin: 0;
  font-size: 4.4rem;
  line-height: 1.1;
}

.mw-sub {
  max-width: 56rem;
  margin: 1.8rem 0 0;
}

.cs-meta a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* longer section names wrap under themselves, clear of the number */
.cs-nav ol a {
  line-height: 1.3;
}

/* ---------- dark mode: two background colors, nothing else ----------
   Panels take the Rider Journey grey; the phone and globe stages take the
   near-black of the BMW & MINI hero. Every one keeps its thin light outline. */

:root[data-theme="dark"] .cs-body {
  --mw-panel: #262626;
  --mw-deep: #111111;
}

:root[data-theme="dark"] .cs-body .cs-frame,
:root[data-theme="dark"] .cs-body .mw-slide,
:root[data-theme="dark"] .cs-body .cs-diagram svg,
:root[data-theme="dark"] .cs-body .cs-spec-row svg,
:root[data-theme="dark"] .cs-body .cs-vtile svg,
:root[data-theme="dark"] .cs-body .cs-case-fig svg,
:root[data-theme="dark"] .cs-body .cs-compare svg,
:root[data-theme="dark"] .cs-body .cs-compare img {
  background: var(--mw-panel);
}

/* the slide's ring around each illustration follows the panel */
:root[data-theme="dark"] .cs-body .mw-slide {
  --slide-bg: var(--mw-panel);
}

/* the live specimen paints its own ground; its default follows the panel (see map-work.html) */
:root[data-theme="dark"] .cs-body .cs-try {
  --cad-ground: var(--mw-panel);
}

:root[data-theme="dark"] .cs-body .mw-stage,
:root[data-theme="dark"] .cs-body .mw-globe {
  border: 1px solid var(--line);
  background: var(--mw-deep);
}

/* cards keep their own thumbnails, so only their outline follows the theme */
:root[data-theme="dark"] .mw-thumb {
  border-color: var(--line);
}



