/* Acme motion: Scene Player (.mo-*), kit marks, and the /for/ page template (.fl-*).
   Contract: docs/bi-redesign/sector-landing-spec.md. Theme tokens only (spec §2.3); loads after themes.css. */

/* ---------- Scene Player ---------- */
.mo-player { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--ink); }
.mo-viewport {
  order: 1; position: relative; display: grid; min-width: 0; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  background: var(--surface); border-top: var(--rule-w) solid var(--rule); border-radius: var(--radius-m); overflow: hidden;
}
.mo-frame { grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.mo-frame.mo-leaving { pointer-events: none; }
.mo-frame.mo-pre { position: absolute; top: 0; left: 0; right: 0; visibility: hidden; pointer-events: none; } /* next scene, pre-built: out of flow */
.mo-art { position: relative; aspect-ratio: 640 / 360; min-width: 0; }
.mo-player.mo-tall .mo-art { aspect-ratio: 360 / 400; }
.mo-art > svg, .mo-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mo-cap {
  display: flex; align-items: center; gap: 16px; min-height: 5.25rem; padding: 12px 18px 14px;
  border-top: var(--rule-w) solid var(--rule);
}
.mo-num {
  flex: none; font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
  line-height: 1; letter-spacing: -0.03em; font-variation-settings: "SOFT" 0; font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap; color: var(--ink);
}
.mo-ch, .mo-word { display: inline-block; }
.mo-cap-text { min-width: 0; }
.mo-chapter { margin: 0 0 4px; color: var(--accent); font: 500 .75rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.mo-text {
  margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.0625rem, 1rem + .45vw, 1.3125rem);
  line-height: 1.3; font-variation-settings: "SOFT" 0; text-wrap: balance; color: var(--ink);
}
.mo-player.mo-tall .mo-cap { align-items: flex-start; flex-direction: column; gap: 6px; min-height: 7.5rem; padding: 12px 14px; }
.mo-player.mo-tall .mo-num { font-size: 2rem; }

/* controls: rotation control first in the DOM, shown under the stage */
.mo-controls { order: 2; display: flex; align-items: center; gap: 6px; min-width: 0; }
.mo-btn {
  flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--rule); border-radius: var(--radius-m); background: var(--surface); color: var(--ink); cursor: pointer;
}
.mo-btn:hover { border-color: var(--axis); }
.mo-btn svg { display: block; }
.mo-segs { flex: 1 1 auto; display: flex; gap: 4px; min-width: 0; height: 44px; align-items: center; }
.mo-seg { position: relative; flex: 1 1 0; height: 44px; min-width: 0; cursor: pointer; }
.mo-seg.mo-seg-ch { margin-left: 6px; } /* showreel: a wider gap where the next sector starts */
.mo-segs.mo-many { gap: 2px; } /* 18-scene showreel: keep each segment readable at 375px */
.mo-segs.mo-many .mo-seg-ch { margin-left: 4px; }
.mo-seg::before, .mo-seg-fill {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px;
}
.mo-seg::before { background: var(--rule); }
.mo-seg-fill { display: block; background: var(--ink-2); transform-origin: 0 50%; transform: scaleX(0); }
.mo-seg.is-current .mo-seg-fill { background: var(--ink); }
.mo-seg:hover::before { background: var(--axis); }
.mo-count { flex: none; min-width: 3.6em; padding-right: 2px; text-align: right; color: var(--muted); font: 500 .75rem/1 var(--font-mono); letter-spacing: .04em; }
.mo-player.mo-tall .mo-count { display: none; }
.mo-player[data-state="held"] .mo-seg.is-current .mo-seg-fill { background: var(--ink-2); }
.mo-player.mo-reduced .mo-seg { cursor: pointer; }

/* reduced motion, stack layout */
.mo-stack { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.mo-stack > li + li { border-top: var(--rule-w) solid var(--rule); }
.mo-static .mo-particle, .mo-static .mo-particles { display: none; }

/* Scene changes crossfade in motion.js (GSAP), not through a same-document View Transition: a VT sends every click
   to <html> while it runs, which would drop a quick second Next. Page-to-page navigation still uses @view-transition below. */

/* ---------- kit marks (SVG) ---------- */
.mo-t { fill: var(--ink-2); font-family: var(--font-text); font-size: 12px; font-variant-numeric: tabular-nums lining-nums; }
.mo-t-strong { fill: var(--ink); font-weight: 600; }
.mo-t-mono { font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.mo-t-num { fill: var(--ink); font-family: var(--font-display); font-weight: 600; font-variation-settings: "SOFT" 0; letter-spacing: -0.02em; }
.mo-stamp-t { font-family: var(--font-mono); font-weight: 500; letter-spacing: .12em; }
.mo-ico { display: block; flex: none; }

/* ---------- /for/ page template ---------- */
.fl-hero { padding-top: 32px; padding-bottom: 48px; display: grid; gap: 24px; align-items: center; }
.fl-hero h1 { margin: 0; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem); }
.fl-lede { margin: 12px 0 0; max-width: 40ch; color: var(--ink-2); font-size: 1.125rem; line-height: 1.5; }
.fl-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.fl-hero .stamp { margin: 0; grid-column: 1 / -1; }
@media (min-width: 1024px) {
  .fl-hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 48px; padding-top: 56px; padding-bottom: 72px; }
}
.fl-sec { padding: 64px 0; border-top: var(--rule-w) solid var(--rule); }
.fl-sec h2 { margin: 0 0 24px; max-width: 24ch; }
@media (min-width: 760px) { .fl-sec { padding: 96px 0; } }

