/* =======================================================
   NexusINT v7 — Core Design Tokens (v7.1 cleaner edition)
   ======================================================= */
:root {
  /* Brand – refined, slightly more muted for a cleaner look */
  --brand:        #5b8def;
  --brand-2:      #7c6bff;
  --brand-3:      #22c5ff;
  --brand-soft:   rgba(91,141,239,.12);
  --brand-grad:   linear-gradient(135deg, #5b8def 0%, #7c6bff 55%, #22c5ff 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(91,141,239,.14), rgba(124,107,255,.12) 55%, rgba(34,197,255,.10));

  /* Neutrals – flatter, less noisy in dark mode */
  --bg-0:         #0a0c12;
  --bg-1:         #0f1219;
  --bg-2:         #141823;
  --bg-3:         #1b2030;
  --bg-4:         #232a3c;
  --border:       #1f2533;
  --border-2:     #2a3244;

  /* Text */
  --text:         #eaeef8;
  --text-mute:    #9aa3b8;
  --text-dim:     #6a7386;

  /* Status */
  --success:      #22c55e;
  --warn:         #f59e0b;
  --danger:       #ef4444;
  --info:         #38bdf8;

  /* Effects */
  --radius-xs:    4px;
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;
  --radius-xl:    22px;

  --shadow-sm:    0 1px 2px rgba(0,0,0,.25);
  --shadow:       0 10px 30px rgba(0,0,0,.35);
  --shadow-lg:    0 24px 64px rgba(0,0,0,.45);
  --ring:         0 0 0 3px rgba(91,141,239,.22);

  --ease:         cubic-bezier(.4,0,.2,1);
  --trans:        .18s var(--ease);

  --font-sans:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', Menlo, monospace;

  --navbar-h:     64px;
  --sidebar-w:    252px;
  --content-max:  1280px;
}

[data-theme="light"] {
  --bg-0: #f5f7fb; --bg-1:#ffffff; --bg-2:#f9fafe; --bg-3:#eef1f8; --bg-4:#dfe4ef;
  --border:#e4e8f1; --border-2:#d4dae6;
  --text:#101527; --text-mute:#4b556b; --text-dim:#7a8394;
  --brand-soft: rgba(91,141,239,.10);
  --shadow: 0 8px 24px rgba(15,20,35,.06);
  --ring: 0 0 0 3px rgba(91,141,239,.18);
}

/* reset */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html,body { height:100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,svg,video { max-width:100%; display:block; }
a { color: var(--brand); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--brand-3); }
button,input,select,textarea { font: inherit; color: inherit; }
code,kbd,pre { font-family: var(--font-mono); }

::selection { background: rgba(91,141,239,.35); color: #fff; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius:6px; border:2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* =============== Typography =============== */
h1,h2,h3,h4,h5 { font-weight: 700; letter-spacing: -.015em; line-height: 1.2; color: var(--text); }
h1 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.02rem; }
p  { color: var(--text-mute); }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 24px; }
.gradient-text {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =============== Buttons =============== */
.btn {
  display: inline-flex; align-items:center; gap:8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 14px; line-height:1;
  background: transparent; color: var(--text);
  transition: transform var(--trans), background var(--trans), color var(--trans), border-color var(--trans), box-shadow var(--trans);
  white-space:nowrap; user-select:none;
}
.btn svg { width:16px; height:16px; stroke-width:2; flex-shrink:0; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary {
  background: var(--brand-grad); color:#fff; border-color: transparent;
  box-shadow: 0 6px 18px rgba(91,141,239,.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(91,141,239,.38); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { border-color: var(--border); background: var(--bg-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--bg-2); }
.btn-outline { border-color: var(--border-2); color: var(--text); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-icon svg { width:18px; height:18px; }
.btn-danger { background: var(--danger); color:#fff; border-color: transparent; }
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-success { background: var(--success); color:#fff; border-color: transparent; }
.btn[disabled], .btn:disabled { opacity:.55; cursor:not-allowed; pointer-events:none; }

/* =============== Cards =============== */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--trans), transform var(--trans), box-shadow var(--trans);
}
.card:hover { border-color: var(--border-2); }
.card-hero { background: linear-gradient(180deg, var(--bg-2), var(--bg-1)); }

/* =============== Forms =============== */
.field { display:flex; flex-direction:column; gap:6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-mute); }
.input, textarea, select {
  width: 100%; padding: 11px 14px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); outline: none;
  transition: border-color var(--trans), box-shadow var(--trans), background var(--trans);
}
.input::placeholder, textarea::placeholder { color: var(--text-dim); }
.input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: var(--ring);
  background: var(--bg-1);
}
.input.with-icon { padding-left: 40px; }
.input-group { position: relative; }
.input-group .ic {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height:18px; color: var(--text-dim); pointer-events:none;
}

/* =============== Badges =============== */
.badge {
  display: inline-flex; align-items:center; gap:6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-3); color: var(--text-mute);
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border);
}
.badge-success { background: rgba(34,197,94,.10); color: var(--success); border-color: rgba(34,197,94,.3); }
.badge-warn    { background: rgba(245,158,11,.10); color: var(--warn);    border-color: rgba(245,158,11,.3); }
.badge-danger  { background: rgba(239,68,68,.10);  color: var(--danger);  border-color: rgba(239,68,68,.3); }
.badge-brand   { background: var(--brand-soft);    color: var(--brand-3); border-color: rgba(91,141,239,.3); }

