/* Social Nexa — FX layer: aurora, spotlight cards, glass header, magnetic buttons, decode text.
   Pure enhancement: without fx.js (or with reduced motion) the site looks and works the same. */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: nx-vt-out .28s ease both; }
::view-transition-new(root) { animation: nx-vt-in .38s cubic-bezier(.2,.8,.2,1) both; }
@keyframes nx-vt-out { to { opacity: 0; filter: blur(6px); transform: scale(.985); } }
@keyframes nx-vt-in { from { opacity: 0; filter: blur(6px); transform: scale(1.015); } }

/* glass header once the page scrolls */
.topbar, .bar { transition: background .3s, box-shadow .3s, backdrop-filter .3s; }
.nx-scrolled.topbar, .nx-scrolled.bar, .nx-scrolled.sp-head {
  background: color-mix(in srgb, var(--surface, var(--pearl, #fff)) 74%, transparent) !important;
  backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 10px 30px -22px rgba(40, 10, 90, .55);
}

/* selection + focus feel */
::selection { background: color-mix(in srgb, var(--blue, #7a2bc4) 30%, transparent); }

/* aurora (fixed, behind everything) */
.nx-aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; opacity: .5; }
.nx-aurora i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .5; will-change: transform; }
.nx-aurora i:nth-child(1) { background: #7a2bc4; top: -18vmax; left: -12vmax; animation: nx-drift1 26s ease-in-out infinite alternate; }
.nx-aurora i:nth-child(2) { background: #fd6250; bottom: -22vmax; right: -14vmax; opacity: .32; animation: nx-drift2 32s ease-in-out infinite alternate; }
.nx-aurora i:nth-child(3) { background: #3c7bff; top: 30%; left: 45%; width: 30vmax; height: 30vmax; opacity: .22; animation: nx-drift3 22s ease-in-out infinite alternate; }
@keyframes nx-drift1 { to { transform: translate(18vmax, 12vmax) scale(1.15); } }
@keyframes nx-drift2 { to { transform: translate(-16vmax, -10vmax) scale(1.2); } }
@keyframes nx-drift3 { to { transform: translate(-22vmax, 14vmax) scale(.85); } }
:root[data-theme="light"] .nx-aurora { opacity: .22; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .nx-aurora { opacity: .22; } }

/* cursor aura */
.nx-cursor { position: fixed; left: 0; top: 0; width: 420px; height: 420px; margin: -210px 0 0 -210px; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(closest-side, color-mix(in srgb, #9b5cff 16%, transparent), transparent); opacity: 0; transition: opacity .4s; will-change: transform; }
.nx-cursor.on { opacity: 1; }

/* spotlight + animated gradient border on cards */
@property --nx-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.nx-card { position: relative; isolation: isolate; transform-style: preserve-3d; }
.nx-card > .nx-glow { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; transition: opacity .35s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, #9b5cff 20%, transparent), transparent 55%); }
.nx-card > .nx-glow::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--nx-a), #7a2bc4, #3c7bff, #fd6250, #c58bff, #7a2bc4);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: nx-spin 4s linear infinite; }
@keyframes nx-spin { to { --nx-a: 360deg; } }
.nx-card:hover > .nx-glow, .nx-card:focus-within > .nx-glow { opacity: 1; }
.nx-tilting { transition: transform .12s ease-out !important; }

/* ripple */
.nx-ripple-host { position: relative; overflow: hidden; }
.nx-ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .25; transform: scale(0); animation: nx-ripple .6s ease-out forwards; }
@keyframes nx-ripple { to { transform: scale(1); opacity: 0; } }

/* hero headline: flowing gradient on the highlight */
@media (prefers-reduced-motion: no-preference) {
  .hero h1 .hl, .intro h1 {
    background: linear-gradient(100deg, var(--blue, #7a2bc4) 0%, #c58bff 30%, #fd6250 55%, var(--blue, #7a2bc4) 80%) 0 0 / 220% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: nx-flow 7s linear infinite;
  }
  @keyframes nx-flow { to { background-position: -220% 0; } }
  /* eyebrow labels get a scan line */
  .eyebrow, .section-kicker, .quick-label { position: relative; }
  .nx-motion .nx-scan { clip-path: inset(0); }
  .nx-motion .nx-scan::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 55%, transparent), transparent); transform: translateX(-100%); animation: nx-scan 1.1s ease .2s forwards; pointer-events: none; mix-blend-mode: overlay; }
  @keyframes nx-scan { to { transform: translateX(100%); } }

  /* subscriptions store: reveal like the home page */
  .nx-motion .store-page [data-rv] { opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .55s cubic-bezier(.2,.8,.2,1), transform .55s cubic-bezier(.2,.8,.2,1); transition-delay: var(--rv-d, 0ms); }
  .nx-motion .store-page [data-rv].rv-in { opacity: 1; transform: none; }
  .store-page .plan, .store-page .quick-tile, .store-page .category-grid > * { transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s, border-color .2s; }
  @media (hover: hover) {
    .store-page .plan:hover, .store-page .quick-tile:hover { box-shadow: 0 24px 46px -28px rgba(60, 30, 120, .6); }
    .store-page .category-grid > *:hover { transform: translateY(-3px); }
  }
}

/* never animate for people who asked for calm */
@media (prefers-reduced-motion: reduce) {
  .nx-aurora, .nx-cursor, .nx-glow { display: none !important; }
  @view-transition { navigation: none; }
}
@media print { .nx-aurora, .nx-cursor, .scroll-progress, .to-top { display: none !important; } }
