/* Landing A · "How it works" re-mapped to the tabs (landing-how-it-works-tabs-mock, D-0612). MOCK ONLY.
   Five steps in the morning's order (Market, Desk, Session, Journal, Rank), each with its tab icon, a small live fragment of
   that tab (from the approved D-0522 set and the landing's Try-it demo) and a mini tab bar in the LOCKED order (D-0611:
   Market, Session, Desk, Journal, Rank) with the step's tab lit. Motion: the cards reveal one by one on scroll, joined by a
   rail that fills as you scroll. ?mode=static and reduced motion: every end state, nothing moves.
   Colours: --tw-* only (tints are color-mix of them). --tw-blue and --tw-amber are the app's values (tw-tokens.css). */
:root { --tw-blue: #58a6ff; --tw-amber: #ffb84c; }

.hiw-sec { padding-top: 0; }
.hiw-sec .h2 { max-width: 760px; }
.hiw { list-style: none; margin: 28px 0 0; padding: 0; position: relative; display: grid; gap: 22px; }
/* the rail: a hairline track with an accent fill that grows as the section scrolls past the middle of the screen */
.hiw-rail { position: absolute; left: 27px; top: 28px; bottom: 28px; width: 2px; border-radius: 2px; background: var(--tw-hairline-strong); }
.hiw-rail i { position: absolute; inset: 0; border-radius: 2px; transform-origin: 50% 0; transform: scaleY(var(--hiw-p, 0));
  background: linear-gradient(var(--tw-accent), color-mix(in srgb, var(--tw-accent) 60%, var(--tw-blue))); box-shadow: 0 0 14px var(--tw-accent-glow); }
.hiw-step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 18px; align-items: start; min-width: 0; }
.hiw-node { position: relative; z-index: 1; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  font: 800 13px/1 var(--tw-font); letter-spacing: .1em; color: var(--tw-ink-3); background: var(--tw-ground);
  border: 1.5px solid var(--tw-hairline-strong); transition: color .4s, border-color .4s, box-shadow .4s, background .4s; }
.hiw-step.lit .hiw-node { color: var(--tw-ink); border-color: var(--tw-accent); background: color-mix(in srgb, var(--tw-accent) 18%, var(--tw-ground));
  box-shadow: 0 0 22px -4px var(--tw-accent-glow); }

.hiw-card { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 28px; align-items: center; min-width: 0;
  padding: 24px; border-radius: 24px; background: var(--tw-glass); border: 1px solid var(--tw-hairline); }
.hiw-copy { min-width: 0; }
.hiw-tab { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800;
  color: var(--tw-accent); }
.hiw-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hiw-copy h3 { margin: 10px 0 6px; font-size: clamp(22px, 2.2vw, 28px); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.hiw-copy p { margin: 0; color: var(--tw-ink-2); font-size: 16px; }

/* the fragment: a slice of the tab's screen, with the mini tab bar under it */
.hiw-ui { min-width: 0; border-radius: 20px; background: var(--tw-ground); border: 1px solid var(--tw-hairline-strong); overflow: hidden;
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--tw-ground) 85%, transparent); display: flex; flex-direction: column; }
.hf { position: relative; padding: 14px 14px 12px; display: grid; gap: 9px; min-width: 0; transition: background .6s var(--tw-ease); }
.hf-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.hf-h b { font-size: 16px; }
.hf-sub { font-size: 11.5px; color: var(--tw-ink-2); }
.hf .lab { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--tw-ink-3); font-weight: 700; }
.hf-card { background: var(--tw-ground-raise); border: 1px solid var(--tw-hairline); border-radius: 13px; padding: 9px 11px; min-width: 0; }
.hf-row { display: flex; gap: 8px; align-items: center; min-width: 0; flex-wrap: wrap; }
.hf-tag { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; color: var(--tw-accent); border: 1px solid var(--tw-accent);
  border-radius: 999px; padding: 2px 8px; flex: none; }
