/* ============================================================
   REIGNCORE Group — Design Tokens
   Vercel-like design system · Inter + JetBrains Mono substitutes
   Weight ceiling : 600 · Sentence-case · Negative tracking
   ============================================================ */

:root {
  /* ===== Brand / Ink ===== */
  --color-primary: #171717;
  --color-on-primary: #ffffff;
  --color-ink: #171717;
  --color-body: #4d4d4d;
  --color-mute: #888888;

  /* ===== Hairlines ===== */
  --color-hairline: #ebebeb;
  --color-hairline-strong: #a1a1a1;

  /* ===== Surfaces ===== */
  --color-canvas: #ffffff;
  --color-canvas-soft: #fafafa;
  --color-canvas-soft-2: #f5f5f5;
  --color-dark: #171717;
  --color-dark-soft: #1a1a1a;
  --color-dark-soft-2: #0f0f0f;

  /* ===== Link / Semantic ===== */
  --color-link: #0070f3;
  --color-link-deep: #0761d1;
  --color-link-bg-soft: #d3e5ff;
  --color-success: #0070f3;
  --color-error: #ee0000;
  --color-error-soft: #f7d4d6;
  --color-error-deep: #c50000;
  --color-warning: #f5a623;
  --color-warning-soft: #ffefcf;
  --color-warning-deep: #ab570a;

  /* ===== Accent stops (gradient palette) ===== */
  --color-violet: #7928ca;
  --color-violet-soft: #d8ccf1;
  --color-violet-deep: #4c2889;
  --color-cyan: #50e3c2;
  --color-cyan-soft: #aaffec;
  --color-cyan-deep: #29bc9b;
  --color-highlight-pink: #ff0080;
  --color-highlight-magenta: #eb367f;
  --color-gradient-develop-start: #007cf0;
  --color-gradient-develop-end: #00dfd8;
  --color-gradient-preview-start: #7928ca;
  --color-gradient-preview-end: #ff0080;
  --color-gradient-ship-start: #ff4d4d;
  --color-gradient-ship-end: #f9cb28;

  /* ===== Selection ===== */
  --color-selection-bg: #171717;
  --color-selection-fg: #f2f2f2;

  /* ===== Brand mesh gradient (hero only) ===== */
  --gradient-mesh:
    radial-gradient(ellipse 60% 50% at 15% 40%, rgba(0, 124, 240, 0.28) 0%, transparent 100%),
    radial-gradient(ellipse 45% 60% at 85% 20%, rgba(121, 40, 202, 0.24) 0%, transparent 100%),
    radial-gradient(ellipse 50% 40% at 60% 85%, rgba(255, 0, 128, 0.18) 0%, transparent 100%),
    radial-gradient(ellipse 40% 50% at 35% 90%, rgba(0, 223, 216, 0.16) 0%, transparent 100%),
    radial-gradient(ellipse 30% 30% at 90% 70%, rgba(249, 203, 40, 0.12) 0%, transparent 100%);

  /* ===== Typography ===== */
  --font-sans: 'Inter', 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;

  --text-display-xl: clamp(36px, 5vw, 64px);
  --text-display-lg: clamp(24px, 3.5vw, 40px);
  --text-display-md: clamp(18px, 2vw, 24px);
  --text-display-sm: 20px;
  --text-body-lg: 18px;
  --text-body-md: 16px;
  --text-body-sm: 14px;
  --text-caption: 12px;
  --text-code: 13px;

  --line-display-xl: 1.05;
  --line-display-lg: 1.15;
  --line-display-md: 1.25;
  --line-body: 1.5;
  --line-caption: 1.33;

  --weight-display: 600;
  --weight-medium: 500;
  --weight-regular: 400;

  --tracking-xl: -2.4px;
  --tracking-lg: -1.28px;
  --tracking-md: -0.96px;
  --tracking-sm: -0.6px;
  --tracking-body-sm: -0.28px;
  --tracking-neutral: 0px;

  /* ===== Radius ===== */
  --radius-none: 0px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill-sm: 64px;
  --radius-pill: 100px;
  --radius-full: 9999px;

  /* ===== Spacing (4px base) ===== */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;
  --space-3xl: 48px;
  --space-4xl: 64px;
  --space-5xl: 96px;
  --space-6xl: 128px;
  --space-section: 192px;

  /* ===== Elevation (Vercel-like stacked shadows) ===== */
  --shadow-level-1: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-level-2:
    0px 1px 1px rgba(0, 0, 0, 0.02),
    0px 2px 2px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px var(--color-hairline);
  --shadow-level-3:
    0px 2px 2px rgba(0, 0, 0, 0.04),
    0px 8px 8px -8px rgba(0, 0, 0, 0.04),
    inset 0 0 0 1px var(--color-hairline);
  --shadow-level-4:
    0px 2px 2px rgba(0, 0, 0, 0.04),
    0px 8px 16px -4px rgba(0, 0, 0, 0.06),
    inset 0 0 0 1px var(--color-hairline);
  --shadow-level-5:
    0px 1px 1px rgba(0, 0, 0, 0.02),
    0px 8px 16px -4px rgba(0, 0, 0, 0.04),
    0px 24px 32px -8px rgba(0, 0, 0, 0.06),
    inset 0 0 0 1px var(--color-hairline);

  /* Legacy aliases */
  --shadow-card: var(--shadow-level-3);
  --shadow-float: var(--shadow-level-4);

  /* ===== Layout ===== */
  --nav-height: 64px;
  --section-padding-v: var(--space-5xl);
  --section-padding-h: clamp(16px, 5vw, 80px);
  --max-width: 1200px;
  --page-width: 1400px;
}

