/*
Theme Name: Nexsist
Theme URI: https://nexsist.ai
Author: Nexsist
Author URI: https://nexsist.ai
Description: Nexsist — a premium, futuristic custom WordPress theme for AI agencies. Dark, cinematic UI with Three.js, GSAP, Lenis smooth scroll, glassmorphism and full Customizer control. Built to WordPress coding standards, PHP 8+, SEO & Core Web Vitals optimized.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nexsist
Tags: dark, one-column, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles, wide-blocks, footer-widgets
*/

/* ==========================================================================
   NEXSIST — DESIGN SYSTEM (tokens, reset, base, utilities)
   Component & layout styles live in assets/css/main.css
   ========================================================================== */

/* ----------------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------------- */
:root {
  /* Core palette (overridable via Customizer -> inline style) */
  --nx-bg: #050816;
  --nx-surface: #0E1323;
  --nx-card: #141B2D;
  --nx-primary: #6D5DFB;
  --nx-secondary: #8B5CF6;
  --nx-accent: #00D9FF;
  --nx-text: #FFFFFF;
  --nx-muted: #AAB4CC;

  /* Derived / support colors */
  --nx-border: rgba(255, 255, 255, 0.08);
  --nx-border-strong: rgba(255, 255, 255, 0.16);
  --nx-glass: rgba(20, 27, 45, 0.55);
  --nx-glass-strong: rgba(14, 19, 35, 0.72);
  --nx-overlay: rgba(5, 8, 22, 0.72);

  /* Gradients */
  --nx-gradient-primary: linear-gradient(135deg, var(--nx-primary) 0%, var(--nx-secondary) 100%);
  --nx-gradient-glow: linear-gradient(135deg, var(--nx-primary), var(--nx-accent));
  --nx-gradient-text: linear-gradient(120deg, #ffffff 0%, #c9c3ff 40%, var(--nx-accent) 100%);
  --nx-gradient-mesh:
      radial-gradient(60% 60% at 15% 20%, rgba(109, 93, 251, 0.28) 0%, transparent 60%),
      radial-gradient(50% 50% at 85% 15%, rgba(0, 217, 255, 0.20) 0%, transparent 60%),
      radial-gradient(60% 60% at 75% 85%, rgba(139, 92, 246, 0.22) 0%, transparent 60%);

  /* Typography */
  --nx-font-heading: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --nx-font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --nx-fs-hero: clamp(2.75rem, 6vw + 1rem, 6rem);
  --nx-fs-h1: clamp(2.25rem, 4vw + 1rem, 4rem);
  --nx-fs-h2: clamp(1.9rem, 2.5vw + 1rem, 3rem);
  --nx-fs-h3: clamp(1.4rem, 1.5vw + 0.8rem, 2rem);
  --nx-fs-h4: clamp(1.15rem, 1vw + 0.7rem, 1.5rem);
  --nx-fs-body: clamp(1rem, 0.4vw + 0.9rem, 1.125rem);
  --nx-fs-small: 0.875rem;
  --nx-fs-eyebrow: 0.8125rem;

  --nx-lh-tight: 1.05;
  --nx-lh-snug: 1.25;
  --nx-lh-normal: 1.6;

  /* Spacing scale */
  --nx-space-1: 0.25rem;
  --nx-space-2: 0.5rem;
  --nx-space-3: 0.75rem;
  --nx-space-4: 1rem;
  --nx-space-5: 1.5rem;
  --nx-space-6: 2rem;
  --nx-space-7: 3rem;
  --nx-space-8: 4rem;
  --nx-space-9: 6rem;
  --nx-space-10: 8rem;

  /* Layout */
  --nx-container: 1240px;
  --nx-container-wide: 1440px;
  --nx-container-narrow: 820px;
  --nx-gutter: clamp(1.25rem, 4vw, 3rem);
  --nx-section-y: clamp(4rem, 8vw, 8rem);

  /* Radii */
  --nx-radius-sm: 10px;
  --nx-radius: 16px;
  --nx-radius-lg: 24px;
  --nx-radius-xl: 32px;
  --nx-radius-pill: 999px;

  /* Shadows */
  --nx-shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.35);
  --nx-shadow-card: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --nx-shadow-glow: 0 0 0 1px rgba(109, 93, 251, 0.4), 0 20px 60px -15px rgba(109, 93, 251, 0.55);
  --nx-shadow-accent: 0 10px 40px -10px rgba(0, 217, 255, 0.45);

  /* Motion */
  --nx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nx-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --nx-dur-fast: 0.2s;
  --nx-dur: 0.45s;
  --nx-dur-slow: 0.8s;

  --nx-header-h: 76px;
  --nx-z-cursor: 9999;
  --nx-z-header: 900;
  --nx-z-menu: 950;
  --nx-z-progress: 960;
}

