/* ============================================================
   theme.css — Refonte vitrine Bureau 403
   « Maison d'édition de logiciels » — registre éditorial/institutionnel
   À charger APRÈS /_design/bureau403.css
   ============================================================ */

:root {
  /* Palette — mode clair (défaut) */
  --accent:        #1d4ed8;   /* bleu d'encre — AA sur --fond et --surface */
  --accent-encre:  #1e40af;   /* accent foncé pour hover/liens visités */
  --accent-contrast: #ffffff;
  --fond:          #f7f5f1;   /* papier chaud */
  --surface:       #ffffff;   /* cartes / encarts */
  --surface-alt:   #efece5;   /* aplats secondaires, filets de séparation */
  --encre:         #1a1a1a;   /* texte principal (chaud) */
  --encre-2:       #4a4742;   /* texte secondaire, légendes (charte) */
  --encre-douce:   #4a4742;   /* alias éditorial */
  --trait:         #d9d4ca;   /* bordures fines (charte) */
  --filet:         #d9d4ca;   /* alias éditorial */

  /* Typographies — piles 100 % système */
  --police-titre:  "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --police:        system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --police-mono:   ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  /* Formes — calmes */
  --rayon:         8px;
  --rayon-petit:   4px;
  --ombre:         none;                       /* on remplace les ombres par des filets */
  --filet-bord:    1px solid var(--filet);

  /* Espacements de rythme éditorial */
  --mesure:        68ch;                        /* largeur de lecture confortable */
  --largeur-texte: 68ch;
}

/* Contrastes vérifiés mode clair :
   #1a1a1a sur #f7f5f1 ≈ 15.5:1 (AAA)
   #1d4ed8 sur #f7f5f1 ≈ 6.1:1 (AA texte, AAA large)
   #1d4ed8 sur #ffffff ≈ 6.5:1 (AA)
   #4a4742 sur #f7f5f1 ≈ 8.3:1 (AAA) */

/* ---------- Mode sombre ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --accent:        #7ea2f5;   /* bleu d'encre éclairci — AA sur fonds sombres */
    --accent-encre:  #a8c1f8;
    --fond:          #16171a;   /* encre nocturne, non pur noir */
    --surface:       #1e2024;
    --surface-alt:   #24272c;
    --encre:         #ececec;
    --encre-2:       #b4b2ad;
    --encre-douce:   #b4b2ad;
    --trait:         #34373d;
    --filet:         #34373d;
  }
  /* Contrastes vérifiés mode sombre :
     #ececec sur #16171a ≈ 15.0:1 (AAA)
     #7ea2f5 sur #16171a ≈ 7.2:1 (AA/AAA)
     #7ea2f5 sur #1e2024 ≈ 6.3:1 (AA)
     #b4b2ad sur #16171a ≈ 9.1:1 (AAA) */
}

/* ---------- Application de base ---------- */
body {
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--police-titre);
  color: var(--encre);
  letter-spacing: -0.01em;
  line-height: 1.15;
  font-weight: 600;
}

p, li { max-width: var(--mesure); }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-encre); }

/* ---------- Cartes / encarts : filets, pas d'ombres ---------- */
.carte, .card, .principe, article, section > .encart {
  background: var(--surface);
  border: var(--filet-bord);
  border-radius: var(--rayon);
  box-shadow: none;
}

/* ---------- Navigation ---------- */
.entete nav, nav {
  background: transparent;
}
header {
  background: color-mix(in srgb, var(--fond) 92%, transparent);
  border-bottom: var(--filet-bord);
}
.entete nav a { color: var(--encre-douce); text-decoration: none; }
.entete nav a:hover, .entete nav a[aria-current="page"] { color: var(--accent); }

/* ---------- Wordmark logo ---------- */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4ch;
  font-family: var(--police-titre);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--encre);
  text-decoration: none;
}
.wordmark__403 {
  font-family: var(--police-mono);
  font-size: 0.82em;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: var(--rayon-petit);
  padding: 0.05em 0.4em;
  line-height: 1;
  position: relative;
  top: -0.05em;
}

/* ---------- Hero typographique ---------- */
.hero { padding: clamp(2.5rem, 8vw, 5.5rem) 0; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3.4rem); }
.hero .statut-ligne { margin-top: 1.5rem; max-width: 100%; }
.hero .statut-ligne svg { width: 100%; max-width: 640px; height: auto; display: block; }

/* Codes couleur du SVG hero pilotés par les variables via currentColor/CSS custom props */
.statut-ligne { color: var(--accent); }
.statut-ligne .statut-encre { fill: var(--encre); }
.statut-ligne .statut-douce { fill: var(--encre-douce); }
.statut-ligne .statut-filet { stroke: var(--filet); }

/* ---------- Boutons / CTA (sobres, jamais dark pattern) ---------- */
.btn, button.cta, a.cta {
  border-radius: var(--rayon);
  font-family: var(--police);
  font-weight: 500;
}
.btn-plein, button.cta, a.cta {
  background: var(--accent);
  color: #ffffff;
  border: 1.5px solid var(--accent);
}
.btn-plein:hover, a.cta:hover { background: var(--accent-encre); border-color: var(--accent-encre); color: #fff; box-shadow: none; }
.btn-contour { border: 1.5px solid var(--filet); color: var(--encre); background: var(--surface); }
.btn-contour:hover { border-color: var(--accent); color: var(--accent); }
.btn:hover { transform: none; }
@media (prefers-color-scheme: dark) {
  .btn-plein, button.cta, a.cta { color: #14161a; }        /* texte foncé sur accent clair pour AA */
  .btn-plein:hover, a.cta:hover { color: #14161a; }
}

/* ---------- Étiquettes sobres (pas de pastille criarde) ---------- */
.etiquette {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}

/* ---------- Filets de séparation (remplacent les ombres) ---------- */
hr, .separateur { border: 0; border-top: var(--filet-bord); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 0.75rem 1.25rem;
  z-index: 100; border-radius: 0 0 var(--rayon-petit) 0;
}
.skip-link:focus { left: 0; clip-path: none; width: auto; height: auto; }

/* ---------- Accessibilité : focus visible ---------- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--rayon-petit);
}

/* ---------- prefers-contrast ---------- */
@media (prefers-contrast: more) {
  :root { --accent: #0b3bb0; --encre: #000000; --fond: #ffffff; --filet: #000000; --trait: #000000; }
  @media (prefers-color-scheme: dark) {
    :root { --accent: #b9cdff; --encre: #ffffff; --fond: #000000; --filet: #ffffff; --trait: #ffffff; }
  }
  .carte, .card, .principe, article { border-width: 2px; }
  a { text-decoration: underline; }
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive 320px+ ---------- */
@media (max-width: 480px) {
  .wordmark { font-size: 1.15rem; }
  .hero h1 { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  p, li { max-width: 100%; }
}
