/* ============================================================
   COURSE MAP — "the trail ahead"
   Two grade trails with an immediate, static route for launch.
   ============================================================ */

/* ---------- hero ---------- */
.cm-hero {
  position: relative;
  padding-top: clamp(150px, 20vh, 200px);
  overflow: hidden;
  background: linear-gradient(180deg, #F7F2E4 0%, var(--sand-50) 60%, var(--sand-100) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.cm-hero .container { position: relative; z-index: 2; padding-bottom: 60px; }

.cm-title {
  font-size: clamp(3.2rem, 8vw, 6.4rem);
  margin-bottom: 26px;
}
.cm-jumps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
  max-width: 760px;
}
.cm-jumps .btn { justify-content: center; text-align: center; }

/* ---------- semester chapters ---------- */
.semester { padding: clamp(70px, 9vw, 110px) 0 clamp(40px, 5vw, 60px); background: var(--sand-50); }
.semester-two { background: var(--sand-100); }

.semester-head {
  position: sticky; top: 92px; z-index: 20;
  background: rgb(250 246 235 / 0.82);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgb(13 13 17 / 0.07);
  border-radius: 18px;
  padding: 18px 28px;
  margin-bottom: 44px;
  box-shadow: 0 14px 34px -16px rgb(13 13 17 / 0.2);
  max-width: 960px; margin-inline: auto;
}
.semester-two .semester-head { background: rgb(243 237 220 / 0.85); }
.semester-head .eyebrow { margin-bottom: 6px; }
.semester-head h2 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.sem-note {
  font-family: var(--font-body); font-weight: 500; font-size: 0.55em;
  letter-spacing: 0; color: var(--ink-500);
}

/* ---------- the trail ---------- */
.stops {
  position: relative;
  max-width: 960px;
  margin-inline: auto;
  padding: 30px 0 26px;
}
.route-svg {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; overflow: visible;
  pointer-events: none;
}
.route-shadow, .route-line, .route-center {
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.route-shadow { stroke: rgb(13 13 17 / 0.08); stroke-width: 13; }
.route-line { stroke-width: 5; }
.route-center {
  stroke: rgb(255 255 255 / 0.82); stroke-width: 1.4;
  stroke-dasharray: 3 11;
}
.zone-summit .route-shadow { stroke: rgb(250 246 235 / 0.1); }
.zone-summit .route-center { stroke: rgb(250 246 235 / 0.72); }

/* stop-node horizontal positions — the switchback rhythm (6 slots) */
.stop:nth-child(6n+1) { --nx: 68%; }
.stop:nth-child(6n+2) { --nx: 32%; }
.stop:nth-child(6n+3) { --nx: 60%; }
.stop:nth-child(6n+4) { --nx: 40%; }
.stop:nth-child(6n+5) { --nx: 66%; }
.stop:nth-child(6n+6) { --nx: 30%; }

/* trail rhythm — steeper climbs and meadow traverses */
.stop:nth-child(3n) { padding-block: 38px 20px; }
.stop:nth-child(5n) { padding-block: 16px 44px; }

/* ---------- immediately visible route ---------- */
.stop-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
a.stop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }

/* ---------- stops ---------- */
.stop {
  position: relative; z-index: 2;
  display: flex;
  padding: 26px 0;
}
.stop:nth-child(odd) { justify-content: flex-start; }
.stop:nth-child(even) { justify-content: flex-end; }
.stop-card { width: calc(50% - 52px); }
.stop-card h3 { margin-bottom: 10px; color: var(--ink-900); }
.stop-card p { color: var(--ink-700); font-size: 15.5px; }
.milestone .stop-card h3 { color: var(--sand-50); }
.stop-card .card-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 18px;
}
.wk { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-300); white-space: nowrap; }

