/* Nexus, the first trade as a live app (tools/builder/projects/nexus.py links this; layers cut from Arash's own screens by
   tools/nexus/cut_trade.py; motion in assets/js/nexus.js on GSAP). Every size is in --u, one pixel of his 750-wide screen.
   The portfolio is the root screen: the coin, the keypad, the review and Done stack over it, and Done hands back to it
   with the buy on the line, a Bitcoin row beside Euro and Tesla, and the next suggestion. */

/* the stack: GSAP owns every screen's transform, so the old class transitions are off */
.nx-tr .nx-s { transition: none; will-change: transform; }
.nx-tr .nx-tp { transform: none; z-index: 1; background: #090909; }
.nx-tr .nx-tc, .nx-tr .nx-tv, .nx-tr .nx-tk, .nx-tr .nx-done { visibility: hidden; }   /* without the script only the portfolio shows; GSAP places the rest */
.nx-tr .nx-tc { z-index: 2; } .nx-tr .nx-tk { z-index: 3; } .nx-tr .nx-tv { z-index: 4; } .nx-tr .nx-done { z-index: 5; }
.nx-tr .nx-touch { z-index: 20; }

/* the portfolio: his top, the live balance and line, then the rows and the suggestion in flow, so a new row pushes them down */
.nx-tp-body { position: absolute; left: 0; top: 0; width: 100%; }
.ph .nx-scr .nx-tp-top { display: block; width: 100%; }
.ph .nx-scr .nx-tp-nav { position: absolute; z-index: 3; left: 0; bottom: 0; width: 100%; }
.nx-tp-bal { z-index: 1; }
.nx-tp-chart { position: absolute; left: 0; top: calc(268 * var(--u)); width: 100%; height: calc(190 * var(--u)); overflow: visible; }
.nx-tp-dash { stroke: #222; stroke-width: 2; stroke-dasharray: 21 12; stroke-dashoffset: 11; fill: none; }
.nx-tp-line, .nx-tp-ext { fill: none; stroke: #ECECEC; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.nx-tp-plus path { fill: none; stroke: #BDFDA6; stroke-width: 2.6; stroke-linecap: round; }
.nx-tp-dot circle { fill: #72F08E; }
.nx-tp-dot .nx-tp-halo { fill: #142016; }

.nx-tp-new { height: 0; overflow: hidden; }
.nx-tp-row { position: relative; height: calc(150 * var(--u)); margin: 0 calc(32 * var(--u)) calc(16 * var(--u)); border-radius: calc(28 * var(--u)); background: #191919; }
.ph .nx-scr .nx-tp-row img { position: absolute; left: calc(32 * var(--u)); top: calc(36 * var(--u)); width: calc(76 * var(--u)); }
.nx-tp-row .nx-ui { position: absolute; line-height: 1; }
.nx-tp-name { left: calc(125 * var(--u)); top: calc(59.5 * var(--u)); font-size: calc(var(--a-subhead) * 2 * var(--u)); color: #AAA; }
.nx-tp-val { right: calc(45 * var(--u)); top: calc(38 * var(--u)); font-size: calc(var(--a-body) * 2 * var(--u)); font-weight: 600; color: #ECECEC; letter-spacing: calc(-0.4 * var(--u)); }
.nx-tp-sub { right: calc(44 * var(--u)); top: calc(85.2 * var(--u)); font-size: calc(var(--a-subhead) * 2 * var(--u)); color: #5E5D5D; }

.nx-tp-sug { position: relative; height: calc(700 * var(--u)); }
.ph .nx-scr .nx-tp-sug img { position: absolute; }
.ph .nx-scr .nx-tp-q { left: calc(150 * var(--u)); top: calc(72 * var(--u)); width: calc(460 * var(--u)); }
.nx-tp-crypto, .nx-tp-next { position: absolute; inset: 0; }
.ph .nx-scr .nx-tp-t { left: calc(140 * var(--u)); top: calc(114 * var(--u)); width: calc(470 * var(--u)); }
.ph .nx-scr .nx-tp-c { top: calc(204.5 * var(--u)); width: calc(150 * var(--u)); }
.ph .nx-scr .nx-tp-c[data-c="btc"] { left: calc(134.5 * var(--u)); }
.ph .nx-scr .nx-tp-c[data-c="eth"] { left: calc(298.5 * var(--u)); }
.ph .nx-scr .nx-tp-c[data-c="bnb"] { left: calc(462.5 * var(--u)); }
.nx-tp-nt { position: absolute; left: 0; right: 0; top: calc(117 * var(--u)); text-align: center; line-height: 1; font-size: calc(var(--a-callout) * 2 * var(--u)); font-weight: 500; color: #BDFDA6; letter-spacing: calc(-0.3 * var(--u)); }
.nx-tp-cards { position: absolute; left: calc(32 * var(--u)); right: calc(32 * var(--u)); top: calc(196 * var(--u)); display: grid; grid-template-columns: 1fr 1fr; gap: calc(16 * var(--u)); }
.ph .nx-scr .nx-tp-cards img { position: static; width: 100%; height: auto; }
/* before the first buy the crypto and bundle suggestions wait (no script: the question shows, as his screen) */
.nx-tp-crypto, .nx-tp-next { visibility: hidden; }

/* the coin: the line draws on as the screen arrives */
.nx-tc-wipe { position: absolute; left: calc(64 * var(--u)); top: calc(436 * var(--u)); width: calc(650 * var(--u)); height: calc(440 * var(--u)); background: #191919; transform-origin: 100% 50%; transform: scaleX(0); }
/* review: Trade now holds a spinner for a beat, in his lime and radius */
.nx-tv-btn { position: absolute; left: calc(94 * var(--u)); top: calc(1440 * var(--u)); width: calc(563 * var(--u)); height: calc(102 * var(--u)); border-radius: calc(51 * var(--u)); background: #BDFDA6; display: grid; place-items: center; opacity: 0; }
.nx-tv-btn i { width: calc(40 * var(--u)); height: calc(40 * var(--u)); border-radius: 50%; border: calc(5 * var(--u)) solid rgba(25, 25, 25, 0.22); border-top-color: #191919; animation: nx-spin 0.7s linear infinite; }
@keyframes nx-spin { to { transform: rotate(1turn); } }

/* Done: his coin, a badge whose tick draws, his two lines */
.ph .nx-scr .nx-td-coin { position: absolute; left: calc(284.5 * var(--u)); top: calc(640.5 * var(--u)); width: calc(182 * var(--u)); }
.nx-td-badge { position: absolute; left: calc(410.5 * var(--u)); top: calc(620.5 * var(--u)); width: calc(106 * var(--u)); height: calc(106 * var(--u)); overflow: visible; }
.nx-td-tick { fill: none; stroke: #191919; stroke-width: 6.5; stroke-linecap: round; stroke-linejoin: round; }
.ph .nx-scr .nx-td-amt { position: absolute; left: calc(230 * var(--u)); top: calc(868 * var(--u)); width: calc(290 * var(--u)); }
.ph .nx-scr .nx-td-sub { position: absolute; left: calc(190 * var(--u)); top: calc(958 * var(--u)); width: calc(370 * var(--u)); }
.nx-tr .nx-done .nx-ring { top: calc(731.5 * var(--u)); left: calc(375.5 * var(--u)); }

/* the trade phone a touch larger, so his type reads (the window keeps its measure) */
.nx-proto .nx-dev { width: 312px; margin: 32px 0 28px; }
@media (max-width: 700px) { .nx-proto .nx-dev { width: 78%; } }

/* the Explore tab on GSAP: the screen scrolls, each row is his cards in a strip that swipes, and cards arrive one by one */
.nx-mk .nx-mk-body { transform: none; transition: none; will-change: transform; }
.nx-row-in { display: flex; height: 100%; will-change: transform; }
.nx-row-learn .nx-row-in { gap: calc(44 * var(--u)); }
.nx-row-gain .nx-row-in { gap: calc(32 * var(--u)); padding-left: calc(48 * var(--u)); }
.nx-row-bund .nx-row-in { gap: calc(32 * var(--u)); }
.ph .nx-row .nx-row-in img { flex: none; width: auto; height: 100%; transform: none; transition: none; }
.nx-mk .nx-pf { transition: none; }   /* off to the right until the wallet is tapped (GSAP takes over its transform) */
.nx-mk .nx-chart, .nx-mk .nx-chart.wipe, .nx-mk .nx-chart.draw { transition: none; }
