/* ==========================================================================
   RANKRUSH — Custom theme layer
   Loaded after built.css / style.css. Only touches presentation: every
   class here is either a new `rr-*` hook added in the .njk components, or
   an override of an existing `sa-*` / utility hook that already ships with
   Canvas. No SellAuth functionality, markup structure, or Nunjucks
   variable is altered from this file.
   ========================================================================== */

/* --------------------------------------------------------------------
   0. Base atmosphere — grain, vignette, selection, scrollbar
   -------------------------------------------------------------------- */

body {
  position: relative;
}

/* Fixed film-grain layer over the whole page. Pure CSS (SVG turbulence
   data-uri), no image request, sits above the page-fx glows but below
   all interactive content and never intercepts clicks. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[data-scheme="light"] body::before {
  opacity: 0.025;
}

::selection {
  background: rgba(var(--cl-accent), 0.32);
  color: rgb(var(--cl-t-primary));
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: rgb(var(--cl-background));
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--cl-accent), 0.35);
  border-radius: 9999px;
  border: 2px solid rgb(var(--cl-background));
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--cl-accent), 0.55);
}
html {
  scrollbar-color: rgba(var(--cl-accent), 0.35) rgb(var(--cl-background));
}

/* --------------------------------------------------------------------
   1. Typography — tighter, heavier headings; glowing highlight spans
   -------------------------------------------------------------------- */

h1, h2, h3, .sa-hero-title, .section-title {
  letter-spacing: -0.02em;
}

.sa-hero-title {
  letter-spacing: -0.03em;
  line-height: 1.04;
}

/* Give the *highlighted* portion of headings (rendered as .mk spans by
   the `markup` filter) a soft red glow instead of a flat color swap. */
.hl-accent .mk {
  text-shadow: 0 0 34px rgba(var(--cl-accent), 0.55), 0 0 6px rgba(var(--cl-accent), 0.35);
}

.sa-hero-eyebrow {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------
   2. Buttons — solid red glow + shine, glass secondary
   -------------------------------------------------------------------- */

.btn-primary,
[class*="btn-solid"][class*="accent"],
a.btn.bg-accent-500,
button.btn.bg-accent-500 {
  position: relative;
  background-image: linear-gradient(155deg, rgba(255, 255, 255, 0.16), transparent 40%),
    linear-gradient(135deg, rgb(var(--cl-accent)) 0%, rgba(var(--cl-accent), 0.82) 100%);
  box-shadow: 0 10px 30px -10px rgba(var(--cl-accent), 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform var(--dur) ease, box-shadow var(--dur) ease, filter var(--dur) ease;
}

.btn-primary:hover,
[class*="btn-solid"][class*="accent"]:hover,
a.btn.bg-accent-500:hover,
button.btn.bg-accent-500:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -10px rgba(var(--cl-accent), 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  filter: brightness(1.04);
}

.btn-secondary,
[class*="btn-outline"] {
  backdrop-filter: blur(6px);
  transition: box-shadow var(--dur) ease, transform var(--dur) ease, border-color var(--dur) ease;
}

.btn-secondary:hover,
[class*="btn-outline"]:hover {
  box-shadow: 0 0 0 1px rgba(var(--cl-accent), 0.4), 0 12px 30px -14px rgba(var(--cl-accent), 0.5);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------
   3. Navbar — floating glass pill, scroll-shrink, active glow
   -------------------------------------------------------------------- */

.rr-nav-pill-wrap {
  transition: padding-top var(--dur) ease;
}

.rr-nav-pill {
  transition: box-shadow var(--dur) ease, background-color var(--dur) ease, border-color var(--dur) ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 45px -25px rgba(0, 0, 0, 0.7);
}

.rr-nav-scrolled .rr-nav-pill-wrap {
  padding-top: 0.4rem;
}

.rr-nav-scrolled .rr-nav-pill {
  background-color: rgba(var(--cl-background), 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 50px -20px rgba(var(--cl-accent), 0.16), 0 20px 45px -25px rgba(0, 0, 0, 0.8);
  border-color: rgba(var(--cl-accent), 0.22);
}

.rr-nav-scrolled .rr-nav-pill .h-14 {
  height: 3rem;
}

.sa-navbar-link {
  position: relative;
}

.sa-navbar-link--active {
  box-shadow: inset 0 0 0 1px rgba(var(--cl-accent), 0.28), 0 0 18px -4px rgba(var(--cl-accent), 0.45);
}

.sa-navbar-link--active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 9999px;
  background: rgb(var(--cl-accent));
  box-shadow: 0 0 10px rgba(var(--cl-accent), 0.9);
}

.rr-brand-icon {
  display: inline-flex;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(var(--cl-accent), 0.25), 0 0 18px -4px rgba(var(--cl-accent), 0.65);
}

/* --------------------------------------------------------------------
   4. Hero — cinematic split visual: glow, light rays, particles, mask
   -------------------------------------------------------------------- */

.hero-bg-glow {
  width: 60rem;
  height: 42rem;
  margin-left: -30rem;
  background: radial-gradient(circle, rgba(var(--cl-accent), 0.34), transparent 68%);
  filter: blur(110px);
}

.rr-hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.rr-hero-visual-glow {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--cl-accent), 0.32), rgba(var(--cl-accent), 0.08) 45%, transparent 70%);
  filter: blur(50px);
  animation: rr-pulse 7s ease-in-out infinite;
}

