/* =========================================================================
   AH Développement — Design System : tokens & thème
   Par Alex Huard. Palette neutre premium + accent piloté par le secteur.
   ========================================================================= */

:root {
  /* --- Typographie --- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  /* --- Rayons --- */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-full: 999px;

  /* --- Espacements --- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
  --sp-9: 56px; --sp-10: 72px;

  /* --- Neutres (light) --- */
  --bg:         #f4f6fb;
  --bg-2:       #eef1f8;
  --surface:    #ffffff;
  --surface-2:  #f7f9fd;
  --surface-3:  #eff3fa;
  --border:     #e3e8f2;
  --border-2:   #d5dcea;
  --text:       #0f1729;
  --text-2:     #3a4560;
  --text-muted: #626e8a;
  --text-faint: #a7b0c6;

  /* --- Sémantique --- */
  --green:  #15803d;  --green-bg:  #e7f7ee;
  --amber:  #a3540a;  --amber-bg:  #fdf1de;
  --red:    #dc2626;  --red-bg:    #fdeaea;
  --blue:   #2563eb;  --blue-bg:   #e8f0fe;
  --violet: #7c3aed;  --violet-bg: #f1eafe;

  /* --- Accent (défaut = AH Développement, écrasé par le secteur) --- */
  --accent:        #2f6df0;
  --accent-600:    #245bd6;
  --accent-700:    #1c49ad;
  --accent-weak:   #e9f0fe;
  --accent-weak-2: #d8e6fd;
  --accent-contrast: #ffffff;
  --accent-glow: 47, 109, 240;   /* rgb pour ombres/halo */

  /* --- Ombres --- */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --sh-md: 0 6px 18px rgba(22, 34, 74, .08), 0 2px 6px rgba(22, 34, 74, .05);
  --sh-lg: 0 18px 44px rgba(22, 34, 74, .14), 0 6px 14px rgba(22, 34, 74, .07);
  --sh-xl: 0 32px 70px rgba(22, 34, 74, .22);
  --sh-accent: 0 10px 26px rgba(var(--accent-glow), .35);

  /* --- Dégradés --- */
  --grad-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-700) 100%);
  --grad-hero: radial-gradient(1200px 600px at 15% -10%, rgba(var(--accent-glow), .16), transparent 60%),
               radial-gradient(1000px 500px at 100% 0%, rgba(124, 58, 237, .10), transparent 55%);

  --header-h: 64px;
  --maxw: 1200px;
}

/* --- Thème sombre --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #0a0e1a;
    --bg-2:       #0d1220;
    --surface:    #131a2b;
    --surface-2:  #182034;
    --surface-3:  #1f293f;
    --border:     #263149;
    --border-2:   #33415f;
    --text:       #f3f6fd;
    --text-2:     #c3cce0;
    --text-muted: #8b96b3;
    --text-faint: #5c6787;
    --accent-weak:   #17233f;
    --accent-weak-2: #1c2c4f;
    --sh-xs: 0 1px 2px rgba(0,0,0,.4);
    --sh-sm: 0 1px 3px rgba(0,0,0,.5);
    --sh-md: 0 8px 22px rgba(0,0,0,.5);
    --sh-lg: 0 22px 50px rgba(0,0,0,.6);
    --sh-xl: 0 34px 74px rgba(0,0,0,.7);
    --green:#4ade80; --amber:#fbbf24; --red:#f87171; --blue:#60a5fa; --violet:#a78bfa;
    --green-bg:#0f2a1c; --amber-bg:#2c2110; --red-bg:#2e1414; --blue-bg:#122542; --violet-bg:#221540;
  }
}
:root[data-theme="dark"] {
  --bg:#0a0e1a; --bg-2:#0d1220; --surface:#131a2b; --surface-2:#182034; --surface-3:#1f293f;
  --border:#263149; --border-2:#33415f; --text:#f3f6fd; --text-2:#c3cce0; --text-muted:#8b96b3; --text-faint:#5c6787;
  --accent-weak:#17233f; --accent-weak-2:#1c2c4f;
  --sh-md:0 8px 22px rgba(0,0,0,.5); --sh-lg:0 22px 50px rgba(0,0,0,.6); --sh-xl:0 34px 74px rgba(0,0,0,.7);
  --green:#4ade80; --amber:#fbbf24; --red:#f87171; --blue:#60a5fa; --violet:#a78bfa;
  --green-bg:#0f2a1c; --amber-bg:#2c2110; --red-bg:#2e1414; --blue-bg:#122542; --violet-bg:#221540;
}

/* --- Reset léger --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,h5 { margin: 0; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(var(--accent-glow), .22); }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
