/* Home v0.4: customer journey map under the hero, stage tags on each section. Builds on v2/home3/home-v03/integrated. */

/* Hero kickers follow the journey order: number + stage, all in the same quiet style. */
.hs .kick, #hs1 .kick { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: 15px; font-weight: 500; line-height: 1.5; }
.kick-no { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 600; }
#hs3 .brand-lead { color: var(--accent); white-space: nowrap; }
@media (max-width: 479px) { .hs .kick, #hs1 .kick { font-size: 13px; margin-bottom: 12px; } }

/* Stage tag: echoes the journey map above each body section. */
.stage-tag { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 2px; }
.stage-no { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); }
.stage-name { color: var(--ink); }
.stage-sep { width: 16px; height: 1px; background: #B9BEC2; align-self: center; }
.fast .stage-tag { margin-bottom: 0; }
.spec { background: var(--white); }

/* Journey map */
.jm { background: var(--paper); padding: 88px 0 72px; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.jm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 40px; }
.jm h2 { font-size: 40px; line-height: 1.2; font-weight: 600; }
.jm-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.jm-reset { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid #7A848D; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color 150ms ease, color 150ms ease; }
.jm-reset:hover { border-color: var(--ink); color: var(--accent); }
.jm-reset svg { width: 16px; height: 16px; }

.jm-map { position: relative; margin-top: 40px; padding-top: 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto auto; }
.jz { position: relative; min-width: 0; grid-row: span 3; display: grid; grid-template-rows: subgrid; }
.jz-st { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.jm-rail, .jm-prog { position: absolute; z-index: 0; height: 3px; border-radius: 2px; pointer-events: none; }
.jm-rail { background: #D5D8D4; }
.jm-prog { background: var(--ink); transform-origin: 0 0; transform: scaleX(0); will-change: transform; }
/* Glint: a short cobalt-to-clear band riding the line head; the track clips it to the rail ends. */
.jm-flow { position: absolute; z-index: 0; height: 3px; overflow: hidden; border-radius: 2px; pointer-events: none; }
.jm-glint { position: absolute; left: 0; top: 0; width: 96px; height: 100%; background: linear-gradient(90deg, rgba(35,70,216,0), var(--accent)); opacity: 0; will-change: transform; transition: opacity 240ms ease; }
.jm.is-flowing .jm-glint { opacity: 1; }

.jm-st { min-width: 0; }
.jm-st button { position: relative; z-index: 1; width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: center; padding: 0 4px 4px; border: 0; background: none; color: var(--muted); font: inherit; text-align: center; cursor: pointer; }
.jm-st button:focus { outline: none; }
.jm-st button:focus-visible .jm-dot::before { outline: 2px solid var(--accent); outline-offset: 4px; }
.jm-dot { display: grid; place-items: center; width: 24px; height: 24px; flex: none; }
.jm-dot::before { content: ""; box-sizing: border-box; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 2.5px solid #B8BEC2; transition: border-color 200ms ease, border-width 200ms ease, background-color 200ms ease, box-shadow 200ms ease; }
.jm-key .jm-dot::before { width: 22px; height: 22px; }
/* Station 02 is optional: a lighter solid ring until reached; the tag says "if needed". */
.jm-opt .jm-dot::before { border-color: #D2D6D9; }
.jm h2 .nw { white-space: nowrap; }
.jm-no { margin-top: 10px; font-family: var(--mono); font-size: 11px; line-height: 16px; color: #8B9399; }
.jm-name { margin-top: 2px; font-size: 15px; line-height: 1.35; font-weight: 500; transition: color 200ms ease; }
.jm-tag { margin-top: 4px; font-style: normal; font-size: 11px; line-height: 18px; padding: 0 5px; border: 1px solid rgba(29,36,42,.24); border-radius: 4px; color: var(--muted); white-space: nowrap; }
.jm-tag-re { display: none; }
.jm-st button:hover .jm-name { color: var(--accent); }
.jm-st.is-done button { color: var(--ink); }
.jm-st.is-done .jm-dot::before { border-color: var(--ink); border-width: 6px; }
.jm-st.is-current button { color: var(--ink); }
.jm-st.is-current .jm-name { font-weight: 600; }
.jm-st.is-current .jm-no { color: var(--accent); }
.jm-st.is-current .jm-dot::before { border-color: var(--accent); border-width: 6px; background: var(--white); box-shadow: 0 0 0 5px rgba(35,70,216,.14); }
.jm-tag { max-width: 100%; white-space: normal; text-wrap: balance; }
.jm-tag-clock { border-color: rgba(35,70,216,.32); color: var(--accent); }

/* Upper arcs: the direct route for complete drawings and the reorder loop. JS positions them on the station dots. */
.jm-arc { position: absolute; z-index: 0; height: 26px; border: 1.5px dashed #C3C8CC; border-bottom: 0; border-radius: 8px 8px 0 0; pointer-events: none; transition: border-color 260ms ease; }
.jm-arc b { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); padding-bottom: 4px; font-size: 12px; line-height: 1.4; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color 260ms ease; }
.jm[data-complete="true"] .jm-arc-re { border-style: solid; border-color: var(--ink); }
.jm[data-complete="true"] .jm-arc-re b { color: var(--ink); }

/* Leader bracket from a stage's stations down to its selling point */
.jz-lead { position: relative; height: 12px; margin: 8px calc(50% / var(--n)) 40px; border: 1.5px solid #D3D7DA; border-top: 0; transition: border-color 320ms ease; }
.jz-lead::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 30px; margin-left: -.75px; background: #D3D7DA; transform-origin: top; transform: scaleY(.45); transition: transform 420ms cubic-bezier(.22,1,.36,1), background-color 320ms ease; }
.jz-lead::before { content: ""; position: absolute; left: 50%; top: calc(100% + 28px); width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: #D3D7DA; opacity: 0; transition: opacity 320ms ease, background-color 320ms ease; }
.jz.is-reached .jz-lead { border-color: var(--ink); }
.jz.is-reached .jz-lead::after { transform: scaleY(1); background: var(--ink); }
.jz.is-reached .jz-lead::before { opacity: 1; background: var(--ink); }
.jz.is-active .jz-lead::after, .jz.is-active .jz-lead::before { background: var(--accent); }
/* Station 02 joins the first bracket as an optional stop. */
.jz-lead-opt { position: absolute; left: 50%; top: 0; height: 100%; border-left: 1.5px dashed #C3C8CC; margin-left: -.75px; }
.jz.is-reached .jz-lead-opt { border-left-color: #8B9399; }

.jz-co { display: block; min-width: 0; padding: 0 12px; text-align: center; text-decoration: none; color: #8B9399; border-radius: 4px; }
.jz-co b { display: block; font-size: 22px; line-height: 1.4; font-weight: 600; white-space: nowrap; transition: color 260ms ease; }
.jz-note { display: block; margin-top: 6px; font-size: 14px; line-height: 1.5; color: #9AA1A7; transition: color 260ms ease; }
.jz.is-reached .jz-co b { color: var(--ink); }
.jz.is-reached .jz-note { color: var(--muted); }
.jz.is-active .jz-co b { color: var(--accent); }
.jz-co:hover b, .jz-co:hover .jz-note { color: var(--accent); }

.jm-brief { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: baseline; gap: 12px; font-size: 14px; line-height: 1.6; color: var(--muted); min-height: 3.6em; }
.jm-brief > span { transition: opacity 100ms ease; }
.jm-brief.is-swap > span { opacity: 0; }
.jm-count { flex: none; color: var(--ink); background: #E6E8E4; border-radius: 4px; padding: 1px 8px; }
.jm[data-complete="true"] .jm-count { background: var(--accent); color: var(--white); }
.jm-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#journey, #fast, #owner, #filament, #integrated, #batch, #start { scroll-margin-top: 24px; }

@media (max-width: 1279px) {
  .jz-co b { font-size: 20px; }
  .jz-note { font-size: 13px; }
}
@media (max-width: 1199px) { .jm h2 { font-size: 36px; } }
@media (max-width: 1023px) {
  .jz-co b { font-size: 18px; white-space: normal; }
  .jm-name { font-size: 14px; }
}

/* Narrow screens: the line turns vertical; each selling point sits on the line after its stations. */
@media (max-width: 899px) {
  .jm { padding: 64px 0 56px; }
  .jm h2 { font-size: 30px; }
  .jm-head { flex-direction: column; align-items: stretch; gap: 20px; }
  .jm-controls { align-items: stretch; }
  .jm-map { display: block; margin-top: 28px; padding-top: 0; }
  .jz { display: block; }
  .jz-st { display: block; }
  .jm-arc, .jz-lead { display: none; }
  .jm-rail, .jm-prog, .jm-flow { width: 3px; }
  .jm-glint { width: 100%; height: 56px; background: linear-gradient(180deg, rgba(35,70,216,0), var(--accent)); }
  .jm-st button { flex-direction: row; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; text-align: left; }
  .jm-no { margin-top: 0; width: 18px; flex: none; }
  .jm-name { margin-top: 0; font-size: 16px; min-width: 0; }
  .jm-tag { margin-top: 0; }
  .jm-tag-re { display: inline-block; }
  .jz-co { margin: 4px 0 20px 36px; padding: 6px 0 6px 16px; text-align: left; border-left: 2px solid #D3D7DA; border-radius: 0; transition: border-color 260ms ease; }
  .jz.is-reached .jz-co { border-left-color: var(--ink); }
  .jz.is-active .jz-co { border-left-color: var(--accent); }
  .jz-co b { font-size: 18px; line-height: 1.45; }
  .jz-note { margin-top: 2px; font-size: 13px; }
  .jm-brief { margin-top: 12px; }
}
@media (max-width: 479px) {
  .jm h2 { font-size: 28px; }
  .jz-co b { font-size: 17px; }
  .jm-reset { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .jm-brief > span, .jm-glint, .jz-lead, .jz-lead::after, .jz-lead::before, .jm-dot::before, .jz-co b { transition: none !important; }
}

/* Body H2s share one step below the hero H1. */
.integrated h2 { font-size: 48px; }
@media (max-width: 1199px) { .integrated h2 { font-size: 42px; } }
@media (max-width: 899px) { .integrated h2 { font-size: 36px; } }
@media (max-width: 767px) { .integrated h2 { font-size: 30px; } }
