/* THORWALLET - the Swaps section bento (xchain.js). Three cards with a live
   visual each: a coin crossing chains natively, a drifting wall of tokens, and
   a quote race between routes. Text classes (.rail-num/-name/-desc/-fact) come
   from site.css so the copy and its translations stay as they were. Follows the
   site theme; the visuals sit on their own soft panels. */

.xb { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 14px; margin-top: 56px; }
.xb-card {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 16px;
  padding: 26px 26px 22px; border-radius: var(--r-lg); border: 1px solid var(--hairline); text-decoration: none; color: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 55%, transparent), color-mix(in srgb, var(--bg-base) 60%, transparent));
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.xb-a { grid-row: 1 / 3; }
/* a soft light that follows the pointer (xchain.js sets --mx / --my) */
.xb-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.4s var(--ease);
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(0, 204, 255, 0.10), rgba(51, 255, 153, 0.05) 40%, transparent 70%);
}
.xb-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.xb-card:hover::before { opacity: 1; }
.xb-card .rail-name { margin-bottom: 6px; }
.xb-card .rail-fact { margin-top: auto; }
.xb-vis { position: relative; border-radius: 18px; background: color-mix(in srgb, var(--bg-base) 70%, transparent); border: 1px solid var(--hairline); overflow: hidden; }
.xb-a .xb-vis { flex: 1; min-height: 260px; }
.xb-vis svg { display: block; width: 100%; height: 100%; }

/* reveal: the typewriter headline adds .rails-in, cards follow one by one */
[data-rails].rails-ready .xb-card { opacity: 0; transform: translateY(18px); transition: opacity 0.55s var(--ease), transform 0.55s var(--ease), border-color 0.35s var(--ease); }
[data-rails].rails-ready.rails-in .xb-card { opacity: 1; transform: none; }
[data-rails].rails-ready.rails-in .xb-b { transition-delay: 0.14s; }
[data-rails].rails-ready.rails-in .xb-c { transition-delay: 0.26s; }
[data-rails].rails-ready.rails-in .xb-card:hover { transform: translateY(-2px); transition-delay: 0s; }