/* link from a stop card to its unit page — whole card is clickable */
a.stop-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.unit-cta {
  align-self: flex-start;
  margin-top: auto;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--iris-500);
  border: 1.5px solid rgb(91 84 214 / 0.4);
  padding: 8px 15px; border-radius: 999px;
  transition: all 0.3s;
}
.stop-card > p { margin-bottom: 18px; }
a.stop-card:hover .unit-cta {
  background: var(--iris-500); border-color: var(--iris-500); color: #fff;
}
.stop-card.is-current {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 4px rgb(232 112 58 / 0.16), var(--shadow-card);
}
a.stop-card.is-current:hover { box-shadow: 0 0 0 4px rgb(232 112 58 / 0.2), var(--shadow-card-hover); }
.current-stop-badge {
  display: block;
  margin: -2px 0 13px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-500);
}
.stop.is-current-stop .stop-node {
  background: var(--amber-500);
  color: var(--ink-900);
  border-color: var(--amber-500);
  box-shadow: 0 0 0 7px rgb(232 112 58 / 0.18), 0 8px 20px rgb(13 13 17 / 0.2);
}

/* cartographer's note — the chapters still being drawn */
.stop.charted { z-index: 1; }
.charted-note {
  width: calc(50% - 52px);
  border: 1.5px dashed rgb(13 13 17 / 0.18);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex; flex-direction: column; gap: 10px;
}
.charted-note p { color: var(--ink-500); font-size: 14px; font-style: italic; }

/* grade break — the big chapter divider */
.grade-break {
  padding: clamp(80px, 11vw, 150px) 0;
  text-align: center;
  background: var(--ink-900); color: var(--sand-50);
  border-radius: clamp(24px, 4vw, 48px);
  margin: clamp(40px, 5vw, 70px) clamp(10px, 2vw, 24px);
  scroll-margin-top: 100px;
}
.grade-break-eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--iris-300); margin-bottom: 16px;
}
.grade-break-big {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(4rem, 12vw, 10rem); line-height: 0.9; letter-spacing: -0.04em;
}
.grade-break-sub { color: rgb(250 246 235 / 0.6); margin-top: 14px; font-size: 1.1rem; }
#g7 { scroll-margin-top: 100px; }
.stop-card .chip { margin-bottom: 18px; }

.stop-node {
  position: absolute; left: var(--nx, 50%); top: 50%;
  transform: translate(-50%, -50%); z-index: 3;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--sand-50);
  border: 1.5px solid rgb(13 13 17 / 0.12);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--ink-700);
  box-shadow: 0 4px 14px rgb(13 13 17 / 0.08);
}

/* milestones: midterm + final */
.milestone .stop-node {
  width: 60px; height: 60px;
  background: var(--ink-900); color: var(--amber-300);
  border-color: var(--ink-900); font-size: 15px;
  box-shadow: 0 0 0 7px rgb(232 112 58 / 0.16), 0 10px 24px rgb(13 13 17 / 0.3);
}
.milestone .stop-card {
  background: var(--ink-900); color: var(--sand-50);
  border-color: transparent;
}
.milestone .stop-card p { color: rgb(250 246 235 / 0.72); }
.summit .stop-node { box-shadow: 0 0 0 9px rgb(232 112 58 / 0.22), 0 10px 26px rgb(13 13 17 / 0.35); }

/* summit flags on milestone nodes */
.milestone .stop-node::before {
  content: ""; position: absolute; left: calc(50% - 1px); top: -18px;
  width: 2px; height: 18px; background: var(--ink-900);
}
.milestone .stop-node::after {
  content: ""; position: absolute; left: calc(50% + 1px); top: -18px;
  width: 16px; height: 11px; background: var(--amber-500);
  clip-path: polygon(0 0, 100% 22%, 0 100%);
  transform-origin: left center;
  animation: flag-wave 1.3s ease-in-out infinite;
}
@keyframes flag-wave {
  0%, 100% { transform: skewY(0deg) scaleX(1); }
  50% { transform: skewY(-7deg) scaleX(0.92); }
}

