/* How It Works (frames how-it-works 1440 / how-it-works-mobile 390). Numbers from fig-spec. */

/* ── hero ─────────────────────────────────────────────────────────────── */
.hiw-hero { display: grid; grid-template-columns: 760px 1fr; height: 540px; overflow: hidden; background: var(--color-surface); }
.hiw-hero__left { display: flex; flex-direction: column; justify-content: space-between; padding: 64px 64px 64px var(--container-pad); }
.hiw-hero__intro { display: flex; flex-direction: column; gap: var(--space-16); }
.hiw-hero__titles { display: contents; }
.hiw-hero__eyebrow { font-size: 12px; line-height: 13px; font-weight: 800; color: var(--color-brand); }
.hiw-hero__title { font-family: var(--font-display); font-weight: 900; font-size: 48px; line-height: 53px; letter-spacing: -1.92px; color: var(--color-text); }
.hiw-hero__lead { font-size: 16px; line-height: 24px; color: var(--color-muted); }
.hiw-hero__pic-m { display: none; }
.hiw-hero__journey { display: flex; flex-direction: column; gap: var(--space-16); }
.hiw-steps { display: flex; justify-content: space-between; }
.hiw-steps__link { display: flex; align-items: center; gap: var(--space-8); text-decoration: none; }
.hiw-steps__num { font-family: var(--font-mono); font-weight: 800; font-size: 12px; line-height: 16px; color: var(--color-muted); transition: color var(--dur-fast) var(--ease); }
.hiw-steps__label { font-family: var(--font-display); font-weight: 900; font-size: 10px; line-height: 12px; color: var(--color-text); }
.hiw-steps__m { display: none; }
.hiw-steps__item.is-active .hiw-steps__num, .hiw-steps__link:hover .hiw-steps__num { color: var(--color-brand); }
.hiw-steps__item:nth-child(n+3) .hiw-steps__label { color: var(--color-muted); }
.hiw-hero__bar { height: 2px; background: var(--color-line-dark); }
.hiw-hero__bar-fill { display: block; width: 90px; height: 2px; background: var(--color-brand); transition: width var(--dur-slow) var(--ease); }
.hiw-hero__note { font-size: 11px; line-height: 12px; color: var(--color-muted); }
.hiw-hero__media { position: relative; background: var(--color-bg); }
.hiw-hero__pic { position: absolute; inset: 0; }
.hiw-hero__pic img { width: 100%; height: 100%; object-fit: cover; }
.hiw-hero__media::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, #111116 0%, rgba(17, 17, 22, 0) 30%); pointer-events: none; }

