/* ==========================================================================
   HumanityZ — Scoped Continuous-Shot Motion Section (sn-motion-html)
   Inherits --page, --ink, --muted, --line, --c, --m, --y, --k from home.css.
   Never overrides html/body when mounted inline inside a page section.
   ========================================================================== */
.mh-root {
  --mh-paper: var(--page, #f7f8f5);
  --mh-ink: var(--ink, #202820);
  --mh-muted: var(--muted, #515c52);
  --mh-line: var(--line, #d1d8ce);
  --mh-surface: var(--surface, #e9ede5);
  --mh-accent: var(--m, #da437d);
  --mh-display: "Christabel Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mh-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mh-ease: var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
  position: relative;
  min-height: 100vh;
  color: var(--mh-ink);
  font-family: var(--mh-body);
}

.mh-root,
.mh-root *,
.mh-root *::before,
.mh-root *::after {
  box-sizing: border-box;
}

/* Inline section framing: sits inside .spread.s3 with top & bottom ink rules */
.mh-root--section {
  margin-top: clamp(32px, 4vw, 56px);
  border-top: 3px solid var(--mh-ink);
  border-bottom: 1px solid var(--mh-ink);
  background: var(--mh-paper);
}

.mh-viewport {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--mh-paper);
}

.mh-root--section .mh-viewport {
  position: sticky;
  top: var(--sh-nav-height, 77px);
  left: 0;
  right: 0;
  width: 100%;
  height: calc(100vh - var(--sh-nav-height, 77px));
  height: calc(100svh - var(--sh-nav-height, 77px));
  z-index: 2;
}

.mh-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--mh-paper);
}

.mh-webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
  pointer-events: none;
}

.mh-stage.has-live-webgl .mh-shot {
  opacity: 0 !important;
  pointer-events: none;
}

.mh-shot {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  will-change: opacity;
}

.mh-shot__poster,
.mh-shot__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.mh-shot__poster {
  transform: scale(1.01);
  transition: opacity 0.22s var(--mh-ease);
}

.mh-shot__video {
  z-index: 1;
}

.mh-shot.has-video .mh-shot__poster {
  opacity: 0;
}

.mh-shot__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  background: var(--mh-paper);
  color: var(--mh-muted);
}

.mh-shot:not(.is-missing) .mh-shot__fallback {
  opacity: 0;
}

.mh-shot__fallback span {
  color: var(--mh-accent);
  font: 600 0.78rem/1 var(--mh-display);
}

.mh-shot__fallback strong {
  font: 600 clamp(1.2rem, 2vw, 1.8rem)/1.08 var(--mh-display);
  color: var(--mh-ink);
}

/* Progress hairline at top of stage */
.mh-progress {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: color-mix(in srgb, var(--mh-ink) 12%, transparent);
}

.mh-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--mh-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: background-color 0.25s var(--mh-ease);
}

/* Top bar inside stage: step status, stage note, step pills, and pause control */
.mh-topbar {
  position: absolute;
  z-index: 25;
  top: 3px;
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px clamp(20px, 3.5vw, 44px);
  border-bottom: 1px solid var(--mh-line);
  background: color-mix(in srgb, var(--mh-paper) 88%, transparent);
  backdrop-filter: blur(6px);
}

.mh-topbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
}

.mh-topbar__status {
  margin: 0;
  font: 600 15px/1.3 var(--mh-display);
  letter-spacing: -0.02em;
  color: var(--mh-ink);
}

.mh-topbar__caption {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  color: var(--mh-muted);
}

.mh-topbar__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
}

.mh-route {
  display: flex;
  align-items: center;
  gap: 6px 16px;
}

.mh-route__item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 36px;
  padding: 4px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--mh-muted);
  font: 500 14.5px/1.2 var(--mh-body);
  cursor: pointer;
  transition: color 0.2s var(--mh-ease), border-color 0.2s var(--mh-ease);
}

.mh-route__item span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mh-muted);
}

.mh-route__item i {
  font-style: normal;
}

.mh-route__item:hover,
.mh-route__item:focus-visible {
  color: var(--mh-ink);
}

.mh-route__item.is-active {
  color: var(--mh-ink);
  border-bottom-color: var(--mh-accent);
}

.mh-route__item.is-active span {
  color: var(--mh-accent);
}

.mh-pause-btn {
  min-height: 36px;
  padding: 5px 12px;
  border: 1px solid var(--mh-line);
  background: transparent;
  color: var(--mh-ink);
  font: 500 13.5px/1.2 var(--mh-body);
  cursor: pointer;
  transition: border-color 0.2s var(--mh-ease), background-color 0.2s var(--mh-ease);
}

.mh-pause-btn:hover,
.mh-pause-btn:focus-visible {
  border-color: var(--mh-ink);
}

