/* Sémaphore · étude de cas. Même palette que le dashboard (public/styles.css). */

:root {
  color-scheme: light dark;

  --bg-light: #f5f3ef;        --bg-dark: #14120f;
  --surface-light: #ffffff;   --surface-dark: #1c1a16;
  --texte-light: #1a1815;     --texte-dark: #f4f1ea;
  --texte-2-light: #5b574f;   --texte-2-dark: #c6c0b3;
  --bord-light: rgba(20, 20, 18, 0.12); --bord-dark: rgba(255, 255, 255, 0.10);
  --accent-light: #c4501b;    --accent-dark: #e2793f;
  --sur-accent-light: #fff9f5; --sur-accent-dark: #1a1006;
  --accent-doux-light: rgba(196, 80, 27, 0.08); --accent-doux-dark: rgba(226, 121, 63, 0.14);

  /* Repli pour les navigateurs sans light-dark() */
  --bg: var(--bg-light); --surface: var(--surface-light); --texte: var(--texte-light);
  --texte-2: var(--texte-2-light); --bord: var(--bord-light); --accent: var(--accent-light);
  --sur-accent: var(--sur-accent-light); --accent-doux: var(--accent-doux-light);
  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-dark); --surface: var(--surface-dark); --texte: var(--texte-dark);
    --texte-2: var(--texte-2-dark); --bord: var(--bord-dark); --accent: var(--accent-dark);
    --sur-accent: var(--sur-accent-dark); --accent-doux: var(--accent-doux-dark);
  }
  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --texte: light-dark(var(--texte-light), var(--texte-dark));
    --texte-2: light-dark(var(--texte-2-light), var(--texte-2-dark));
    --bord: light-dark(var(--bord-light), var(--bord-dark));
    --accent: light-dark(var(--accent-light), var(--accent-dark));
    --sur-accent: light-dark(var(--sur-accent-light), var(--sur-accent-dark));
    --accent-doux: light-dark(var(--accent-doux-light), var(--accent-doux-dark));
  }

  --police: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --largeur: 68rem;
  accent-color: var(--accent);
}

/* Thème épinglé par le bouton (vitrine/theme.js) : le CSS suit le <meta name="color-scheme">,
   que le script règle à light, dark ou « light dark » (système). Sans JS, rien ne change. */
:root:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
@supports not (color: light-dark(white, black)) {
  :root:has(> head > meta[name="color-scheme"][content="light"]) {
    --bg: var(--bg-light); --surface: var(--surface-light); --texte: var(--texte-light);
    --texte-2: var(--texte-2-light); --bord: var(--bord-light); --accent: var(--accent-light);
    --sur-accent: var(--sur-accent-light); --accent-doux: var(--accent-doux-light);
  }
  :root:has(> head > meta[name="color-scheme"][content="dark"]) {
    --bg: var(--bg-dark); --surface: var(--surface-dark); --texte: var(--texte-dark);
    --texte-2: var(--texte-2-dark); --bord: var(--bord-dark); --accent: var(--accent-dark);
    --sur-accent: var(--sur-accent-dark); --accent-doux: var(--accent-doux-dark);
  }
}

*, *::before, *::after { box-sizing: border-box; }

.bouton-theme {
  position: absolute; top: 0.75rem; right: 1rem; z-index: 5;
  padding: 0.5rem 0.6rem; font-size: 1rem; line-height: 1; cursor: pointer;
  background: transparent; color: var(--texte); border: 1px solid var(--bord); border-radius: 0.6rem;
}
.bouton-theme:hover { background: var(--accent-doux); }
.bouton-theme:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.bouton-theme[hidden] { display: none; }
/* Le bouton porte ses deux actions ; seule celle qui s'applique au thème affiché reste visible
   (et lisible par les lecteurs d'écran), sans JS quand le réglage système change. */
.vers-clair { display: none; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) { .vers-clair { display: inline; } .vers-sombre { display: none; } }
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) { .vers-clair { display: inline; } .vers-sombre { display: none; } }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (min-width: 48rem) { .bouton-theme { right: 2rem; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--texte);
  font: 1.0625rem/1.65 var(--police);
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: var(--largeur); margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 48rem) { .wrap { padding-inline: 2rem; } }