.hf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--tw-glass-strong); border: 1px solid var(--tw-hairline-strong); }
.hf-chip .tk { width: 14px; height: 14px; border-radius: 50%; background: var(--tw-accent); flex: none; display: grid; place-items: center; }
.hf-chip .tk svg { width: 9px; height: 9px; fill: none; stroke: var(--tw-cta-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Market: the calendar rows and the plan chip (Try-it Market, D-0522 Market feed) */
.hf-cal { display: grid; font-size: 12.5px; }
.hf-cal > div { display: grid; grid-template-columns: 38px 22px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--tw-hairline); border-radius: 8px; transition: background .5s; }
.hf-cal > div:last-child { border-bottom: 0; }
.hf-cal .t { color: var(--tw-ink-2); font-variant-numeric: tabular-nums; }
.hf-imp { display: flex; gap: 2px; } .hf-imp i { width: 4px; height: 10px; border-radius: 2px; background: var(--tw-hairline-strong); }
.hf-imp i.on { background: var(--tw-accent); }
.hf-lv .hf-chip { padding: 4px 9px; font-variant-numeric: tabular-nums; }
.hf-cal > div.hot { background: color-mix(in srgb, var(--tw-accent) 12%, transparent); }

/* Desk: the limits stamp in, said out loud */
.hf-scene { margin: -14px -14px 0; height: 190px; overflow: hidden; min-width: 0; }
.hf-scene img { display: block; width: 100%; max-width: 100%; min-width: 0; height: 100%; object-fit: cover; object-position: 50% 66%; }
.hf-cool { display: block; font-size: 18px; line-height: 1; font-variant-numeric: tabular-nums; }
.hf-skip { flex: none; border: 1px solid var(--tw-hairline-strong); border-radius: 999px; padding: 4px 9px; font-size: 11.5px; }
.hf-jt { font-weight: 300; font-size: 20px !important; }
.hf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.hf-say { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--tw-ink-2); }
.hf-wave { display: flex; gap: 3px; height: 18px; align-items: center; flex: none; }
.hf-wave i { width: 3px; height: 18px; border-radius: 3px; background: var(--tw-accent); transform: scaleY(.35); }
.hf-btn { border-radius: 999px; padding: 8px 12px; text-align: center; font-weight: 700; font-size: 13px; background: var(--tw-cta-bg); color: var(--tw-cta-ink); }

/* Session: the revenge entry, the red spike, then the purple-blue calm (the Try-it demo's alarm and settle) */
.hf-lims { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 6px; }
.hf-lim { background: var(--tw-ground-raise); border: 1px solid var(--tw-hairline); border-radius: 10px; padding: 5px 8px; min-width: 0; }
.hf-lim .v { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.hf-bar { height: 4px; border-radius: 4px; background: var(--tw-hairline-strong); overflow: hidden; margin-top: 4px; }
.hf-bar i { display: block; height: 100%; background: var(--tw-amber); }
.hf-msg { border-radius: 12px; padding: 8px 10px; font-size: 13px; min-width: 0; background: var(--tw-ground-raise); border: 1px solid var(--tw-hairline); }
.hf-msg .who { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--tw-accent); margin-bottom: 2px;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.hf-msg.you { background: var(--tw-accent-soft); justify-self: end; max-width: 88%; }
.hf-msg.you .who { color: var(--tw-ink); }
.hf-msg.catch { border-color: var(--tw-red); background: color-mix(in srgb, var(--tw-red) 14%, var(--tw-ground)); }
.hf-msg.catch .who { color: var(--tw-red); }
.hf-lines { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.hf-pause { display: flex; gap: 10px; align-items: center; font-size: 12.5px; }
.hf-pause svg { width: 34px; height: 34px; flex: none; }
.hf-pause .trk { stroke: var(--tw-hairline-strong); } .hf-pause .arc { stroke: var(--tw-accent); transition: stroke-dashoffset 1.4s var(--tw-ease); }
.hf.session.alarm { background: radial-gradient(120% 80% at 50% 40%, color-mix(in srgb, var(--tw-red) 42%, var(--tw-ground)) 0%,
  color-mix(in srgb, var(--tw-red) 14%, var(--tw-ground)) 60%, var(--tw-ground) 100%); }
.hf.session.alarm .hf-flash { position: absolute; inset: 0; pointer-events: none; background: var(--tw-red); animation: hiwFlash .7s ease-out both; }
.hf.session.calm { background: radial-gradient(120% 80% at 50% 30%, color-mix(in srgb, color-mix(in srgb, var(--tw-accent) 70%, var(--tw-blue)) 36%, var(--tw-ground)) 0%,
  color-mix(in srgb, color-mix(in srgb, var(--tw-accent) 70%, var(--tw-blue)) 12%, var(--tw-ground)) 55%, var(--tw-ground) 100%); }
@keyframes hiwFlash { from { opacity: .55; } to { opacity: 0; } }
@keyframes hiwShake { 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.hf.session.alarm .hf-lines { animation: hiwShake .4s ease-out; }
.hf-state { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; justify-self: end; color: var(--tw-ink-3); }
.hf.session.alarm .hf-state { color: var(--tw-red); }
.hf.session.calm .hf-state { color: color-mix(in srgb, var(--tw-accent) 70%, var(--tw-blue)); }

/* Journal: Debriefs, the process score once to 100, one line carried */
.hf-seg { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--tw-glass-strong); border: 1px solid var(--tw-hairline); width: max-content; max-width: 100%; }
.hf-seg span { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: var(--tw-ink-3); }
.hf-seg span.on { color: var(--tw-ink); background: var(--tw-accent-soft); }
.hf-score { display: flex; gap: 10px; align-items: center; }
.hf-score .n { font-size: 38px; font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.hf-parts { display: grid; gap: 4px; }
.hf-part { display: grid; grid-template-columns: 58px minmax(0, 1fr) 24px; gap: 6px; align-items: center; font-size: 10.5px; color: var(--tw-ink-2); }
.hf-part .hf-bar i { background: var(--tw-accent); transition: width 1.1s var(--tw-ease); }
.hf-carry { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12.5px; border-left: 2px solid var(--tw-accent); }

/* Rank: level, XP to the next level, streak (the approved two-lane Rank, D-0523) */
.hf-lvl { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hf-lvl b { font-size: 18px; }
.hf-xp { height: 7px; border-radius: 7px; background: var(--tw-hairline-strong); overflow: hidden; margin-top: 7px; }
.hf-xp i { display: block; height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--tw-accent), var(--tw-gold)); transition: width 1.2s var(--tw-ease); }
.hf-ring { width: 30px; height: 30px; flex: none; }
.hf-ring .trk { stroke: var(--tw-hairline-strong); } .hf-ring .arc { stroke: var(--tw-gold); transition: stroke-dashoffset 1.2s var(--tw-ease); }
.hf-ring text { fill: var(--tw-ink); font: 700 11px var(--tw-font); }

/* the mini tab bar: the locked order (D-0611), the step's tab lit (the D-0522 bar's look) */
.hiw-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 5px 5px 7px; border-top: 1px solid var(--tw-hairline);
  background: var(--tw-glass-strong); margin-top: auto; }
.hiw-bar span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; border-radius: 10px; font-size: 10px; font-weight: 600;
  color: var(--tw-ink-3); min-width: 0; }
