/* Home hero story: visit → lead → auto-reply → booked → revenue (assets/js/nx-hero.js), 2026-10-13.
 * Loads after nx.css and reuses its browser frame (.nx-browser / .nx-sk-*). Everything here is an
 * illustration and is labelled as one; motion is driven by class toggles so reduced-motion can
 * show the finished state with no animation at all. */

.nx-pipe .nx-browser { top: 44px; }
.nx-pipe .nx-book { padding: 5px 11px; font-size: .62rem; transition: transform .15s ease, background .25s ease, color .25s ease; }
.nx-pipe .nx-book.is-press { transform: scale(.9); }
.nx-pipe .nx-book.is-sent { background: #3ee3a1; color: #050609; }
.nx-pipe .nx-sk-h { transition: opacity .25s ease, transform .25s ease; }
.nx-pipe .nx-sk-hero.is-swap .nx-sk-h { opacity: 0; transform: translateY(6px); }
.nx-pipe .nx-sk-img { transition: background .6s ease; }
.nx-pipe .nx-sk-img { background: radial-gradient(120% 90% at 20% 10%, var(--sc-a, rgba(169,141,255,.55)), transparent 60%), radial-gradient(90% 90% at 90% 80%, var(--sc-b, rgba(86,224,255,.35)), transparent 60%), #161a26; }

/* Progress rail along the top of the stage. */
.nx-rail { position: absolute; z-index: 3; top: 0; left: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nx-rail li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; border: 1px solid var(--nx-line); background: rgba(12,13,20,.82); font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); transition: color .3s ease, border-color .3s ease, background .3s ease; }
.nx-rail li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.18); transition: background .3s ease, box-shadow .3s ease; }
.nx-rail li.is-on { color: var(--text); border-color: rgba(169,141,255,.45); background: rgba(130,87,255,.14); }
.nx-rail li.is-on::before { background: var(--purple-light); box-shadow: 0 0 0 3px rgba(130,87,255,.25); }
.nx-rail li.is-done::before { background: #3ee3a1; }
.nx-rail .nx-rail-note { padding-left: 10px; color: rgba(146,154,170,.75); font-weight: 600; letter-spacing: .04em; text-transform: none; font-size: .66rem; }
.nx-rail .nx-rail-note::before { display: none; }

/* Where the visitor came from. */
.nx-src { position: absolute; z-index: 4; left: 0; top: 300px; display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px 8px 8px; border-radius: 12px; border: 1px solid var(--border-hover); background: linear-gradient(180deg, rgba(22,20,36,.97), rgba(12,13,20,.98)); box-shadow: 0 24px 50px -20px rgba(0,0,0,.85); font-size: .78rem; line-height: 1.2; color: var(--text); opacity: 0; transform: translateX(-14px); transition: opacity .4s ease, transform .5s var(--nx-ease); }
.nx-src.is-on { opacity: 1; transform: none; }
.nx-src-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.07); font-weight: 800; font-size: .72rem; letter-spacing: -.02em; }
.nx-src b { display: block; font-weight: 700; }
.nx-src small { display: block; margin-top: 2px; font-size: .68rem; color: var(--muted); }