a { color: var(--accent); text-underline-offset: 3px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; padding: 0.5rem 1rem;
  background: var(--accent); color: var(--sur-accent); border-radius: 0.5rem; z-index: 10;
}
.skip-link:focus { top: 1rem; }

h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.6rem); margin: 0.4em 0 0.5em; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.1rem); margin: 0 0 0.75em; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; margin: 0 0 0.4em; }
p { margin: 0 0 1em; text-wrap: pretty; }

/* En-tête */
.hero { padding-block: clamp(3rem, 2rem + 6vw, 7rem) clamp(2.5rem, 2rem + 3vw, 4.5rem); border-bottom: 1px solid var(--bord); }
.marque { font-weight: 700; color: var(--accent); letter-spacing: 0.02em; margin: 0; }
.chapo { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); color: var(--texte-2); max-width: 46rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.actions--fin { margin-top: 2.5rem; }
.note-demo { font-size: 0.9rem; color: var(--texte-2); margin-top: 0.75rem; }

.bouton {
  display: inline-block; padding: 0.7rem 1.3rem; border-radius: 0.6rem;
  background: var(--accent); color: var(--sur-accent); font-weight: 600; text-decoration: none;
  border: 1px solid var(--accent);
}
.bouton:hover { filter: brightness(1.08); }
.bouton:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.bouton--discret { background: transparent; color: var(--accent); }

