/* REPLEX landing — small additions on top of the template CSS.
   Only covers pieces the template rendered with its React runtime. */

html { scroll-behavior: smooth; }
section[id], #main section { scroll-margin-top: 96px; }

/* Header navigation: 8 anchor links need more room than the template's 5 */
.rx-nav { display: none; }
@media (min-width: 1200px) {
  .rx-nav { display: flex; }
  .rx-menu-btn { display: none !important; }
}

/* Brand logo (header + footer) */
.rx-logo { display: block; width: auto; max-width: none; }
.rx-logo-header { height: 40px; }
.rx-logo-footer { height: 52px; }
@media (max-width: 480px) { .rx-logo-header { height: 34px; } }
/* white-text logo on dark theme, navy-text logo on light theme */
.rx-logo-on-light { display: none; }
html:not(.dark) .rx-logo-on-dark { display: none; }
html:not(.dark) .rx-logo-on-light { display: block; }
.rx-icon-on-light { display: none; object-fit: contain; }
html:not(.dark) .rx-icon-on-dark { display: none; }
html:not(.dark) .rx-icon-on-light { display: block; }

/* Mobile menu */
.rx-mobile-menu {
  position: fixed; top: 84px; left: 16px; right: 16px; z-index: 49;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px; border-radius: 1rem; border: 1px solid var(--border);
}
.rx-mobile-menu[hidden] { display: none; }
.rx-mobile-menu a {
  padding: 12px 14px; border-radius: .75rem; font-size: .9375rem; font-weight: 500;
  color: var(--muted-foreground);
}
.rx-mobile-menu a:hover { color: var(--foreground); background: color-mix(in oklab, var(--muted-foreground) 10%, transparent); }
.rx-mobile-menu .rx-mobile-cta {
  margin-top: 6px; text-align: center; color: #fff;
  background: linear-gradient(110deg, var(--primary), var(--secondary));
}
.rx-wallet-icons { display: inline-flex; align-items: center; justify-content: center; }
.rx-wallet-icon { display: block; width: 18px; height: 18px; }
.animate-loader-dismiss { pointer-events: none; }
.rx-mobile-menu button.rx-mobile-cta {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: .55rem;
  border: 0; font: inherit; font-weight: 600; cursor: pointer;
}
@media (min-width: 1200px) { .rx-mobile-menu { display: none !important; } }

/* Package price */
.rx-price {
  font-family: var(--font-heading, inherit); font-size: 2.25rem; line-height: 1;
  font-weight: 600; color: var(--foreground); letter-spacing: -0.02em;
}

