/* ==========================================================================
   solution-hero-motion.css
   CBC SOLUTION HERO MOTION SUITE  (shared framework, 9 pages)

   WHAT THIS IS
     The suite-wide generalisation of the approved Capital Strategy & PMO
     large-motion prototype (assets/css/construction-heroes.css, section 6).
     It carries the same approved behaviour to the remaining nine solution
     heroes — four Construction, five Enterprise — from one stylesheet:

       - one large right-half composition on a 620 x 360 canvas
       - a single one-time phase-in of exactly 4s, slightly slow and smooth
       - fully resolved for ever afterwards: no loop, exit, bounce, spin or
         pulse anywhere in the file
       - reduced motion renders the resolved end state, statically
       - the figure is hidden at <= 900px by the existing shared rule

   WHY CAPITAL IS NOT IN HERE
     The Capital prototype is the approved appearance/timing reference and is
     left byte-identical in construction-heroes.css. This file never selects
     .enthero--con-capital, so that page cannot be altered by loading it.

   ARCHITECTURE
     Two orthogonal axes, so each page needs geometry only, not CSS:

       PAINT class   what the object looks like and how it moves
                     .shm-block .shm-frame .shm-dot   -> rise family
                     .shm-gate                        -> scale family
                     .shm-line (+ --spine --route --mark) -> draw family
                     .shm-line--soft                  -> soft-draw family

       STAGE class   when inside the shared 4s it resolves
                     .shm-s1 ... .shm-s6  (earliest -> latest)

     Per-object nudges use inline custom properties only:
       --shm-fx / --shm-fy   entry offset for the rise family
       --shm-d               0-200ms intra-stage stagger

   SCOPE
     Everything is scoped under .enthero--shm, a private class added to the
     nine hero <section> elements. No selector here can reach any other
     animation on the site, and no @keyframes name is reused from
     enterprise-heroes.css or construction-heroes.css (all are shm-*).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Canvas — identical numbers to the approved Capital prototype
   -------------------------------------------------------------------------- */
.enthero.enthero--shm {
  --ink-x0: 0;
  --ink-w: 620;
  --ink-hu: 360;
  --ink-y0: 0;
  --ink-h: clamp(260px, 25.13vw, 380px);
  --ink-edge: 1px;
}

/* Ink-bound viewport with two user units of safety on every side. Restated
   here rather than inherited because the Strategy page carries the legacy
   .enthero--strategy transform-scale workaround for its retired figure. */
.enthero.enthero--shm .enthero__figure svg {
  position: absolute;
  left: calc(var(--ink-bleed) - 2 * var(--k));
  top: calc(var(--ink-bleed) - 2 * var(--k));
  width: calc(var(--ink-w) * var(--k) + 4 * var(--k));
  height: calc(var(--ink-hu) * var(--k) + 4 * var(--k));
  margin: 0;
  transform: none;
  overflow: visible;
}

.enthero--shm .shm path,
.enthero--shm .shm rect,
.enthero--shm .shm polygon {
  transform-box: fill-box;
  transform-origin: center;
}

/* --------------------------------------------------------------------------
   2. Paint roles — CBC line-art language, brand palette only

   SPECIFICITY NOTE. Every rule below is written `.enthero--shm .shm .shm-*`
   (three classes) on purpose. enterprise-heroes.css carries
   `.enthero .dg--v2 rect { fill: none }` and
   `.enthero .dg--v2 path { vector-effect: non-scaling-stroke }`, both
   (0,2,1). A two-class suite selector loses to them regardless of load
   order, which silently drops every solid fill and re-enables the
   non-scaling-stroke dash truncation this suite must avoid.
   -------------------------------------------------------------------------- */
.enthero--shm .shm .shm-block {
  fill: #fff;
  stroke: var(--slate-deep);
  stroke-width: 2;
}

.enthero--shm .shm .shm-block--accent {
  stroke: var(--rust-deep);
}

.enthero--shm .shm .shm-frame {
  fill: none;
  stroke: var(--slate-deep);
  stroke-width: 2.5;
}

.enthero--shm .shm .shm-dot {
  fill: var(--rust-deep);
  stroke: none;
}