/* ----------------------------------------------------------------
   2. RESET
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--nx-font-body);
  font-size: var(--nx-fs-body);
  line-height: var(--nx-lh-normal);
  color: var(--nx-text);
  background-color: var(--nx-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

a { color: inherit; text-decoration: none; transition: color var(--nx-dur-fast) var(--nx-ease); }
a:hover { color: var(--nx-accent); }

:focus-visible {
  outline: 2px solid var(--nx-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(109, 93, 251, 0.55); color: #fff; }

/* ----------------------------------------------------------------
   3. BASE TYPOGRAPHY
   ---------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--nx-font-heading);
  font-weight: 600;
  line-height: var(--nx-lh-snug);
  letter-spacing: -0.02em;
  color: var(--nx-text);
}
h1 { font-size: var(--nx-fs-h1); line-height: var(--nx-lh-tight); }
h2 { font-size: var(--nx-fs-h2); }
h3 { font-size: var(--nx-fs-h3); }
h4 { font-size: var(--nx-fs-h4); }

p { color: var(--nx-muted); }
strong { color: var(--nx-text); font-weight: 700; }
small { font-size: var(--nx-fs-small); }

.nx-gradient-text {
  background: var(--nx-gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ----------------------------------------------------------------
   4. LAYOUT PRIMITIVES
   ---------------------------------------------------------------- */
.nx-container {
  width: 100%;
  max-width: var(--nx-container);
  margin-inline: auto;
  padding-inline: var(--nx-gutter);
}
.nx-container--wide { max-width: var(--nx-container-wide); }
.nx-container--narrow { max-width: var(--nx-container-narrow); }

.nx-section { padding-block: var(--nx-section-y); position: relative; }
.nx-section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.nx-grid { display: grid; gap: var(--nx-space-6); }
.nx-grid--2 { grid-template-columns: repeat(2, 1fr); }
.nx-grid--3 { grid-template-columns: repeat(3, 1fr); }
.nx-grid--4 { grid-template-columns: repeat(4, 1fr); }
.nx-flex { display: flex; }
.nx-flex--center { align-items: center; justify-content: center; }
.nx-flex--between { align-items: center; justify-content: space-between; }
.nx-flex--wrap { flex-wrap: wrap; }

/* ----------------------------------------------------------------
   5. SECTION HEADINGS / EYEBROW
   ---------------------------------------------------------------- */
.nx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--nx-space-2);
  font-family: var(--nx-font-heading);
  font-size: var(--nx-fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nx-accent);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-pill);
  background: rgba(0, 217, 255, 0.06);
}
.nx-eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--nx-accent);
  box-shadow: 0 0 12px var(--nx-accent);
}

.nx-section-head { max-width: 720px; margin-bottom: var(--nx-space-8); }
.nx-section-head--center { margin-inline: auto; text-align: center; }
.nx-section-head h2 { margin-top: var(--nx-space-4); font-size: var(--nx-fs-h2); }
.nx-section-head p { margin-top: var(--nx-space-4); font-size: var(--nx-fs-body); }

/* ----------------------------------------------------------------
   6. BUTTONS
   ---------------------------------------------------------------- */
