/* ═══════════════════════════════════════════════════════════
   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-amber-pale:   #FCE3B8;
  --c-sand:         #E8C897;       /* warm neutral accent (v2) */

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

  --c-white:        #FFFFFF;

  /* Tri-stop brand gradient (v2) — purple → lavender → amber */
  --grad-tri: linear-gradient(135deg, var(--c-purple-mid) 0%, var(--c-lavender) 45%, var(--c-amber-light) 100%);
  --grad-warm: linear-gradient(135deg, var(--c-amber) 0%, var(--c-coral-light) 100%);

  /* 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:
    radial-gradient(ellipse 90% 60% at 12% 0%, rgba(239,159,39,0.055), transparent 55%),
    radial-gradient(ellipse 80% 50% at 88% 100%, rgba(216,90,48,0.04), transparent 60%),
    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); }

/* Warm accent CTA (v2) — for hero "Get free API key" / featured plan */
.btn-amber {
  background: linear-gradient(135deg, var(--c-amber) 0%, #E68A1E 100%);
  color: #1A1308;
  box-shadow: 0 0 24px rgba(239,159,39,0.32), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-amber:hover { box-shadow: 0 0 36px rgba(239,159,39,0.45), inset 0 1px 0 rgba(255,255,255,0.22); filter: brightness(1.05); }
.btn-amber:active { filter: brightness(0.96); }

/* Tri-stop gradient text helper (v2) */
.grad-tri {
  background: var(--grad-tri);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.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; }

/* ── PUBLIC TOP NAV (index, pricing, docs, trust, status) ── */
.pub-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  padding: 18px 64px;
  display: flex; align-items: center; justify-content: space-between;
  transition: all var(--t-base);
}
.pub-nav.scrolled {
  padding: 12px 64px;
  background: rgba(10, 15, 30, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border);
}
.pub-nav .nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-display); font-size: 21px; font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none; color: var(--c-text-1);
}
.pub-nav .nav-brand .lt { color: var(--c-purple-mid); font-weight: 300; }
.pub-nav .nav-links {
  display: flex; gap: 32px; list-style: none;
  margin: 0; padding: 0;
}
.pub-nav .nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--c-text-2);
  transition: color var(--t-fast);
  text-decoration: none;
}
.pub-nav .nav-links a:hover { color: var(--c-text-1); }
.pub-nav .nav-links a.active { color: var(--c-teal-light); font-weight: 600; }
.pub-nav .nav-actions {
  display: flex; align-items: center; gap: 12px;
}
/* When nex-nav.js inserts the public nav into a page that wasn't built
   with one (e.g. login.html, signup.html), the fixed-position bar sits
   on top of the y=0 content. Reserve room so body content starts below
   the bar instead of underneath it. Pages that ship with a static
   .pub-nav already account for the bar in their own layout. */
body.nex-nav-injected { padding-top: 72px; }
@media (max-width: 768px) {
  body.nex-nav-injected { padding-top: 60px; }
}

