/* ═══════════════════════════════════════════════════════════
   NEX DESIGN SYSTEM v1.0
   Cete Ventures Pte Ltd · NexToken
   ═══════════════════════════════════════════════════════════ */

/* ── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* ── COLOR TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand */
  --c-deep-space:   #0A0F1E;
  --c-space-900:    #080C18;
  --c-space-800:    #0D1426;
  --c-space-700:    #111929;
  --c-space-600:    #161F35;
  --c-space-500:    #1C2840;
  --c-space-400:    #243352;
  --c-space-300:    #2E4068;

  --c-purple:       #534AB7;
  --c-purple-mid:   #7F77DD;
  --c-lavender:     #AFA9EC;
  --c-purple-pale:  #EEEDFE;

  --c-teal:         #1D9E75;
  --c-teal-light:   #9FE1CB;
  --c-teal-pale:    #D1F5EA;

  --c-blue:         #378ADD;
  --c-blue-light:   #B5D4F4;

  --c-amber:        #EF9F27;
  --c-amber-light:  #FAC775;

  --c-coral:        #D85A30;
  --c-coral-light:  #F4896A;

  --c-white:        #FFFFFF;

  /* Semantic text */
  --c-text-1:       #F0EFFC;   /* primary */
  --c-text-2:       #AFA9EC;   /* secondary */
  --c-text-3:       #6B6490;   /* muted */
  --c-text-4:       #3D3860;   /* disabled */

  /* Semantic borders */
  --c-border:       rgba(127, 119, 221, 0.15);
  --c-border-2:     rgba(127, 119, 221, 0.28);
  --c-border-3:     rgba(127, 119, 221, 0.45);

  /* Glows */
  --glow-purple:    rgba(83, 74, 183, 0.40);
  --glow-teal:      rgba(29, 158, 117, 0.35);
  --glow-blue:      rgba(55, 138, 221, 0.30);

  /* ── Typography ── */
  --f-display:  'Syne', sans-serif;
  --f-body:     'Space Grotesk', sans-serif;
  --f-mono:     'JetBrains Mono', monospace;

  /* ── Spacing ── */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px;  --sp-6: 24px;  --sp-8: 32px;  --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* ── Radii ── */
  --r-xs: 4px;  --r-sm: 6px;  --r-md: 10px;
  --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;

  /* ── Shadows ── */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.5);
  --shadow-xl:  0 32px 80px rgba(0,0,0,0.6);

  /* ── Transitions ── */
  --t-fast:   0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:   0.40s cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── Layout ── */
  --sidebar-w: 236px;
  --topbar-h:  56px;
  --max-w:     1280px;
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--f-body); background: var(--c-deep-space); color: var(--c-text-1); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--f-body); cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: var(--f-body); outline: none; }
img, svg { display: block; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-space-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-purple); }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); padding: 10px 20px;
  font-size: 13.5px; font-weight: 600; font-family: var(--f-body);
  border-radius: var(--r-sm); border: none;
  transition: all var(--t-base);
  cursor: pointer; white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.07); opacity: 0;
  transition: opacity var(--t-fast);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--c-purple); color: var(--c-white);
  box-shadow: 0 0 20px var(--glow-purple);
}
.btn-primary:hover { background: var(--c-purple-mid); box-shadow: 0 0 32px var(--glow-purple); }

.btn-teal {
  background: var(--c-teal); color: var(--c-white);
  box-shadow: 0 0 20px var(--glow-teal);
}
.btn-teal:hover { box-shadow: 0 0 32px var(--glow-teal); filter: brightness(1.08); }

.btn-ghost {
  background: transparent; color: var(--c-text-2);
  border: 1px solid var(--c-border);
}
.btn-ghost:hover { color: var(--c-text-1); border-color: var(--c-border-2); background: rgba(127,119,221,0.06); }