/* The visitor's cursor: moved by setting --cx/--cy, the transition does the travel. */
.nx-cur { position: absolute; z-index: 7; left: 0; top: 0; width: 22px; height: 22px; opacity: 0; transform: translate3d(var(--cx, 0px), var(--cy, 0px), 0); transition: transform 1.1s cubic-bezier(.3,.7,.2,1), opacity .3s ease; pointer-events: none; }
.nx-cur.is-on { opacity: 1; }
.nx-cur svg { width: 22px; height: 22px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.6)); }
.nx-cur path { fill: #fff; stroke: #050609; stroke-width: 1.3; stroke-linejoin: round; }
.nx-cur i { position: absolute; left: -12px; top: -12px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(169,141,255,.9); opacity: 0; transform: scale(.3); }
.nx-cur.is-press i { animation: nx-ring .6s ease-out forwards; }
@keyframes nx-ring { from { opacity: .9; transform: scale(.3); } to { opacity: 0; transform: scale(1.3); } }

/* The lead lands in the CRM and the autoresponder answers. */
.nx-plead { position: absolute; z-index: 5; left: 0; bottom: 0; width: min(340px, 60%); padding: 14px; border-radius: 18px; border: 1px solid var(--border-hover); background: linear-gradient(180deg, rgba(22,20,36,.94), rgba(12,13,20,.97)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 40px 90px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(130,87,255,.08); opacity: 0; transform: translateY(calc(18px - 40px * var(--hp, 0))); transition: opacity .45s ease, transform .6s var(--nx-ease); }
.nx-plead.is-on { opacity: 1; transform: translateY(calc(-40px * var(--hp, 0))); }
.nx-plead-head { display: flex; align-items: center; gap: 10px; }
.nx-plead-head > div { flex: 1; min-width: 0; }
.nx-plead-av { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(130,87,255,.18); color: var(--purple-light); font-weight: 800; font-size: .76rem; }
.nx-plead-head b { display: block; font-size: .9rem; color: var(--text); }
.nx-plead-head small { display: block; font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-plead-head em { flex: none; font-style: normal; padding: 3px 8px; border-radius: 999px; background: rgba(130,87,255,.16); color: var(--purple-light); font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.nx-thread { display: grid; gap: 8px; margin-top: 12px; }
.nx-msg { max-width: 92%; padding: 9px 11px; border-radius: 12px; font-size: .8rem; line-height: 1.4; color: var(--text); opacity: 0; transform: translateY(8px); transition: opacity .35s ease, transform .45s var(--nx-ease); }
.nx-msg p { margin: 0; }
.nx-msg.is-on { opacity: 1; transform: none; }
.nx-msg.is-auto { border-bottom-left-radius: 4px; background: rgba(130,87,255,.16); border: 1px solid rgba(169,141,255,.25); }
.nx-msg.is-them { justify-self: end; border-bottom-right-radius: 4px; background: rgba(255,255,255,.07); }
.nx-msg-tag { display: block; margin-bottom: 3px; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--purple-light); }
.nx-typing { display: none; gap: 4px; padding: 4px 0 2px; }
.nx-typing i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.55); animation: nx-dot 1s ease-in-out infinite; }
.nx-typing i:nth-child(2) { animation-delay: .15s; }
.nx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes nx-dot { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.nx-msg.is-typing .nx-typing { display: inline-flex; }
.nx-msg.is-typing p { display: none; }
.nx-booked { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: 10px; background: rgba(62,227,161,.12); border: 1px solid rgba(62,227,161,.3); color: #3ee3a1; font-size: .8rem; font-weight: 700; opacity: 0; transform: scale(.96); transition: opacity .35s ease, transform .4s var(--nx-ease); }
.nx-booked.is-on { opacity: 1; transform: none; }
.nx-booked svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Revenue panel: the number ticks up and a new bar grows on each booking. */
.nx-rev { position: absolute; z-index: 4; right: 0; bottom: 0; width: min(212px, 38%); padding: 14px; border-radius: 16px; border: 1px solid var(--border-hover); background: linear-gradient(180deg, rgba(16,15,26,.97), rgba(12,13,20,.98)); box-shadow: 0 30px 70px -30px rgba(0,0,0,.85); }
.nx-rev-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .66rem; line-height: 1.2; color: var(--muted); }
.nx-rev-head em { flex: none; font-style: normal; font-size: .58rem; border: 1px solid var(--nx-line); border-radius: 999px; padding: 1px 6px; }
.nx-rev-n { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 0; font-family: "Manrope", Inter, sans-serif; font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; }
.nx-rev-n small { font-family: Inter, sans-serif; font-size: .7rem; font-weight: 700; color: #3ee3a1; opacity: 0; transform: translateY(4px); transition: opacity .3s ease, transform .3s ease; }
.nx-rev.is-bump .nx-rev-n small { opacity: 1; transform: none; }
.nx-rev-bars { display: flex; align-items: flex-end; gap: 4px; height: 38px; margin-top: 10px; }
.nx-rev-bars i { flex: 1; height: var(--h, 10%); border-radius: 3px 3px 0 0; background: rgba(169,141,255,.32); transition: height .8s var(--nx-ease); }
.nx-rev-bars i:last-child { background: var(--purple-light); }

@media (prefers-reduced-motion: reduce) {
  .nx-pipe .nx-book, .nx-pipe .nx-sk-h, .nx-src, .nx-cur, .nx-plead, .nx-msg, .nx-booked, .nx-rev-n small, .nx-rev-bars i, .nx-rail li, .nx-rail li::before { transition: none; }
  .nx-typing i, .nx-cur.is-press i { animation: none; }
  .nx-plead, .nx-plead.is-on { transform: none; }
}

/* Phone: the collage becomes a short stack. The browser keeps only its nav and headline. */
@media (max-width: 720px) {
  /* Phone: a short stack. Every piece keeps its slot at all times (cards fade in place), so the page never
     shifts while the story loops. The lead inbox shows a quiet waiting line until a lead arrives. */
  .nx-pipe { min-height: 0; display: grid; gap: 12px; }
  .nx-pipe .nx-rail { display: none; }
  .nx-pipe .nx-src { position: relative; order: -1; top: auto; left: auto; justify-self: start; min-height: 46px; opacity: 0; transform: translateY(6px); }
  .nx-pipe .nx-src.is-on { opacity: 1; transform: none; }
  .nx-pipe .nx-browser { display: block; position: relative; top: auto; width: 100%; transform: none; }
  .nx-pipe .nx-browser-body { padding: 14px 16px 18px; gap: 12px; }
  .nx-pipe .nx-sk-p, .nx-pipe .nx-sk-img, .nx-pipe .nx-sk-cards { display: none; }
  .nx-pipe .nx-sk-h { font-size: 1.15rem; }
  .nx-pipe .nx-plead { position: relative; bottom: auto; width: 100%; height: 290px; overflow: hidden; opacity: 1; transform: none; transition: border-color .3s ease; }
  .nx-pipe .nx-plead:not(.is-on) { border-color: var(--nx-line); box-shadow: none; }
  .nx-pipe .nx-plead::before { content: "Lead inbox · waiting for the next inquiry…"; position: absolute; inset: 0; display: grid; place-items: center; padding: 0 20px; text-align: center; font-size: .82rem; color: var(--muted); opacity: 1; transition: opacity .3s ease; }
  .nx-pipe .nx-plead.is-on::before { opacity: 0; }
  .nx-pipe .nx-plead > * { opacity: 0; transition: opacity .35s ease .1s; }
  .nx-pipe .nx-plead.is-on > * { opacity: 1; }
  .nx-pipe .nx-rev { position: relative; right: auto; bottom: auto; width: 100%; display: grid; grid-template-columns: 1fr 120px; column-gap: 14px; align-items: center; }
  .nx-pipe .nx-rev-head { grid-column: 1; }
  .nx-pipe .nx-rev-n { grid-column: 1; margin-top: 4px; }
  .nx-pipe .nx-rev-bars { grid-column: 2; grid-row: 1 / 3; height: 34px; margin: 0; }
}
