/* ==========================================================================
   KairoBot v2 — base : variables, reset, typographie.
   Règles : flat strict, zéro border-radius, aucune ombre, aucun dégradé.
   ========================================================================== */

:root {
  color-scheme: dark; /* barres de défilement et champs natifs sombres */

  /* Couleurs */
  --bg: #0d0d0d;
  --surface: #141414;
  --surface-2: #1b1b1b;
  --border: #262626;
  --border-strong: #3a3a3a;

  --text: #ededed;
  --text-2: #9a9a9a;

  --accent: #5b6ef0;
  --accent-hover: #6d7ef5;
  --accent-active: #4a5ce0;
  --on-accent: #ffffff;

  --ok: #57c98a;
  --warn: #f0b232;
  --danger: #e0556a;

  /* Typographie */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Espacement (échelle de 4 px) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 72px;
  --s-9: 112px;

  /* Mise en page */
  --container: 1120px;
  --gutter: 20px;
  --header-h: 64px;
}

/* Thème clair (choix dans Mon profil). Mêmes règles : aplats, filets de 1 px, aucun arrondi. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --border: #e1e1e6;
  --border-strong: #c4c4cc;
  --text: #17171c;
  --text-2: #5a5a66;
  --accent: #4a5ce0;
  --accent-hover: #3b4cd0;
  --accent-active: #3040bd;
  --ok: #1d8a52;
  --warn: #9a6200;
  --danger: #c23048;
}
:root[data-theme="light"] .hero, :root[data-theme="light"] .cta {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M48 0H0v48' fill='none' stroke='%23ececf0' stroke-width='1'/%3E%3C/svg%3E");
}
:root[data-theme="light"] .er::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M48 0H0v48' fill='none' stroke='%23ececf0' stroke-width='1'/%3E%3C/svg%3E");
}

/* Animations réduites (choix dans Mon profil) */
:root[data-mouvement="reduit"] *, :root[data-mouvement="reduit"] *::before, :root[data-mouvement="reduit"] *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important;
}

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  border-radius: 0; /* garde-fou : rien ne s'arrondit, même par oubli */
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

/* Typographie ------------------------------------------------------------ */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); }
p  { margin: 0; color: var(--text-2); }
code, kbd, pre { font-family: var(--font-mono); font-size: 0.9em; }

/* Focus clavier visible -------------------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Mise en page ----------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { flex: 1; }

/* Séparateur entre sections : ligne fine 1 px */
.section { padding-block: var(--s-9); }
.section + .section { border-top: 1px solid var(--border); }

/* Boutons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 40px;
  padding-inline: var(--s-5);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 6px; /* exception voulue : boutons légèrement arrondis */
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); border-color: var(--accent-active); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
