/* Social Nexa — polish layer: layout fixes, smooth motion, small UX features.
   Loaded after nexa.css. Everything stays visible without JS; motion respects reduced-motion. */

/* ---------- layout fixes ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
.nav a { white-space: nowrap; }
/* Track card was as wide as the outer container — line it up with the other sections */
.wrap.track-wrap { width: calc(100% - 40px); max-width: 1160px; margin-inline: auto; box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 18px 50px -32px rgba(60,30,120,.25); }
/* Automatic Likes sat flush against the section above */
#automatic-likes { padding-top: 46px; padding-bottom: 6px; }
#automatic-likes + #track { padding-top: 40px; }
.support-strip { margin-top: 0; }
.faq-wrap > div:first-child { position: sticky; top: 96px; align-self: start; }
@media (max-width: 860px) {
  .faq-wrap > div:first-child { position: static; }
  .wrap.track-wrap { width: calc(100% - 32px); padding: 22px; }
  #automatic-likes { padding-top: 34px; }
}

/* ---------- scroll progress ---------- */
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none;
  background: linear-gradient(90deg, var(--blue), #c58bff 55%, #fd6250); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- active nav link (scrollspy) ---------- */
.nav a { position: relative; }
.nav a.is-active { color: var(--blue-ink, var(--blue)); }
.nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: currentColor; transform: scaleX(0); transition: transform .25s ease; }
.nav a.is-active::after { transform: scaleX(1); }
.mobile-dock a.is-active { color: var(--blue); }

/* ---------- back to top ---------- */
.to-top { position: fixed; left: 18px; bottom: 22px; z-index: 45; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--outline);
  background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--fg); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.35); opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: opacity .25s, transform .25s; backdrop-filter: blur(8px); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--blue); color: var(--blue); }
.to-top:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 860px) { .to-top { bottom: 84px; left: 14px; width: 40px; height: 40px; } }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* reveal on scroll — only when polish.js is running (html.nx-motion) */
  .nx-motion [data-rv] { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--motion-ease, ease), transform .6s var(--motion-ease, ease); transition-delay: var(--rv-d, 0ms); }
  .nx-motion [data-rv].rv-in { opacity: 1; transform: none; }

  /* gentle lift on cards */
  .preview-plan, .value-grid > article, .steps > li, .platform-shortcut, .section-choice, .faq details, .customer-guide, .route-card {
    transition: transform .28s var(--motion-ease, ease), box-shadow .28s var(--motion-ease, ease), border-color .2s;
  }
  @media (hover: hover) {
    .preview-plan:hover, .value-grid > article:hover, .steps > li:hover, .section-choice:hover, .customer-guide:hover {
      transform: translateY(-4px); box-shadow: 0 22px 40px -26px rgba(60, 30, 120, .45); border-color: color-mix(in srgb, var(--blue) 35%, var(--outline));
    }
    .platform-shortcut:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -22px rgba(60, 30, 120, .5); }
    .route-card:hover { transform: translateY(-4px) rotate(-.25deg); }
    .btn { transition: transform .2s var(--motion-ease, ease), box-shadow .2s, background .2s, color .2s; }
    .btn:active { transform: scale(.97); }
  }

  /* hero: soft floating glow behind the route cards */
  .hero { position: relative; overflow-x: clip; }
  .hero::before { content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; right: -120px; top: -160px; border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 22%, transparent), transparent); filter: blur(10px); animation: nx-float 9s ease-in-out infinite alternate; }
  @keyframes nx-float { to { transform: translate(-40px, 50px) scale(1.08); } }

  /* FAQ answers slide open */
  .faq details[open] > :not(summary) { animation: nx-open .32s var(--motion-ease, ease) both; }
  @keyframes nx-open { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

  /* WhatsApp CTA attention ring (support strip) */
  .support-strip a { position: relative; }
  .support-strip a::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid currentColor; opacity: 0; animation: nx-ring 2.8s ease-out 1.5s infinite; pointer-events: none; }
  @keyframes nx-ring { 0% { opacity: .45; transform: scale(.96); } 70%, 100% { opacity: 0; transform: scale(1.12); } }
}

/* Dark mode: old theme put a white plate behind .brand (for the old PNG logo). The new Nexa mark doesn't need it. */
:root[data-theme="dark"] .brand.nexa-brand { background: transparent; padding: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand.nexa-brand { background: transparent; padding: 0; } }
.footer .nexa-brand, .footer .brand { background: transparent; padding: 0; }