.rr-hero-visual-rays {
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(var(--cl-accent), 0.08) 0deg 4deg,
    transparent 4deg 18deg
  );
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 62%);
  animation: rr-spin 60s linear infinite;
  opacity: 0.55;
}

.rr-hero-visual-media {
  position: relative;
  z-index: 1;
  animation: rr-float 6.5s ease-in-out infinite;
}

.rr-hero-visual-image {
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 48%, transparent 88%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 48%, transparent 88%);
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 60px rgba(var(--cl-accent), 0.25));
}

.rr-hero-crest {
  width: 100%;
  max-width: 420px;
  height: auto;
  filter: drop-shadow(0 20px 55px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 70px rgba(var(--cl-accent), 0.35));
}

.rr-hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rr-hero-particles span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: rgb(var(--cl-accent));
  box-shadow: 0 0 8px 2px rgba(var(--cl-accent), 0.8);
  opacity: 0.7;
  animation: rr-drift 9s ease-in-out infinite;
}

.rr-hero-particles span:nth-child(1) { top: 12%; left: 18%; animation-delay: 0s; }
.rr-hero-particles span:nth-child(2) { top: 28%; left: 82%; animation-delay: -1.4s; width: 3px; height: 3px; }
.rr-hero-particles span:nth-child(3) { top: 62%; left: 8%;  animation-delay: -3.2s; }
.rr-hero-particles span:nth-child(4) { top: 78%; left: 70%; animation-delay: -5s; width: 5px; height: 5px; }
.rr-hero-particles span:nth-child(5) { top: 45%; left: 50%; animation-delay: -2.1s; width: 3px; height: 3px; }
.rr-hero-particles span:nth-child(6) { top: 8%;  left: 55%; animation-delay: -6.4s; }

@keyframes rr-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

@keyframes rr-pulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes rr-spin {
  to { transform: rotate(360deg); }
}

@keyframes rr-drift {
  0%, 100% { transform: translate(0, 0); opacity: 0.4; }
  50% { transform: translate(10px, -18px); opacity: 0.9; }
}

/* --------------------------------------------------------------------
   5. Categories — cinematic large game cards
   -------------------------------------------------------------------- */

.rr-cat-card {
  aspect-ratio: 3 / 4;
  background-color: rgb(var(--cl-surface));
  transition: transform var(--dur) ease, border-color var(--dur) ease, box-shadow var(--dur) ease;
}

.rr-cat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--cl-accent), 0.5);
  box-shadow: 0 30px 60px -24px rgba(var(--cl-accent), 0.4), 0 20px 40px -20px rgba(0, 0, 0, 0.6);
}

.rr-cat-card-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 0.8s ease;
}

.rr-cat-card:hover .rr-cat-card-media {
  transform: scale(1.12);
}

.rr-cat-card-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(var(--cl-accent), 0.28), transparent 60%),
    linear-gradient(160deg, rgb(var(--cl-surface-raised)), rgb(var(--cl-background)));
}

.rr-cat-card-fallback::before {
  content: '';
  position: absolute;
  inset: -20%;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(var(--cl-accent), 0.06) 0px,
    rgba(var(--cl-accent), 0.06) 1px,
    transparent 1px,
    transparent 14px
  );
}

.rr-cat-card-fallback::after {
  content: '';
  position: absolute;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(var(--cl-accent), 0.4);
  border-radius: 9999px;
}

.rr-cat-card-fallback-glyph {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading, inherit);
  font-weight: 700;
  font-size: 3.4rem;
  letter-spacing: -0.02em;
  color: rgba(var(--cl-accent), 0.9);
  text-shadow: 0 0 40px rgba(var(--cl-accent), 0.55);
}

.rr-cat-card-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(6, 4, 6, 0.35) 55%, rgba(4, 2, 3, 0.94) 100%),
    linear-gradient(0deg, rgba(var(--cl-accent), 0.16), transparent 40%);
  transition: background var(--dur) ease;
}

.rr-cat-card:hover .rr-cat-card-overlay {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(10, 3, 5, 0.4) 50%, rgba(10, 2, 4, 0.96) 100%),
    linear-gradient(0deg, rgba(var(--cl-accent), 0.32), transparent 45%);
}