/* =============== Toast =============== */
.toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  padding: 12px 16px; border-radius: var(--radius-sm); background: var(--bg-2);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: toast-in .28s var(--ease) both;
  display: flex; gap: 12px; align-items: center; font-size: 14px;
}
.toast svg { flex-shrink: 0; }
.toast.success { border-color: rgba(34,197,94,.5); }
.toast.error   { border-color: rgba(239,68,68,.5); }
.toast.info    { border-color: rgba(91,141,239,.5); }
.toast.warn    { border-color: rgba(245,158,11,.5); }
@keyframes toast-in { from{opacity:0;transform:translateX(40px);} to{opacity:1;transform:translateX(0);} }

/* =============== Modal =============== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px); z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  animation: fadein .2s ease;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  width: min(560px, 94vw); max-height: 90vh; overflow: auto;
  animation: modal-in .24s var(--ease);
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 8px; }
@keyframes modal-in { from{opacity:0;transform:scale(.96);} to{opacity:1;transform:scale(1);} }
@keyframes fadein { from{opacity:0;} to{opacity:1;} }

/* =============== Loader =============== */
.spinner {
  width: 18px; height:18px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .9s linear infinite;
  display: inline-block;
}
.spinner-sm { width: 13px; height: 13px; border-width: 1.6px; vertical-align: -2px; }
.spinner-light { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skel { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2));
        background-size: 200% 100%; animation: skel 1.4s ease infinite;
        border-radius: 8px; }
@keyframes skel { 0%{background-position:-200% 0;} 100%{background-position:200% 0;} }

/* =============== Utilities =============== */
.row { display:flex; }
.col { display:flex; flex-direction:column; }
.gap-4 { gap:4px; } .gap-8 { gap:8px; } .gap-12 { gap:12px; } .gap-16 { gap:16px; } .gap-24 { gap:24px; }
.center { align-items:center; justify-content:center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }

.mt-4 {margin-top:4px;} .mt-8{margin-top:8px;} .mt-12{margin-top:12px;}
.mt-16{margin-top:16px;} .mt-24{margin-top:24px;} .mt-32{margin-top:32px;}
.mb-4{margin-bottom:4px;} .mb-8{margin-bottom:8px;} .mb-16{margin-bottom:16px;} .mb-24{margin-bottom:24px;}
.text-sm { font-size: 13px; } .text-xs { font-size: 11px; } .text-lg { font-size: 17px; }
.text-mute { color: var(--text-mute); } .text-dim { color: var(--text-dim); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warn { color: var(--warn); }
.mono { font-family: var(--font-mono); font-size: 13px; }

/* Background orbs – softer */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.orb { position:absolute; border-radius: 50%; filter: blur(100px); opacity:.22; }
.orb-1 { width:520px; height:520px; background:#5b8def; top:-160px; left:-160px; }
.orb-2 { width:420px; height:420px; background:#7c6bff; bottom:-120px; right:-120px; }
.orb-3 { width:320px; height:320px; background:#22c5ff; top:40%; left:50%; transform:translate(-50%,-50%); opacity:.08; }

.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(rgba(91,141,239,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91,141,239,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, transparent 80%);
}

/* Icon (lucide) */
.ic { width:18px; height:18px; stroke-width:2; flex-shrink:0; }
.ic-sm { width:14px; height:14px; }
.ic-lg { width:24px; height:24px; }

/* tiny focus-ring for all interactive widgets */
:focus-visible { outline: none; }
input:focus-visible, button:focus-visible, a:focus-visible, [role="button"]:focus-visible {
  outline: none;
}

/* kbd */
kbd {
  background: var(--bg-3); padding: 3px 8px; border-radius: 4px;
  font-size: 11px; color: var(--text-mute); border: 1px solid var(--border);
  font-family: var(--font-mono);
}