/* ── 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 (v2 — RAF-decoupled, no transition fighting) ─ */
body.custom-cursor { cursor: none; }
.cursor-dot {
  position: fixed; top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--c-lavender); border-radius: 50%;
  pointer-events: none; z-index: 99999;
  will-change: transform;
  transition: opacity 0.2s, background 0.2s;
  mix-blend-mode: screen;
}
.cursor-ring {
  position: fixed; top: 0; left: 0;
  width: 32px; height: 32px;
  border: 1.5px solid rgba(175,169,236,0.5); border-radius: 50%;
  pointer-events: none; z-index: 99998;
  will-change: transform, width, height, border-color;
  /* CSS only animates size/color, NOT transform — RAF owns transform */
  transition: width 0.22s var(--t-base), height 0.22s var(--t-base), border-color 0.22s var(--t-base), background 0.22s var(--t-base);
}
.cursor-ring.hovered {
  width: 56px; height: 56px;
  border-color: var(--c-amber-light);
  background: rgba(239,159,39,0.06);
}
@media (hover: none), (max-width: 768px), (prefers-reduced-motion: reduce) {
  body.custom-cursor { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE MEDIA QUERIES
   Breakpoints: 1200px (tablet), 768px (mobile), 480px (small phone)
   ═══════════════════════════════════════════════════════════ */

/* ── TABLET (≤1200px) ─────────────────────────────────────── */
@media (max-width: 1200px) {
  :root { --sidebar-w: 200px; }

  .page-content { padding: 24px; }

  /* Grid: 4-col → 2-col */
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* Public pages: reduce section padding */
  .feat-sec,
  .route-sec,
  .stats-sec { padding: 80px 48px; }

  /* Public nav: tighten */
  .pub-nav,
  .pub-nav.scrolled { padding: 16px 32px; }
}

/* ── MOBILE (≤768px on mouse, ANY pointer:coarse) ─────────────
   Boss 2026-05-29 update — even at max-width: 1024px the iPad-class
   foldable Boss tested on still didn't flip (CSS viewport seemed to
   come in just above 1024). Drop the width cap on the coarse-pointer
   branch so any touch device, regardless of reported width, gets the
   bottom-nav-bar treatment. Mouse-driven viewports still need to be
   under 768px to flip — laptops are not affected. */
@media (max-width: 768px), (pointer: coarse) {

  /* ── Sidebar: hide, replace with bottom nav bar ── */
  .sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--c-border);
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 200;
  }

  /* `!important` everywhere to override nex-nav.js's inline styles
     (it stamps display:flex on collapsible labels and display:none on
     collapsed bodies). The layout below makes the sidebar a single
     horizontal flex bar at the bottom: each nav-link is a flex item
     centered as an icon+label stack. Inner DOM has section→label+body,
     but on mobile we collapse all of it into one row by making each
     element a row-flex container. */
  .sidebar-brand    { display: none !important; }
  .sidebar-footer   { display: none !important; }
  .sidebar-section-label { display: none !important; }

  .sidebar-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    padding: 0;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sidebar-section {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    margin: 0;
    flex-shrink: 0;
  }
  .sidebar-section-body {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    flex-shrink: 0;
  }

  .nav-link {
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    font-size: 10px;
    border-left: none;
    border-top: 2px solid transparent;
    white-space: nowrap;
  }
  .nav-link.active { border-left-color: transparent; border-top-color: var(--c-purple); }
  .nav-link-icon   { width: 20px; height: 20px; opacity: 1; }
  .nav-link-badge  { display: none; }

  /* ── App main: no left margin, bottom padding for nav bar ── */
  .app-main {
    margin-left: 0;
    padding-bottom: 64px;
  }

  /* ── Topbar: full width ── */
  .topbar {
    left: 0;
    padding: 0 16px;
  }
  .topbar-sub { display: none; }

  /* ── Page content: reduce padding ── */
  .page-content { padding: 16px; }

  /* ── Grids → single column ── */
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; gap: 12px; }

  /* ── Login page: two-panel → stacked ── */
  body:has(.panel-l) {
    grid-template-columns: 1fr;
  }
  .panel-l { display: none; }
  .panel-r { padding: 32px 20px; }

  /* ── Public nav ── */
  /* `!important` here because each marketing page duplicates a copy of
     these base `.pub-nav` rules inline in its <style> block (legacy
     inlining for first-paint speed), and the inline copy follows the
     external _ds.css <link> in document order — without !important the
     desktop padding/layout wins on phones. */
  .pub-nav,
  .pub-nav.scrolled { padding: 14px 20px !important; }
  .pub-nav .nav-links { display: none !important; }
  .pub-nav .nav-actions .btn-ghost { display: none !important; }

  /* ── Hero section ── */
  .hero { padding: 100px 20px 60px; }

  /* ── Feature/route sections ── */
  .feat-sec,
  .route-sec,
  .stats-sec { padding: 60px 20px; }

  .feat-grid,
  .stats-grid { grid-template-columns: 1fr; }

  /* route section: two-col → stacked */
  .route-inner { grid-template-columns: 1fr; gap: 40px; }

  /* ── Metric value: smaller on mobile ── */
  .metric-value { font-size: 24px; }

  /* ── Tables: horizontal scroll ── */
  .card-body:has(.nex-table),
  .card:has(.nex-table) { overflow-x: auto; }

  .nex-table { min-width: 540px; }

  /* ── Card headers: allow wrapping ── */
  .card-header { flex-wrap: wrap; gap: 8px; }

  /* ── Section heading ── */
  .section-sub { font-size: 15px; }

  /* ── Wallet hero (dashboard) ── */
  .wallet-hero { grid-template-columns: 1fr !important; gap: 24px !important; padding: 24px !important; }

  /* ── Dashboard metrics row ── */
  .metrics { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── Charts: stacked ── */
  .charts { grid-template-columns: 1fr !important; }

  /* ── Topbar title: smaller ── */
  .topbar-title { font-size: 15px; }

  /* ── Buttons in topbar-right: icon-only on small screens ── */
  .topbar-right .btn span { display: none; }
}

