/* ============ How It Works — full-bleed site scene (hero continuation) ============ */
.hiw { position: relative; background: transparent; color: #fff; overflow: visible; padding-top: 24px; padding-bottom: 0; }
.hiw > .container { position: relative; z-index: 2; }

/* full-bleed scene; trailers run off the left edge, content sits in the container band.
   Container is shorter than the 16:9 artwork (16/8) so the empty ground below the MAX
   is cropped; the stage keeps true 16:9 geometry anchored to the top. */
.hiw-scene { position: relative; width: 100%; margin-left: 0; aspect-ratio: 16 / 7; overflow: visible; margin-bottom: 40px; }
.hiw-stage-clip { position: absolute; top: -220px; left: 0; right: 0; bottom: 0; overflow: hidden; z-index: 1; }
.hiw-stage { position: absolute; top: -20px; left: 0; right: 0; width: calc(100% + 200px); aspect-ratio: 16 / 9; z-index: 1; transform: translateX(-500px) scale(1.0); transform-origin: 30% top; }
.hiw-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hiw-construction { z-index: 1; }
.hiw-office { z-index: 2; }
.hiw-generator { z-index: 3; will-change: filter; transition: none; }
.hiw-max { z-index: 4; transition: none; }
.hiw-max-gray { filter: grayscale(0.7) brightness(0.92) saturate(0.3); z-index: 4; }
.hiw-max-fill { z-index: 5; filter: saturate(1.04); clip-path: polygon(0% 53%, 47% 53%, 56% 54%, 67% 53%, 100% 53%, 100% 100%, 0% 100%); will-change: clip-path; }

/* energy flows — solid line with lemon arrows travelling in the direction of flow.
   Both render UNDER the MAX (z-index 3) so lines emerge from behind the unit. */
.hiw-flow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.hiw-flow .fl-line { fill: none; stroke-linecap: round; stroke-width: .5; }
.hiw-flow .fl-arrow path { fill: var(--lemon); filter: drop-shadow(0 0 1.4px rgba(170,199,96,.85)); }
/* load: MAX → office trailers, always flowing */
.hiw-flow-load .fl-line { stroke: rgba(170,199,96,.45); }
/* charge: generator → MAX. Line always present; grayed + no arrows until the genset runs */
.hiw-flow-charge .fl-line { stroke: rgba(255,255,255,.22); transition: stroke .2s linear; }
.hiw-flow-charge .fl-arrow { opacity: 0; transition: opacity .15s linear; }
.hiw-flow-charge.on .fl-line { stroke: rgba(170,199,96,.45); }
.hiw-flow-charge.on .fl-arrow { opacity: 1; }

/* overlay aligned to the content container */
.hiw-overlay { position: absolute; top: 0; bottom: 0; z-index: 7; pointer-events: none;
  left: max(28px, calc((100vw - var(--container)) / 2 + 28px));
  right: max(28px, calc((100vw - var(--container)) / 2 + 28px)); }

/* copy — left-aligned, narrow, pinned to the right side of the scene */
.hiw-copy { position: absolute; right: 100px; top: calc(8% - 100px); max-width: 440px; text-align: left; pointer-events: auto; }
.hiw-copy h2 { color: #fff; }
.hiw-sub { margin-top: 16px; font-size: 17px; font-weight: 700; color: #fff; }
.hiw-body { margin-top: 14px; font-size: 15px; line-height: 1.65; color: #fff; text-wrap: pretty; }

/* three steps — bold lead word + sentence on the same line, no bullets */
.hiw-steps { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.hiw-steps li { margin: 0; font-size: 14.5px; line-height: 1.5; color: rgba(255,255,255,.82); text-wrap: pretty; }
.hiw-steps h3 { display: inline; font-size: 14.5px; font-weight: 800; color: #fff; margin: 0 .35em 0 0; }
.hiw-steps p { display: inline; margin: 0; color: rgba(255,255,255,.82); }

/* cycle tagline — label sitting directly above the HUD */
.hiw-cycle-tag { margin-top: 26px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.hiw-cycle-tag span { color: var(--lemon); }
.hiw-cycle-tag span + span { margin-left: 4px; }
/* belt-and-braces: the scene copy is always white on the dark canvas */
.hiw .hiw-sub, .hiw .hiw-body { color: #fff; }
.hiw .hiw-copy h3 { color: #fff; }
.hiw .hiw-copy h2 { color: #fff; }
.hiw-steps li:nth-child(1) p, .hiw-steps li:nth-child(2) p { white-space: nowrap; }

/* HUD — stacked in flow directly under the body text (can never overlap it),
   right-aligned within the copy column, slimmed so it clears the generator top */
.hiw-hud { margin: 22px 0 0; width: min(290px, 100%); text-align: left; pointer-events: auto;
  background: rgba(8,18,23,.62); border: 1px solid rgba(144,171,181,.22); border-radius: 13px;
  padding: 11px 13px 10px; backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); color: #fff; }
.hiw-hud-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.hiw-hud-label { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.hiw-soc-num { font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }

.hiw-graph-wrap { position: relative; height: 44px; }
.hiw-graph { width: 100%; height: 44px; display: block; overflow: visible; }
.hiw-graph-line { fill: none; stroke: var(--lemon); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.hiw-graph-fill { fill: rgba(170,199,96,.14); stroke: none; }
.hiw-graph-low { stroke: rgba(255,255,255,.22); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
/* moving head — a true round dot (HTML, so it never stretches with the SVG) */
.hiw-graph-head { position: absolute; left: 0; top: 0; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--lemon); transform: translate(-50%, -50%);
  box-shadow: 0 0 5px rgba(170,199,96,.9); pointer-events: none; will-change: transform; }

.hiw-hud-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.hiw-genset-pill { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 4px 9px; transition: color .15s, border-color .15s, background .15s; white-space: nowrap; }
.hiw-genset-pill.on { color: #0c1a21; background: var(--lemon); border-color: var(--lemon); }
.hiw-clock { font-size: 10px; font-weight: 600; letter-spacing: .04em; color: rgba(255,255,255,.5); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hiw-clock-t { color: var(--electric); font-weight: 700; }

@media (max-width: 840px) {
  /* MOBILE ONLY — desktop layout above is untouched.
     Stack order: title → steps → "Charge. Power. Repeat." → SoC chart → scene (last).
     The scene no longer pulls up over the hero, so it can't cover the hero copy/CTA. */

  /* Gap below the hero. Bump these up if you ever want more separation. */
  .hiw { margin-top: 0; padding-top: 0; }

  .hiw-scene { aspect-ratio: auto; margin-bottom: 50px; overflow: visible; display: flex; flex-direction: column; }
  .hiw-overlay, .hiw-copy { display: contents; }

  .hiw-copy h2   { order: 1; text-align: left; margin: 0 24px; }
  .hiw-steps     { order: 2; margin: 16px 24px 0; }
  .hiw-cycle-tag { order: 3; text-align: left; margin: 22px 24px 0; }
  .hiw-hud       { order: 4; margin: 20px 24px 0; width: auto; }

  /* Image/animation last. Its own crop window, deterministically centred on the MAX
     unit (~58% across, 64% down of the artwork) so it can't drift off-screen at any width. */
  .hiw-stage-clip { order: 5; position: relative; inset: auto; top: auto; left: auto; right: auto; bottom: auto;
    width: 100%; aspect-ratio: 4 / 3; margin-top: 26px; overflow: hidden; }
  .hiw-stage { position: absolute; top: 50%; left: 50%; width: 220%; height: auto; aspect-ratio: 16 / 9;
    transform: translate(-58%, -64%); transform-origin: 0 0; }
  /* zoom now comes from the oversized stage above, so clear the desktop transforms/scale */
  .hiw-stage > * { transform: none; }
  /* TUNING: stage width % = zoom (larger = tighter on the MAX);
     translate(-58%, -64%) = focal point (raise the first % to shift the view right). */
}
