/* rbxnexus.net — v5 large-scale premium */

:root {
  --bg:        #080809;
  --bg-1:      #0d0d10;
  --bg-2:      #131318;
  --border:    rgba(255,255,255,.11);
  --border-h:  rgba(255,255,255,.3);
  --ink:       #f5f5f7;
  --ink-2:     #a3a3ad;
  --ink-3:     #4e4e5a;
  --mono:      "JetBrains Mono", ui-monospace, monospace;
  --sans:      "Onest", -apple-system, "Segoe UI", sans-serif;
  --ease:      cubic-bezier(.16,1,.3,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar { display: none; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── Ambient layers ── */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 60% at 12% -10%, rgba(255,255,255,.06) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 8%,   rgba(255,255,255,.04) 0%, transparent 52%),
    radial-gradient(ellipse 60% 45% at 55% 108%,  rgba(255,255,255,.025) 0%, transparent 50%);
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .28;
  background-image: radial-gradient(circle, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 88% 70% at 50% 22%, #000 5%, transparent 70%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .042;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noise-drift 10s steps(6) infinite;
}

@keyframes noise-drift {
  0%,100% { transform: translate(0,0); }
  17%  { transform: translate(-2%,1.2%); }
  34%  { transform: translate(1.5%,-1.8%); }
  51%  { transform: translate(2.2%,.8%); }
  68%  { transform: translate(-.8%,2%); }
  85%  { transform: translate(1%,-1%); }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,transparent,transparent 3px,
    rgba(255,255,255,.011) 3px,rgba(255,255,255,.011) 4px
  );
  mask-image: linear-gradient(to bottom, #000 0%, transparent 38%);
}

.spotlight {
  position: fixed;
  top: -220px; left: -220px;
  width: 440px; height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 68%);
  pointer-events: none;
  z-index: 1;
  will-change: transform;
}

/* ── Layout ── */

.wrap {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(18px,5vw,56px);
}

/* ── Nav ── */

#nav {
  position: sticky;
  top: 16px;
  z-index: 100;
}

@media (prefers-reduced-motion: no-preference) {
  #nav {
    opacity: 0;
    transform: translateY(-14px) scale(.98);
    animation: nav-in .65s var(--ease) .05s forwards;
  }
}
@keyframes nav-in { to { opacity: 1; transform: none; } }

.nav-inner {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(9,9,10,.86);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  transition: border-color .3s;
}
.nav-inner:hover { border-color: var(--border-h); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.025em;
}
.brand img { width: 28px; height: 28px; border-radius: 8px; }

.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-menu a {
  font-size: 13px;
  color: var(--ink-2);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 13px;
  transition: color .2s, border-color .2s, background .2s;
}
.nav-menu a:hover {
  color: var(--ink);
  border-color: var(--border);
  background: rgba(255,255,255,.04);
}

/* ── Hero ── */

.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: clamp(48px,9vw,96px) clamp(18px,5vw,56px);
  max-width: 1240px;
  margin: 0 auto;
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 60px; padding-bottom: 48px; }
}

/* hero left */
.hero-left {}

.hero-headline {
  font-family: var(--sans);
  font-weight: 900;
  line-height: .88;
  letter-spacing: -.055em;
  overflow: hidden;
  margin-bottom: 22px;
}

.hero-headline .line {
  display: block;
  font-size: clamp(52px,9.5vw,108px);
}

.hero-sub {
  font-size: clamp(16px,1.6vw,19px);
  color: var(--ink-2);
  line-height: 1.68;
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-headline .line {
    opacity: 0;
    transform: translateY(110%);
    animation: line-up .9s var(--ease) both;
  }
  .hero-headline .line:nth-child(1) { animation-delay: .14s; }
  .hero-headline .line:nth-child(2) { animation-delay: .24s; }
  .hero-headline .line:nth-child(3) { animation-delay: .34s; }

  .hero-sub {
    opacity: 0;
    transform: translateY(14px);
    animation: fade-up .7s var(--ease) .48s both;
  }
  .hero-actions {
    opacity: 0;
    transform: translateY(12px);
    animation: fade-up .6s var(--ease) .64s both;
  }
  .hero-right {
    opacity: 0;
    transform: translateY(28px);
    animation: fade-up .85s var(--ease) .38s both;
  }
}

@keyframes line-up { to { opacity: 1; transform: translateY(0); } }
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  border-radius: 13px;
  border: 1px solid var(--border-h);
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s, filter .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: transparent;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(255,255,255,.2);
  filter: brightness(1.06);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--border-h);
  background: rgba(255,255,255,.04);
  transform: translateY(-2px);
}