/* ---------- terrain zones ---------- */
.zone { position: relative; }
.zone-contours {
  position: absolute; inset: 0; z-index: 0;
  opacity: 0.18; pointer-events: none;
}
.zone .container { position: relative; z-index: 2; }
.zone-dunes { background: linear-gradient(180deg, var(--sand-50), var(--sand-100)); }
.zone-canyon { background: linear-gradient(180deg, #F3E6CE, #EBD5B4); }
.zone-mesa { background: linear-gradient(180deg, #F0EBDF, #E9E4F3); }
.zone-summit {
  background: var(--ink-900); color: var(--sand-50);
  border-radius: clamp(24px, 4vw, 48px);
  margin-inline: clamp(10px, 2vw, 24px);
}
.zone-summit .semester-head {
  background: rgb(43 43 51 / 0.85);
  border-color: rgb(250 246 235 / 0.14);
}
.zone-summit .semester-head h2 { color: var(--sand-50); }
.zone-summit .eyebrow { color: var(--iris-300); }
.zone-summit .sem-note { color: rgb(250 246 235 / 0.55); }
.zone-summit .stop-node {
  background: var(--sand-50); color: var(--ink-900); border-color: transparent;
}
.zone-summit .milestone .stop-node {
  background: var(--amber-500); color: var(--ink-900);
}
.zone-summit .milestone .stop-node::before { background: var(--sand-50); }
.zone-summit .charted-note { border-color: rgb(250 246 235 / 0.28); }
.zone-summit .charted-note p { color: rgb(250 246 235 / 0.55); }

/* elevation signposts */
.semester-head .elev {
  position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em;
  color: var(--ink-300); white-space: nowrap;
}
.zone-summit .semester-head .elev { color: rgb(250 246 235 / 0.5); }

/* ---------- closer ---------- */
.cm-closer { padding: clamp(80px, 10vw, 130px) 0 clamp(60px, 7vw, 90px); text-align: center; background: var(--sand-50); }
.cm-closer-big {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.cm-closer .lede { margin: 0 auto 32px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .stop:nth-child(n) { --nx: 22px; }  /* rail alignment beats the switchback slots */
  .stop { display: block; padding: 20px 0; }
  .stop-card { width: auto; margin-left: 58px; }
  .stop-node { width: 38px; height: 38px; font-size: 11px; }
  .milestone .stop-node { width: 50px; height: 50px; font-size: 13px; }
  .semester-head { top: 78px; padding: 14px 20px; }
  .semester-head .elev { display: none; }
  .zone-summit { border-radius: 24px; margin-inline: 8px; }
}

@media (max-width: 560px) {
  .cm-jumps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .milestone .stop-node::after { animation: none; }
  .stop-card { transition: none; }
}

/* Teacher-selected compact purple teleports; destinations are authored in HTML. */
.cm-teleports { display:flex; flex-wrap:wrap; align-items:flex-start; gap:20px 24px; margin:28px 0; }
.cm-teleport-entry { width:15rem; max-width:100%; min-width:0; }
.cm-teleport { display:flex; align-items:center; justify-content:center; gap:12px; min-height:56px; padding:14px 20px; color:#fff; background:#5a3db1; border:1px solid #4d319c; border-radius:14px; text-decoration:none; box-shadow:0 3px 0 #342068; transition:background-color .16s ease,box-shadow .16s ease,transform .16s ease; }
.cm-teleport:hover,.cm-teleport:focus-visible { color:#fff; background:#482b96; box-shadow:0 3px 0 #2e195e,0 0 0 4px rgb(90 61 177 / .12); }
.cm-teleport:focus-visible { outline:3px solid #342068; outline-offset:4px; }
.cm-teleport:active { transform:translateY(2px); box-shadow:0 1px 0 #342068; }
.cm-teleport-icon { flex:none; font-size:1.1rem; color:#ffd787; }
.cm-teleport strong { min-width:0; overflow-wrap:anywhere; font-family:var(--font-display); font-size:1.125rem; line-height:1.25; font-weight:600; }
.cm-teleport-arrow { flex:none; font-size:1.2rem; color:#fff; }
.cm-teleport-entry [data-teleport-label] { margin:11px 12px 0; font-size:.875rem; line-height:1.5; text-align:center; color:var(--ink-500); overflow-wrap:anywhere; }
@media(prefers-reduced-motion:reduce) { .cm-teleport { transition:none; } }
@media print { .cm-teleports { display:none; } }
