/* =============================================================
 * KAYNOT — Modernization Layer (Electric Blue 2025)
 * Override-safe: not overwritten by theme updates.
 * Loads AFTER pro.css → wins on equal specificity.
 * Tokens use !important to beat the inline #theme-styles block.
 * ============================================================= */

/* ------------------------------------------------------------
 * 1. DESIGN TOKENS
 * ---------------------------------------------------------- */
:root {
  /* Electric blue accent (punchier than the old #44789b) */
  --cl-accent: #3b82f6 !important;
  --cl-accent-rgb: 59, 130, 246 !important;
  --accent-bright: #60a5fa;
  --accent-deep: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.45);

  /* Deeper, subtly blue-tinted backgrounds (kills the flat pure-black) */
  --cl-background-primary: #08080c !important;
  --cl-background-primary-rgb: 8, 8, 12 !important;
  --cl-background-secondary: #0f1118 !important;
  --cl-background-secondary-rgb: 15, 17, 24 !important;

  /* Crisper, visible borders */
  --cl-border: rgba(255, 255, 255, 0.09) !important;

  /* Surface + elevation system */
  --surface-1: rgba(255, 255, 255, 0.022);
  --surface-2: rgba(255, 255, 255, 0.04);
  --border-soft: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(96, 165, 250, 0.45);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 10px 34px rgba(59, 130, 246, 0.28);

  --radius: 14px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------------------------------------------------------
 * 2. GLOBAL POLISH — background ambiance + typography rendering
 * ---------------------------------------------------------- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: #08080c;
  background-image: none !important; /* remove the site-wide grid pattern → pure ambient look */
}

/* Layered radial glows behind everything for depth */
body::before {
  content: "";
  position: fixed;
  inset: -15%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(45% 40% at 18% 12%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(40% 38% at 85% 22%, rgba(37, 99, 235, 0.13), transparent 58%),
    radial-gradient(50% 45% at 60% 88%, rgba(59, 130, 246, 0.10), transparent 60%);
  background-repeat: no-repeat;
  will-change: transform;
  animation: ambient-drift 34s ease-in-out infinite alternate;
}
@keyframes ambient-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(2%, 1.6%, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* Hero grid removed too, for a consistent pattern-free ambient look
   (hero keeps its aurora + central glow + corner brackets) */
.nexus-grid { display: none !important; }

/* Tighter, more confident headings */
h1, h2, h3, .section-title h1, .section-title h2 {
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* Section titles: bigger + gradient shine */
.section-title h1,
.section-title h2 {
  font-size: clamp(28px, 4vw, 40px);
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.72) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

::selection {
  background: rgba(59, 130, 246, 0.35);
  color: #fff;
}

/* Modern thin scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, 0.5) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.4);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(96, 165, 250, 0.6); background-clip: padding-box; }

/* ------------------------------------------------------------
 * 3. BUTTONS — gradient + glow, smooth press
 * ---------------------------------------------------------- */
.btn {
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
              background 0.18s var(--ease), border-color 0.18s var(--ease) !important;
  font-weight: 600 !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-deep)) !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.28) !important;
  color: #fff !important;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.45) !important;
  filter: brightness(1.06);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
  border: 1.5px solid rgba(96, 165, 250, 0.55) !important;
  color: var(--accent-bright) !important;
  background: rgba(59, 130, 246, 0.06) !important;
}
.btn-outline-primary:hover {
  background: rgba(59, 130, 246, 0.16) !important;
  border-color: var(--accent-bright) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* ------------------------------------------------------------
 * 4. CARDS & SURFACES — depth, gradient, hover lift + glow
 * ---------------------------------------------------------- */
.card,
.bg-gray,
.list-group {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1)) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md);
}

/* Product cards: the commerce centerpiece */
.product-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)) !important;
  border: 1px solid var(--border-soft) !important;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease) !important;
}
.product-card:hover {
  transform: translateY(-6px) !important;
  border-color: var(--border-hover) !important;
  box-shadow: var(--shadow-lg), var(--shadow-glow) !important;
}

/* Buy Now CTA inside product cards → gradient + glow */
.product-card .cta {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-deep)) !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25) !important;
  letter-spacing: 0.01em;
}
.product-card:hover .cta {
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.5) !important;
  filter: brightness(1.05);
}

.product-card .price { color: var(--accent-bright) !important; }
.product-image .image-placeholder { color: var(--accent-bright) !important; }

/* ------------------------------------------------------------
 * 5. STOCK / BADGES — glassy pills
 * ---------------------------------------------------------- */
.stock-in {
  background: var(--badge-color, linear-gradient(135deg, var(--accent-bright), var(--accent-deep))) !important;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
  font-weight: 600 !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ------------------------------------------------------------
 * 6. NAVBAR — refined glass on scroll
 * ---------------------------------------------------------- */
.navbar-glass {
  background: rgba(10, 11, 16, 0.72) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35) !important;
}