.rr-cat-card-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.9s ease;
}

.rr-cat-card:hover .rr-cat-card-sheen {
  transform: translateX(120%);
}

.rr-cat-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem;
  color: #fff;
}

.rr-cat-card-title {
  font-family: var(--font-heading, inherit);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.rr-cat-card-desc {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.85rem;
}

.rr-cat-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--cl-accent));
  transition: gap var(--dur) ease;
}

.rr-cat-card:hover .rr-cat-card-cta {
  gap: 0.65rem;
}

.rr-cat-card-arrow {
  width: 15px;
  height: 15px;
}

/* --------------------------------------------------------------------
   6. Product cards — glass surface, ambient glow, crisper stock dot
   -------------------------------------------------------------------- */

.sa-product-card {
  transition: transform var(--dur) ease, border-color var(--dur) ease, box-shadow var(--dur) ease;
}

a.sa-product-card:hover,
.sa-product-card.hfx-lift:hover {
  box-shadow: 0 30px 60px -28px rgba(var(--cl-accent), 0.35), 0 18px 34px -22px rgba(0, 0, 0, 0.6);
}

.sa-product-card-media {
  position: relative;
  overflow: hidden;
}

.sa-product-card-media img {
  transition: transform 0.7s ease;
}

.sa-product-card:hover .sa-product-card-media img {
  transform: scale(1.08);
}

.sa-product-card-stock .text-success,
.sa-product-card-stock [class*="text-success"] {
  position: relative;
  padding-left: 0.95rem;
}

.sa-product-card-stock .text-success::before,
.sa-product-card-stock [class*="text-success"]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: currentColor;
  transform: translateY(-50%);
  box-shadow: 0 0 6px currentColor;
}

/* --------------------------------------------------------------------
   7. Features / trust cards — icon glow ring
   -------------------------------------------------------------------- */

.sa-features [class*="rounded-input"][class*="bg-accent"],
.sa-features .bg-accent-500\/10 {
  box-shadow: 0 0 0 1px rgba(var(--cl-accent), 0.18), 0 0 24px -6px rgba(var(--cl-accent), 0.5);
}

/* --------------------------------------------------------------------
   8. Stats cards — glass surface, glowing numerals
   -------------------------------------------------------------------- */

.sa-stats [class*="text-3xl"],
.sa-stats [class*="text-4xl"],
.sa-stats .font-heading {
  text-shadow: 0 0 30px rgba(var(--cl-accent), 0.28);
}

/* --------------------------------------------------------------------
   9. Steps — connector line + icon ring polish
   -------------------------------------------------------------------- */

.sa-steps [class*="rounded-full"][class*="border-accent"],
.sa-steps [class*="bg-accent-500\/10"] {
  box-shadow: 0 0 20px -4px rgba(var(--cl-accent), 0.45);
}

/* --------------------------------------------------------------------
   10. FAQ — hover border glow
   -------------------------------------------------------------------- */

.sa-faq details,
.sa-faq [class*="border-theme"] {
  transition: border-color var(--dur) ease, box-shadow var(--dur) ease;
}

.sa-faq details:hover,
.sa-faq details[open] {
  border-color: rgba(var(--cl-accent), 0.35);
}

/* --------------------------------------------------------------------
   11. Footer — hairline top glow, social hover
   -------------------------------------------------------------------- */

.sa-footer {
  position: relative;
}

.sa-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--cl-accent), 0.5), transparent);
}

.sa-footer a[class*="rounded-full"]:hover,
.sa-footer .social-link:hover {
  color: rgb(var(--cl-accent));
  box-shadow: 0 0 16px -2px rgba(var(--cl-accent), 0.6);
}

/* --------------------------------------------------------------------
   12. Motion safety
   -------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .rr-hero-visual-glow,
  .rr-hero-visual-rays,
  .rr-hero-visual-media,
  .rr-hero-particles span,
  .hero-bg-glow,
  .pfx-glows::before,
  .pfx-glows-corners::after {
    animation: none !important;
  }

  .rr-cat-card,
  .rr-cat-card-media,
  .rr-cat-card-sheen,
  .btn-primary,
  .sa-product-card,
  .sa-product-card-media img {
    transition: none !important;
  }
}

/* --------------------------------------------------------------------
   13. Overflow / responsive safety net
   -------------------------------------------------------------------- */

html, body {
  overflow-x: hidden;
}

@media (max-width: 640px) {
  .rr-hero-visual {
    min-height: 220px;
  }

  .rr-cat-card {
    aspect-ratio: 4 / 3;
  }

  .rr-cat-card-fallback-glyph {
    font-size: 3rem;
  }
}