.nx-btn {
  --_bg: var(--nx-gradient-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nx-space-2);
  font-family: var(--nx-font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 0.62rem 1.25rem;
  border-radius: var(--nx-radius-pill);
  color: #fff;
  background: var(--_bg);
  position: relative;
  isolation: isolate;
  transition: transform var(--nx-dur) var(--nx-ease), box-shadow var(--nx-dur) var(--nx-ease), background var(--nx-dur) var(--nx-ease);
  will-change: transform;
}
.nx-btn::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: var(--nx-shadow-glow);
  opacity: 0;
  transition: opacity var(--nx-dur) var(--nx-ease);
  z-index: -1;
}
.nx-btn:hover { color: #fff; transform: translateY(-2px); }
.nx-btn:hover::after { opacity: 1; }
.nx-btn:active { transform: translateY(0); }

.nx-btn--ghost {
  --_bg: transparent;
  border: 1px solid var(--nx-border-strong);
  backdrop-filter: blur(8px);
}
.nx-btn--ghost:hover { border-color: var(--nx-accent); background: rgba(0, 217, 255, 0.08); }

.nx-btn--sm { padding: 0.48rem 1rem; font-size: 0.82rem; }
.nx-btn--lg { padding: 0.78rem 1.5rem; font-size: 0.95rem; }
.nx-btn--block { display: flex; width: 100%; }

.nx-btn__icon { width: 0.9em; height: 0.9em; flex: none; display: inline-flex; align-items: center; justify-content: center; transition: transform var(--nx-dur) var(--nx-ease); }
.nx-btn__icon svg { width: 100%; height: 100%; display: block; }
/* Safety net: any inline icon SVG without an explicit size stays 1em, never the 300x150 SVG default. */
.nx-btn svg, .nx-learn svg, .nx-swiper-btn svg { width: 1em; height: 1em; display: block; }
.nx-btn:hover .nx-btn__icon { transform: translateX(3px); }

/* Magnetic wrapper hook (JS enhanced) */
.nx-magnetic { display: inline-block; will-change: transform; }

/* ----------------------------------------------------------------
   7. CARDS / GLASS
   ---------------------------------------------------------------- */
.nx-card {
  background: var(--nx-card);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-6);
  position: relative;
  overflow: hidden;
  transition: transform var(--nx-dur) var(--nx-ease), border-color var(--nx-dur) var(--nx-ease), box-shadow var(--nx-dur) var(--nx-ease);
}
.nx-card--lift:hover { transform: translateY(-6px); border-color: var(--nx-border-strong); box-shadow: var(--nx-shadow-card); }

.nx-glass {
  background: var(--nx-glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--nx-border);
}

/* Animated glow border on hover */
.nx-glow-border { position: relative; }
.nx-glow-border::before {
  content: "";
  position: absolute; inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--nx-gradient-glow);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--nx-dur) var(--nx-ease);
  pointer-events: none;
}
.nx-glow-border:hover::before { opacity: 1; }

/* ----------------------------------------------------------------
   8. UTILITIES
   ---------------------------------------------------------------- */
.nx-mesh-bg { position: absolute; inset: 0; background: var(--nx-gradient-mesh); pointer-events: none; z-index: 0; }
.nx-noise { position: absolute; inset: 0; opacity: 0.04; pointer-events: none; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.nx-relative { position: relative; z-index: 2; }
.nx-text-center { text-align: center; }
.nx-muted { color: var(--nx-muted); }
.nx-divider { height: 1px; background: var(--nx-border); border: 0; margin: 0; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: var(--nx-primary); color: #fff;
  padding: 0.75rem 1.25rem; border-radius: 0 0 var(--nx-radius) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Reveal animation base (GSAP will override; CSS fallback for no-JS) */
.nx-reveal { opacity: 0; transform: translateY(24px); }
.no-js .nx-reveal, .nx-reveal.is-in { opacity: 1; transform: none; }

/* ----------------------------------------------------------------
   9. REDUCED MOTION
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .nx-reveal { opacity: 1 !important; transform: none !important; }
}
