/* css/design-system.css
   Source unique de vérité pour toutes les variables visuelles.
   Identique au design system mobile (couleurs, espacements, coins).
   ─────────────────────────────────────────────────────────────── */

/* ── TOKENS ──────────────────────────────────────────────────────────────── */
:root {
  /* ── Couleurs — alignées sur le design system mobile ─────────────────────── */
  --bg:            #121212;   /* mobile: colors.background */
  --bg-2:          #1a1a1a;
  --bg-3:          #1e1e1e;   /* mobile: colors.card */
  --sidebar-bg:    #111111;   /* sidebar — plus sombre que --bg pour séparation visuelle */
  --purple:        #7b2ff7;   /* mobile: colors.primary */
  --purple-soft:   rgba(123,47,247,0.18);  /* mobile: colors.primarySoft */
  --purple-subtle: rgba(123,47,247,0.12);  /* mobile: colors.primarySubtle */
  --purple-strong: rgba(123,47,247,0.30);  /* mobile: colors.primaryStrong */
  --purple-glow:   rgba(123,47,247,0.32);
  --purple-border: rgba(123,47,247,0.35);

  --card-bg:       #1e1e1e;              /* mobile: colors.card (solide, aligné) */
  --card-border:   #333;                 /* mobile: colors.border */
  --card-border-strong: #444;            /* mobile: colors.borderStrong */
  --glass:         rgba(255,255,255,0.05);  /* mobile: colors.surfaceLight */
  --glass-border:  rgba(255,255,255,0.08);  /* mobile: colors.surfaceMedium */

  --surface-subtle: rgba(255,255,255,0.03);  /* mobile: colors.surfaceSubtle */
  --surface-light:  rgba(255,255,255,0.05);  /* mobile: colors.surfaceLight */
  --surface-medium: rgba(255,255,255,0.08);  /* mobile: colors.surfaceMedium */
  --surface-strong: rgba(255,255,255,0.10);  /* mobile: colors.surfaceStrong */

  --overlay-light:  rgba(0,0,0,0.18);    /* mobile: colors.overlayLight */
  --overlay-medium: rgba(0,0,0,0.45);    /* mobile: colors.overlayMedium */
  --overlay:        rgba(0,0,0,0.70);    /* mobile: colors.overlay */
  --overlay-strong: rgba(0,0,0,0.88);    /* mobile: colors.overlayStrong */

  --text-primary:   #ffffff;             /* mobile: colors.text */
  --text-secondary: #bbbbbb;             /* mobile: colors.textSoft */
  --text-muted:     #aaaaaa;             /* mobile: colors.textMuted */

  --danger:        #ff3b30;              /* mobile: colors.danger */
  --danger-soft:   rgba(255,59,48,0.14); /* mobile: colors.dangerSoft */
  --success:       #34d399;              /* mobile: colors.success */
  --success-soft:  rgba(52,211,153,0.14);
  --warning:       #fbbf24;              /* mobile: colors.warning */
  --warning-soft:  rgba(251,191,36,0.14);

  /* ── Typo ─────────────────────────────────────────────────────────────────── */
  --font-sans:  'DM Sans', system-ui, sans-serif;
  --font-mono:  'DM Mono', 'Fira Code', monospace;

  /* ── Espacements — alignés sur mobile (spacing tokens) ───────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Rayons — alignés sur mobile (radius tokens) ─────────────────────────── */
  --radius-sm:   8px;    /* mobile: radius.sm */
  --radius-md:   12px;   /* mobile: radius.md */
  --radius-lg:   16px;   /* mobile: radius.lg */
  --radius-xl:   20px;   /* mobile: radius.xl */
  --radius-full: 9999px; /* mobile: radius.pill */

  /* ── Mise en page ─────────────────────────────────────────────────────────── */
  --sidebar-w:   240px;
  --content-max: 900px;

  /* ── Transitions ──────────────────────────────────────────────────────────── */
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-fast: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:  .15s;
  --dur-std:   .25s;
  --dur-slow:  .4s;

  /* ── Aliases de compatibilité ────────────────────────────────────────────── */
  --text:       var(--text-primary);           /* alias → --text-primary */
  --accent:     var(--purple);                 /* alias → --purple */
  --accent-soft: var(--purple-soft);           /* alias → --purple-soft */
  --glass-bg:   var(--surface-light);          /* alias → --surface-light */
}

/* ── RESET ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg { display: block; max-width: 100%; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

ul, ol { list-style: none; }

a { color: inherit; text-decoration: none; }

/* Focus visible — accessibilité clavier */
:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── TYPOGRAPHY ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

/* ── ANIMATIONS ──────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse-opacity {
  0%, 100% { opacity: .5; }
  50%       { opacity: 1; }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── SCROLLBAR ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ── ION-ICON ────────────────────────────────────────────────────────────── */
ion-icon {
  display: block;
  pointer-events: none;
}
