/* ============================================================
   Nexials AI Academy — Design System
   Tokens + component styles (faithful to the Nexials brandbook)
   ============================================================ */

/* Brand fonts — Clash Display (display), Manrope (body), JetBrains Mono (code) */
@import url("https://api.fontshare.com/v2/css?f[]=clash-display@400,500,600,700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  /* Core palette */
  --nx-void: #0a0a0b;
  --nx-surface: #141417;
  --nx-surface-2: #1b1b1f;
  --nx-surface-3: #222227;
  --nx-border: #2a2a30;
  --nx-border-2: #3a3a42;

  /* Gold scale */
  --nx-gold: #e8b84b;
  --nx-gold-bright: #f2c744;
  --nx-champagne: #f3e3b0;
  --nx-amber: #c8841f;
  --nx-bronze: #a9651a;
  --nx-gold-grad: linear-gradient(135deg, #f8e6a8, #e8b84b 42%, #c8841f 78%, #a9651a);

  /* Accent */
  --nx-teal: #48c2b4;

  /* Text */
  --nx-white: #f5f1e6;
  --nx-text-2: #9b978c;
  --nx-mute: #6e6b62;

  /* Typography */
  --nx-font-display: "Clash Display", system-ui, sans-serif;
  --nx-font-sans: "Manrope", system-ui, sans-serif;
  --nx-font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Radius */
  --nx-radius-xs: 7px;
  --nx-radius-sm: 10px;
  --nx-radius-md: 14px;
  --nx-radius-lg: 16px;
  --nx-radius-pill: 100px;

  /* Spacing scale */
  --nx-space-1: 4px;
  --nx-space-2: 8px;
  --nx-space-3: 12px;
  --nx-space-4: 16px;
  --nx-space-5: 24px;
  --nx-space-6: 32px;
  --nx-space-7: 40px;

  /* Effects */
  --nx-glow-sm: 0 6px 16px rgba(232, 184, 75, 0.18);
  --nx-glow: 0 0 24px rgba(232, 184, 75, 0.35);
  --nx-glow-lg: 0 0 40px rgba(232, 184, 75, 0.5);
  --nx-glow-xl: 0 0 60px rgba(232, 184, 75, 0.8), 0 0 18px rgba(248, 230, 168, 0.6);
  --nx-focus-ring: 0 0 0 3px rgba(232, 184, 75, 0.14);
}

/* Base surface for cards/previews so the dark brand reads correctly */
.nx-root,
.nx-surface-fill {
  background: var(--nx-void);
  color: var(--nx-white);
  font-family: var(--nx-font-sans);
  -webkit-font-smoothing: antialiased;
}

/* ---------------- Button ---------------- */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nx-space-2);
  font-family: var(--nx-font-sans);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  border-radius: var(--nx-radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
  text-decoration: none;
}
.nx-btn:focus-visible {
  outline: none;
  box-shadow: var(--nx-focus-ring);
}
.nx-btn:active {
  transform: translateY(1px);
}
.nx-btn[disabled],
.nx-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
/* sizes */
.nx-btn--sm {
  height: 34px;
  padding: 0 18px;
  font-size: 13px;
}
.nx-btn--md {
  height: 42px;
  padding: 0 26px;
  font-size: 14px;
}
.nx-btn--lg {
  height: 52px;
  padding: 0 40px;
  font-size: 16px;
}
/* variants */
.nx-btn--primary {
  background: var(--nx-gold-grad);
  color: #16120a;
  box-shadow: var(--nx-glow-sm);
}
.nx-btn--primary:hover {
  box-shadow: var(--nx-glow);
}
.nx-btn--secondary {
  background: var(--nx-surface-3);
  color: var(--nx-white);
  border-color: var(--nx-border-2);
}
.nx-btn--secondary:hover {
  border-color: var(--nx-gold);
  color: var(--nx-gold);
}
.nx-btn--outline {
  background: transparent;
  color: var(--nx-gold);
  border-color: var(--nx-gold);
}
.nx-btn--outline:hover {
  background: rgba(232, 184, 75, 0.08);
}
.nx-btn--ghost {
  background: transparent;
  color: var(--nx-text-2);
}
.nx-btn--ghost:hover {
  color: var(--nx-white);
  background: var(--nx-surface-2);
}

/* ---------------- Card ---------------- */
.nx-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-5);
  color: var(--nx-white);
  font-family: var(--nx-font-sans);
}
.nx-card--glow {
  border-color: rgba(232, 184, 75, 0.35);
  box-shadow: var(--nx-glow-sm);
}
.nx-card--flush {
  padding: 0;
  overflow: hidden;
}
.nx-card__title {
  font-family: var(--nx-font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--nx-white);
}
.nx-card__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--nx-text-2);
  margin: 0;
}

/* ---------------- Badge / Status ---------------- */
.nx-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--nx-font-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--nx-radius-pill);
  border: 1px solid transparent;
  line-height: 1;
}
.nx-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.nx-badge--gold {
  background: rgba(232, 184, 75, 0.12);
  color: var(--nx-gold);
  border-color: rgba(232, 184, 75, 0.3);
}
.nx-badge--teal {
  background: rgba(72, 194, 180, 0.12);
  color: var(--nx-teal);
  border-color: rgba(72, 194, 180, 0.3);
}
.nx-badge--neutral {
  background: var(--nx-surface-3);
  color: var(--nx-text-2);
  border-color: var(--nx-border-2);
}
.nx-badge--muted {
  background: transparent;
  color: var(--nx-mute);
  border-color: var(--nx-border);
}