.enthero--shm .shm .shm-dot--ember {
  fill: var(--ember);
}

.enthero--shm .shm .shm-gate {
  fill: #fff;
  stroke: var(--ember);
  stroke-width: 2.5;
}

.enthero--shm .shm .shm-line,
.enthero--shm .shm .shm-line--soft {
  fill: none;
  stroke: var(--slate-deep);
  stroke-width: 2;
  stroke-linecap: butt;
}

.enthero--shm .shm .shm-line--soft {
  stroke: var(--slate);
}

.enthero--shm .shm .shm-line--spine {
  stroke: var(--burgundy);
  stroke-width: 2.5;
}

.enthero--shm .shm .shm-line--route {
  stroke: var(--rust-deep);
  stroke-width: 4;
}

.enthero--shm .shm .shm-line--mark {
  stroke: var(--ember);
  stroke-width: 2.5;
}

/* Draw families. vector-effect:none is mandatory: the shared .dg--v2 rule
   sets non-scaling-stroke, which resolves a pathLength="1" dash pattern in
   device pixels and truncates the line at the current figure scale. */
.enthero--shm .shm .shm-line,
.enthero--shm .shm .shm-line--soft,
.enthero--shm .shm .shm-line--spine,
.enthero--shm .shm .shm-line--route,
.enthero--shm .shm .shm-line--mark {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  vector-effect: none;
}

.enthero--shm .shm .shm-block,
.enthero--shm .shm .shm-frame,
.enthero--shm .shm .shm-dot,
.enthero--shm .shm .shm-gate {
  opacity: 0;
}

/* --------------------------------------------------------------------------
   3. Shared clock — one 4s phase-in, one iteration, settles and stays
   -------------------------------------------------------------------------- */
.enthero--shm .shm .shm-block,
.enthero--shm .shm .shm-frame,
.enthero--shm .shm .shm-dot,
.enthero--shm .shm .shm-gate,
.enthero--shm .shm .shm-line,
.enthero--shm .shm .shm-line--soft,
.enthero--shm .shm .shm-line--spine,
.enthero--shm .shm .shm-line--route,
.enthero--shm .shm .shm-line--mark {
  animation-duration: 4s;
  animation-iteration-count: 1;
  animation-fill-mode: both;
  animation-delay: var(--shm-d, 0ms);
}

