/* ========================================
   NVRMIND — Design System Foundation
   Minimalisme premium pour créateurs numériques
   ======================================== */

/* ========================================
   1. CSS Variables
   ======================================== */

:root {
  /* --- Couleurs monochromes --- */
  --color-white: #ffffff;
  --color-black: #000000;
  --color-gray-100: #f8f8f8;
  --color-gray-200: #f0f0f0;
  --color-gray-300: #e0e0e0;
  --color-gray-400: #c0c0c0;
  --color-gray-500: #a0a0a0;
  --color-gray-600: #808080;
  --color-gray-700: #606060;
  --color-gray-800: #404040;
  --color-gray-900: #202020;

  /* --- Sémantique --- */
  --color-background: var(--color-white);
  --color-text: var(--color-black);
  --color-muted: var(--color-gray-600);
  --color-border: var(--color-gray-300);
  --color-hover: var(--color-gray-100);

  /* --- Typographie --- */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* --- Tailles de texte --- */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-md: 1.125rem;   /* 18px */
  --text-lg: 1.25rem;    /* 20px */
  --text-xl: 1.5rem;     /* 24px */
  --text-2xl: 2rem;      /* 32px */
  --text-3xl: 2.5rem;    /* 40px */
  --text-4xl: 3.25rem;   /* 52px */
  --text-5xl: 4.5rem;    /* 72px */
  --text-6xl: 6rem;      /* 96px */

  /* --- Interlignage --- */
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  /* --- Espacement (système) --- */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2.5rem;    /* 40px */
  --spacing-2xl: 4rem;     /* 64px */
  --spacing-3xl: 6rem;     /* 96px */
  --spacing-4xl: 8rem;     /* 128px */

  /* --- Layout --- */
  --container-max-width: 1280px;
  --container-padding-mobile: 1.25rem;
  --container-padding-desktop: 2.5rem;
  --content-max-width: 720px;  /* Largeur optimale pour la lecture */

  /* --- Border radius --- */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
}

/* ========================================
   2. Reset global
   ======================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   3. Base HTML
   ======================================== */

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

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

ul,
ol {
  list-style: none;
}

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

button {
  cursor: pointer;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--spacing-xl) 0;
}

/* ========================================
   4. Typography
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-weight-bold);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

small {
  font-size: var(--text-sm);
  color: var(--color-muted);
}

strong {
  font-weight: var(--font-weight-semibold);
}

/* --- Utilitaires typographiques --- */
.text-xs {
  font-size: var(--text-xs);
}
.text-sm {
  font-size: var(--text-sm);
}
.text-base {
  font-size: var(--text-base);
}
.text-md {
  font-size: var(--text-md);
}
.text-lg {
  font-size: var(--text-lg);
}
.text-xl {
  font-size: var(--text-xl);
}
.text-2xl {
  font-size: var(--text-2xl);
}
.text-3xl {
  font-size: var(--text-3xl);
}
.text-4xl {
  font-size: var(--text-4xl);
}
.text-5xl {
  font-size: var(--text-5xl);
}

.leading-tight {
  line-height: var(--leading-tight);
}
.leading-snug {
  line-height: var(--leading-snug);
}
.leading-normal {
  line-height: var(--leading-normal);
}
.leading-relaxed {
  line-height: var(--leading-relaxed);
}

.font-light {
  font-weight: var(--font-weight-light);
}
.font-regular {
  font-weight: var(--font-weight-regular);
}
.font-medium {
  font-weight: var(--font-weight-medium);
}
.font-semibold {
  font-weight: var(--font-weight-semibold);
}
.font-bold {
  font-weight: var(--font-weight-bold);
}

.text-muted {
  color: var(--color-muted);
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* ========================================
   5. Layout system
   ======================================== */

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding-left: var(--container-padding-mobile);
  padding-right: var(--container-padding-mobile);
  width: 100%;
}

.content {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
}

.section {
  padding-top: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
}

.section-sm {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}

.section-lg {
  padding-top: var(--spacing-3xl);
  padding-bottom: var(--spacing-3xl);
}

.section-xl {
  padding-top: var(--spacing-4xl);
  padding-bottom: var(--spacing-4xl);
}

/* ========================================
   6. Spacing system (utilitaires essentiels)
   ======================================== */

/* --- Marges --- */
.m-0 {
  margin: 0;
}
.m-sm {
  margin: var(--spacing-sm);
}
.m-md {
  margin: var(--spacing-md);
}
.m-lg {
  margin: var(--spacing-lg);
}
.m-xl {
  margin: var(--spacing-xl);
}