/* Transparent Editorial Copy Layer */
.mh-copy-layer {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.mh-copy {
  --mh-scene-accent: var(--mh-accent);
  position: absolute;
  top: 54%;
  width: min(460px, calc(100% - 44px));
  padding: clamp(18px, 2.2vw, 28px);
  opacity: 0;
  transform: translate3d(0, -50%, 0);
  isolation: isolate;
  background: transparent;
  border-left: 3px solid var(--mh-scene-accent);
  color: var(--mh-ink);
  will-change: opacity, transform;
  pointer-events: none;
}

.mh-copy::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -36px -48px;
  background: radial-gradient(
    ellipse at center,
    color-mix(in srgb, var(--mh-paper) 94%, transparent) 0 38%,
    color-mix(in srgb, var(--mh-paper) 76%, transparent) 64%,
    transparent 100%
  );
  pointer-events: none;
}

.mh-copy[data-position="left"] {
  left: clamp(20px, 3.5vw, 48px);
}

.mh-copy[data-position="right"] {
  right: clamp(20px, 3.5vw, 48px);
}

.mh-copy__eyebrow {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--mh-scene-accent);
}

.mh-copy h3 {
  margin: 6px 0 0;
  font-family: var(--mh-display);
  font-size: clamp(36px, 4.4vw, 62px);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--mh-ink);
}

.mh-copy h3 b {
  font-weight: inherit;
  color: var(--mh-scene-accent);
}

.mh-copy__subtitle {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--mh-muted);
}

.mh-copy__body {
  margin-top: 14px;
  max-width: 44ch;
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.55;
}

.mh-copy__body p {
  margin: 0 0 0.6em;
}

.mh-copy__body p:last-child {
  margin-bottom: 0;
}

/* Ruled facts ledger matching home.css .facts */
.mh-facts {
  margin: 18px 0 0;
  padding: 0;
}

.mh-facts div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid var(--mh-line);
  font-size: 14.5px;
  line-height: 1.45;
}

.mh-facts dt {
  color: var(--mh-muted);
  font-weight: 500;
}

.mh-facts dd {
  margin: 0;
  color: var(--mh-ink);
}

.mh-actions {
  margin-top: 18px;
}

.mh-copy__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 16px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--mh-ink);
  list-style: none;
}

.mh-copy__tags li {
  font-size: 13px;
  font-weight: 500;
  color: var(--mh-muted);
}

.mh-copy__tags li + li::before {
  content: "·";
  margin-right: 16px;
  color: var(--mh-scene-accent);
}

.mh-track {
  position: relative;
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 760px) {
  .mh-topbar {
    padding: 10px 16px;
    gap: 8px 14px;
  }
  .mh-topbar__caption {
    display: none;
  }
  .mh-route__item i {
    display: none;
  }
  .mh-copy,
  .mh-copy[data-position="left"],
  .mh-copy[data-position="right"] {
    top: auto;
    left: 14px;
    right: 14px;
    bottom: 18px;
    width: auto;
    max-height: 54svh;
    padding: 16px 18px;
    overflow-y: auto;
    transform: none !important;
    background: color-mix(in srgb, var(--mh-paper) 92%, transparent);
    border-top: 1px solid var(--mh-line);
  }
  .mh-copy h3 {
    font-size: clamp(28px, 7.5vw, 38px);
  }
  .mh-facts div {
    grid-template-columns: 92px 1fr;
    font-size: 13.5px;
    padding: 7px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mh-shot__poster {
    transform: none !important;
  }
}

/* Copy panels always fit the frame. On wider screens they centre in the space below the story's top bar,
   and short windows get a condensed panel, so nothing slides under the bar or off the bottom. */
@media (min-width: 761px) {
  .mh-copy { top: calc(50% + 36px); }
}
@media (min-width: 761px) and (max-height: 820px) {
  .mh-copy { padding: 16px 22px; }
  .mh-copy h3 { font-size: clamp(32px, 3.6vw, 48px); }
  .mh-copy__subtitle { display: none; }
  .mh-copy__body { margin-top: 10px; font-size: 15.5px; line-height: 1.5; }
  .mh-facts { margin-top: 12px; }
  .mh-facts div { padding: 6px 0; font-size: 13.5px; }
  .mh-actions { margin-top: 12px; }
  .mh-copy__tags { display: none; }
}
@media (min-width: 761px) and (max-height: 640px) {
  .mh-facts { display: none; }
}
/* Phones: the panel is a sheet with the essentials only, so it needs no scrolling of its own,
   and its glow can no longer push it sideways. The subtitle repeats the body, so it goes as it does
   on short wider windows, and the bar's chapter line repeats the sheet's eyebrow and title, so the bar
   keeps one row of steps and the pause button. Both leave the form more of the frame. */
@media (max-width: 760px) {
  .mh-topbar__left { display: none; }
  .mh-copy::before { display: none; }
  .mh-copy,
  .mh-copy[data-position="left"],
  .mh-copy[data-position="right"] { overflow-x: hidden; }
  .mh-copy__subtitle,
  .mh-facts,
  .mh-copy__tags { display: none; }
}