/* ── Orbit ── */

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.orbit {
  position: relative;
  width: min(420px,82vw);
  height: min(420px,82vw);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
}
.orbit-ring--b {
  inset: 13%;
  border-style: dashed;
  border-color: rgba(255,255,255,.1);
}
.orbit-ring--c {
  inset: 27%;
  border-color: rgba(255,255,255,.08);
}

@media (prefers-reduced-motion: no-preference) {
  .orbit-ring--a { animation: spin 58s linear infinite; }
  .orbit-ring--b { animation: spin 36s linear infinite reverse; }
  .orbit-ring--c { animation: spin 23s linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }

.orbit-dot {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-2);
  top: 50%; left: 50%;
  margin: -3px 0 0 -3px;
}
@media (prefers-reduced-motion: no-preference) {
  .orbit-dot--a {
    transform: translateY(calc(-1 * min(210px,41vw)));
    animation: spin 58s linear infinite;
    transform-origin: 3px 3px;
  }
  .orbit-dot--b {
    transform: translateY(calc(-1 * min(148px,29vw)));
    background: rgba(255,255,255,.32);
    animation: spin 36s linear infinite reverse;
    transform-origin: 3px 3px;
  }
}

.orbit-mark {
  position: relative;
  z-index: 2;
  width: 104px; height: 104px;
  border-radius: 26px;
  filter: drop-shadow(0 0 36px rgba(255,255,255,.13));
}
@media (prefers-reduced-motion: no-preference) {
  .orbit-mark { animation: float 6s ease-in-out infinite; }
}
@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-16px) scale(1.03); }
}

.hero-tags {
  list-style: none;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-tags li {
  padding: 5px 11px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--border);
  border-radius: 7px;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-tags li {
    opacity: 0;
    transform: translateY(8px);
    animation: fade-up .5s var(--ease) both;
  }
  .hero-tags li:nth-child(1) { animation-delay: .92s; }
  .hero-tags li:nth-child(2) { animation-delay: 1.06s; }
  .hero-tags li:nth-child(3) { animation-delay: 1.2s; }
}

/* ── Stats strip ── */

.stats-wrap {
  position: relative;
  z-index: 2;
  padding: 0 clamp(18px,5vw,56px);
}

.stats-bar {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-1);
  padding: 28px clamp(24px,4vw,52px);
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 100px;
  text-align: center;
}

.stat strong {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(24px,3.5vw,38px);
  letter-spacing: -.04em;
  line-height: 1;
}

.stat span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.stat-sep {
  width: 1px;
  height: 44px;
  background: var(--border);
  flex-shrink: 0;
  align-self: center;
  margin: 0 clamp(12px,2vw,28px);
}

@media (max-width: 640px) {
  .stats-bar { gap: 20px; padding: 24px; }
  .stat-sep { display: none; }
}

/* ── Marquee ── */

.marquee-wrap {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 52px;
  padding: 14px 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  width: max-content;
}

@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marquee 28s linear infinite; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

.marquee-track span {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--ink-3);
  padding: 0 22px;
  text-transform: uppercase;
}

.marquee-track .msep {
  color: var(--border-h);
  padding: 0;
  font-size: 16px;
  font-weight: 400;
}

/* ── Divider ── */

.hr {
  border: none;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

/* ── Section ── */

.section {
  padding: clamp(64px,10vw,112px) 0;
  position: relative;
  z-index: 2;
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(36px,6vw,72px);
  letter-spacing: -.046em;
  line-height: .96;
}

.section-sub {
  color: var(--ink-2);
  margin-top: 12px;
  font-size: 17px;
  line-height: 1.65;
}

.section-head { margin-bottom: 44px; }

/* ── Bento ── */

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 860px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .bento { grid-template-columns: 1fr; } }

/* ── Tool cards ── */

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  min-height: 270px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  transition: transform .5s var(--ease), border-color .35s, box-shadow .5s;
}

/* top shimmer */
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  opacity: .6;
  transition: opacity .3s;
}

/* cursor radial */
.tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    520px circle at var(--mx,50%) var(--my,50%),
    rgba(255,255,255,.055), transparent 44%
  );
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
  border-radius: inherit;
}

.tool-card:hover {
  border-color: var(--border-h);
  box-shadow: 0 28px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.07);
}

