/* Home page, wave 2: touch and pointer interaction. Scoped to .home and the .hx / .hm-* sections.
   Motion is transform/opacity only. Hover effects live behind (hover: hover); touch gets press states.
   Price tier rows are made pickable sitewide by 20-footer.js / 20-footer.css, so nothing here touches them. */

/* ---------- shared: press feedback (individual `scale` so it stacks with GSAP inline transforms) ---------- */
.home .hx-cta .btn,
.home .hm-custom-cta .btn {
  transition: background-color .2s, color .2s, box-shadow .25s, border-color .2s, transform .3s var(--ease), scale .16s var(--ease);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.home .hx-cta .btn:active,
.home .hm-custom-cta .btn:active { scale: .97; }

.hx-board-grid a,
.hm-sports .sport,
.hm-chain-filter button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ---------- hero line sheet ---------- */
.hx-board-grid a { overflow: hidden; }
.hx-board-grid img { -webkit-user-drag: none; user-select: none; transition: transform .45s var(--ease), scale .18s var(--ease); }
.hx-board-grid a::before {
  content: ""; position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 3px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.hx-board-grid a:focus-visible::before,
.hx-board-grid a:active::before { transform: scaleX(1); }
.hx-board-grid a:active img { scale: .94; }
@media (hover: hover) {
  .hx-board-grid a:hover::before { transform: scaleX(1); }
}

/* swipe meter: shown only where a rail actually scrolls (phone widths) */
.hm-rail-meter { display: none; }
.hm-rail-meter > span { font: 500 .64rem/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.hm-track { position: relative; display: block; flex: 1 1 auto; height: 2px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.hm-track b { position: absolute; left: 0; top: 0; bottom: 0; width: var(--tw, 30%); background: var(--accent); border-radius: inherit; transform: translateX(var(--tx, 0%)); will-change: transform; }

@media (max-width: 900px) {
  .hx-swipe { display: flex; align-items: center; gap: 12px; padding: 10px 2px 2px; }
  .hx-board { overflow: visible; border: 0; background: transparent; }
  .hx-board-grid { border: 1px solid var(--rule-strong); border-radius: 10px; overscroll-behavior-x: contain; }
  .hx-board-grid li { min-height: 44px; }
}

/* Mouse drag on rails (set by 20-home.js only when the rail overflows). */
.hm-rail-drag { cursor: grab; }
.hm-rail-drag.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.hm-rail-drag.is-dragging a { pointer-events: none; }

/* ---------- 01 what we make: sport tiles ---------- */
.hm-sports .sport { transition: transform .35s var(--ease), box-shadow .35s, scale .16s var(--ease); }
.hm-sports .sport img { -webkit-user-drag: none; user-select: none; }
.hm-sports .sport:active { scale: .97; }
.hm-go {
  position: absolute; z-index: 2; top: 10px; right: 10px; display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--accent-ink);
  opacity: 0; transform: translate(-6px, 6px); transition: opacity .25s, transform .35s var(--ease);
}
.hm-sports .sport:focus-visible .hm-go { opacity: 1; transform: none; }
@media (hover: hover) {
  .hm-sports .sport:hover .hm-go { opacity: 1; transform: none; }
}
@media (hover: none), (pointer: coarse) {
  .hm-go { opacity: .92; transform: none; width: 28px; height: 28px; }
}

/* Phones: two-row swipe rail instead of a six-screen-tall grid. */
@media (max-width: 620px) {
  .hm-sports {
    grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: minmax(136px, 42%);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
    padding: 4px 2px 6px; margin-inline: -2px;
  }
  .hm-sports::-webkit-scrollbar { display: none; }
  .hm-sports .sport { scroll-snap-align: start; }
  .hm-sports-meter { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
}

/* ---------- 02 how it works: progress rule + active step ---------- */
.hm-steps { position: relative; }
.hm-steps::before {
  content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--accent);
  transform: scaleX(var(--fill, 0)); transform-origin: left; pointer-events: none; transition: transform .7s var(--ease);
}
.hm-steps li { isolation: isolate; }
/* justify-self: on phones the step is a grid row, so the pill must hug its label. */
.hm-step-n { position: relative; display: inline-block; justify-self: start; padding: 4px 0; transition: color .25s; }
.hm-step-n::before {
  content: ""; position: absolute; z-index: -1; inset: 0 -7px; border-radius: 4px; background: var(--accent);
  opacity: 0; transform: scaleX(.6); transform-origin: left; transition: opacity .3s, transform .35s var(--ease);
}
.hm-steps li.is-on .hm-step-n { color: #fff; }
.hm-steps li.is-on .hm-step-n::before { opacity: 1; transform: none; }
.hm-steps img { transition: transform .45s var(--ease); }
@media (hover: hover) {
  .hm-steps li:hover img { transform: translateY(-3px); }
}

/* ---------- 04 factory: chain filter ---------- */
.hm-chain-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.hm-chain-filter[hidden] { display: none; }
.hm-chain-filter button {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: 500 .72rem/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, scale .16s var(--ease);
}
.hm-chain-filter button:active { scale: .96; }
.hm-chain-filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.hm-chain-filter button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .hm-chain-filter button:hover:not([aria-pressed="true"]) { border-color: var(--accent); color: var(--accent-ink); }
}
.hm-chain tbody tr { transition: opacity .3s; }
.hm-chain[data-show="is-in"] tbody tr.is-out,
.hm-chain[data-show="is-out"] tbody tr.is-in { opacity: .28; }
.hm-chain tbody th a { display: inline-block; padding-block: 6px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .home .hx-cta .btn:active, .home .hm-custom-cta .btn:active, .hm-sports .sport:active,
  .hx-board-grid a:active img, .hm-chain-filter button:active { scale: none; }
  .hm-steps::before, .hx-board-grid a::before, .hm-go, .hm-step-n, .hm-step-n::before, .hm-steps img, .hm-chain tbody tr { transition: none; }
  .hm-steps li:hover img, .hm-sports .sport:hover .hm-go { transform: none; }
}