/* ---------------- Tag ---------------- */
.nx-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--nx-font-mono);
  font-size: 12px;
  color: var(--nx-text-2);
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-xs);
  padding: 4px 10px;
}

/* ---------------- Input / Textarea / Select ---------------- */
.nx-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--nx-font-sans);
}
.nx-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--nx-white);
}
.nx-field__hint {
  font-size: 12px;
  color: var(--nx-mute);
}
.nx-field__error {
  font-size: 12px;
  color: var(--nx-amber);
}
.nx-input,
.nx-textarea,
.nx-select {
  width: 100%;
  font-family: var(--nx-font-sans);
  font-size: 14px;
  color: var(--nx-white);
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-border-2);
  border-radius: var(--nx-radius-md);
  padding: 12px 15px;
  transition: border-color 0.15s ease, box-shadow 0.2s ease;
}
.nx-input::placeholder,
.nx-textarea::placeholder {
  color: var(--nx-mute);
}
.nx-input:focus,
.nx-textarea:focus,
.nx-select:focus {
  outline: none;
  border-color: var(--nx-gold);
  box-shadow: var(--nx-focus-ring);
}
.nx-textarea {
  min-height: 96px;
  resize: vertical;
}
.nx-input--invalid,
.nx-textarea--invalid {
  border-color: var(--nx-amber);
}
.nx-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--nx-text-2) 50%),
    linear-gradient(135deg, var(--nx-text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

/* ---------------- Avatar ---------------- */
.nx-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--nx-surface-3);
  color: var(--nx-gold);
  font-family: var(--nx-font-display);
  font-weight: 600;
  overflow: hidden;
  border: 1px solid var(--nx-border-2);
}
.nx-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nx-avatar--ring {
  border: 2px solid var(--nx-gold);
  box-shadow: var(--nx-glow-sm);
}
.nx-avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}
.nx-avatar--md {
  width: 44px;
  height: 44px;
  font-size: 16px;
}
.nx-avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

/* ---------------- Progress ---------------- */
.nx-progress {
  width: 100%;
  height: 8px;
  background: var(--nx-surface-3);
  border-radius: var(--nx-radius-pill);
  overflow: hidden;
}
.nx-progress__bar {
  height: 100%;
  background: var(--nx-gold-grad);
  border-radius: var(--nx-radius-pill);
  box-shadow: var(--nx-glow-sm);
  transition: width 0.3s ease;
}

/* ---------------- NavItem ---------------- */
.nx-navitem {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--nx-font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--nx-text-2);
  padding: 10px 14px;
  border-radius: var(--nx-radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nx-navitem:hover {
  color: var(--nx-white);
  background: var(--nx-surface-2);
}
.nx-navitem--active {
  color: var(--nx-gold);
  background: rgba(232, 184, 75, 0.1);
}
.nx-navitem__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------------- ListItem ---------------- */
.nx-listitem {
  display: flex;
  align-items: center;
  gap: var(--nx-space-3);
  padding: 14px 16px;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-md);
  font-family: var(--nx-font-sans);
}
.nx-listitem__main {
  flex: 1;
  min-width: 0;
}
.nx-listitem__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--nx-white);
  margin: 0;
}
.nx-listitem__sub {
  font-size: 12px;
  color: var(--nx-mute);
  margin: 2px 0 0;
}

/* ---------------- Stat ---------------- */
.nx-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--nx-font-sans);
}
.nx-stat__value {
  font-family: var(--nx-font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1;
  color: var(--nx-white);
}
.nx-stat__value--gold {
  background: var(--nx-gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nx-stat__label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nx-mute);
}

/* ---------------- GlowOrb (brand motif) ---------------- */
.nx-gl-orb {
  border-radius: 50%;
  background: var(--nx-gold-grad);
  box-shadow: var(--nx-glow-lg);
}

/* ---------------- LessonCard ---------------- */
.nx-lesson {
  display: flex;
  flex-direction: column;
  gap: var(--nx-space-3);
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-5);
  font-family: var(--nx-font-sans);
}
.nx-lesson__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nx-space-3);
}
.nx-lesson__index {
  font-family: var(--nx-font-mono);
  font-size: 12px;
  color: var(--nx-gold);
}
.nx-lesson__title {
  font-family: var(--nx-font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--nx-white);
  margin: 0;
}
.nx-lesson__desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--nx-text-2);
  margin: 0;
}
.nx-lesson__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nx-space-3);
  font-size: 12px;
  color: var(--nx-mute);
}

/* ---------------- AgentCard ---------------- */
.nx-agent {
  display: flex;
  gap: var(--nx-space-4);
  align-items: flex-start;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius-lg);
  padding: var(--nx-space-5);
  font-family: var(--nx-font-sans);
}
.nx-agent--featured {
  border-color: rgba(232, 184, 75, 0.35);
  box-shadow: var(--nx-glow-sm);
}
.nx-agent__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nx-agent__name {
  font-family: var(--nx-font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--nx-white);
  margin: 0;
}
.nx-agent__role {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--nx-gold);
}
.nx-agent__desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--nx-text-2);
  margin: 4px 0 0;
}
