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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body { min-height: 100vh; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
fieldset { border: none; padding: 0; margin: 0; }

/* Typographie */
.font-mono  { font-family: 'IBM Plex Mono', monospace; }
.font-serif { font-family: 'IBM Plex Serif', Georgia, serif; }
.italic     { font-style: italic; }
.font-light    { font-weight: 300; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.tracking-tight { letter-spacing: -0.025em; }
.leading-relaxed { line-height: 1.625; }

/* Container */
.container {
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}
@media (min-width: 1024px) {
  .container { padding-inline: 2rem; }
}

/* Grille 12 colonnes */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}
@media (max-width: 1023px) {
  .grid-12 { grid-template-columns: 1fr; }
}
@media (min-width: 1024px) {
  .col-4 { grid-column: span 4; }
  .col-5 { grid-column: span 5; }
  .col-7 { grid-column: span 7; }
  .col-8 { grid-column: span 8; }
}

/* Grille 2/4 colonnes (presets) */
.grid-presets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .grid-presets { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-presets { grid-template-columns: repeat(4, 1fr); }
}

/* Grille 2 colonnes (paramètres) */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 479px) {
  .grid-2 { grid-template-columns: 1fr; }
}
.col-span-2 { grid-column: span 2; }
@media (max-width: 479px) {
  .col-span-2 { grid-column: span 1; }
}

/* Flex utilitaires */
.flex         { display: flex; }
.inline-flex  { display: inline-flex; }
.flex-col     { flex-direction: column; }
.items-center   { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1 { flex: 1; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Affichage */
.hidden { display: none !important; }
.block  { display: block; }
.relative { position: relative; }
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.ml-auto { margin-left: auto; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.overflow-hidden { overflow: hidden; }
.select-none { user-select: none; }
.cursor-pointer { cursor: pointer; }

/* Espacements courants */
.mt-1  { margin-top: 0.25rem; }
.mt-2  { margin-top: 0.5rem; }
.mt-3  { margin-top: 0.75rem; }
.mt-4  { margin-top: 1rem; }
.mt-5  { margin-top: 1.25rem; }
.mt-7  { margin-top: 1.75rem; }
.mt-8  { margin-top: 2rem; }
.mb-2  { margin-bottom: 0.5rem; }
.mb-3  { margin-bottom: 0.75rem; }
.ml-1  { margin-left: 0.25rem; }
.p-3   { padding: 0.75rem; }
.p-5   { padding: 1.25rem; }
.p-7   { padding: 1.75rem; }
.p-8   { padding: 2rem; }
.px-4  { padding-inline: 1rem; }
.px-5  { padding-inline: 1.25rem; }
.px-6  { padding-inline: 1.5rem; }
.py-3  { padding-block: 0.75rem; }
.py-4  { padding-block: 1rem; }
.pb-6  { padding-bottom: 1.5rem; }
.pb-16 { padding-bottom: 4rem; }
.pt-3  { padding-top: 0.75rem; }
.pt-5  { padding-top: 1.25rem; }

/* Bordures */
.border   { border: 1px solid var(--rule); }
.border-t { border-top: 1px solid var(--rule); }
.border-b { border-bottom: 1px solid var(--rule); }

/* Accessibilité */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Masquage responsive */
@media (max-width: 767px)  { .hidden-mobile  { display: none !important; } }
@media (min-width: 768px)  { .hidden-desktop { display: none !important; } }
@media (max-width: 1023px) { .hidden-lg      { display: none !important; } }

/* Espace entre enfants */
.space-y-2 > * + * { margin-top: 0.5rem; }

/* Dimensions icônes */
.icon-dot  { width: 0.375rem; height: 0.375rem; }
.icon-sm   { width: 0.75rem;  height: 0.75rem; }
.icon-logo { width: 1.75rem;  height: 1.75rem; }
.rounded-full { border-radius: 9999px; }

/* Focus global */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
button:focus-visible, a:focus-visible { outline-offset: 4px; }
