/* Chapter tour: a 3D map whose pins fly to a campus, then scrolling moves through the landmarks. */
.cm { position: relative; background: var(--ground); }
.cm.is-story { height: calc(var(--cm-length) * 50svh / var(--zoom)); }
.cm__stage {
  position: sticky;
  top: var(--cm-top, 0px);
  height: calc(100svh / var(--zoom) - var(--cm-top, 0px));
  min-height: 460px;
  overflow: hidden;
  container-type: size;
}
.cm__stage:focus { outline: none; }   /* takes focus only so the keyboard keeps scrolling the tour */
.cm__map { position: absolute; inset: 0; }

/* The map view */
.cm__intro {
  position: absolute;
  bottom: clamp(16px, 4cqh, 40px);
  left: clamp(16px, 4cqw, 56px);
  max-width: min(100cqw - 32px, 720px);
  transition: opacity 0.3s ease;
}
.cm__intro h1 {
  font-family: "Archivo", var(--sans);
  font-size: clamp(28px, 4.4cqw, 60px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink);
}
.cm__intro p { margin-top: 6px; font-size: 16px; color: var(--ink); }
.cm__schools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.cm__schools button {
  padding: 6px 12px;
  border: 1px solid var(--maroon);
  border-radius: 999px;
  background: var(--cream);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--maroon);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.cm__schools button:hover,
.cm__schools button:focus-visible { background: var(--maroon); color: var(--cream); }
.is-flying .cm__intro { visibility: hidden; opacity: 0; }

.cm__pin {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.cm__pin:hover, .cm__pin:focus-visible { z-index: 2; }
.cm__pin-dot {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease;
}
.cm__pin:hover .cm__pin-dot, .cm__pin:focus-visible .cm__pin-dot { transform: scale(1.35); }
.cm__pin:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 50%; }
.cm__pin-name {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  display: none;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--cream);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.cm__pin:hover .cm__pin-name, .cm__pin:focus-visible .cm__pin-name { display: block; }
.is-flying .cm__pin { visibility: hidden; }

.cm__beacon {   /* names each landmark on the 3D map, once the visitor has flown in */
  display: none;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--maroon);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--cream);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.is-near .cm__beacon { display: block; }

/* Layers the scroll timeline reveals */
.cm__campus,
.cm__scene,
.cm__card { visibility: hidden; opacity: 0; }
.cm__scenes { position: absolute; inset: 0; pointer-events: none; }
.cm__scenes a,
.cm__scenes button { pointer-events: auto; }

.cm__campus {
  position: absolute;
  left: clamp(16px, 4cqw, 56px);
  bottom: clamp(76px, 10cqh, 84px);   /* clears the map's credit line */
  max-width: calc(100cqw - 32px);
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(20, 3, 3, 0.72);
  color: var(--cream);
}
.cm__campus h2 {
  font-family: "Archivo", var(--sans);
  font-size: clamp(24px, 3.4cqw, 44px);
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
}
.cm__campus p { margin-top: 6px; font-size: 16px; }
.cm__cue { font-weight: 600; }

.cm__scene { position: absolute; inset: 0; }
.cm__frame { position: absolute; inset: 0; background: #3a0606; }
.cm__photo {   /* the backdrop and cutout share a box, so the cutout lands exactly on its own blurred copy */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@container (max-aspect-ratio: 3 / 4) {   /* tall phones: drop the photo so the words clear the subject */
  .cm__photo { top: 18%; height: 82%; }
}
.cm__scrim { position: absolute; inset: 0; background: rgba(60, 4, 4, 0.42); }
.cm__big {
  position: absolute;
  inset: max(5cqh, 64px) 0 auto;   /* clears the back button */
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: "Archivo", var(--sans);
  font-size: min(calc(100cqw / var(--chars)), 24cqh);   /* the longest line fits the stage */
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--cream);
}
.cm__caption {
  position: absolute;
  left: clamp(16px, 4cqw, 56px);
  bottom: clamp(76px, 10cqh, 84px);   /* clears the map's credit line */
  max-width: min(100cqw - 32px, 420px);
  color: var(--cream);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
.cm__caption strong { display: block; font-size: 16px; font-weight: 600; }
.cm__caption small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.35; }
.cm__caption a { color: inherit; text-decoration: underline; }

.cm__card {
  position: absolute;
  right: clamp(16px, 5cqw, 80px);
  bottom: clamp(134px, 15cqh, 140px);   /* clears the caption on phones */
  width: min(100cqw - 32px, 340px);
  padding: 26px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(20, 3, 3, 0.4);
  color: var(--ink);
}
.cm__card-label { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--maroon); }
.cm__card h3 { margin: 8px 0; font-family: var(--serif); font-size: 28px; font-weight: 400; line-height: 1.1; }
.cm__card-link { display: block; margin-top: 14px; font-weight: 600; color: var(--maroon); }
.cm__card-next {
  display: block;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.cm__card-next:hover { text-decoration: underline; }

.cm__back {
  position: absolute;
  top: 16px;
  left: 16px;
  display: none;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.is-story .cm__back { display: block; }