/* ── steps ────────────────────────────────────────────────────────────── */
.step { position: relative; display: grid; gap: 64px; align-items: start; padding: 80px var(--container-pad); background: var(--color-bg); }
.step--01 { grid-template-columns: 576px 1fr; box-shadow: inset 0 1px 0 var(--color-line-dark), inset 0 -1px 0 var(--color-line-dark); }
.step--02 { grid-template-columns: 640px 1fr; background: var(--color-surface); box-shadow: inset 0 -1px 0 var(--color-line-dark); }
.step--03 { grid-template-columns: 1fr; gap: var(--space-48); box-shadow: inset 0 -1px 0 var(--color-line-dark); overflow: hidden; }
.step--04 { grid-template-columns: 736px 480px; background: var(--color-surface); box-shadow: inset 0 -1px 0 var(--color-line-dark); }
.step__left { display: flex; flex-direction: column; gap: var(--space-32); }
.step__text { display: flex; flex-direction: column; gap: var(--space-32); }
.step__text--03 { width: 640px; max-width: 100%; gap: var(--space-16); }
.step__text--03 .step__headers { gap: var(--space-16); }
.step__num { font-family: var(--font-mono); font-weight: 900; font-size: 72px; line-height: 94px; color: var(--color-brand); opacity: .8; }
.step__verb { display: none; }
.step__headers { display: flex; flex-direction: column; gap: var(--space-12); }
.step__kicker { font-size: 12px; line-height: 13px; font-weight: 800; letter-spacing: 1.5px; color: var(--color-brand); }
.step__title { font-family: var(--font-display); font-weight: 900; font-size: 36px; line-height: 45px; color: var(--color-text); }
.step__desc { font-size: 16px; line-height: 26px; color: var(--color-muted); }
.step--01 .step__desc { line-height: 25.6px; }
.step--04 .step__desc { line-height: 25.6px; }
.step--03 .step__desc { line-height: 24px; }
.step__desc-m { display: none; }
.step__text--03 .step__num { margin-bottom: 0; }
.step__hint {
  display: flex; align-items: center; gap: var(--space-12); align-self: flex-start;
  padding: 12px; border-radius: var(--radius-sm); background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-line-dark);
  font-family: var(--font-mono); font-weight: 700; font-size: 12px; line-height: 16px; color: var(--color-text);
}
.step__hint-on { color: var(--color-brand); font-weight: 400; }
.step__hint > span:not(.step__hint-on):not(.step__hint-arrow) { font-weight: 700; }
.step__hint-arrow { font-family: var(--font-body); font-weight: 400; font-size: 12px; line-height: 13px; color: var(--color-muted); }
.step__tip { display: flex; align-items: center; gap: var(--space-12); font-size: 13px; line-height: 14px; color: var(--color-muted); }
.step__tip-icon { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--color-muted); font-family: var(--font-mono); font-size: 10px; font-weight: 700; }

/* preview cards */
.step__preview { position: relative; height: 320px; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-line-dark); }
.step__preview-bg { position: absolute; inset: 0; }
.step__preview-bg img { width: 100%; height: 100%; object-fit: cover; }
.step__preview::before { content: ""; position: absolute; inset: 0; background: rgba(11, 11, 16, .75); }
.step__preview--dark { background: var(--color-bg); }
.step__preview--dark::before { display: none; }
.ui {
  position: absolute; left: 70px; top: 40px; width: 500px;
  display: flex; flex-direction: column; gap: var(--space-16);
  padding: var(--space-20); border-radius: var(--radius-md); background: var(--color-surface-2);
  box-shadow: inset 0 0 0 1px var(--color-line-dark), 0 12px 24px rgba(0, 0, 0, .502);
}
.ui__head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-weight: 700; }
.ui__crumb { font-size: 11px; line-height: 14px; font-weight: 800; color: var(--color-muted); }
.ui__crumb--on { color: var(--color-brand); }
.ui__when { font-size: 10px; line-height: 13px; font-weight: 400; color: var(--color-muted); }
.ui__when--on { color: var(--color-brand); }
.ui__meta { display: flex; flex-direction: column; gap: var(--space-4); }
.ui__event { font-family: var(--font-display); font-weight: 900; font-size: 16px; line-height: 20px; color: var(--color-text); }
.ui__market { font-size: 12px; line-height: 13px; color: var(--color-muted); }
.ui__odds { display: flex; gap: var(--space-12); }
.ui__odd { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-4); height: 62px; padding: 12px; border-radius: var(--radius-sm); background: var(--color-bg); box-shadow: inset 0 0 0 1px var(--color-line-dark); }
.ui__odd-name { font-size: 12px; line-height: 13px; color: var(--color-muted); }
.ui__odd-price { font-family: var(--font-mono); font-weight: 800; font-size: 16px; line-height: 21px; color: var(--color-text); }
.ui__odd.is-selected { background: var(--color-brand); box-shadow: none; }
.ui__odd.is-selected .ui__odd-name, .ui__odd.is-selected .ui__odd-price { color: var(--color-bg); }
.ui__foot { display: flex; justify-content: space-between; font-size: 12px; line-height: 13px; color: var(--color-muted); }
.ui__more { color: var(--color-brand); font-weight: 700; }
.ui--selected { box-shadow: inset 0 0 0 1px var(--color-line-dark); }
.ui__toast { display: flex; align-items: center; gap: var(--space-12); padding: 10px; border-radius: var(--radius-sm); background: var(--color-bg); box-shadow: inset 0 0 0 1px rgba(124, 111, 255, .2); font-size: 12px; line-height: 13px; color: var(--color-text); }
.ui__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-brand); }
.step__toast-m { display: none; }

