/* Existing active-step classes drive the presentation; selection logic is unchanged. */
#how-it-works { background: #16191c; }
#how-it-works .how-header { gap: 72px; align-items: start; margin-bottom: 36px; }
#how-it-works .section-title { font-size: 40px; line-height: 1.24; }
#how-it-works .how-desc { color: #b1bbc5; font-size: 15px; line-height: 1.9; padding-top: 44px; }
#how-it-works .how-flow-bar {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 0;
  position: relative;
  padding: 0;
  margin: 0;
  border: 1px solid #394550;
  border-radius: 6px 6px 0 0;
  background: #1c2126;
}
#how-it-works .how-flow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 18px 24px;
  font: 11px/1.4 var(--mono);
  position: relative;
  transition: background-color .2s, color .2s;
}
#how-it-works .how-flow-step:not(:first-child) { border-left: 1px solid #ffffff0c; }
#how-it-works .how-flow-step::before { margin: 0; color: #8d9cab; font-size: 10px; }
#how-it-works .how-flow-step::after { content: ""; position: absolute; height: 2px; inset: auto 0 -1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
#how-it-works .how-flow-step:hover { color: #e3ecf5; background: #ffffff05; }
#how-it-works .how-flow-step.active { background: #96c8fa0c; color: var(--accent); }
#how-it-works .how-flow-step.active::before { color: var(--accent); }
#how-it-works .how-flow-step.active::after { transform: scaleX(1); }
#how-it-works .how-flow-step:focus-visible { outline: 2px solid var(--accent); outline-offset: -5px; border-radius: 4px; }
#how-it-works .how-flow-arrow { display: none; }
#how-it-works .how-flow-latency { grid-column: 1 / -1; margin: 0; padding: 12px 24px; border-top: 1px solid #ffffff0c; text-align: right; font-size: 9px; }
#how-it-works .steps-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; border-bottom: 1px solid #394550; }
#how-it-works .step-card { display: flex; flex-direction: column; min-width: 0; padding: 30px 24px 24px; border: 0; border-left: 1px solid #394550; border-radius: 0; background: #181d21; transition: background-color .25s; }
#how-it-works .step-card:last-child { border-right: 1px solid #394550; }
#how-it-works .step-card--active { background: #20272d; }
#how-it-works .step-card:hover { background: #20262b; }
#how-it-works .step-card--inactive { opacity: 1; }
#how-it-works .step-badge { display: none; }
#how-it-works .step-visual { position: relative; display: flex; align-items: center; gap: 16px; flex-shrink: 0; height: 80px; margin-bottom: 24px; overflow: hidden; }
#how-it-works .step-icon { position: relative; inset: auto; margin: 0; order: -1; flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; color: #8eabca; }
#how-it-works .step-icon svg { width: 28px; height: 28px; }
#how-it-works .step-card--active .step-icon { color: #b4d9fc; }
#how-it-works .step-title { font-size: 18px; line-height: 1.5; min-height: 54px; margin: 0 0 14px; color: #e8eef4; text-wrap: pretty; }
#how-it-works .step-body { font-size: 14px; line-height: 1.85; margin: 0 0 22px; }
#how-it-works .step-metrics { margin-top: auto; padding-top: 4px; gap: 8px 12px; }
#how-it-works .step-chip { font-size: 10px; color: #b5c2ce; }
#how-it-works .step-latency { position: static; margin-top: 20px; padding-top: 14px; border-top: 1px solid #ffffff13; font: 11px/1.4 var(--mono); display: flex; align-items: center; justify-content: space-between; }
#how-it-works .step-latency::after { content: ""; width: 16px; height: 5px; border-block: 1px solid #687987; }
#how-it-works .step-card--active .step-latency::after { border-color: var(--accent); }
#how-it-works .step-active-label { inset: 12px 24px auto auto; font-size: 8px; color: #9eb6cc; }
#how-it-works .step-card--active .step-active-label { color: var(--accent); }
#how-it-works .step-signal-demo { display: grid; grid-template-columns: auto auto; align-items: center; gap: 9px 12px; margin: 0; padding: 10px 0 10px 12px; border-left: 1px solid #80d6b25c; font-size: 11px; }
#how-it-works .signal-conf { grid-column: 1 / -1; font-size: 9px; }
#how-it-works .workflow-stream { display: grid; gap: 9px; flex: 1; max-width: 164px; }
#how-it-works .workflow-stream i { display: block; position: relative; width: 90%; height: 3px; background: #899cab38; transform-origin: left; }
#how-it-works .workflow-stream i::before { content: ""; position: absolute; left: 0; top: -1px; width: 5px; height: 5px; background: #8ba3b7; }
#how-it-works .workflow-stream i:nth-child(2n) { width: 68%; }
#how-it-works .workflow-stream i:nth-child(3) { width: 80%; background: #96c8fa70; }
#how-it-works .workflow-stream i:nth-child(3)::before { background: var(--accent); }
#how-it-works .workflow-matrix { display: grid; grid-template-columns: repeat(6,8px); gap: 6px 10px; }
#how-it-works .workflow-matrix i { display: block; width: 8px; height: 8px; border: 1px solid #8297aa45; background: #96c8fa0a; }
#how-it-works .workflow-matrix i:nth-child(3n) { background: #96c8fa50; border-color: #96c8fa70; }
#how-it-works .workflow-matrix i:nth-child(5n) { background: #b1bbc555; border-color: #b1bbc570; }
#how-it-works .workflow-monitor { display: flex; flex: 1; align-items: center; justify-content: space-between; height: 56px; max-width: 164px; gap: 3px; border-block: 1px solid #ffffff0a; }
#how-it-works .workflow-monitor i { display: block; flex: 1; max-width: 4px; height: 20%; background: #9eb1c36b; }
#how-it-works .workflow-monitor i:nth-child(2n) { height: 36%; }
#how-it-works .workflow-monitor i:nth-child(3n) { height: 60%; background: #96c8fabb; }
#how-it-works .workflow-monitor i:nth-child(4n) { height: 80%; }
#how-it-works .workflow-monitor i:nth-child(7n) { height: 46%; }
#how-it-works .step-card--active .workflow-stream i { animation: workflow-input 1.5s ease-out both; }
#how-it-works .step-card--active .workflow-stream i:nth-child(2n) { animation-delay: .18s; }
#how-it-works .step-card--active .workflow-matrix i { animation: workflow-cell 1.8s ease-in-out; }
#how-it-works .step-card--active .workflow-matrix i:nth-child(2n) { animation-delay: .15s; }
#how-it-works .step-card--active .workflow-matrix i:nth-child(3n) { animation-delay: .3s; }
#how-it-works .step-card--active .workflow-matrix i:nth-child(5n) { animation-delay: .45s; }
#how-it-works .step-card--active .step-signal-demo { animation: workflow-signal .8s ease-out; }
#how-it-works .step-card--active .workflow-monitor i { animation: workflow-monitor 2s ease-in-out; }
#how-it-works .step-card--active .workflow-monitor i:nth-child(2n) { animation-delay: .2s; }
#how-it-works .step-card--active .workflow-monitor i:nth-child(3n) { animation-delay: .4s; }
#how-it-works .how-cta-bar { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; gap: 28px; padding: 30px 0 0; }
#how-it-works .how-cta-divider { display: none; }
#how-it-works .how-cta-val { font-size: 24px; color: #dce6ef; }
#how-it-works .how-cta-label { font-size: 11px; }
#how-it-works .how-cta-bar .btn { min-height: 48px; padding: 14px 24px; font-size: 12px; }
@keyframes workflow-input { from { transform: translateX(-12px); opacity: .2; } to { transform: translateX(0); opacity: 1; } }
@keyframes workflow-cell { 45% { background: #96c8fad9; border-color: #c4e0fc; } }
@keyframes workflow-signal { from { opacity: .4; transform: translateX(-6px); } to { opacity: 1; transform: translateX(0); } }
@keyframes workflow-monitor { 45% { transform: scaleY(.4); opacity: .4; } }
@media (max-width: 1100px) {
  #how-it-works .how-header { gap: 40px; }
  #how-it-works .section-title { font-size: 34px; }
  #how-it-works .how-desc { font-size: 14px; }
  #how-it-works .step-card { padding-inline: 18px; }
  #how-it-works .step-visual { gap: 10px; }
  #how-it-works .step-icon { flex-basis: 28px; width: 28px; }
  #how-it-works .step-icon svg { width: 24px; height: 24px; }
  #how-it-works .workflow-matrix { grid-template-columns: repeat(6,6px); gap: 5px 7px; }
  #how-it-works .workflow-matrix i { width: 6px; height: 6px; }
  #how-it-works .step-signal-demo { font-size: 10px; gap: 7px; padding-left: 8px; }
  #how-it-works .signal-conf { font-size: 8px; }
  #how-it-works .how-flow-step { padding-inline: 18px; gap: 8px; }
}
@media (max-width: 1100px) {
  #how-it-works .how-header { grid-template-columns: 1fr; gap: 22px; }
  #how-it-works .how-desc { padding-top: 0; max-width: 66ch; }
  #how-it-works .steps-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #how-it-works .step-card { padding: 26px 24px 24px; }
  #how-it-works .step-card:nth-child(even) { border-right: 1px solid #394550; }
  #how-it-works .step-card:nth-child(n+3) { border-top: 1px solid #394550; }
  #how-it-works .step-visual { height: 66px; }
  #how-it-works .step-title { font-size: 18px; min-height: 54px; }
  #how-it-works .step-body { font-size: 14px; }
  #how-it-works .step-signal-demo { font-size: 11px; }
  #how-it-works .workflow-matrix { grid-template-columns: repeat(6,8px); gap: 5px 10px; }
  #how-it-works .workflow-matrix i { width: 8px; height: 8px; }
  #how-it-works .how-cta-bar { gap: 24px; grid-template-columns: repeat(3,minmax(0,1fr)); }
  #how-it-works .how-cta-bar .btn { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 550px) {
  #how-it-works .section-title { font-size: 30px; }
  #how-it-works .how-flow-step { min-height: 68px; flex-direction: column; align-items: flex-start; gap: 7px; padding: 13px 10px; font-size: 9px; }
  #how-it-works .how-flow-step::before { font-size: 9px; }
  #how-it-works .how-flow-latency { display: block; padding: 12px; font-size: 8px; text-align: left; }
  #how-it-works .steps-grid { grid-template-columns: 1fr; }
  #how-it-works .step-card { border: 0; border-inline: 1px solid #394550; padding: 24px; }
  #how-it-works .step-card + .step-card { border-top: 1px solid #394550; }
  #how-it-works .step-badge { display: block; position: absolute; top: 28px; right: 24px; margin: 0; font-size: 10px; }
  #how-it-works .step-active-label { top: 27px; right: 58px; }
  #how-it-works .step-visual { height: 66px; width: calc(100% - 48px); margin-bottom: 16px; gap: 16px; }
  #how-it-works .step-title { min-height: 0; font-size: 18px; }
  #how-it-works .step-body { font-size: 14px; margin-bottom: 18px; }
  #how-it-works .step-metrics { margin-top: 0; }
  #how-it-works .step-latency { margin-top: 16px; }
  #how-it-works .step-visual--signal { margin-top: 14px; }
  #how-it-works .how-cta-bar { gap: 22px 12px; }
  #how-it-works .how-cta-val { font-size: 22px; }
  #how-it-works .how-cta-label { font-size: 9px; line-height: 1.6; }
  #how-it-works .how-cta-bar .btn { justify-self: stretch; }
}
@media (max-width: 359px) {
  #how-it-works .section-title { font-size: 27px; }
  #how-it-works .how-flow-step { padding-inline: 8px; font-size: 8px; }
  #how-it-works .step-card { padding-inline: 18px; }
  #how-it-works .step-title { font-size: 17px; }
  #how-it-works .step-body { font-size: 13px; }
}
@supports (grid-template-rows: subgrid) {
  #how-it-works .step-card { display: grid; grid-template-rows: subgrid; grid-row: span 5; row-gap: 0; }
  #how-it-works .step-title { min-height: 0; }
  #how-it-works .step-metrics { margin-top: 0; align-self: end; }
}
@media (prefers-reduced-motion: reduce) {
  #how-it-works *, #how-it-works *::before, #how-it-works *::after { animation: none !important; transition: none !important; }
}