/* ── SMALL PHONE (≤480px) ─────────────────────────────────── */
@media (max-width: 480px) {
  .page-content { padding: 12px; }

  /* Single column for everything */
  .metrics { grid-template-columns: 1fr !important; }

  /* Reduce large display font sizes */
  .metric-value { font-size: 22px; }
  .topbar-title { font-size: 14px; }

  /* Auth box: full width */
  .auth-box { max-width: 100%; }
  .panel-r  { padding: 24px 16px; }

  /* Hero: less padding */
  .hero { padding: 80px 16px 48px; }

  /* Buttons: full width in hero CTA */
  .hero-cta { flex-direction: column; width: 100%; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  /* Tables: ensure scroll */
  .nex-table { min-width: 480px; }

  /* Cards: reduce padding */
  .card-body  { padding: 16px; }
  .card-header { padding: 14px 16px; }

  /* Code block: smaller font */
  .code-body { padding: 16px; font-size: 11.5px; }

  /* Feat/stats sections */
  .feat-sec,
  .route-sec,
  .stats-sec { padding: 48px 16px; }

  /* Public nav */
  .pub-nav,
  .pub-nav.scrolled { padding: 12px 16px; }

  /* Form row: stack fields */
  .form-row { grid-template-columns: 1fr !important; }
}

/* ═══════════════════════════════════════════════════════════
   H5 MOBILE BASELINE v1 (2026-05-20)
   Global fixes for touch UX, iOS quirks, narrow viewports.
   Layered on top of the breakpoint blocks above.
   ═══════════════════════════════════════════════════════════ */

/* ── Global: prevent horizontal scroll + tap-highlight + smooth scroll ── */
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
* { -webkit-tap-highlight-color: rgba(127,119,221,0.18); }

/* ── iOS Safari quirk: prevent zoom on input focus when font < 16px ── */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ── iPhone safe-area-inset (notch + home indicator) ── */
@supports (padding: max(0px)) {
  body {
    padding-left:  env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .sidebar {            /* bottom nav-bar on mobile picks up home indicator */
    padding-bottom: env(safe-area-inset-bottom);
  }
  .app-main {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
  }
  .modal {
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }
}

/* ── Hamburger menu (mobile-only, injected by _app.js into .nav-actions) ── */
.mobile-menu-btn {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  cursor: pointer;
  color: var(--c-text-1);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.mobile-menu-btn:hover,
.mobile-menu-btn:active { background: rgba(127,119,221,0.08); border-color: var(--c-purple); }
.mobile-menu-btn svg { width: 22px; height: 22px; stroke: currentColor; flex-shrink: 0; }

.mobile-nav-drawer {
  position: fixed;
  inset: 0;
  background: rgba(10,15,30,0.92);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  flex-direction: column;
  padding: 80px 24px 32px;
  overflow-y: auto;
}
.mobile-nav-drawer.open { display: flex; }
.mobile-nav-drawer a {
  display: block;
  padding: 16px 12px;
  border-bottom: 1px solid var(--c-border);
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text-1);
  text-decoration: none;
}
.mobile-nav-drawer a:hover,
.mobile-nav-drawer a:active { color: var(--c-purple-light); }
.mobile-nav-drawer .nav-actions-mobile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.mobile-nav-drawer .nav-actions-mobile .btn {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 15px;
}
.mobile-nav-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  color: var(--c-text-2);
  font-size: 28px;
  width: 44px; height: 44px;
  cursor: pointer;
  line-height: 1;
}

@media (max-width: 768px) {
  /* Show hamburger, hide ALL other nav-actions buttons on mobile so the
     hamburger stands alone on the right edge. `!important` needed — see
     note above on inline <style> blocks in marketing pages. */
  .pub-nav .mobile-menu-btn { display: inline-flex !important; }
  .pub-nav .nav-actions > *:not(.mobile-menu-btn) { display: none !important; }
  /* Lock scroll on body while drawer open */
  body.mobile-nav-open { overflow: hidden; }
}

/* ── Touch targets: minimum 44px tap area on mobile ── */
@media (hover: none) {
  .btn,
  .btn-sm,
  .btn-ghost,
  .pm-radio,
  .amount-btn,
  .nav-link,
  .modal-close-btn,
  .lang-picker-inline button,
  [onclick] {
    min-height: 44px;
  }
  .modal-close-btn {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
}

/* ── Modal: full-screen on small phones (≤480px) ── */
@media (max-width: 480px) {
  .modal-overlay { padding: 0; }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    padding: 24px 16px;
    overflow-y: auto;
  }
  .modal-overlay.open .modal { transform: none; }

  /* Top-up amount grid: 2 columns instead of 3 on very narrow */
  .amount-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .amount-btn { padding: 16px 10px; font-size: 17px; }

  /* Modal-footer: stack buttons */
  .modal-footer {
    flex-direction: column-reverse;
    gap: 10px;
  }
  .modal-footer .btn { width: 100%; justify-content: center; }
}

/* ── Toasts: pin to top on mobile (don't conflict with bottom nav) ── */
@media (max-width: 768px) {
  .toast,
  #toast-container,
  [class*="toast-"] {
    bottom: auto !important;
    top: calc(16px + env(safe-area-inset-top, 0px)) !important;
    left: 16px !important;
    right: 16px !important;
    max-width: calc(100% - 32px);
  }
}

/* ── Lang picker compact on mobile ── */
@media (max-width: 480px) {
  .lang-picker-inline {
    transform: scale(0.85);
    transform-origin: right center;
  }
}

/* ── Sticky bottom CTA on payment confirm + auth ── */
@media (max-width: 480px) {
  /* When a modal has more content than viewport, keep Pay button visible */
  .modal .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--c-space-700);
    padding-top: 12px;
    margin-top: 16px;
    border-top: 1px solid var(--c-border);
    z-index: 2;
  }
}

