/* AI Buddy · how it works ("Four steps from idea to launch.").
   One screen on a wide page: label, headline and lead on the left, the four steps on the right, all in the layout from the start.
   Nothing here depends on scroll position. The entrance is the shared [data-scene] behaviour from kit.js; no script of its own.

   Layout   .hw        the scene, two columns (5 : 7)
            .hw-l      label, headline, lead
            .hw-r      the steps column; .hw-line is the vertical line on its left edge (track, fill .hw-line i, dot at the end)
            .hw-s      one step: number (.hw-n) beside title, text and tag (.hw-tg)
   Sizes    step padding and type follow the window height as well as the width (--u, --row-pad), so the four steps fit one window
   States   .is-armed on .hw          the kit is running and parts wait for their entrance
            .is-in on a part          that part has entered: the line draws once from the top, the steps rise one after another
                                      and each step number lights up as it arrives
            On a narrow page the steps run past the window, so the steps and the line never wait: they are always shown,
            and only each step number lights up as its step is reached.
            Without .is-armed (no script, motion off) everything shows its final, lit state. */

.s5 .hw{
  --row-pad:clamp(12px,calc(var(--dvh) * .021),30px);
  --num-w:clamp(80px,calc(var(--u) * 6.2),120px);
  --rail:clamp(30px,3.4cqw,56px);
  display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(40px,6cqw,110px);align-items:start;
}

/* left: label, headline, lead */
.hw-l .s-sub{max-width:26em}

/* right: the steps and their line */
.hw-r{position:relative;padding-left:var(--rail)}
.hw-line{position:absolute;left:0;top:calc(var(--row-pad) + .4em);bottom:calc(var(--row-pad) + 1em);width:1px;background:rgba(255,255,255,.1);transform-origin:50% 0}
.hw-line i{position:absolute;inset:0;background:linear-gradient(rgba(180,140,255,0),var(--v2))}
.hw-line::after{content:"";position:absolute;left:-3px;bottom:-3px;width:7px;height:7px;border-radius:50%;background:#fff;box-shadow:0 0 0 4px rgba(139,61,255,.22),0 0 18px var(--v2)}

.hw-steps{margin:0;padding:0;list-style:none}
.hw-s{display:grid;grid-template-columns:var(--num-w) minmax(0,1fr);gap:clamp(16px,2cqw,36px);padding-block:var(--row-pad);border-top:1px solid rgba(255,255,255,.07)}
.hw-s:first-child{border-top:0;padding-top:0}
.hw-s:last-child{padding-bottom:0}

.hw-n{font-family:var(--serif);font-weight:200;font-size:clamp(44px,calc(var(--u) * 4.2),80px);line-height:.86;letter-spacing:-.06em;color:#fff}
.hw-n i{font-style:normal;color:var(--v2)}
.hw-s h3{margin:2px 0 0;font-family:var(--serif);font-weight:400;font-size:clamp(21px,calc(var(--u) * 1.5),31px);line-height:1.15;letter-spacing:-.025em;color:#fff}
.hw-s p{margin:clamp(6px,calc(var(--dvh) * .01),14px) 0 0;max-width:33em;font-size:var(--fs-body);line-height:1.55;color:rgba(255,255,255,.6)}
.hw-tg{display:inline-flex;align-items:center;gap:10px;margin-top:clamp(10px,calc(var(--dvh) * .016),22px);padding:9px 15px;border-radius:999px;border:1px solid rgba(168,117,255,.42);font-size:11px;line-height:1.4;letter-spacing:.16em;text-transform:uppercase;color:rgba(255,255,255,.88)}
.hw-tg::before{content:"";flex:none;width:6px;height:6px;border-radius:50%;background:var(--v2);box-shadow:0 0 10px var(--v)}

/* narrow page (phones, and the phone preview): one column, headline above the steps */
@container (max-width:900px){
  .s5 .hw{grid-template-columns:minmax(0,1fr);gap:36px;--row-pad:28px;--num-w:58px;--rail:26px}
  .hw-n{font-size:44px}
  .hw-s{gap:14px}
  .hw-s h3{font-size:22px}
  .hw-s p{font-size:15px}
}

/* entrance: the line draws once from the top, its dot arrives at the end; each step number lights as its step enters */
.hw.is-armed .hw-line[data-u]{opacity:1;transform:scaleY(0)}
.hw.is-armed .hw-line::after{opacity:0}
.hw.is-armed .hw-line.is-in{transform:none;transition:transform .9s cubic-bezier(.45,0,.2,1)}
.hw.is-armed .hw-line.is-in::after{opacity:1;transition:opacity .3s ease .8s}
.hw.is-armed .hw-s:not(.is-in) .hw-n{color:rgba(255,255,255,.16)}
.hw.is-armed .hw-s:not(.is-in) .hw-n i{color:rgba(168,117,255,.4)}
.hw.is-armed .hw-s.is-in .hw-n,.hw.is-armed .hw-s.is-in .hw-n i{transition:color .8s var(--ease) .15s}

/* narrow page: the steps run past the window, so they and the line never hide; only the number lighting plays */
@container (max-width:900px){
  .hw.is-armed .hw-s[data-u],.hw.is-armed .hw-line[data-u]{opacity:1;transform:none}
  .hw.is-armed .hw-line::after{opacity:1}
}