/* ============================================================
   Dark mode overrides
   ============================================================ */
[data-theme="dark"] {
  --color-canvas: #0a0a0a;
  --color-canvas-soft: #111111;
  --color-canvas-soft-2: #1a1a1a;
  --color-ink: #f5f5f5;
  --color-body: #a1a1a1;
  --color-mute: #555555;
  --color-hairline: #222222;
  --color-hairline-strong: #2a2a2a;
  --color-selection-bg: #f5f5f5;
  --color-selection-fg: #0a0a0a;
  --shadow-level-1: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-level-2:
    0px 1px 1px rgba(0, 0, 0, 0.2),
    0px 2px 2px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-level-3:
    0px 2px 2px rgba(0, 0, 0, 0.3),
    0px 8px 8px -8px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-level-4:
    0px 2px 2px rgba(0, 0, 0, 0.3),
    0px 8px 16px -4px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ============================================================
   Reset + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  font-size: var(--text-body-md);
  font-weight: var(--weight-regular);
  line-height: var(--line-body);
  color: var(--color-body);
  background: var(--color-canvas-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 300ms ease, color 300ms ease;
}

::selection {
  background: var(--color-selection-bg);
  color: var(--color-selection-fg);
}

/* ===== Headings ===== */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-ink);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-md);
  line-height: var(--line-display-md);
}

h1 {
  font-size: var(--text-display-xl);
  letter-spacing: var(--tracking-xl);
  line-height: var(--line-display-xl);
}

h2 {
  font-size: var(--text-display-lg);
  letter-spacing: var(--tracking-lg);
  line-height: var(--line-display-lg);
}

h3 {
  font-size: var(--text-display-md);
  letter-spacing: var(--tracking-sm);
}

h4 { font-size: var(--text-display-sm); letter-spacing: var(--tracking-sm); }

p { color: var(--color-body); }

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--color-link-deep); }
a:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-code);
}

/* ============================================================
   Text utilities — hiérarchie couleur typographie
   ============================================================ */
.text-accent { color: var(--color-link); }
.text-muted  { color: var(--color-mute); }
.text-ink    { color: var(--color-ink); }

.gradient-text {
  background: linear-gradient(135deg, #007cf0, #7928ca 35%, #ff0080 65%, #f9cb28);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: gradient-shift 6s ease-in-out infinite;
}

/* ============================================================
   Reveal-on-scroll primitive
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