/* step 03 */
.step--03__bg { position: absolute; left: 0; right: 0; top: 0; height: 450px; z-index: 0; }
.step--03__bg img { width: 100%; height: 100%; object-fit: cover; }
.step--03__bg::after { content: ""; position: absolute; inset: 0; background: rgba(11, 11, 16, .9); }
.step--03 > * { position: relative; z-index: 1; }
.step--03 .step--03__bg { position: absolute; }
.step__cols { display: grid; grid-template-columns: 1fr 380px; gap: var(--space-48); align-items: start; }
.anatomy { display: flex; flex-direction: column; gap: var(--space-24); padding: var(--space-32); border-radius: var(--radius-lg); background: var(--color-surface-2); box-shadow: inset 0 0 0 1px var(--color-line-dark); }
.anatomy__title { font-family: var(--font-display); font-weight: 900; font-size: 14px; line-height: 17px; color: var(--color-text); }
.anatomy__list { display: flex; flex-direction: column; gap: var(--space-16); }
.anatomy__item { display: flex; gap: var(--space-16); }
.anatomy__letter { width: 9px; padding-top: 6px; font-family: var(--font-mono); font-weight: 800; font-size: 14px; line-height: 18px; color: var(--color-brand); }
.anatomy__body { display: flex; flex-direction: column; gap: 2px; }
.anatomy__name { font-size: 14px; line-height: 15px; font-weight: 700; color: var(--color-text); }
.anatomy__desc { font-size: 12px; line-height: 13px; color: var(--color-muted); }

.dslip { display: flex; flex-direction: column; gap: var(--space-20); padding: var(--space-24); border-radius: 14px; background: var(--color-surface-2); box-shadow: inset 0 0 0 1px var(--color-line-dark), var(--shadow-card); }
.dslip__head { display: flex; justify-content: space-between; align-items: center; height: 22px; }
.dslip__title { font-family: var(--font-display); font-weight: 900; font-size: 14px; line-height: 17px; color: var(--color-text); }
.dslip__count { padding: 4px 10px; border-radius: 100px; background: var(--color-brand); font-family: var(--font-mono); font-weight: 800; font-size: 11px; line-height: 14px; color: var(--color-bg); }
.dslip__rule { height: 0; margin: 0; border: 0; border-top: 1px solid var(--color-line-dark); }
.dslip__rule--m { display: none; }
.dslip__sel { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius-md); background: var(--color-bg); box-shadow: inset 0 0 0 1px rgba(124, 111, 255, .2); }
.dslip__sel-row { display: flex; justify-content: space-between; align-items: center; }
.dslip__pick { font-size: 14px; line-height: 15px; font-weight: 700; color: var(--color-text); }
.dslip__price { font-family: var(--font-mono); font-weight: 800; font-size: 14px; line-height: 18px; color: var(--color-brand); }
.dslip__market { font-size: 12px; line-height: 13px; color: var(--color-muted); }
.dslip__sep-m { display: none; }
.dslip__stake { display: flex; flex-direction: column; gap: var(--space-8); }
.dslip__label-row { display: flex; justify-content: space-between; align-items: center; }
.dslip__amount--m { display: none; }
.dslip__label { font-size: 11px; line-height: 12px; font-weight: 800; letter-spacing: 1px; color: var(--color-muted); }
.dslip__input { display: flex; justify-content: space-between; align-items: center; height: 44px; padding: 0 16px; border-radius: var(--radius-md); background: var(--color-bg); box-shadow: inset 0 0 0 1px var(--color-line-dark); font-size: 14px; line-height: 15px; color: var(--color-muted); }
.dslip__amount { font-family: var(--font-mono); font-weight: 700; font-size: 15px; line-height: 20px; color: var(--color-text); }
.dslip__quick { display: flex; gap: var(--space-8); }
.dslip__quick span { flex: 1; display: grid; place-items: center; height: 32px; border-radius: var(--radius-sm); background: var(--color-bg); box-shadow: inset 0 0 0 1px var(--color-line-dark); font-family: var(--font-mono); font-weight: 700; font-size: 12px; line-height: 16px; color: var(--color-text); }
.dslip__summary { display: flex; flex-direction: column; gap: var(--space-8); }
.dslip__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; line-height: 14px; color: var(--color-muted); }
.dslip__row dd { font-family: var(--font-mono); font-weight: 700; font-size: 13px; line-height: 17px; color: var(--color-text); }
.dslip__row--return dt { color: var(--color-text); }
.dslip__row--return dd { font-size: 16px; line-height: 21px; font-weight: 900; color: var(--color-brand); }
.dslip__btn { min-height: 44px; border-radius: var(--radius-md); font-size: 14px; line-height: 15px; }
.dslip__note { font-size: 11px; line-height: 12px; text-align: center; color: var(--color-muted); }

