/* ==========================================================
   Mentors page. Hero: the students mentors would meet (js/mentor-hero.js).
   Plays by itself as the page opens (about 2 seconds, no scrolling needed): the two
   headline lines part as a strip of photo opens between them, photos of the students
   flip past, then the strip grows into a wide card behind the headline and lands on the
   stage photo, which holds still. Then the button fades in.
   Phones: the headline, then the photo card under it. Reduced motion: the last frame.
   Photos: BEAM Venture students (used with their permission); the QR code on the
   welcome sign is blurred.
   ========================================================== */
.mh { position: relative; }
.mh-pin { position: relative; overflow: hidden; display: flex; flex-direction: column; padding-bottom: var(--space-6); }
.mh-head { order: 1; }
.mh-card { order: 2; }
.mh-card { position: relative; overflow: hidden; border-radius: 18px; aspect-ratio: 4 / 3; margin: var(--space-4) var(--gutter) 0; }
.mh-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 40%;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 900ms ease, transform 6s linear;
}
.mh-slide.is-on { opacity: 1; transform: scale(1); }
.mh.is-flip .mh-slide { transition: opacity 160ms linear; }
.mh-slide--1 { background-image: url("../images/mentors-stage-900.webp"); background-position: center 37%; }
.mh-slide--2 { background-image: url("../images/mentors-team-2-900.webp"); background-position: center 40%; }
.mh-slide--3 { background-image: url("../images/mentors-team-3-700.webp"); background-position: center 38%; }
@media (min-width: 900px) {
  .mh-slide--1 { background-image: url("../images/mentors-stage.webp"); background-position: center 52%; }
  .mh-slide--2 { background-image: url("../images/mentors-team-2.webp"); }
  .mh-slide--3 { background-image: url("../images/mentors-team-3.webp"); }
}
/* a soft navy shade so the white headline reads on any photo */
.mh-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 50%, rgba(7, 0, 48, 0.5), rgba(7, 0, 48, 0) 100%),
    linear-gradient(180deg, rgba(7, 0, 48, 0.32) 0%, rgba(7, 0, 48, 0.14) 45%, rgba(7, 0, 48, 0.55) 100%);
}
.mh-head { position: relative; z-index: 2; padding: var(--space-7) var(--gutter) 0; text-align: center; }
.mh-title { margin: 0; font-size: var(--text-hero); text-shadow: 0 2px 30px rgba(7, 0, 48, 0.4); }
.mh-title .hero__line { will-change: transform; }
.mh-cta { margin-top: var(--space-4); }
/* the underlines draw in once the lines have met (not on page load) */
.js .mh:not(.is-met) .ul::after { animation-play-state: paused; }

/* Desktop: everything sits in one screen-high stage; the script places the card and the
   two lines (it sets the stage's height) */