/* 1 RPX = 1 USDT selling point */
.rx-rate-pill {
  margin-top: 1.75rem; display: inline-flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: center;
  padding: .5rem 1.1rem .5rem .5rem; border-radius: 999px;
  border: 1px solid color-mix(in oklab, #22E1FF 45%, transparent);
  background: linear-gradient(110deg, color-mix(in oklab, #22E1FF 14%, transparent), color-mix(in oklab, #1D5BFF 14%, transparent));
  box-shadow: 0 0 40px -12px #22E1FF;
}
.rx-rate-pill strong { font-family: var(--font-heading, inherit); font-size: 1.125rem; letter-spacing: -.01em; color: var(--foreground); }
.rx-rate-sub { font-size: .8125rem; color: var(--muted-foreground); }
.rx-rate-coin {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px; flex: none;
  font-size: .625rem; font-weight: 700; letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, #22E1FF, #1D5BFF);
}
.rx-rate-inline {
  margin-top: .9rem; display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 600; font-size: 1rem; color: var(--foreground);
}
.rx-rate-inline .rx-rate-coin { width: 1.6rem; height: 1.6rem; font-size: .5rem; }

/* Tier engine artwork */
.rx-engine {
  position: relative; display: flex; align-items: flex-end; justify-content: center;
  height: 200px; margin: -.25rem -.5rem .25rem; overflow: visible;
}
.rx-engine::before {
  content: ""; position: absolute; left: 15%; right: 15%; bottom: 2%; height: 30%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(34,170,255,.35), transparent); filter: blur(10px);
}
.rx-engine img {
  position: relative; display: block; height: 200px !important; width: 100% !important; max-width: 100%; object-fit: contain; object-position: center bottom;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.35));
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.group:hover .rx-engine img { transform: translateY(-6px) scale(1.03); }
.rx-engine-4::before, .rx-engine-5::before, .rx-engine-6::before {
  background: radial-gradient(closest-side, rgba(255,190,60,.28), rgba(34,170,255,.18) 60%, transparent);
}
@media (prefers-reduced-motion: reduce) { .group:hover .rx-engine img { transform: none; } }

/* Package card actions */
.rx-card-actions { margin-top: 1.5rem; display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; position: relative; z-index: 1; }

/* RPX coin: 360° spin → 3s hold with gloss wipe → spin again (seamless loop) */
.rx-coin-wrap { display: grid; place-items: center; padding: 1.5rem 0 1rem; }
.rx-coin-stage { --size: clamp(180px, 22vw, 280px); --cycle: 4.8s; position: relative; width: var(--size); height: var(--size); perspective: 1100px; }
.rx-coin { position: absolute; inset: 0; transform-style: preserve-3d; animation: rx-coin-spin var(--cycle) infinite; }
.rx-coin-face { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.rx-coin-face img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.rx-coin-front { transform: translateZ(8px); }
.rx-coin-back { transform: rotateY(180deg) translateZ(8px); }
/* stacked discs give the coin a metallic rim when seen edge-on */
.rx-coin-edge {
  position: absolute; inset: 1.2%; border-radius: 50%;
  transform: translateZ(var(--z));
  background: radial-gradient(circle, #1d3f8f 0 60%, #9aa7bd 66%, #e9eef6 74%, #7d8aa3 84%, #c9d2e0 94%, #6b778f 100%);
}
/* glossy wipe, clipped to the coin artwork */
.rx-coin-gloss {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 50%;
  -webkit-mask: url(rpx-coin.webp) center / 100% 100% no-repeat; mask: url(rpx-coin.webp) center / 100% 100% no-repeat;
}
.rx-coin-gloss::before {
  content: ""; position: absolute; top: -25%; bottom: -25%; left: 0; width: 55%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12) 30%, rgba(255,255,255,.8) 50%, rgba(255,255,255,.12) 70%, transparent);
  transform: translateX(-130%) skewX(-18deg); opacity: 0; mix-blend-mode: screen;
  animation: rx-coin-gloss var(--cycle) linear infinite;
}
.rx-coin-shadow {
  position: absolute; left: 18%; right: 18%; bottom: -12%; height: 10%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(34,225,255,.35), transparent);
  filter: blur(6px); animation: rx-coin-shadow var(--cycle) infinite;
}
/* 0–37.5% (1.8s): one full turn, eased; 37.5–100% (3s): hold. 360deg == 0deg, so the loop is seamless. */
@keyframes rx-coin-spin {
  0%    { transform: rotateY(0deg); animation-timing-function: cubic-bezier(.65,0,.35,1); }
  37.5% { transform: rotateY(360deg); }
  100%  { transform: rotateY(360deg); }
}
/* gloss sweeps across during the hold */
@keyframes rx-coin-gloss {
  0%, 44%   { transform: translateX(-130%) skewX(-18deg); opacity: 0; }
  47%       { opacity: 1; }
  78%       { transform: translateX(260%) skewX(-18deg); opacity: 1; }
  80%, 100% { transform: translateX(260%) skewX(-18deg); opacity: 0; }
}
@keyframes rx-coin-shadow {
  0%, 37.5%, 100% { transform: scaleX(1); opacity: 1; }
  18.75% { transform: scaleX(.55); opacity: .6; }
}
@media (prefers-reduced-motion: reduce) {
  .rx-coin, .rx-coin-gloss::before, .rx-coin-shadow { animation: none; }
}

/* Notes / small print */
.rx-note { margin-top: 1.5rem; font-size: .8125rem; line-height: 1.6; color: var(--muted-foreground); max-width: 46rem; }
.rx-center { margin-left: auto; margin-right: auto; text-align: center; }

/* Bullet lists */
.rx-list { display: grid; gap: .875rem; margin-top: 2.25rem; }
.rx-list-flush { margin-top: 0; }
.rx-list li { display: flex; align-items: flex-start; gap: .75rem; font-size: .875rem; line-height: 1.55; color: var(--muted-foreground); }
.rx-dot {
  flex: none; width: 8px; height: 8px; margin-top: .45rem; border-radius: 999px;
  background: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}
@media (min-width: 768px) { .rx-list-2 { grid-template-columns: 1fr 1fr; column-gap: 2rem; } }