.hiw-bar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hiw-bar span.on { color: var(--tw-ink); background: var(--tw-accent-soft); }
.hiw-bar span.on svg { color: var(--tw-accent); }
.hiw-note { margin: 18px 0 0 74px; font-size: 12px; color: var(--tw-ink-3); }

/* motion: the card reveals (slides up, the fragment morphs from a pill into its card), the pieces inside play once */
.hiw-step.wait .hiw-card { opacity: 0; transform: translateY(34px) scale(.97); }
.hiw-step.wait .hiw-ui { border-radius: 60px; filter: blur(5px); }
.hiw-card { transition: opacity .7s var(--tw-ease), transform .8s var(--tw-ease); }
.hiw-ui { transition: border-radius .8s var(--tw-ease) .15s, filter .6s var(--tw-ease) .15s; }
.hiw-step.wait .hf-chip.st, .hiw-step.wait .hf-msg.you, .hiw-step.wait .hf-lines, .hiw-step.wait .hf-pause { opacity: 0; transform: scale(1.12) rotate(-2deg); }
.hf-chip.st, .hf-msg.you, .hf-lines, .hf-pause { transition: opacity .35s var(--tw-ease), transform .45s var(--tw-ease); }
.hf.pre .hf-lines, .hf.pre .hf-pause { opacity: 0; transform: scale(1.12) rotate(-2deg); }
.hf-wave.on i { animation: hiwBar 1s ease-in-out infinite; }
.hf-wave i:nth-child(2) { animation-delay: .15s; } .hf-wave i:nth-child(3) { animation-delay: .3s; } .hf-wave i:nth-child(4) { animation-delay: .45s; } .hf-wave i:nth-child(5) { animation-delay: .6s; }
@keyframes hiwBar { 50% { transform: scaleY(1); } }

/* static and reduced motion: every end state (Session ends calm, its catch line still red-edged), the rail full */
.static .hiw-rail i { transform: none; }
.static .hiw-step .hiw-card, .static .hiw-step .hiw-ui { opacity: 1; transform: none; border-radius: 20px; filter: none; }
.static .hiw-step .hiw-card { border-radius: 24px; }
@media (prefers-reduced-motion: reduce) {
  .hiw-rail i { transform: none; }
  .hiw-step.wait .hiw-card, .hiw-step.wait .hiw-ui, .hiw-step.wait .hf-chip.st, .hiw-step.wait .hf-msg.you, .hiw-step.wait .hf-lines, .hiw-step.wait .hf-pause,
  .hf.pre .hf-lines, .hf.pre .hf-pause { opacity: 1; transform: none; filter: none; }
  .hiw-step.wait .hiw-ui { border-radius: 20px; }
}

@media (max-width: 900px) {
  .hiw-card { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 18px; }
}
@media (max-width: 600px) {
  .hiw { gap: 16px; }
  .hiw-rail { left: 15px; top: 16px; bottom: 16px; }
  .hiw-step { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .hiw-node { width: 32px; height: 32px; font-size: 10.5px; letter-spacing: .04em; }
  .hiw-card { padding: 14px; border-radius: 20px; }
  .hiw-copy p { font-size: 15px; }
  .hf { padding: 12px 10px 10px; }
  .hf-scene { margin: -12px -10px 0; }
  .hf-lines { grid-template-columns: minmax(0, 1fr); }
  .hiw-note { margin-left: 42px; }
}