@media (min-width: 961px) {
  .js .mh-pin { display: block; height: calc(100svh - var(--header-h)); padding-bottom: 0; }
  .js .mh-card { position: absolute; inset: 0; margin: 0; border-radius: 28px; aspect-ratio: auto; }
  .js .mh-head { position: absolute; left: 0; right: 0; top: 50%; padding: 0 var(--gutter); transform: translateY(-50%); pointer-events: none; }
  .js .mh-cta { position: absolute; left: 0; right: 0; top: 100%; pointer-events: auto; }
  .js .mh-cta { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mh-slide { transition: none; transform: none; }
  .js .mh-cta { opacity: 1; }
}

/* ==========================================================
   How it works: a trail map (js/mentor-map.js). The section holds in place while you
   scroll (.mm-pin is sticky inside the taller .mm-track, set up only when .is-pinned);
   the script moves the camera (the SVG's viewBox) from checkpoint to checkpoint.
   Phones: the current step above the map. Reduced motion: no holding, the whole route.
   No JS: the steps only.
   ========================================================== */
.mm-inner { display: grid; gap: var(--space-5); }
.mm .section-title { margin: 0 0 var(--space-4); }
.mm-steps { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.mm-step__title { margin: 0; font-size: var(--text-h3); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--text); }
.mm-step__num { margin-right: 0.35em; color: var(--lime); font-variant-numeric: tabular-nums; }
.mm-step__text { margin: var(--space-1) 0 0; max-width: 36ch; color: var(--text-2); }
.mm-cta { margin-top: var(--space-4); }
.mm-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 640;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: #0d0a45;
}
html:not(.js) .mm-map { display: none; }
.mm-svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the map's drawing */
.mm-contour { fill: none; stroke: rgba(244, 243, 250, 0.07); stroke-width: 1.5; }
.mm-contour--major { stroke: rgba(244, 243, 250, 0.13); }
.mm-bank { fill: none; stroke: #1d2a6b; stroke-width: 58; stroke-linecap: round; }
.mm-water { fill: none; stroke: #2b4fa8; stroke-width: 44; stroke-linecap: round; }
.mm-ripple { fill: none; stroke: rgba(190, 215, 255, 0.35); stroke-width: 2; stroke-dasharray: 14 40; stroke-linecap: round; animation: mm-flow 3s linear infinite; }
.mm-ripple--late { animation-delay: -1.3s; }
@keyframes mm-flow { to { stroke-dashoffset: -54; } }
.mm-trail { fill: none; stroke: rgba(244, 243, 250, 0.3); stroke-width: 3; stroke-dasharray: 3 10; stroke-linecap: round; }
.mm-lit { fill: none; stroke: var(--lime); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(209, 238, 43, 0.6)); }
.mm-dim { opacity: 0.25; transition: opacity 500ms var(--ease); }
.mm-t { font-size: 20px; fill: var(--text); }
.mm-ts { font-size: 15px; fill: var(--text-2); }
.mm-cap { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; fill: var(--lime); }
.mm-elev { font-size: 14px; fill: rgba(244, 243, 250, 0.25); }
.mm-end { fill: none; stroke: rgba(244, 243, 250, 0.5); stroke-width: 2; }
.mm-end-dot, .mm-head-dot { fill: rgba(244, 243, 250, 0.7); }
.mm-ring { fill: rgba(13, 10, 69, 0.9); stroke: rgba(244, 243, 250, 0.35); stroke-width: 2; transition: stroke 500ms var(--ease); }
.mm-person { fill: rgba(244, 243, 250, 0.9); }
.mm-camp .mm-person { fill: rgba(244, 243, 250, 0.55); transition: fill 500ms var(--ease); }
.mm-camp.is-on .mm-ring { stroke: var(--lime); }
.mm-camp.is-on .mm-person, .mm-camp.is-on .mm-t { fill: var(--lime); }
.mm-you { fill: var(--lime); }
.mm-badge { opacity: 0; transition: opacity 500ms var(--ease); }
.mm-badge.is-on { opacity: 1; }
.mm-badge rect { fill: var(--lime); }
.mm-badge text { font-size: 15px; font-weight: 600; fill: var(--navy); }
.mm-pole { stroke: #9c7048; stroke-width: 8; stroke-linecap: round; }
.mm-board { fill: #3a2f86; stroke: rgba(244, 243, 250, 0.5); stroke-width: 2; transition: fill 350ms var(--ease), stroke 350ms var(--ease); }
.mm-board-t { font-size: 16px; font-weight: 600; fill: var(--text); transition: fill 350ms var(--ease); }
.mm-sign.is-on .mm-board { fill: var(--lime); stroke: var(--lime); }
.mm-sign.is-on .mm-board-t { fill: var(--navy); }
.mm-flagpole { stroke: var(--text); stroke-width: 4; }
.mm-flag { fill: rgba(244, 243, 250, 0.4); transition: fill 500ms var(--ease); }
.mm-flag.is-on { fill: var(--lime); }
.mm-trunk { fill: #5a4130; }
.mm-canopy { fill: #2a5a43; }
.mm-canopy--alt { fill: #22503c; }
.mm-light { fill: #3d7556; }
.mm-pine { fill: #24533f; }
.mm-pine-light { fill: #336a4f; }
.mm-bush { fill: #2a5843; }
.mm-plank { fill: #9c7048; }
.mm-deck { fill: #6b4d33; }
.mm-rail { fill: #c29a6b; }

/* held in place while you scroll (set by the script) */
.mm.is-pinned { padding-block: 0; }
.mm.is-pinned .mm-pin { position: sticky; top: var(--header-h); display: flex; align-items: center; height: calc(100svh - var(--header-h)); }
.mm.is-pinned .mm-inner { width: 100%; }
.mm.is-pinned .mm-step { opacity: 0.35; transition: opacity 400ms var(--ease); }
.mm.is-pinned .mm-step.is-on { opacity: 1; }
@media (min-width: 960px) {
  .mm-inner { grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); align-items: center; gap: var(--space-8); }
  .mm.is-pinned .mm-track { height: calc(100svh + 420svh); }
  /* a little smaller than the column, so the steps get room */
  .mm-map { width: min(100%, calc((100svh - var(--header-h) - 140px) * 1.5625)); justify-self: end; }
}
@media (max-width: 959px) {
  .mm.is-pinned .mm-track { height: calc(100svh + 340svh); }
  .mm.is-pinned .mm-pin { align-items: stretch; padding-block: var(--space-3); }
  .mm.is-pinned .mm-inner { grid-template-rows: auto 1fr; gap: var(--space-3); }
  .mm.is-pinned .section-title { margin-bottom: var(--space-2); }
  /* only the current step shows (the others stay readable to screen readers) */
  .mm.is-pinned .mm-step:not(.is-on) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mm.is-pinned .mm-cta { display: none; }
  .mm.is-pinned .mm-map { aspect-ratio: auto; height: 100%; min-height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .mm-ripple { animation: none; }
}