/* ---- 01 native cross-chain ---- */
.xa-label { font-family: var(--font-display); font-size: 13px; font-weight: 600; fill: var(--text-mid); text-anchor: middle; }
.xa-node { fill: var(--bg-elev-1); stroke: var(--hairline-strong, rgba(255, 255, 255, 0.16)); stroke-width: 1.5; }
.xa-ring { fill: none; stroke: #33FF99; stroke-width: 2; opacity: 0; }
.xa-arc { fill: none; stroke: var(--text-low); stroke-opacity: 0.35; stroke-width: 1.6; stroke-dasharray: 3 7; }
.xa-trail { fill: none; stroke: url(#xa-grad); stroke-width: 3; stroke-linecap: round; }
.xa-coin circle { fill: var(--bg-elev-1); stroke: #33FF99; stroke-width: 2; }
.xa-orbit { fill: none; stroke: var(--hairline); stroke-width: 1; stroke-dasharray: 2 5; }
.xa-dot { fill: var(--text-low); opacity: 0.28; }
.xa-bridge { fill: none; stroke: rgba(242, 107, 86, 0.4); stroke-width: 1.5; stroke-dasharray: 5 6; }
.xa-spark { fill: #33FF99; }
.xa-nobridge rect { fill: var(--bg-elev-1); stroke: rgba(242, 107, 86, 0.45); }
.xa-nobridge text { font-family: var(--font-display); font-size: 12px; font-weight: 600; fill: #F2826E; }
.xa-nobridge path { fill: none; stroke: #F2826E; stroke-width: 1.8; stroke-linecap: round; }
.xa-chip rect { fill: rgba(51, 255, 153, 0.12); stroke: rgba(51, 255, 153, 0.55); }
.xa-chip text { font-family: var(--font-display); font-size: 12.5px; font-weight: 600; fill: #33FF99; text-anchor: middle; }
.xa-sm .xa-label { font-size: 15px; }
.xa-sm .xa-nobridge text { font-size: 13.5px; }
.xa-sm .xa-chip text { font-size: 14px; }
[data-theme="light"] .xa-chip text { fill: #0C9E73; }
[data-theme="light"] .xa-coin circle, [data-theme="light"] .xa-ring { stroke: #0C9E73; }

/* ---- 02 tokens: three rows drifting in turn ---- */
.xb-b .xb-vis { height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 10px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); border: 0; background: none; border-radius: 0; }
.xb-row { display: flex; width: max-content; gap: 10px; animation: xb-drift 92s linear infinite; }
.xb-row.r2 { animation-direction: reverse; animation-duration: 76s; }
.xb-row.r3 { animation-duration: 108s; }
.xb-row img { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: var(--bg-elev-1); box-shadow: 0 0 0 1px var(--hairline); object-fit: cover; }
[data-theme="light"] .xb-row img { box-shadow: 0 0 0 1px rgba(10, 26, 43, 0.14); }
.xb-b:hover .xb-row { animation-play-state: paused; }
@keyframes xb-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- 03 quote race ---- */
.xb-c .xb-vis { padding: 12px 14px 12px; display: grid; gap: 10px; }
.xc-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-low); }
.xc-head b { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0; text-transform: none; color: var(--text-hi); font-weight: 600; }
.xc-row { position: relative; display: grid; grid-template-columns: 22px 88px 1fr 98px; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border-radius: 10px; transition: background-color 0.35s; }
.xc-row img { width: 22px; height: 22px; border-radius: 50%; object-fit: contain; background: #0B1522; }
.xc-row img.pad { padding: 3px; }
.xc-name { font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; color: var(--text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xc-track { position: relative; min-width: 0; }
.xc-bar { display: block; height: 6px; border-radius: 3px; background: var(--hairline); overflow: hidden; }
.xc-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #00CCFF, #33FF99); opacity: 0.55; }
.xc-amt { font-family: var(--font-mono); font-size: 0.74rem; text-align: right; color: var(--text-low); font-variant-numeric: tabular-nums; white-space: nowrap; }
.xc-row.none .xc-name, .xc-row.none img, .xc-row.none .xc-bar { opacity: 0.45; }
.xc-row.best { background: rgba(51, 255, 153, 0.09); }
.xc-row.best .xc-bar i { opacity: 1; }
.xc-row.best .xc-name, .xc-row.best .xc-amt { color: var(--text-hi); }
.xc-tag { position: absolute; left: 0; bottom: 100%; margin-bottom: 3px; white-space: nowrap; padding: 2px 8px; border-radius: 999px; background: #33FF99; color: #06222B; font-family: var(--font-display); font-size: 0.64rem; font-weight: 700; opacity: 0; transform: translateY(4px); transition: opacity 0.3s, transform 0.3s; }
.xc-row.best .xc-tag { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .xb { grid-template-columns: 1fr; margin-top: 34px; gap: 12px; }
  .xb-a { grid-row: auto; }
  .xb-card { padding: 20px 18px 18px; gap: 14px; }
  .xb-a .xb-vis { min-height: 0; aspect-ratio: 520 / 240; flex: none; }
  .xc-row { grid-template-columns: 20px 78px 1fr 94px; gap: 8px; }
}
@media (max-width: 540px) {
  .xb-a .xb-vis { aspect-ratio: 380 / 250; }
  /* the header already names the coin; the unit goes so the bars keep room for the tag */
  .xc-row { grid-template-columns: 18px 80px 1fr 56px; gap: 6px; }
  .xc-amt { font-size: 0.68rem; }
  .xc-name { font-size: 0.76rem; }
  .xc-row img { width: 18px; height: 18px; }
  .xc-unit { display: none; }
  .xc-tag { padding: 2px 6px; font-size: 0.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .xb-row { animation: none; }
  [data-rails].rails-ready .xb-card { opacity: 1; transform: none; }
}
