/* ============================================================
   Police Inter, hébergée sur le site (aucun appel à Google)
   Licence SIL Open Font License — voir fonts/LICENSE.txt
   ============================================================ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/inter-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-latin-700.woff2") format("woff2");
}

/* ============================================================
   Couleurs — contrastes vérifiés (RGAA 3.2 : ≥ 4.5:1 texte,
   ≥ 3:1 composants d'interface)
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-alt: #f4f4f4;
  --text: #242424;        /* 15.9:1 sur blanc */
  --muted: #555555;       /*  7.5:1 sur blanc, 6.9:1 sur #f4f4f4 */
  --accent: #313178;      /* 11.4:1 sur blanc */
  --focus: #313178;
  color-scheme: light;
}

/* Sans JavaScript : on suit la préférence système */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1a1a;
    --bg-alt: #242424;
    --text: #f4f4f4;        /* 15.6:1 sur #1a1a1a */
    --muted: #bdbdbd;       /*  9.6:1 sur #1a1a1a */
    --accent: #a9a9f0;      /*  8.0:1 sur #1a1a1a — #313178 éclairci */
    --focus: #a9a9f0;
    color-scheme: dark;
  }
}

/* Choix explicite via le bouton */
:root[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg-alt: #242424;
  --text: #f4f4f4;        /* 15.6:1 sur #1a1a1a */
  --muted: #bdbdbd;       /*  9.26:1 sur #1a1a1a */
  --accent: #a9a9f0;      /*  8.0:1 sur #1a1a1a — #313178 éclairci */
  --focus: #a9a9f0;
  color-scheme: dark;
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 100%; }   /* respecte la taille choisie par l'utilisateur */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.6;
  transition: background-color .2s, color .2s;
}
body > * {
    margin-bottom: 4rem;
}

h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; }
h1 { font-weight: 700; }

.wrap {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--accent); text-underline-offset: .2em; }

/* Focus toujours visible (RGAA 10.7) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
main:focus { outline: none; }
main > section:not(:last-child) {
    margin-bottom: 2rem;
}
/* Lien d'évitement (RGAA 12.7) */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 10;
  padding: .75rem 1rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 4px;
}
.skip-link:focus { top: 1rem; }

/* ============================================================
   En-tête (nom + bouton jour/nuit)
   ============================================================ */
.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 4.5rem;
  padding-bottom: 3.5rem;
}

/* Mobile : bouton au-dessus du titre, sans débordement horizontal (RGAA 10.11).
   Seul l'ordre visuel change ; le h1 n'étant pas focalisable, l'ordre de tabulation reste cohérent. */
@media (max-width: 30em) {
  .hero {
    flex-direction: column-reverse;
    /* Bloc titre centré verticalement entre le bouton et « Services » :
       gap = padding-bottom + padding-top de .services (1rem) */
    gap: 2.5rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  .hero > div { min-width: 0; max-width: 100%; }
  .hero .theme-toggle { align-self: flex-end; }
}

.hero h1 {
  overflow-wrap: break-word;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  letter-spacing: -.01em;
}

.role {
  margin: .75rem 0 0;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 400;
  color: var(--accent);
}

.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.75rem;          /* cible tactile confortable */
  padding: .5rem .9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; } /* sinon display:inline-flex écrase l'attribut hidden */
.theme-toggle:hover { color: var(--text); background: var(--bg-alt); }
.theme-toggle[data-mode="dark"] .icon-moon,
.theme-toggle[data-mode="light"] .icon-sun { display: none; }

/* ============================================================
   Services
   ============================================================ */
.services { padding: 1rem 0 3.5rem; }

.services h2,
.contact h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 48em) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.75rem 1.5rem;
  background: var(--bg-alt);
  border-radius: 10px;
}

.card-icon {
  color: var(--accent);
  margin-bottom: .5rem;
}

.card h3 { font-size: 1.2rem;   color: var(--accent);}

.card p {
  margin: 0;
  color: var(--muted);
}

/* ============================================================
   Contact
   ============================================================ */
.contact { padding: 1.5rem 0 4rem; }

.contact p { margin: 0 0 1rem; }

.contact-mail { font-size: 1.25rem; overflow-wrap: anywhere;}

/* ============================================================
   Pied de page
   ============================================================ */
.site-footer {
  padding: 1.5rem 0 2rem;
  font-size: 1rem;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .5rem;
}
.site-footer p { margin: 0; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Séparateur décoratif, ignoré par les lecteurs d'écran (texte alternatif vide) */
.footer-links li::before {
  content: "·";
  content: "·" / "";
  margin-right: .5rem;
}
.site-footer a { color: var(--muted); }

/* Mobile : présentation en liste, un élément par ligne, sans séparateurs */
@media (max-width: 30em) {
  .site-footer .wrap,
  .footer-links { flex-direction: column; }
  .footer-links li::before { content: none; }
}
.site-footer a:hover { color: var(--text); }

/* ============================================================
   Page de contenu (mentions légales)
   ============================================================ */
.back { margin: 1rem 0 0; font-size: 1rem; }

.legal { padding: 0 0 4rem; }
.legal-content { max-width: 46rem; }   /* lignes courtes = meilleure lisibilité */
.legal h2 {
  font-size: 1.35rem;
  margin: 2.5rem 0 .75rem;
}
.legal h2:first-child { margin-top: 0; }
.legal p { margin: 0 0 .75rem; }
.legal ul { margin: 0 0 .75rem; padding-left: 1.25rem; }
.legal .placeholder { color: var(--muted); }

/* ============================================================
   Préférences utilisateur
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