.mt-sm {
  margin-top: var(--spacing-sm);
}
.mt-md {
  margin-top: var(--spacing-md);
}
.mt-lg {
  margin-top: var(--spacing-lg);
}
.mt-xl {
  margin-top: var(--spacing-xl);
}
.mt-2xl {
  margin-top: var(--spacing-2xl);
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}
.mb-md {
  margin-bottom: var(--spacing-md);
}
.mb-lg {
  margin-bottom: var(--spacing-lg);
}
.mb-xl {
  margin-bottom: var(--spacing-xl);
}
.mb-2xl {
  margin-bottom: var(--spacing-2xl);
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* --- Padding --- */
.p-0 {
  padding: 0;
}
.p-sm {
  padding: var(--spacing-sm);
}
.p-md {
  padding: var(--spacing-md);
}
.p-lg {
  padding: var(--spacing-lg);
}
.p-xl {
  padding: var(--spacing-xl);
}

.pt-sm {
  padding-top: var(--spacing-sm);
}
.pt-md {
  padding-top: var(--spacing-md);
}
.pt-lg {
  padding-top: var(--spacing-lg);
}
.pt-xl {
  padding-top: var(--spacing-xl);
}
.pt-2xl {
  padding-top: var(--spacing-2xl);
}

.pb-sm {
  padding-bottom: var(--spacing-sm);
}
.pb-md {
  padding-bottom: var(--spacing-md);
}
.pb-lg {
  padding-bottom: var(--spacing-lg);
}
.pb-xl {
  padding-bottom: var(--spacing-xl);
}
.pb-2xl {
  padding-bottom: var(--spacing-2xl);
}

.px-sm {
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}
.px-md {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}
.px-lg {
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}
.px-xl {
  padding-left: var(--spacing-xl);
  padding-right: var(--spacing-xl);
}

.py-sm {
  padding-top: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
}
.py-md {
  padding-top: var(--spacing-md);
  padding-bottom: var(--spacing-md);
}
.py-lg {
  padding-top: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
}
.py-xl {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}

/* ========================================
   7. Utility classes essentielles
   ======================================== */

/* --- Flexbox --- */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.items-end {
  align-items: flex-end;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-start {
  justify-content: flex-start;
}
.justify-end {
  justify-content: flex-end;
}
.gap-sm {
  gap: var(--spacing-sm);
}
.gap-md {
  gap: var(--spacing-md);
}
.gap-lg {
  gap: var(--spacing-lg);
}
.gap-xl {
  gap: var(--spacing-xl);
}

/* --- Grid --- */
.grid {
  display: grid;
}
.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* --- Affichage --- */
.block {
  display: block;
}
.inline {
  display: inline;
}
.relative {
  position: relative;
}
.absolute {
  position: absolute;
}
.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}
.overflow-hidden {
  overflow: hidden;
}

/* --- Bordures & Radius --- */
.border {
  border: 1px solid var(--color-border);
}
.border-top {
  border-top: 1px solid var(--color-border);
}
.border-bottom {
  border-bottom: 1px solid var(--color-border);
}
.rounded-sm {
  border-radius: var(--radius-sm);
}
.rounded-md {
  border-radius: var(--radius-md);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}

/* --- Divers --- */
.select-none {
  user-select: none;
}
.pointer-events-none {
  pointer-events: none;
}
.text-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========================================
   8. Responsive rules
   ======================================== */

/* --- Tablette --- */
@media (min-width: 768px) {
  :root {
    --text-5xl: 5.5rem;
    --container-padding-mobile: var(--container-padding-desktop);
  }

  .container {
    padding-left: var(--container-padding-desktop);
    padding-right: var(--container-padding-desktop);
  }

  .section {
    padding-top: var(--spacing-3xl);
    padding-bottom: var(--spacing-3xl);
  }

  .section-lg {
    padding-top: var(--spacing-4xl);
    padding-bottom: var(--spacing-4xl);
  }

  .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Desktop --- */
@media (min-width: 1024px) {
  :root {
    --text-5xl: 6.5rem;
  }

  .section {
    padding-top: var(--spacing-4xl);
    padding-bottom: var(--spacing-4xl);
  }
}

/* --- Grand écran --- */
@media (min-width: 1440px) {
  :root {
    --text-5xl: 7.5rem;
  }

  .container {
    padding-left: calc(var(--container-padding-desktop) * 1.5);
    padding-right: calc(var(--container-padding-desktop) * 1.5);
  }
}