/* five steps */
.fl-steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: fl; }
.fl-steps-list li { position: relative; display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; padding: 0 0 22px; color: var(--ink-2); }
.fl-steps-list li .mo-ico { grid-row: 1 / span 2; width: 44px; height: 44px; padding: 7px; border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--ink); position: relative; z-index: 1; }
.fl-steps-list b { font-family: var(--font-display); font-weight: var(--display-wght); font-size: 1.25rem; color: var(--ink); line-height: 1.2; align-self: end; }
.fl-steps-list span { font-size: .9375rem; }
.fl-steps-list li:not(:last-child)::after {
  content: ""; position: absolute; left: 21.5px; top: 44px; bottom: 0; width: 1px; background: var(--axis);
  transform-origin: 50% 0; transform: scaleY(var(--fl-line, 1));
}
@media (min-width: 760px) {
  .fl-steps-list { grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 16px; }
  .fl-steps-list li { grid-template-columns: 1fr; row-gap: 10px; padding: 0; }
  .fl-steps-list li .mo-ico { grid-row: auto; }
  .fl-steps-list li:not(:last-child)::after { left: 52px; right: -8px; top: 22px; bottom: auto; width: auto; height: 1px; transform-origin: 0 50%; transform: scaleX(var(--fl-line, 1)); }
}

/* what we connect */
.fl-connect-grid { display: grid; gap: 24px; align-items: center; }
.fl-connect-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.fl-connect-list li { padding: 8px 0; border-top: var(--rule-w) solid var(--rule); color: var(--ink); font-weight: 600; }
.fl-connect-list li span { display: block; font-weight: 400; color: var(--ink-2); font-size: .9375rem; }
.fl-connect-art { min-width: 0; aspect-ratio: 340 / 360; }
@media (min-width: 760px) { .fl-connect-art { aspect-ratio: 560 / 340; } }
.fl-connect-art.mo-wide { aspect-ratio: 560 / 340; } /* the engine picks the drawing by the art's own width */
.fl-connect-art.mo-tall { aspect-ratio: 340 / 360; }
@media (min-width: 1024px) { .fl-connect-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 48px; } }

/* 30-day timeline */
.fl-30-day { margin: 0 0 16px; color: var(--muted); font: 500 .75rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.fl-30-day b { font: 600 2.5rem/1 var(--font-display); letter-spacing: -0.03em; color: var(--ink); font-variation-settings: "SOFT" 0; margin-left: .25em; text-transform: none; }
.fl-30-list { position: relative; list-style: none; margin: 0; padding: 0 0 0 0; display: grid; gap: 18px; }
.fl-30-list::before, .fl-30-list::after { content: ""; position: absolute; left: 11px; top: 12px; bottom: 12px; width: 2px; border-radius: 1px; }
.fl-30-list::before { background: var(--rule); }
.fl-30-list::after { background: var(--ink-2); transform-origin: 50% 0; transform: scaleY(var(--fl-rail, 1)); }
.fl-30-list li { position: relative; z-index: 1; display: grid; grid-template-columns: 24px 1fr; column-gap: 14px; align-content: start; }
.fl-30-list b { font: 500 .75rem/1.6 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.fl-30-list span:not(.fl-30-dot) { grid-column: 2; color: var(--ink); }
.fl-30-dot { grid-row: 1 / span 2; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); color: var(--st-verified); }
@media (min-width: 760px) {
  .fl-30-list { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 12px; }
  .fl-30-list::before, .fl-30-list::after { left: 12px; right: calc(100% / 6 - 12px); top: 11px; bottom: auto; width: auto; height: 2px; }
  .fl-30-list::after { transform-origin: 0 50%; transform: scaleX(var(--fl-rail, 1)); }
  .fl-30-list li { grid-template-columns: 1fr; row-gap: 8px; }
  .fl-30-dot { grid-row: auto; }
  .fl-30-list span:not(.fl-30-dot) { grid-column: 1; }
}

/* closing CTA and sector switcher */
.fl-cta { display: grid; gap: 16px; justify-items: start; }
.fl-cta h2 { margin: 0; }
.fl-switch { padding: 32px 0 56px; border-top: var(--rule-w) solid var(--rule); }
.fl-switch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; } /* wraps: every sector link stays visible on phones */
.fl-switch a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 8px; border: 1px solid var(--rule); border-radius: var(--radius-pill); color: var(--ink); text-decoration: none; white-space: nowrap; font-weight: 500; }
.fl-switch a:hover { border-color: var(--axis); }
.fl-switch a[aria-current="page"] { background: var(--accent-wash); border-color: var(--accent); font-weight: 600; }
.fl-switch svg { width: 32px; height: 21px; flex: none; color: var(--ink-2); }
.nav a[aria-current="true"] { color: var(--ink); font-weight: 600; text-decoration: underline 2px var(--accent); text-underline-offset: 8px; }

/* pre-reveal: hidden only while JS is about to animate; a failsafe shows it after 2.5s if motion.js never runs */
@keyframes mo-failsafe { to { opacity: 1; } }
html.js [data-reveal]:not([data-mo-ready]) { opacity: 0; animation: mo-failsafe .01s 2.5s forwards; }
@media (prefers-reduced-motion: reduce) { html.js [data-reveal]:not([data-mo-ready]) { opacity: 1; animation: none; } }
@media (forced-colors: active) { .mo-seg::before { background: GrayText; } .mo-seg-fill { background: CanvasText; } }
@media print { .mo-controls { display: none; } .mo-frame { break-inside: avoid; } }

/* cross-document View Transition between /for/ pages (sector switcher); both pages load this file */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