/* JS handles transform when fine pointer; CSS fallback for touch */
@media (hover: none) {
  .tool-card:hover { transform: translateY(-4px); }
}
.tool-card:hover::before { opacity: 1; }
.tool-card:hover::after  { opacity: 1; }

/* featured card */
.tool-card--featured {
  grid-column: span 2;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(255,255,255,.04) 0%, transparent 60%),
    var(--bg-1);
}
@media (max-width: 860px) { .tool-card--featured { grid-column: span 2; } }
@media (max-width: 520px) { .tool-card--featured { grid-column: span 1; } }

.card-feat-body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.card-feat-body .card-icon { flex-shrink: 0; }
.card-feat-body .card-title { font-size: 24px; margin-bottom: 8px; }
.card-feat-body .card-desc  { font-size: 15px; }

.tool-card--featured .btn { align-self: flex-start; }

/* card inner */
.card-num {
  position: absolute;
  top: 18px; right: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .04em;
}

.card-icon {
  width: 50px; height: 50px;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: color .3s, border-color .3s, transform .5s var(--ease);
  flex-shrink: 0;
}
.tool-card:hover .card-icon {
  color: var(--ink);
  border-color: var(--border-h);
  transform: rotate(-8deg) scale(1.1);
}
.card-icon svg {
  width: 24px; height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-title {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.028em;
  line-height: 1.12;
}

.card-desc {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.64;
  flex: 1;
}

.tool-card .btn {
  margin-top: auto;
  font-size: 13px;
  padding: 10px 18px;
}

/* ── Reveal ── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .72s var(--ease), transform .72s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

.tool-card.reveal.in:nth-child(1) { transition-delay: 0s; }
.tool-card.reveal.in:nth-child(2) { transition-delay: .08s; }
.tool-card.reveal.in:nth-child(3) { transition-delay: .16s; }
.tool-card.reveal.in:nth-child(4) { transition-delay: .24s; }
.tool-card.reveal.in:nth-child(5) { transition-delay: .32s; }

/* ── Install steps (horizontal) ── */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

.step-h {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-1);
  padding: 28px 24px;
  transition: border-color .3s, transform .4s var(--ease), box-shadow .4s;
  opacity: 0;
  transform: translateY(22px);
}

.step-h.in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .65s var(--ease), transform .65s var(--ease), border-color .3s, box-shadow .4s;
}

.step-h:nth-child(1).in { transition-delay: 0s; }
.step-h:nth-child(2).in { transition-delay: .09s; }
.step-h:nth-child(3).in { transition-delay: .18s; }
.step-h:nth-child(4).in { transition-delay: .27s; }

.step-h:hover {
  border-color: var(--border-h);
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}

.step-n {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--ink-3);
  margin-bottom: 22px;
}

.step-t {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.62;
}

.step-t code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
}

.step-t strong {
  color: var(--ink);
  font-weight: 700;
}

/* ── Footer ── */

footer {
  position: relative;
  z-index: 2;
  padding: clamp(22px,4vw,36px) 0 clamp(32px,5vw,52px);
}

.foot-inner {
  display: flex;
  align-items: center;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
}
.foot-brand img { width: 18px; height: 18px; opacity: .5; }

/* ── Download button states ── */

.btn[data-state='loading'] {
  pointer-events: none;
  opacity: .75;
  position: relative;
  overflow: hidden;
}

.btn[data-state='loading']::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: btn-shimmer .9s ease-in-out infinite;
}

@keyframes btn-shimmer {
  to { transform: translateX(100%); }
}

.btn[data-state='done'] {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.4) !important;
  color: var(--ink) !important;
  animation: btn-pop .35s var(--ease);
}

@keyframes btn-pop {
  0%   { transform: scale(.94); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.btn[data-state='err'] {
  border-color: rgba(255,80,80,.5) !important;
  animation: btn-shake .4s var(--ease);
}

@keyframes btn-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  40%     { transform: translateX(6px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .reveal                         { opacity: 1; transform: none; transition: none; }
  .tool-card                      { transition: border-color .2s; }
  .tool-card:hover                { transform: none; }
  .step-h:hover                   { transform: none; }
  .spotlight                      { display: none; }
  .noise                          { animation: none; }
  .orbit-ring--a,
  .orbit-ring--b,
  .orbit-ring--c                  { animation: none; }
  .orbit-mark                     { animation: none; }
  .marquee-track                  { animation: none; }
  .hero-tags li                   { opacity: 1; transform: none; animation: none; }
}