/* step 04 */
.checklist { display: flex; flex-direction: column; gap: var(--space-12); }
.checklist__title { font-family: var(--font-mono); font-weight: 800; font-size: 11px; line-height: 14px; color: var(--color-text); }
.checklist__chips { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.checklist__chip { display: inline-flex; align-items: center; gap: var(--space-6); padding: 6px 12px; border-radius: var(--radius-sm); background: var(--color-bg); box-shadow: inset 0 0 0 1px var(--color-line-dark); font-size: 12px; line-height: 13px; color: var(--color-text); }
.checklist__tick { color: var(--color-brand); font-weight: 800; }
.final { display: flex; flex-direction: column; align-items: center; gap: var(--space-20); padding: var(--space-32); border-radius: var(--radius-lg); background: var(--color-bg); box-shadow: inset 0 0 0 1px var(--color-line-dark); text-align: center; }
.final__kicker { font-size: 12px; line-height: 13px; font-weight: 800; letter-spacing: 1.5px; color: var(--color-brand); }
.final__title { font-family: var(--font-display); font-weight: 900; font-size: 20px; line-height: 25px; color: var(--color-text); }
.final__btn { width: 100%; min-height: 49px; padding: 16px 32px; font-size: 16px; line-height: 17px; font-weight: 900; }
.final__desc { font-size: 12px; line-height: 18px; color: var(--color-muted); }
.final__note { font-size: 11px; line-height: 12px; font-weight: 700; color: var(--color-muted); }
.final__note-m { display: none; }

/* ── mobile (frame how-it-works-mobile 390) ───────────────────────────── */
@media (max-width: 1199px) {
  .hiw-hero { grid-template-columns: 1fr; height: auto; background: var(--color-bg); }
  .hiw-hero__left { gap: 0; padding: 40px var(--container-pad-m); justify-content: flex-start; }
  .hiw-hero__intro { gap: 0; }
  .hiw-hero__eyebrow { font-size: 10px; line-height: 11px; }
  .hiw-hero__titles { display: flex; flex-direction: column; gap: var(--space-16); padding: 12px 0 16px; }
  .hiw-hero__title { font-size: 44px; line-height: 44px; letter-spacing: -1.76px; }
  .hiw-hero__lead { font-size: 14px; line-height: 21px; color: var(--color-text); }
  .hiw-hero__pic-m { display: block; height: 240px; margin-top: 0; border-radius: var(--radius-lg); overflow: hidden; }
  .hiw-hero__pic-m img { width: 100%; height: 100%; object-fit: cover; }
  .hiw-hero__journey { gap: 0; margin-top: 0; padding: 12px; border-radius: var(--radius-lg); background: var(--color-surface-2); box-shadow: inset 0 0 0 1px var(--color-line-dark); }
  .hiw-steps { gap: var(--space-4); }
  .hiw-steps__item { flex: 1; }
  .hiw-steps__link { flex-direction: column; gap: var(--space-4); }
  .hiw-steps__num { font-family: var(--font-display); font-weight: 900; font-size: 12px; line-height: 15px; }
  .hiw-steps__label { font-family: var(--font-body); font-weight: 400; font-size: 8px; line-height: 9px; color: var(--color-muted); }
  .hiw-steps__item.is-active .hiw-steps__label { color: var(--color-text); }
  .hiw-steps__d { display: none; }
  .hiw-steps__m { display: inline; }
  .hiw-hero__bar, .hiw-hero__note { display: none; }
  .hiw-hero__media { display: none; }
  /* the frame stacks intro → image → indicator with no gaps, then 40px bottom; image sits at y=290 */
  .hiw-hero__intro { margin-bottom: 0; }
  .hiw-hero__lead { margin-bottom: 0; }
  .hiw-hero__pic-m { margin-top: 0; }

  .step { grid-template-columns: 1fr; gap: var(--space-32); padding: 80px var(--container-pad-m) 48px; box-shadow: none; }
  .step--02, .step--03, .step--04 { background: var(--color-bg); box-shadow: inset 0 1px 0 var(--color-ink); }
  .step__num { opacity: 1; }
  .ui--selected { box-shadow: inset 0 0 0 1px var(--color-line-dark); }
  .step__text { gap: var(--space-16); }
  .step__num { display: flex; flex-direction: column; gap: var(--space-4); font-family: var(--font-display); font-weight: 900; font-size: 48px; line-height: 60px; }
  .step__verb { display: block; font-family: var(--font-body); font-weight: 800; font-size: 10px; line-height: 11px; color: var(--color-brand); }
  .step--03 .step__verb, .step--04 .step__verb { color: var(--color-muted); }
  .step__kicker { display: none; }
  .step__title { font-size: 28px; line-height: 35px; }
  .step__desc, .step--01 .step__desc, .step--04 .step__desc, .step--03 .step__desc { font-size: 14px; line-height: 21px; color: var(--color-text); }
  .step__desc-d { display: none; }
  .step__desc-m { display: inline; }
  .step__hint, .step__tip { display: none; }
  .step--02 { display: flex; flex-direction: column; align-items: stretch; }
  .step--02 .step__text { order: 0; }
  .step--02 .step__preview { order: 1; }

  .step__preview { height: auto; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
  .step__preview-bg, .step__preview::before { display: none; }
  .ui { position: static; width: auto; padding: 16px; border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--color-line-dark); }
  .ui__event { font-family: var(--font-body); font-weight: 700; font-size: 14px; line-height: 15px; }
  .ui__odd { height: 48px; flex-direction: row; justify-content: center; gap: var(--space-8); padding: 0 12px; border-radius: var(--radius-md); background: #1e1e28; }
  .ui__foot, .ui__toast { display: none; }
  .step__toast-m { display: block; padding-top: 8px; font-size: 12px; line-height: 13px; color: var(--color-brand); }

  .step--03 { gap: 0; padding-top: 80px; }
  .step--03__bg { display: none; }
  .step__text--03 { width: auto; margin-top: 24px; }
  .step__text--03 .step__headers { gap: var(--space-12); }
  .step__cols { grid-template-columns: 1fr; gap: var(--space-32); padding-top: 32px; }
  .anatomy { gap: var(--space-16); padding: 0; background: none; box-shadow: none; }
  .anatomy__title { font-family: var(--font-body); font-weight: 400; font-size: 10px; line-height: 11px; color: var(--color-muted); }
  .anatomy__list { gap: 0; }
  .anatomy__item { justify-content: space-between; align-items: center; height: 42px; padding: 12px 0; box-shadow: inset 0 -1px 0 var(--color-ink); }
  .anatomy__letter { padding-top: 0; }
  .anatomy__body { align-items: flex-end; }
  .anatomy__name { font-size: 13px; line-height: 14px; }
  .anatomy__desc { display: none; }
  .dslip { gap: var(--space-16); padding: var(--space-20); border-radius: var(--radius-lg); box-shadow: none; }
  .dslip__head { height: 16px; }
  .dslip__sep-d { display: none; }
  .dslip__sep-m { display: inline; }
  .dslip__title { font-size: 13px; line-height: 16px; }
  .dslip__count { padding: 2px 8px; font-size: 10px; line-height: 12px; }
  .dslip__rule--m { display: block; }
  .dslip__sel { gap: var(--space-12); padding: 0; background: none; box-shadow: none; }
  .dslip__stake { gap: var(--space-12); }
  .dslip__input { display: none; }
  .dslip__label-row { height: 21px; }
  .dslip__amount--m { display: inline; }
  .dslip__sel-row { height: 21px; }
  .dslip__quick { margin-top: -4px; }   /* stake-controller: label row + 12 + quick stakes */
  .dslip__quick span { height: 40px; }
  .dslip__btn { min-height: 48px; }

  .step--04 { gap: var(--space-32); }
  .step__left { display: contents; }
  .checklist__chip { padding: 8px 12px; border-radius: var(--radius-md); background: var(--color-surface-2); box-shadow: none; font-size: 13px; line-height: 14px; }
  .final { align-items: stretch; gap: var(--space-16); padding: var(--space-24); background: var(--color-surface-2); box-shadow: none; text-align: left; }
  .final__kicker { font-size: 10px; line-height: 11px; font-weight: 400; color: var(--color-muted); margin-bottom: -12px; }
  .final__title { font-family: var(--font-body); font-weight: 700; font-size: 16px; line-height: 17px; }
  .final__btn { min-height: 52px; padding: 0; font-size: 15px; line-height: 16px; }
  .final__desc { display: none; }
  .final__note-d { display: none; }
  .final__note { font-weight: 400; }
  .final__note-m { display: inline; }
}

@media (min-width: 1200px) and (max-width: 1439px) {
  .hiw-hero { grid-template-columns: minmax(0, 60%) 1fr; }
  .step--01 { grid-template-columns: minmax(0, 45%) minmax(0, 1fr); }
  .step--02 { grid-template-columns: minmax(0, 1fr) minmax(0, 45%); }
  .step--04 { grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); }
  .step__cols { grid-template-columns: minmax(0, 1fr) 360px; }
  .ui { left: 32px; width: calc(100% - 64px); }
}

/* mobile fixes from the frame-by-frame style check */
@media (max-width: 1199px) {
  .hiw-steps__m { font-weight: 700; }
  .ui__event { font-family: var(--font-body); font-weight: 800; font-size: 14px; line-height: 15px; }
  .ui__odd-name { font-size: 13px; line-height: 14px; font-weight: 700; color: var(--color-text); }
  .step__desc, .step--01 .step__desc, .step--04 .step__desc, .step--03 .step__desc { opacity: .6; }
  .checklist__tick { font-weight: 700; }
  .dslip__quick span { font-size: 13px; line-height: 17px; }
}

/* narrower than the 390 frame: the three mock odds no longer fit one row → the last wraps under */
@media (max-width: 389px) {
  .step__text { min-width: 0; }
  .ui__odds { flex-wrap: wrap; }
  .ui__odd { flex: 1 1 calc(50% - 6px); min-width: 0; }
}

/* wider than the 1440 frame: the copy column keeps its frame width next to the centred content,
   the photo column takes the rest (the side padding sits on the full-bleed hero, so the token resolves right) */
@media (min-width: 1441px) {
  .hiw-hero { padding-left: var(--container-pad); grid-template-columns: 680px minmax(0, 1fr); }
  .hiw-hero__left { padding-left: 0; }
}