.btn-danger {
  background: transparent; color: var(--c-coral-light);
  border: 1px solid rgba(216,90,48,0.25);
}
.btn-danger:hover { background: rgba(216,90,48,0.1); border-color: rgba(216,90,48,0.45); }

.btn-sm  { padding: 7px 14px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg  { padding: 14px 32px; font-size: 15px; border-radius: var(--r-md); }
.btn-xl  { padding: 17px 40px; font-size: 16px; font-weight: 700; border-radius: var(--r-md); }
.btn-icon { padding: 8px; border-radius: var(--r-sm); aspect-ratio: 1; }

/* ── BADGES / CHIPS ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-xs);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.badge-green  { background: rgba(29,158,117,0.12); color: var(--c-teal-light); border: 1px solid rgba(29,158,117,0.25); }
.badge-purple { background: rgba(83,74,183,0.12);  color: var(--c-lavender);   border: 1px solid rgba(83,74,183,0.25); }
.badge-amber  { background: rgba(239,159,39,0.10); color: var(--c-amber-light);border: 1px solid rgba(239,159,39,0.25); }
.badge-red    { background: rgba(216,90,48,0.10);  color: var(--c-coral-light);border: 1px solid rgba(216,90,48,0.25); }
.badge-blue   { background: rgba(55,138,221,0.10); color: var(--c-blue-light); border: 1px solid rgba(55,138,221,0.25); }
.badge-muted  { background: var(--c-space-500);    color: var(--c-text-3);     border: 1px solid var(--c-border); }

.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-green  { background: var(--c-teal);   box-shadow: 0 0 6px var(--c-teal); }
.dot-amber  { background: var(--c-amber);  box-shadow: 0 0 6px var(--c-amber); }
.dot-red    { background: var(--c-coral);  box-shadow: 0 0 6px var(--c-coral); }
.dot-muted  { background: var(--c-text-3); }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--c-space-700);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-hover { transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base); }
.card-hover:hover {
  border-color: var(--c-border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
}
.card-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.card-body  { padding: 24px; }

/* ── FORM ELEMENTS ────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; margin-bottom: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--c-text-2);
  letter-spacing: 0.01em;
}
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--c-space-600); border: 1px solid var(--c-border);
  border-radius: var(--r-md); color: var(--c-text-1);
  font-size: 14px; font-family: var(--f-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-input:focus { border-color: var(--c-purple); box-shadow: 0 0 0 3px rgba(83,74,183,0.15); }
.form-input::placeholder { color: var(--c-text-3); }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }
select.form-input { cursor: pointer; }
.form-hint { margin-top: 6px; font-size: 12px; color: var(--c-text-3); line-height: 1.5; }
.form-error{ margin-top: 6px; font-size: 12px; color: var(--c-coral-light); }

/* ── TABLES ───────────────────────────────────────────────── */
.nex-table { width: 100%; border-collapse: collapse; }
.nex-table th {
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 700;
  color: var(--c-text-3); letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.nex-table td { padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid rgba(127,119,221,0.07); vertical-align: middle; }
.nex-table tbody tr:last-child td { border-bottom: none; }
.nex-table tbody tr { transition: background var(--t-fast); }
.nex-table tbody tr:hover td { background: rgba(127,119,221,0.04); }

/* ── CODE ─────────────────────────────────────────────────── */
code {
  font-family: var(--f-mono); font-size: 12.5px;
  background: var(--c-space-600); border: 1px solid var(--c-border);
  padding: 1px 6px; border-radius: var(--r-xs); color: var(--c-lavender);
}
.code-block {
  background: var(--c-space-800); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-md);
}
.code-titlebar {
  padding: 11px 18px; background: var(--c-space-900); border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: var(--sp-2);
}
.code-dots { display: flex; gap: 6px; }
.code-dot { width: 11px; height: 11px; border-radius: 50%; }
.code-dot-r { background: #FF5F57; }
.code-dot-y { background: #FEBC2E; }
.code-dot-g { background: #28C840; }
.code-filename { margin-left: 10px; font-family: var(--f-mono); font-size: 12px; color: var(--c-text-3); }
.code-lang { margin-left: auto; font-family: var(--f-mono); font-size: 11px; padding: 2px 7px; background: var(--c-space-600); border-radius: var(--r-xs); color: var(--c-text-3); }
.code-copy { margin-left: 8px; padding: 3px 9px; background: transparent; border: 1px solid var(--c-border); border-radius: var(--r-xs); font-size: 11px; font-family: var(--f-body); color: var(--c-text-3); cursor: pointer; transition: all var(--t-fast); }
.code-copy:hover { color: var(--c-text-1); border-color: var(--c-border-2); }
.code-body { padding: 22px 26px; font-family: var(--f-mono); font-size: 13px; line-height: 1.8; overflow-x: auto; }

/* Syntax highlighting */
.hl-c  { color: var(--c-text-3); }     /* comment */
.hl-k  { color: var(--c-blue-light); } /* keyword */
.hl-s  { color: var(--c-teal-light); } /* string */
.hl-n  { color: var(--c-lavender); }   /* name/key */
.hl-v  { color: var(--c-amber); }      /* value/number */
.hl-f  { color: var(--c-purple-mid); } /* function */
.hl-t  { color: var(--c-blue); }       /* type/import */

/* ── CALLOUTS ─────────────────────────────────────────────── */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 18px; border-radius: var(--r-md); margin: 18px 0;
  font-size: 14px; line-height: 1.65;
}
.callout-icon { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.callout-title { font-weight: 700; margin-bottom: 4px; font-size: 13.5px; }
.callout-info    { background: rgba(55,138,221,0.07);  border: 1px solid rgba(55,138,221,0.2);  color: var(--c-blue-light); }
.callout-success { background: rgba(29,158,117,0.07);  border: 1px solid rgba(29,158,117,0.2);  color: var(--c-teal-light); }
.callout-warning { background: rgba(239,159,39,0.07);  border: 1px solid rgba(239,159,39,0.2);  color: var(--c-amber-light); }
.callout-danger  { background: rgba(216,90,48,0.07);   border: 1px solid rgba(216,90,48,0.2);   color: var(--c-coral-light); }

/* ── SIDEBAR NAV ──────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--c-space-800);
  border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
}
.sidebar-brand {
  padding: 20px; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-display); font-size: 18px; font-weight: 700;
  letter-spacing: -0.5px; color: var(--c-text-1); flex-shrink: 0;
}
.sidebar-brand .light { color: var(--c-purple-mid); font-weight: 300; }
.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-section-label {
  padding: 12px 18px 6px;
  font-size: 10px; font-weight: 700; color: var(--c-text-3);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  font-size: 13.5px; font-weight: 500; color: var(--c-text-2);
  transition: all var(--t-fast); cursor: pointer;
  position: relative; border-left: 2px solid transparent;
}
.nav-link:hover { color: var(--c-text-1); background: rgba(127,119,221,0.06); }
.nav-link.active {
  color: var(--c-text-1); background: rgba(83,74,183,0.1);
  border-left-color: var(--c-purple);
}
.nav-link-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.65; }
.nav-link.active .nav-link-icon { opacity: 1; }
.nav-link-badge {
  margin-left: auto; padding: 1px 6px;
  background: rgba(83,74,183,0.2); color: var(--c-lavender);
  border-radius: 10px; font-size: 10px; font-weight: 700;
}
.sidebar-footer {
  border-top: 1px solid var(--c-border); padding: 14px;
  flex-shrink: 0;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-md);
  cursor: pointer; transition: background var(--t-fast);
}
.user-chip:hover { background: rgba(127,119,221,0.07); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-purple), var(--c-teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: white; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--c-text-3); }

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h); z-index: 90;
  background: rgba(13,20,38,0.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; padding: 0 32px; gap: 16px;
}
.topbar-title { font-family: var(--f-display); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.topbar-sub { font-size: 12px; color: var(--c-text-3); margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── MAIN LAYOUT ──────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.app-main { margin-left: var(--sidebar-w); flex: 1; padding-top: var(--topbar-h); min-height: 100vh; }
.page-content { padding: 28px 32px; }

/* ── SECTION LABELS (public pages) ───────────────────────── */
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--c-purple-mid);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 14px;
}
.section-eyebrow::before { content: ''; display: block; width: 18px; height: 1.5px; background: var(--c-purple); }
.section-h { font-family: var(--f-display); font-size: clamp(32px, 4vw, 56px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.section-sub { font-size: 18px; color: var(--c-text-2); line-height: 1.68; max-width: 560px; }

/* ── ANIMATIONS ───────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50%       { transform: scale(1.6); opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-up { animation: fade-up 0.7s cubic-bezier(0.4,0,0.2,1) both; }
.delay-100 { animation-delay: 0.10s; }
.delay-200 { animation-delay: 0.20s; }
.delay-300 { animation-delay: 0.30s; }
.delay-400 { animation-delay: 0.40s; }
.delay-500 { animation-delay: 0.50s; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }

/* ── NOISE TEXTURE ────────────────────────────────────────── */
.noise-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.018; mix-blend-mode: overlay;
}

/* ── LOGO MARK SVG (inline) ───────────────────────────────── */
.logo-mark { display: inline-block; flex-shrink: 0; }

/* ── MONO TAGS ────────────────────────────────────────────── */
.mono-tag {
  font-family: var(--f-mono); font-size: 11.5px; font-weight: 500;
  padding: 3px 8px; border-radius: var(--r-xs);
  display: inline-flex; align-items: center; gap: 4px;
}
.mono-tag-purple { background: rgba(83,74,183,0.12); color: var(--c-lavender); }
.mono-tag-teal   { background: rgba(29,158,117,0.1);  color: var(--c-teal-light); }
.mono-tag-amber  { background: rgba(239,159,39,0.1);  color: var(--c-amber-light); }
.mono-tag-blue   { background: rgba(55,138,221,0.1);  color: var(--c-blue-light); }

/* ── METRIC CARD ──────────────────────────────────────────── */
.metric-card { position: relative; overflow: hidden; }
.metric-accent {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
}
.metric-value { font-family: var(--f-display); font-size: 32px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.metric-label { font-size: 11px; font-weight: 700; color: var(--c-text-3); letter-spacing: 0.09em; text-transform: uppercase; margin-bottom: 12px; }
.metric-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; margin-top: 6px; }
.delta-up   { color: var(--c-teal); }
.delta-down { color: var(--c-coral); }
.delta-flat { color: var(--c-text-3); }

/* ── DIVIDER ──────────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--c-text-3); font-size: 12px; margin: 20px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--c-border); }

/* ── GRID UTILITIES ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── SCROLLBAR HIDE ───────────────────────────────────────── */
.scrollbar-hide { scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── CUSTOM CURSOR ────────────────────────────────────────── */
body.custom-cursor { cursor: none; }
.cursor-dot {
  position: fixed; width: 8px; height: 8px;
  background: var(--c-lavender); border-radius: 50%;
  pointer-events: none; z-index: 99999;
  transition: transform 0.08s, opacity 0.2s;
  mix-blend-mode: screen;
}
.cursor-ring {
  position: fixed; width: 32px; height: 32px;
  border: 1.5px solid rgba(175,169,236,0.45); border-radius: 50%;
  pointer-events: none; z-index: 99998;
  transition: width 0.22s, height 0.22s, border-color 0.22s;
}
.cursor-ring.hovered { width: 56px; height: 56px; border-color: var(--c-purple-mid); }

/* JS-managed cursor positioning done via transform in JS */