/* Sections */
main > section { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.intro-section { max-width: 46rem; color: var(--texte-2); }

.deux-colonnes { display: grid; gap: 1rem 2.5rem; }
@media (min-width: 48rem) { .deux-colonnes { grid-template-columns: 1fr 1fr; } }

.etapes { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; counter-reset: etape; }
@media (min-width: 48rem) { .etapes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 72rem) { .etapes { grid-template-columns: repeat(4, 1fr); } }
.etapes li {
  counter-increment: etape; background: var(--surface); border: 1px solid var(--bord);
  border-radius: 0.9rem; padding: 1.25rem 1.25rem 0.5rem;
}
.etapes h3::before {
  content: counter(etape); display: inline-grid; place-items: center;
  width: 1.8rem; height: 1.8rem; margin-right: 0.6rem; border-radius: 50%;
  background: var(--accent-doux); color: var(--accent); font-size: 0.95rem;
}
.etapes p { font-size: 0.98rem; color: var(--texte-2); }

/* Chiffres */
.bandeau-chiffres { background: var(--accent-doux); border-block: 1px solid var(--bord); }
.source-chiffres { color: var(--texte-2); font-size: 0.95rem; }
.chiffres { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.chiffres strong { display: block; font-size: clamp(2rem, 1.6rem + 1.6vw, 2.8rem); line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.chiffres span { color: var(--texte-2); }

/* Captures */
.captures { display: grid; gap: 2rem; margin-top: 1.5rem; }
@media (min-width: 60rem) { .captures { grid-template-columns: 1fr 1fr; } }
.captures figure { margin: 0; }
.captures img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10;
  object-fit: cover; object-position: top;
  border: 1px solid var(--bord); border-radius: 0.75rem; background: var(--surface);
}
.captures figcaption { font-size: 0.92rem; color: var(--texte-2); margin-top: 0.6rem; }

/* Cartes */
.cartes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-top: 1.5rem; }
.cartes article { background: var(--surface); border: 1px solid var(--bord); border-radius: 0.9rem; padding: 1.25rem 1.25rem 0.5rem; }
.cartes p { font-size: 0.98rem; color: var(--texte-2); }

.lecons { padding-left: 1.2rem; max-width: 50rem; }
.lecons li { margin-bottom: 1rem; }
.lecons li::marker { color: var(--accent); }

.stack { padding-left: 1.2rem; color: var(--texte-2); }

/* Exemple de bout en bout (accueil) */
.lien-etape { font-size: 0.95rem; font-weight: 600; }
.annonce {
  background: var(--surface); border: 1px solid var(--bord); border-left: 4px solid var(--accent);
  border-radius: 0.9rem; padding: 1.25rem 1.5rem 0.5rem; margin-block: 1.5rem 2.5rem; max-width: 50rem;
}
.annonce .etiquette, .doc-entete .etiquette {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin: 0 0 0.3em;
}
.annonce ul { padding-left: 1.2rem; margin: 0 0 1em; }
.annonce .meta { color: var(--texte-2); margin-bottom: 0.6em; }
.annonce .pastilles { padding-left: 0; }
.pastilles { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pastilles li { font-size: 0.85rem; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--accent-doux); color: var(--texte); }
.extraits { display: grid; gap: 2rem; }
@media (min-width: 72rem) { .extraits { grid-template-columns: repeat(3, 1fr); } }
.extrait h3 { margin-bottom: 0.75rem; }
.extrait .bouton { margin-top: 0.25rem; }

/* Document annoté : le document à gauche, les explications à droite (dessous sur mobile) */
.doc-annote { display: grid; gap: 0.75rem; margin-block: 1.5rem 2rem; }
.ligne { display: grid; gap: 0.6rem; }
.papier {
  position: relative; background: var(--surface); border: 1px solid var(--bord); border-radius: 0.6rem;
  padding: 1.1rem 3rem 0.4rem 1.5rem; font-size: 0.97rem; min-width: 0;
}
.papier h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin: 0 0 0.5em; }
.papier h5 { font-size: 1rem; margin: 0 0 0.2em; }
.papier .meta { color: var(--texte-2); font-size: 0.9rem; margin-bottom: 0.4em; }
.papier ul { padding-left: 1.1rem; margin: 0 0 0.8em; }
.papier li { margin-bottom: 0.25em; }
.papier .nom { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.2; }
.papier .titre-cv { font-size: 1.1rem; font-weight: 600; color: var(--accent); margin: 0.1em 0 0.3em; }
.papier blockquote { margin: 0 0 0.8em; padding-left: 0.9rem; border-left: 2px solid var(--bord); }
.repere, .note b.num {
  display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--accent); color: var(--sur-accent); font-size: 0.85rem; font-weight: 700; font-style: normal; flex: none;
}
.papier .repere { position: absolute; top: 0.9rem; right: 0.9rem; }
.note { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.94rem; color: var(--texte-2); padding: 0.2rem 0 0.8rem; }
.note p { margin: 0 0 0.5em; }
.note strong { color: var(--texte); }
@media (min-width: 60rem) {
  .doc-annote { gap: 0; }
  .ligne { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 2.5rem; }
  .ligne .papier { border-radius: 0; border-top: 0; }
  .ligne:first-child .papier { border-top: 1px solid var(--bord); border-radius: 0.6rem 0.6rem 0 0; }
  .ligne:last-child .papier { border-radius: 0 0 0.6rem 0.6rem; }
  .ligne .note { padding-top: 1rem; }
}

.encadre {
  background: var(--accent-doux); border: 1px solid var(--bord); border-radius: 0.9rem;
  padding: 1.25rem 1.5rem 0.5rem; max-width: 50rem; margin-block: 1rem 2rem;
}
.encadre h2 { font-size: 1.15rem; margin-bottom: 0.5em; }
.encadre ul { padding-left: 1.2rem; }

/* Extraits de l'accueil : colonnes étroites, le document et sa note toujours l'un sous l'autre */
.extrait .doc-annote { margin-block: 0 1rem; }
.extrait .ligne { grid-template-columns: 1fr; gap: 0.6rem; }
.extrait .ligne .papier { border: 1px solid var(--bord); border-radius: 0.6rem; }
.extrait .ligne .note { padding-top: 0.2rem; }

/* Pages d'exemple */
.fil { padding-block: 1.25rem; border-bottom: 1px solid var(--bord); font-size: 0.95rem; }
.fil a { font-weight: 600; }
.doc-entete { padding-block: 2.5rem 0.5rem; }
.doc-entete h1 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); }
.suite { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-block: 1rem 3rem; }

/* Pied */
.pied { border-top: 1px solid var(--bord); padding-block: 2rem 3rem; font-size: 0.92rem; color: var(--texte-2); }
.pied p { margin-bottom: 0.4em; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