/* ─── nex-nav.js 2026-05-26 — public footer + collapsible sidebar ─── */

.pub-footer {
  margin-top: 80px;
  padding: 36px 24px 28px;
  background: var(--c-space-800);
  border-top: 1px solid var(--c-border);
  color: var(--c-text-3);
  font-size: 12.5px;
}
.pub-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}
.pub-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-text-1);
  font-weight: 600;
  font-size: 14px;
}
.pub-footer-brand .logo-mark { flex-shrink: 0; }
.pub-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  flex: 1;
  justify-content: center;
}
.pub-foot-link {
  color: var(--c-text-3);
  text-decoration: none;
  transition: color .15s;
}
.pub-foot-link:hover { color: var(--c-purple-light); }
.pub-footer-meta {
  color: var(--c-text-3);
  font-size: 11.5px;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .pub-footer-inner { flex-direction: column; text-align: center; gap: 14px; }
  .pub-footer-meta { white-space: normal; }
}

/* Collapsible section header — chevron rotates when collapsed */
.sidebar-section.is-collapsible .sidebar-section-label {
  user-select: none;
}
.sidebar-section.is-collapsible .sidebar-section-label:hover {
  color: var(--c-text-1);
}
.sidebar-chev {
  display: inline-flex;
  align-items: center;
  opacity: 0.5;
}