.enthero--shm .shm .shm-block,
.enthero--shm .shm .shm-frame,
.enthero--shm .shm .shm-dot,
.enthero--shm .shm .shm-gate {
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.enthero--shm .shm .shm-line,
.enthero--shm .shm .shm-line--soft,
.enthero--shm .shm .shm-line--spine,
.enthero--shm .shm .shm-line--route,
.enthero--shm .shm .shm-line--mark {
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* rise family */
.enthero--shm .shm .shm-block.shm-s1,
.enthero--shm .shm .shm-frame.shm-s1,
.enthero--shm .shm .shm-dot.shm-s1 { animation-name: shm-rise-s1; }
.enthero--shm .shm .shm-block.shm-s2,
.enthero--shm .shm .shm-frame.shm-s2,
.enthero--shm .shm .shm-dot.shm-s2 { animation-name: shm-rise-s2; }
.enthero--shm .shm .shm-block.shm-s3,
.enthero--shm .shm .shm-frame.shm-s3,
.enthero--shm .shm .shm-dot.shm-s3 { animation-name: shm-rise-s3; }
.enthero--shm .shm .shm-block.shm-s4,
.enthero--shm .shm .shm-frame.shm-s4,
.enthero--shm .shm .shm-dot.shm-s4 { animation-name: shm-rise-s4; }
.enthero--shm .shm .shm-block.shm-s5,
.enthero--shm .shm .shm-frame.shm-s5,
.enthero--shm .shm .shm-dot.shm-s5 { animation-name: shm-rise-s5; }
.enthero--shm .shm .shm-block.shm-s6,
.enthero--shm .shm .shm-frame.shm-s6,
.enthero--shm .shm .shm-dot.shm-s6 { animation-name: shm-rise-s6; }

/* scale family */
.enthero--shm .shm .shm-gate.shm-s1 { animation-name: shm-scale-s1; }
.enthero--shm .shm .shm-gate.shm-s2 { animation-name: shm-scale-s2; }
.enthero--shm .shm .shm-gate.shm-s3 { animation-name: shm-scale-s3; }
.enthero--shm .shm .shm-gate.shm-s4 { animation-name: shm-scale-s4; }
.enthero--shm .shm .shm-gate.shm-s5 { animation-name: shm-scale-s5; }
.enthero--shm .shm .shm-gate.shm-s6 { animation-name: shm-scale-s6; }

/* draw family */
.enthero--shm .shm .shm-line.shm-s1,
.enthero--shm .shm .shm-line--spine.shm-s1,
.enthero--shm .shm .shm-line--route.shm-s1,
.enthero--shm .shm .shm-line--mark.shm-s1 { animation-name: shm-draw-s1; }
.enthero--shm .shm .shm-line.shm-s2,
.enthero--shm .shm .shm-line--spine.shm-s2,
.enthero--shm .shm .shm-line--route.shm-s2,
.enthero--shm .shm .shm-line--mark.shm-s2 { animation-name: shm-draw-s2; }
.enthero--shm .shm .shm-line.shm-s3,
.enthero--shm .shm .shm-line--spine.shm-s3,
.enthero--shm .shm .shm-line--route.shm-s3,
.enthero--shm .shm .shm-line--mark.shm-s3 { animation-name: shm-draw-s3; }
.enthero--shm .shm .shm-line.shm-s4,
.enthero--shm .shm .shm-line--spine.shm-s4,
.enthero--shm .shm .shm-line--route.shm-s4,
.enthero--shm .shm .shm-line--mark.shm-s4 { animation-name: shm-draw-s4; }
.enthero--shm .shm .shm-line.shm-s5,
.enthero--shm .shm .shm-line--spine.shm-s5,
.enthero--shm .shm .shm-line--route.shm-s5,
.enthero--shm .shm .shm-line--mark.shm-s5 { animation-name: shm-draw-s5; }
.enthero--shm .shm .shm-line.shm-s6,
.enthero--shm .shm .shm-line--spine.shm-s6,
.enthero--shm .shm .shm-line--route.shm-s6,
.enthero--shm .shm .shm-line--mark.shm-s6 { animation-name: shm-draw-s6; }

/* soft-draw family — settles at 0.58, the approved scaffold weight */
.enthero--shm .shm .shm-line--soft.shm-s1 { animation-name: shm-soft-s1; }
.enthero--shm .shm .shm-line--soft.shm-s2 { animation-name: shm-soft-s2; }
.enthero--shm .shm .shm-line--soft.shm-s3 { animation-name: shm-soft-s3; }
.enthero--shm .shm .shm-line--soft.shm-s4 { animation-name: shm-soft-s4; }
.enthero--shm .shm .shm-line--soft.shm-s5 { animation-name: shm-soft-s5; }
.enthero--shm .shm .shm-line--soft.shm-s6 { animation-name: shm-soft-s6; }

/* --------------------------------------------------------------------------
   4. Keyframes. Six stage windows x four families. Every set holds its
      initial state until its window opens, resolves inside the window, and
      repeats the resolved values at 100% so the final frame IS the hold.
   -------------------------------------------------------------------------- */
@keyframes shm-rise-s1 {
  0%, 8% { opacity: 0; transform: translate(var(--shm-fx, 0px), var(--shm-fy, 14px)); }
  45%, 100% { opacity: 1; transform: translate(0, 0); }
}
@keyframes shm-rise-s2 {
  0%, 22% { opacity: 0; transform: translate(var(--shm-fx, 0px), var(--shm-fy, 14px)); }
  58%, 100% { opacity: 1; transform: translate(0, 0); }
}
@keyframes shm-rise-s3 {
  0%, 35% { opacity: 0; transform: translate(var(--shm-fx, 0px), var(--shm-fy, 14px)); }
  68%, 100% { opacity: 1; transform: translate(0, 0); }
}
@keyframes shm-rise-s4 {
  0%, 46% { opacity: 0; transform: translate(var(--shm-fx, 0px), var(--shm-fy, 14px)); }
  76%, 100% { opacity: 1; transform: translate(0, 0); }
}
@keyframes shm-rise-s5 {
  0%, 56% { opacity: 0; transform: translate(var(--shm-fx, 0px), var(--shm-fy, 14px)); }
  86%, 100% { opacity: 1; transform: translate(0, 0); }
}
@keyframes shm-rise-s6 {
  0%, 68% { opacity: 0; transform: translate(var(--shm-fx, 0px), var(--shm-fy, 12px)); }
  100% { opacity: 1; transform: translate(0, 0); }
}

@keyframes shm-scale-s1 {
  0%, 8% { opacity: 0; transform: scale(0.72); }
  45%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes shm-scale-s2 {
  0%, 22% { opacity: 0; transform: scale(0.72); }
  58%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes shm-scale-s3 {
  0%, 35% { opacity: 0; transform: scale(0.72); }
  68%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes shm-scale-s4 {
  0%, 46% { opacity: 0; transform: scale(0.72); }
  76%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes shm-scale-s5 {
  0%, 56% { opacity: 0; transform: scale(0.72); }
  86%, 100% { opacity: 1; transform: scale(1); }
}
@keyframes shm-scale-s6 {
  0%, 68% { opacity: 0; transform: scale(0.78); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes shm-draw-s1 {
  0%, 8% { stroke-dashoffset: 1; opacity: 0; }
  45%, 100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes shm-draw-s2 {
  0%, 22% { stroke-dashoffset: 1; opacity: 0; }
  58%, 100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes shm-draw-s3 {
  0%, 35% { stroke-dashoffset: 1; opacity: 0; }
  68%, 100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes shm-draw-s4 {
  0%, 46% { stroke-dashoffset: 1; opacity: 0; }
  76%, 100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes shm-draw-s5 {
  0%, 56% { stroke-dashoffset: 1; opacity: 0; }
  86%, 100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes shm-draw-s6 {
  0%, 68% { stroke-dashoffset: 1; opacity: 0; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes shm-soft-s1 {
  0%, 8% { stroke-dashoffset: 1; opacity: 0; }
  45%, 100% { stroke-dashoffset: 0; opacity: 0.58; }
}
@keyframes shm-soft-s2 {
  0%, 22% { stroke-dashoffset: 1; opacity: 0; }
  58%, 100% { stroke-dashoffset: 0; opacity: 0.58; }
}
@keyframes shm-soft-s3 {
  0%, 35% { stroke-dashoffset: 1; opacity: 0; }
  68%, 100% { stroke-dashoffset: 0; opacity: 0.58; }
}
@keyframes shm-soft-s4 {
  0%, 46% { stroke-dashoffset: 1; opacity: 0; }
  76%, 100% { stroke-dashoffset: 0; opacity: 0.58; }
}
@keyframes shm-soft-s5 {
  0%, 56% { stroke-dashoffset: 1; opacity: 0; }
  86%, 100% { stroke-dashoffset: 0; opacity: 0.58; }
}
@keyframes shm-soft-s6 {
  0%, 68% { stroke-dashoffset: 1; opacity: 0; }
  100% { stroke-dashoffset: 0; opacity: 0.58; }
}

/* --------------------------------------------------------------------------
   5. Reduced motion — the resolved end state, painted immediately
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .enthero--shm .shm .shm-block,
  .enthero--shm .shm .shm-frame,
  .enthero--shm .shm .shm-dot,
  .enthero--shm .shm .shm-gate,
  .enthero--shm .shm .shm-line,
  .enthero--shm .shm .shm-line--spine,
  .enthero--shm .shm .shm-line--route,
  .enthero--shm .shm .shm-line--mark {
    animation: none !important;
    opacity: 1;
    transform: none;
    stroke-dashoffset: 0;
  }

  .enthero--shm .shm .shm-line--soft {
    animation: none !important;
    opacity: 0.58;
    transform: none;
    stroke-dashoffset: 0;
  }
}