/* RPX token spec list */
.rx-specs { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.rx-specs > div { padding: .875rem 1rem; }
.rx-specs > div:first-child, .rx-specs > div:last-child { grid-column: 1 / -1; }
.rx-specs > div:first-child { border-color: color-mix(in oklab, #22E1FF 45%, transparent); }
.rx-specs > div:first-child dd { font-size: 1.25rem; }
.rx-specs dt { font-size: .75rem; color: var(--muted-foreground); }
.rx-specs dd { margin-top: .25rem; font-weight: 600; font-size: .9375rem; color: var(--foreground); }

/* Utility mock reply bubble */
.rx-bubble {
  max-width: 85%; padding: .75rem 1rem; border-radius: 1rem; border-top-left-radius: .25rem;
  font-size: .8125rem; line-height: 1.55; color: var(--foreground);
}

/* Security safeguard tiles: caption always visible */
.rx-caption-wrap { transform: none !important; }
.rx-safe-caption { font-size: .8125rem; line-height: 1.4; color: rgba(255,255,255,.95); }
@media (max-width: 480px) { .rx-safe-caption { font-size: .6875rem; } }

/* FAQ accordion panels */
.rx-faq-panel { padding: 0 2rem 1.25rem 0; font-size: .9375rem; line-height: 1.65; color: var(--muted-foreground); }
[data-slot="accordion-trigger"][aria-expanded="true"] svg { transform: rotate(180deg); }
[data-slot="accordion-trigger"] svg { transition: transform .2s ease; }

/* Scroll reveal (replaces the template's Framer Motion entrance) */
.rx-js [data-rx-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.rx-js [data-rx-reveal].rx-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rx-js [data-rx-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Footer risk line ---------- */
.rx-footer-risk { margin-top: 2.5rem; font-size: .8125rem; line-height: 1.6; color: var(--muted-foreground); max-width: 56rem; }
.rx-footer-risk a { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Subpages (project information + legal) ---------- */
.rx-prose { max-width: 50rem; margin: 0 auto; color: var(--muted-foreground); font-size: 1rem; line-height: 1.75; }
.rx-prose h1 { font-family: var(--font-heading, inherit); color: var(--foreground); font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.1; font-weight: 600; letter-spacing: -.02em; margin: .25rem 0 1rem; }
.rx-prose h2 { font-family: var(--font-heading, inherit); color: var(--foreground); font-size: 1.375rem; font-weight: 600; margin: 2.75rem 0 .75rem; scroll-margin-top: 110px; }
.rx-prose p { margin: .85rem 0; }
.rx-prose ul, .rx-prose ol { margin: .85rem 0; padding-left: 1.4rem; }
.rx-prose ul { list-style: disc; } .rx-prose ol { list-style: decimal; }
.rx-prose li { margin: .4rem 0; } .rx-prose li::marker { color: var(--primary); }
.rx-prose strong { color: var(--foreground); }
.rx-prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.rx-prose code { font-size: .875em; }
.rx-eyebrow { font-size: .75rem !important; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--primary) !important; margin: 0 !important; }
.rx-lead { font-size: 1.125rem; color: var(--foreground); opacity: .85; }
.rx-meta { font-size: .8125rem; margin-top: -.25rem !important; }
.rx-draft-banner, .rx-callout {
  margin: 1.5rem 0; padding: 1rem 1.25rem; border-radius: 1rem; font-size: .9375rem; line-height: 1.6;
  border: 1px solid color-mix(in oklab, #f5b740 55%, transparent); background: color-mix(in oklab, #f5b740 10%, transparent);
  color: var(--foreground);
}
.rx-callout { border-color: color-mix(in oklab, #22E1FF 45%, transparent); background: color-mix(in oklab, #22E1FF 8%, transparent); }
.rx-table-wrap { margin: 1rem 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 1rem; }
.rx-prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.rx-prose th, .rx-prose td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rx-prose td:last-child, .rx-prose th:last-child { white-space: normal; }
.rx-prose th { color: var(--foreground); font-weight: 600; background: color-mix(in oklab, var(--muted-foreground) 8%, transparent); }
.rx-prose tr:last-child td { border-bottom: 0; }

/* ---------- Purchase modal ---------- */
.rx-modal-open, .rx-modal-open body { overflow: hidden; }
.rx-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; }
.rx-modal[hidden] { display: none; }
.rx-modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 18, .66); backdrop-filter: blur(6px); }
.rx-modal-panel {
  position: relative; width: min(100%, 30rem); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 1.5rem; border-radius: 1.5rem; border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
.rx-modal-x { position: absolute; top: .75rem; right: .75rem; width: 2.25rem; height: 2.25rem; border-radius: 999px; font-size: 1.4rem; line-height: 1; color: var(--muted-foreground); cursor: pointer; }
.rx-modal-x:hover { color: var(--foreground); background: color-mix(in oklab, var(--muted-foreground) 12%, transparent); }
.rx-modal-head { display: flex; align-items: center; gap: 1rem; padding-right: 2rem; }
.rx-modal-engine { width: 120px; height: 105px; object-fit: contain; flex: none; }
.rx-modal-tier { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-foreground); }
.rx-modal-head h2 { font-family: var(--font-heading, inherit); font-size: 1.5rem; font-weight: 600; margin: .1rem 0 .25rem; }
.rx-modal-price { font-size: .9375rem; color: var(--muted-foreground); }
.rx-modal-price strong { color: var(--foreground); }
.rx-modal-body { margin-top: 1.25rem; font-size: .9375rem; line-height: 1.6; }
.rx-modal-notice { padding: 1rem 1.1rem; border-radius: 1rem; border: 1px solid color-mix(in oklab, #f5b740 55%, transparent); background: color-mix(in oklab, #f5b740 10%, transparent); }
.rx-modal-notice p { margin-top: .4rem; color: var(--muted-foreground); }
.rx-modal-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.rx-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 2.75rem; padding: 0 1.25rem; border-radius: 999px;
  font-size: .9375rem; font-weight: 500; border: 1px solid var(--border); color: var(--foreground); cursor: pointer; transition: transform .2s, opacity .2s;
}
.rx-btn:hover { transform: translateY(-1px); }
.rx-btn-primary { border: 0; color: #fff; background: linear-gradient(110deg, var(--primary), var(--secondary)); box-shadow: 0 8px 32px -8px var(--glow-primary, rgba(91,91,247,.6)); }
.rx-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.rx-steps { display: grid; gap: .5rem; }
.rx-steps li { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .7rem; padding: .6rem .8rem; border-radius: .8rem; border: 1px solid var(--border); }
.rx-steps li small { grid-column: 2; font-size: .75rem; color: var(--muted-foreground); }
.rx-steps li small:empty { display: none; }
.rx-steps a { color: var(--primary); text-decoration: underline; }
.rx-step-dot { width: .7rem; height: .7rem; border-radius: 999px; border: 2px solid var(--muted-foreground); }
.rx-steps li[data-state="active"] { border-color: var(--primary); }
.rx-steps li[data-state="active"] .rx-step-dot { border-color: var(--primary); animation: rx-pulse 1s ease-in-out infinite; }
.rx-steps li[data-state="done"] .rx-step-dot { border-color: #22c55e; background: #22c55e; }
.rx-steps li[data-state="error"] { border-color: #ef4444; }
.rx-steps li[data-state="error"] .rx-step-dot { border-color: #ef4444; background: #ef4444; }
@keyframes rx-pulse { 50% { transform: scale(1.35); } }
.rx-modal-sponsor { margin-top: .9rem; font-size: .8125rem; color: var(--muted-foreground); }
.rx-consent { display: flex; gap: .6rem; align-items: flex-start; margin-top: .9rem; font-size: .8125rem; color: var(--muted-foreground); }
.rx-consent input { margin-top: .2rem; accent-color: var(--primary); }
.rx-consent a { color: var(--foreground); text-decoration: underline; }
.rx-modal-status { margin-top: .9rem; font-size: .875rem; }
.rx-modal-status:empty { display: none; }
.rx-modal-status.is-error { color: #ef4444; }
.rx-modal-status.is-success { color: #22c55e; }
.rx-modal-status a { text-decoration: underline; }
/* package details view */
.rx-detail-list { display: grid; border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; }
.rx-detail-list > div { display: grid; grid-template-columns: 9.5rem 1fr; gap: .75rem; padding: .6rem .9rem; border-top: 1px solid var(--border); font-size: .875rem; }
.rx-detail-list > div:first-child { border-top: 0; }
.rx-detail-list dt { color: var(--muted-foreground); }
.rx-detail-list dd { color: var(--foreground); font-weight: 500; }
.rx-detail-list small { font-weight: 400; color: var(--muted-foreground); }
.rx-detail-h { margin-top: 1.1rem; font-size: .9375rem; font-weight: 600; }
.rx-detail-steps { margin-top: .5rem; padding-left: 1.2rem; list-style: decimal; display: grid; gap: .3rem; font-size: .875rem; color: var(--muted-foreground); }
.rx-detail-note { margin-top: .9rem; font-size: .8125rem; color: var(--muted-foreground); }
.rx-detail-note a { color: var(--foreground); text-decoration: underline; }
@media (max-width: 480px) { .rx-detail-list > div { grid-template-columns: 1fr; gap: .1rem; } }

/* RPX coin icon */
.rpx-ic { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: 3px; border-radius: 50%; filter: drop-shadow(0 0 4px #00e5ff88); }

/* Wallet button: always in the top bar (also on phones); the menu no longer has its own wallet button */
.rx-mobile-menu .rx-mobile-cta { display: none !important; }
@media (max-width: 639px) {
  .rx-top-wallet { height: 36px; padding: 0 14px; font-size: 13px; gap: 6px; }
  .rx-top-wallet .rx-wallet-icon { width: 16px; height: 16px; }
}
@media (max-width: 380px) { .rx-top-wallet .rx-wallet-icons { display: none; } }