/* ------------------------------------------------------------
 * 7. FORMS — modern inputs + focus ring
 * ---------------------------------------------------------- */
.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: 10px !important;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease) !important;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--accent-bright) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

/* ------------------------------------------------------------
 * 8. FOOTER — subtle top separation
 * ---------------------------------------------------------- */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.03));
}
.footer .nav li a { transition: color 0.18s var(--ease); }

/* ------------------------------------------------------------
 * 9. LINKS
 * ---------------------------------------------------------- */
a { transition: color 0.18s var(--ease); }

/* ------------------------------------------------------------
 * 10. ANNOUNCEMENT BAR — darker bg so white text passes WCAG AA
 *     (was white-on-#3b82f6 ≈ 3.9:1, fails; now ≈ 6:1+)
 * ---------------------------------------------------------- */
.announcement {
  background: linear-gradient(90deg, #1e40af, #2563eb) !important;
  color: #eff6ff !important;
  border-bottom: 1px solid rgba(96, 165, 250, 0.30) !important;
  font-weight: 500;
}
.announcement a { color: #ffffff !important; text-decoration: underline; }

/* ------------------------------------------------------------
 * 11. MOTION — scroll reveal (sections fade + slide up on enter)
 *     Only applied to below-the-fold sections via JS (hero excluded),
 *     so there's no flash and no LCP hit. No-JS → everything visible.
 * ---------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
[data-reveal].revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ------------------------------------------------------------
 * 12. SPOTLIGHT — cursor-following blue glow on cards
 *     'screen' blend = only adds light, keeps text crisp.
 * ---------------------------------------------------------- */
.spotlight { position: relative; isolation: isolate; }
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
              rgba(96, 165, 250, 0.20), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  mix-blend-mode: screen;
  z-index: 2;
}
.spotlight:hover::after { opacity: 1; }

/* ------------------------------------------------------------
 * 13. DISPLAY TYPOGRAPHY — punchy geometric font on big titles only
 * ---------------------------------------------------------- */
:root { --font-display: 'Space Grotesk', 'Rubik', sans-serif; }
h1, h2,
.section-title h1, .section-title h2,
.hero-title, .nexus-title, .hero-color,
.discord-cta-title, .payment-cta-title,
.social-proof h2, .about-text h2 {
  font-family: var(--font-display) !important;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------
 * 14. SHINE SWEEP — a light reflection crosses primary CTAs on hover
 * ---------------------------------------------------------- */
.btn-primary,
.product-card .cta,
.discord-btn,
.join-btn,
.nexus-cta-wrapper .nexus-btn-glass:first-child {
  position: relative;
  overflow: hidden;
}
.btn-primary::before,
.product-card .cta::before,
.discord-btn::before,
.join-btn::before,
.nexus-cta-wrapper .nexus-btn-glass:first-child::before {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.40), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.btn-primary:hover::before,
.product-card:hover .cta::before,
.discord-btn:hover::before,
.join-btn:hover::before,
.nexus-cta-wrapper .nexus-btn-glass:first-child:hover::before {
  left: 130%;
}

/* ------------------------------------------------------------
 * 15. REAL sales notifications (native SellAuth, product pages only) —
 *     premium glassy blue styling + slide-in. Data = liveStats.latestOrders,
 *     filtered to purchases within the last hour (see product-page.njk).
 * ---------------------------------------------------------- */
.notification-content {
  background: linear-gradient(180deg, rgba(20, 24, 34, 0.94), rgba(12, 15, 22, 0.94)) !important;
  border: 1px solid rgba(96, 165, 250, 0.30) !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(59, 130, 246, 0.15) !important;
  backdrop-filter: blur(12px);
  padding: 0.5rem !important;
  animation: notif-in 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.notification-image {
  border-radius: 10px !important;
  border: 1px solid rgba(96, 165, 250, 0.25);
}
.notification-text-secondary {
  background: linear-gradient(120deg, #93c5fd, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.notification-text-tertiary { color: rgba(96, 165, 250, 0.85) !important; opacity: 1 !important; }
@keyframes notif-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
 * 16. FILM GRAIN — subtle noise overlay, kills the flat-digital look
 * ---------------------------------------------------------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  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'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ------------------------------------------------------------
 * 17. ANIMATED GRADIENT BORDER — rotating conic edge on product cards (hover)
 * ---------------------------------------------------------- */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--angle), transparent 0deg, #60a5fa 60deg, #2563eb 150deg, transparent 230deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 3;
}
.product-card:hover::before {
  opacity: 1;
  animation: rotate-border 4s linear infinite;
}
@keyframes rotate-border {
  to { --angle: 360deg; }
}
@media (prefers-reduced-motion: reduce) {
  .product-card:hover::before { animation: none; }
  body::after { display: none; }
}